...

Source file src/google.golang.org/api/adsense/v1.3/adsense-gen.go

Documentation: google.golang.org/api/adsense/v1.3

     1  // Copyright 2020 Google LLC.
     2  // Use of this source code is governed by a BSD-style
     3  // license that can be found in the LICENSE file.
     4  
     5  // Code generated file. DO NOT EDIT.
     6  
     7  // Package adsense provides access to the AdSense Management API.
     8  //
     9  // For product documentation, see: https://developers.google.com/adsense/management/
    10  //
    11  // # Creating a client
    12  //
    13  // Usage example:
    14  //
    15  //	import "google.golang.org/api/adsense/v1.3"
    16  //	...
    17  //	ctx := context.Background()
    18  //	adsenseService, err := adsense.NewService(ctx)
    19  //
    20  // In this example, Google Application Default Credentials are used for authentication.
    21  //
    22  // For information on how to create and obtain Application Default Credentials, see https://developers.google.com/identity/protocols/application-default-credentials.
    23  //
    24  // # Other authentication options
    25  //
    26  // By default, all available scopes (see "Constants") are used to authenticate. To restrict scopes, use option.WithScopes:
    27  //
    28  //	adsenseService, err := adsense.NewService(ctx, option.WithScopes(adsense.AdsenseReadonlyScope))
    29  //
    30  // To use an API key for authentication (note: some APIs do not support API keys), use option.WithAPIKey:
    31  //
    32  //	adsenseService, err := adsense.NewService(ctx, option.WithAPIKey("AIza..."))
    33  //
    34  // To use an OAuth token (e.g., a user token obtained via a three-legged OAuth flow), use option.WithTokenSource:
    35  //
    36  //	config := &oauth2.Config{...}
    37  //	// ...
    38  //	token, err := config.Exchange(ctx, ...)
    39  //	adsenseService, err := adsense.NewService(ctx, option.WithTokenSource(config.TokenSource(ctx, token)))
    40  //
    41  // See https://godoc.org/google.golang.org/api/option/ for details on options.
    42  package adsense // import "google.golang.org/api/adsense/v1.3"
    43  
    44  import (
    45  	"bytes"
    46  	"context"
    47  	"encoding/json"
    48  	"errors"
    49  	"fmt"
    50  	"io"
    51  	"net/http"
    52  	"net/url"
    53  	"strconv"
    54  	"strings"
    55  
    56  	googleapi "google.golang.org/api/googleapi"
    57  	gensupport "google.golang.org/api/internal/gensupport"
    58  	option "google.golang.org/api/option"
    59  	htransport "google.golang.org/api/transport/http"
    60  )
    61  
    62  // Always reference these packages, just in case the auto-generated code
    63  // below doesn't.
    64  var _ = bytes.NewBuffer
    65  var _ = strconv.Itoa
    66  var _ = fmt.Sprintf
    67  var _ = json.NewDecoder
    68  var _ = io.Copy
    69  var _ = url.Parse
    70  var _ = gensupport.MarshalJSON
    71  var _ = googleapi.Version
    72  var _ = errors.New
    73  var _ = strings.Replace
    74  var _ = context.Canceled
    75  
    76  const apiId = "adsense:v1.3"
    77  const apiName = "adsense"
    78  const apiVersion = "v1.3"
    79  const basePath = "https://www.googleapis.com/adsense/v1.3/"
    80  
    81  // OAuth2 scopes used by this API.
    82  const (
    83  	// View and manage your AdSense data
    84  	AdsenseScope = "https://www.googleapis.com/auth/adsense"
    85  
    86  	// View your AdSense data
    87  	AdsenseReadonlyScope = "https://www.googleapis.com/auth/adsense.readonly"
    88  )
    89  
    90  // NewService creates a new Service.
    91  func NewService(ctx context.Context, opts ...option.ClientOption) (*Service, error) {
    92  	scopesOption := option.WithScopes(
    93  		"https://www.googleapis.com/auth/adsense",
    94  		"https://www.googleapis.com/auth/adsense.readonly",
    95  	)
    96  	// NOTE: prepend, so we don't override user-specified scopes.
    97  	opts = append([]option.ClientOption{scopesOption}, opts...)
    98  	client, endpoint, err := htransport.NewClient(ctx, opts...)
    99  	if err != nil {
   100  		return nil, err
   101  	}
   102  	s, err := New(client)
   103  	if err != nil {
   104  		return nil, err
   105  	}
   106  	if endpoint != "" {
   107  		s.BasePath = endpoint
   108  	}
   109  	return s, nil
   110  }
   111  
   112  // New creates a new Service. It uses the provided http.Client for requests.
   113  //
   114  // Deprecated: please use NewService instead.
   115  // To provide a custom HTTP client, use option.WithHTTPClient.
   116  // If you are using google.golang.org/api/googleapis/transport.APIKey, use option.WithAPIKey with NewService instead.
   117  func New(client *http.Client) (*Service, error) {
   118  	if client == nil {
   119  		return nil, errors.New("client is nil")
   120  	}
   121  	s := &Service{client: client, BasePath: basePath}
   122  	s.Accounts = NewAccountsService(s)
   123  	s.Adclients = NewAdclientsService(s)
   124  	s.Adunits = NewAdunitsService(s)
   125  	s.Alerts = NewAlertsService(s)
   126  	s.Customchannels = NewCustomchannelsService(s)
   127  	s.Metadata = NewMetadataService(s)
   128  	s.Reports = NewReportsService(s)
   129  	s.Savedadstyles = NewSavedadstylesService(s)
   130  	s.Urlchannels = NewUrlchannelsService(s)
   131  	return s, nil
   132  }
   133  
   134  type Service struct {
   135  	client    *http.Client
   136  	BasePath  string // API endpoint base URL
   137  	UserAgent string // optional additional User-Agent fragment
   138  
   139  	Accounts *AccountsService
   140  
   141  	Adclients *AdclientsService
   142  
   143  	Adunits *AdunitsService
   144  
   145  	Alerts *AlertsService
   146  
   147  	Customchannels *CustomchannelsService
   148  
   149  	Metadata *MetadataService
   150  
   151  	Reports *ReportsService
   152  
   153  	Savedadstyles *SavedadstylesService
   154  
   155  	Urlchannels *UrlchannelsService
   156  }
   157  
   158  func (s *Service) userAgent() string {
   159  	if s.UserAgent == "" {
   160  		return googleapi.UserAgent
   161  	}
   162  	return googleapi.UserAgent + " " + s.UserAgent
   163  }
   164  
   165  func NewAccountsService(s *Service) *AccountsService {
   166  	rs := &AccountsService{s: s}
   167  	rs.Adclients = NewAccountsAdclientsService(s)
   168  	rs.Adunits = NewAccountsAdunitsService(s)
   169  	rs.Alerts = NewAccountsAlertsService(s)
   170  	rs.Customchannels = NewAccountsCustomchannelsService(s)
   171  	rs.Reports = NewAccountsReportsService(s)
   172  	rs.Savedadstyles = NewAccountsSavedadstylesService(s)
   173  	rs.Urlchannels = NewAccountsUrlchannelsService(s)
   174  	return rs
   175  }
   176  
   177  type AccountsService struct {
   178  	s *Service
   179  
   180  	Adclients *AccountsAdclientsService
   181  
   182  	Adunits *AccountsAdunitsService
   183  
   184  	Alerts *AccountsAlertsService
   185  
   186  	Customchannels *AccountsCustomchannelsService
   187  
   188  	Reports *AccountsReportsService
   189  
   190  	Savedadstyles *AccountsSavedadstylesService
   191  
   192  	Urlchannels *AccountsUrlchannelsService
   193  }
   194  
   195  func NewAccountsAdclientsService(s *Service) *AccountsAdclientsService {
   196  	rs := &AccountsAdclientsService{s: s}
   197  	return rs
   198  }
   199  
   200  type AccountsAdclientsService struct {
   201  	s *Service
   202  }
   203  
   204  func NewAccountsAdunitsService(s *Service) *AccountsAdunitsService {
   205  	rs := &AccountsAdunitsService{s: s}
   206  	rs.Customchannels = NewAccountsAdunitsCustomchannelsService(s)
   207  	return rs
   208  }
   209  
   210  type AccountsAdunitsService struct {
   211  	s *Service
   212  
   213  	Customchannels *AccountsAdunitsCustomchannelsService
   214  }
   215  
   216  func NewAccountsAdunitsCustomchannelsService(s *Service) *AccountsAdunitsCustomchannelsService {
   217  	rs := &AccountsAdunitsCustomchannelsService{s: s}
   218  	return rs
   219  }
   220  
   221  type AccountsAdunitsCustomchannelsService struct {
   222  	s *Service
   223  }
   224  
   225  func NewAccountsAlertsService(s *Service) *AccountsAlertsService {
   226  	rs := &AccountsAlertsService{s: s}
   227  	return rs
   228  }
   229  
   230  type AccountsAlertsService struct {
   231  	s *Service
   232  }
   233  
   234  func NewAccountsCustomchannelsService(s *Service) *AccountsCustomchannelsService {
   235  	rs := &AccountsCustomchannelsService{s: s}
   236  	rs.Adunits = NewAccountsCustomchannelsAdunitsService(s)
   237  	return rs
   238  }
   239  
   240  type AccountsCustomchannelsService struct {
   241  	s *Service
   242  
   243  	Adunits *AccountsCustomchannelsAdunitsService
   244  }
   245  
   246  func NewAccountsCustomchannelsAdunitsService(s *Service) *AccountsCustomchannelsAdunitsService {
   247  	rs := &AccountsCustomchannelsAdunitsService{s: s}
   248  	return rs
   249  }
   250  
   251  type AccountsCustomchannelsAdunitsService struct {
   252  	s *Service
   253  }
   254  
   255  func NewAccountsReportsService(s *Service) *AccountsReportsService {
   256  	rs := &AccountsReportsService{s: s}
   257  	rs.Saved = NewAccountsReportsSavedService(s)
   258  	return rs
   259  }
   260  
   261  type AccountsReportsService struct {
   262  	s *Service
   263  
   264  	Saved *AccountsReportsSavedService
   265  }
   266  
   267  func NewAccountsReportsSavedService(s *Service) *AccountsReportsSavedService {
   268  	rs := &AccountsReportsSavedService{s: s}
   269  	return rs
   270  }
   271  
   272  type AccountsReportsSavedService struct {
   273  	s *Service
   274  }
   275  
   276  func NewAccountsSavedadstylesService(s *Service) *AccountsSavedadstylesService {
   277  	rs := &AccountsSavedadstylesService{s: s}
   278  	return rs
   279  }
   280  
   281  type AccountsSavedadstylesService struct {
   282  	s *Service
   283  }
   284  
   285  func NewAccountsUrlchannelsService(s *Service) *AccountsUrlchannelsService {
   286  	rs := &AccountsUrlchannelsService{s: s}
   287  	return rs
   288  }
   289  
   290  type AccountsUrlchannelsService struct {
   291  	s *Service
   292  }
   293  
   294  func NewAdclientsService(s *Service) *AdclientsService {
   295  	rs := &AdclientsService{s: s}
   296  	return rs
   297  }
   298  
   299  type AdclientsService struct {
   300  	s *Service
   301  }
   302  
   303  func NewAdunitsService(s *Service) *AdunitsService {
   304  	rs := &AdunitsService{s: s}
   305  	rs.Customchannels = NewAdunitsCustomchannelsService(s)
   306  	return rs
   307  }
   308  
   309  type AdunitsService struct {
   310  	s *Service
   311  
   312  	Customchannels *AdunitsCustomchannelsService
   313  }
   314  
   315  func NewAdunitsCustomchannelsService(s *Service) *AdunitsCustomchannelsService {
   316  	rs := &AdunitsCustomchannelsService{s: s}
   317  	return rs
   318  }
   319  
   320  type AdunitsCustomchannelsService struct {
   321  	s *Service
   322  }
   323  
   324  func NewAlertsService(s *Service) *AlertsService {
   325  	rs := &AlertsService{s: s}
   326  	return rs
   327  }
   328  
   329  type AlertsService struct {
   330  	s *Service
   331  }
   332  
   333  func NewCustomchannelsService(s *Service) *CustomchannelsService {
   334  	rs := &CustomchannelsService{s: s}
   335  	rs.Adunits = NewCustomchannelsAdunitsService(s)
   336  	return rs
   337  }
   338  
   339  type CustomchannelsService struct {
   340  	s *Service
   341  
   342  	Adunits *CustomchannelsAdunitsService
   343  }
   344  
   345  func NewCustomchannelsAdunitsService(s *Service) *CustomchannelsAdunitsService {
   346  	rs := &CustomchannelsAdunitsService{s: s}
   347  	return rs
   348  }
   349  
   350  type CustomchannelsAdunitsService struct {
   351  	s *Service
   352  }
   353  
   354  func NewMetadataService(s *Service) *MetadataService {
   355  	rs := &MetadataService{s: s}
   356  	rs.Dimensions = NewMetadataDimensionsService(s)
   357  	rs.Metrics = NewMetadataMetricsService(s)
   358  	return rs
   359  }
   360  
   361  type MetadataService struct {
   362  	s *Service
   363  
   364  	Dimensions *MetadataDimensionsService
   365  
   366  	Metrics *MetadataMetricsService
   367  }
   368  
   369  func NewMetadataDimensionsService(s *Service) *MetadataDimensionsService {
   370  	rs := &MetadataDimensionsService{s: s}
   371  	return rs
   372  }
   373  
   374  type MetadataDimensionsService struct {
   375  	s *Service
   376  }
   377  
   378  func NewMetadataMetricsService(s *Service) *MetadataMetricsService {
   379  	rs := &MetadataMetricsService{s: s}
   380  	return rs
   381  }
   382  
   383  type MetadataMetricsService struct {
   384  	s *Service
   385  }
   386  
   387  func NewReportsService(s *Service) *ReportsService {
   388  	rs := &ReportsService{s: s}
   389  	rs.Saved = NewReportsSavedService(s)
   390  	return rs
   391  }
   392  
   393  type ReportsService struct {
   394  	s *Service
   395  
   396  	Saved *ReportsSavedService
   397  }
   398  
   399  func NewReportsSavedService(s *Service) *ReportsSavedService {
   400  	rs := &ReportsSavedService{s: s}
   401  	return rs
   402  }
   403  
   404  type ReportsSavedService struct {
   405  	s *Service
   406  }
   407  
   408  func NewSavedadstylesService(s *Service) *SavedadstylesService {
   409  	rs := &SavedadstylesService{s: s}
   410  	return rs
   411  }
   412  
   413  type SavedadstylesService struct {
   414  	s *Service
   415  }
   416  
   417  func NewUrlchannelsService(s *Service) *UrlchannelsService {
   418  	rs := &UrlchannelsService{s: s}
   419  	return rs
   420  }
   421  
   422  type UrlchannelsService struct {
   423  	s *Service
   424  }
   425  
   426  type Account struct {
   427  	// Id: Unique identifier of this account.
   428  	Id string `json:"id,omitempty"`
   429  
   430  	// Kind: Kind of resource this is, in this case adsense#account.
   431  	Kind string `json:"kind,omitempty"`
   432  
   433  	// Name: Name of this account.
   434  	Name string `json:"name,omitempty"`
   435  
   436  	// Premium: Whether this account is premium.
   437  	Premium bool `json:"premium,omitempty"`
   438  
   439  	// SubAccounts: Sub accounts of the this account.
   440  	SubAccounts []*Account `json:"subAccounts,omitempty"`
   441  
   442  	// ServerResponse contains the HTTP response code and headers from the
   443  	// server.
   444  	googleapi.ServerResponse `json:"-"`
   445  
   446  	// ForceSendFields is a list of field names (e.g. "Id") to
   447  	// unconditionally include in API requests. By default, fields with
   448  	// empty values are omitted from API requests. However, any non-pointer,
   449  	// non-interface field appearing in ForceSendFields will be sent to the
   450  	// server regardless of whether the field is empty or not. This may be
   451  	// used to include empty fields in Patch requests.
   452  	ForceSendFields []string `json:"-"`
   453  
   454  	// NullFields is a list of field names (e.g. "Id") to include in API
   455  	// requests with the JSON null value. By default, fields with empty
   456  	// values are omitted from API requests. However, any field with an
   457  	// empty value appearing in NullFields will be sent to the server as
   458  	// null. It is an error if a field in this list has a non-empty value.
   459  	// This may be used to include null fields in Patch requests.
   460  	NullFields []string `json:"-"`
   461  }
   462  
   463  func (s *Account) MarshalJSON() ([]byte, error) {
   464  	type NoMethod Account
   465  	raw := NoMethod(*s)
   466  	return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
   467  }
   468  
   469  type Accounts struct {
   470  	// Etag: ETag of this response for caching purposes.
   471  	Etag string `json:"etag,omitempty"`
   472  
   473  	// Items: The accounts returned in this list response.
   474  	Items []*Account `json:"items,omitempty"`
   475  
   476  	// Kind: Kind of list this is, in this case adsense#accounts.
   477  	Kind string `json:"kind,omitempty"`
   478  
   479  	// NextPageToken: Continuation token used to page through accounts. To
   480  	// retrieve the next page of results, set the next request's "pageToken"
   481  	// value to this.
   482  	NextPageToken string `json:"nextPageToken,omitempty"`
   483  
   484  	// ServerResponse contains the HTTP response code and headers from the
   485  	// server.
   486  	googleapi.ServerResponse `json:"-"`
   487  
   488  	// ForceSendFields is a list of field names (e.g. "Etag") to
   489  	// unconditionally include in API requests. By default, fields with
   490  	// empty values are omitted from API requests. However, any non-pointer,
   491  	// non-interface field appearing in ForceSendFields will be sent to the
   492  	// server regardless of whether the field is empty or not. This may be
   493  	// used to include empty fields in Patch requests.
   494  	ForceSendFields []string `json:"-"`
   495  
   496  	// NullFields is a list of field names (e.g. "Etag") to include in API
   497  	// requests with the JSON null value. By default, fields with empty
   498  	// values are omitted from API requests. However, any field with an
   499  	// empty value appearing in NullFields will be sent to the server as
   500  	// null. It is an error if a field in this list has a non-empty value.
   501  	// This may be used to include null fields in Patch requests.
   502  	NullFields []string `json:"-"`
   503  }
   504  
   505  func (s *Accounts) MarshalJSON() ([]byte, error) {
   506  	type NoMethod Accounts
   507  	raw := NoMethod(*s)
   508  	return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
   509  }
   510  
   511  type AdClient struct {
   512  	// ArcOptIn: Whether this ad client is opted in to ARC.
   513  	ArcOptIn bool `json:"arcOptIn,omitempty"`
   514  
   515  	// Id: Unique identifier of this ad client.
   516  	Id string `json:"id,omitempty"`
   517  
   518  	// Kind: Kind of resource this is, in this case adsense#adClient.
   519  	Kind string `json:"kind,omitempty"`
   520  
   521  	// ProductCode: This ad client's product code, which corresponds to the
   522  	// PRODUCT_CODE report dimension.
   523  	ProductCode string `json:"productCode,omitempty"`
   524  
   525  	// SupportsReporting: Whether this ad client supports being reported on.
   526  	SupportsReporting bool `json:"supportsReporting,omitempty"`
   527  
   528  	// ForceSendFields is a list of field names (e.g. "ArcOptIn") to
   529  	// unconditionally include in API requests. By default, fields with
   530  	// empty values are omitted from API requests. However, any non-pointer,
   531  	// non-interface field appearing in ForceSendFields will be sent to the
   532  	// server regardless of whether the field is empty or not. This may be
   533  	// used to include empty fields in Patch requests.
   534  	ForceSendFields []string `json:"-"`
   535  
   536  	// NullFields is a list of field names (e.g. "ArcOptIn") to include in
   537  	// API requests with the JSON null value. By default, fields with empty
   538  	// values are omitted from API requests. However, any field with an
   539  	// empty value appearing in NullFields will be sent to the server as
   540  	// null. It is an error if a field in this list has a non-empty value.
   541  	// This may be used to include null fields in Patch requests.
   542  	NullFields []string `json:"-"`
   543  }
   544  
   545  func (s *AdClient) MarshalJSON() ([]byte, error) {
   546  	type NoMethod AdClient
   547  	raw := NoMethod(*s)
   548  	return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
   549  }
   550  
   551  type AdClients struct {
   552  	// Etag: ETag of this response for caching purposes.
   553  	Etag string `json:"etag,omitempty"`
   554  
   555  	// Items: The ad clients returned in this list response.
   556  	Items []*AdClient `json:"items,omitempty"`
   557  
   558  	// Kind: Kind of list this is, in this case adsense#adClients.
   559  	Kind string `json:"kind,omitempty"`
   560  
   561  	// NextPageToken: Continuation token used to page through ad clients. To
   562  	// retrieve the next page of results, set the next request's "pageToken"
   563  	// value to this.
   564  	NextPageToken string `json:"nextPageToken,omitempty"`
   565  
   566  	// ServerResponse contains the HTTP response code and headers from the
   567  	// server.
   568  	googleapi.ServerResponse `json:"-"`
   569  
   570  	// ForceSendFields is a list of field names (e.g. "Etag") to
   571  	// unconditionally include in API requests. By default, fields with
   572  	// empty values are omitted from API requests. However, any non-pointer,
   573  	// non-interface field appearing in ForceSendFields will be sent to the
   574  	// server regardless of whether the field is empty or not. This may be
   575  	// used to include empty fields in Patch requests.
   576  	ForceSendFields []string `json:"-"`
   577  
   578  	// NullFields is a list of field names (e.g. "Etag") to include in API
   579  	// requests with the JSON null value. By default, fields with empty
   580  	// values are omitted from API requests. However, any field with an
   581  	// empty value appearing in NullFields will be sent to the server as
   582  	// null. It is an error if a field in this list has a non-empty value.
   583  	// This may be used to include null fields in Patch requests.
   584  	NullFields []string `json:"-"`
   585  }
   586  
   587  func (s *AdClients) MarshalJSON() ([]byte, error) {
   588  	type NoMethod AdClients
   589  	raw := NoMethod(*s)
   590  	return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
   591  }
   592  
   593  type AdCode struct {
   594  	// AdCode: The ad code snippet.
   595  	AdCode string `json:"adCode,omitempty"`
   596  
   597  	// Kind: Kind this is, in this case adsense#adCode.
   598  	Kind string `json:"kind,omitempty"`
   599  
   600  	// ServerResponse contains the HTTP response code and headers from the
   601  	// server.
   602  	googleapi.ServerResponse `json:"-"`
   603  
   604  	// ForceSendFields is a list of field names (e.g. "AdCode") to
   605  	// unconditionally include in API requests. By default, fields with
   606  	// empty values are omitted from API requests. However, any non-pointer,
   607  	// non-interface field appearing in ForceSendFields will be sent to the
   608  	// server regardless of whether the field is empty or not. This may be
   609  	// used to include empty fields in Patch requests.
   610  	ForceSendFields []string `json:"-"`
   611  
   612  	// NullFields is a list of field names (e.g. "AdCode") to include in API
   613  	// requests with the JSON null value. By default, fields with empty
   614  	// values are omitted from API requests. However, any field with an
   615  	// empty value appearing in NullFields will be sent to the server as
   616  	// null. It is an error if a field in this list has a non-empty value.
   617  	// This may be used to include null fields in Patch requests.
   618  	NullFields []string `json:"-"`
   619  }
   620  
   621  func (s *AdCode) MarshalJSON() ([]byte, error) {
   622  	type NoMethod AdCode
   623  	raw := NoMethod(*s)
   624  	return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
   625  }
   626  
   627  type AdStyle struct {
   628  	// Colors: The colors which are included in the style. These are
   629  	// represented as six hexadecimal characters, similar to HTML color
   630  	// codes, but without the leading hash.
   631  	Colors *AdStyleColors `json:"colors,omitempty"`
   632  
   633  	// Corners: The style of the corners in the ad (deprecated: never
   634  	// populated, ignored).
   635  	Corners string `json:"corners,omitempty"`
   636  
   637  	// Font: The font which is included in the style.
   638  	Font *AdStyleFont `json:"font,omitempty"`
   639  
   640  	// Kind: Kind this is, in this case adsense#adStyle.
   641  	Kind string `json:"kind,omitempty"`
   642  
   643  	// ForceSendFields is a list of field names (e.g. "Colors") to
   644  	// unconditionally include in API requests. By default, fields with
   645  	// empty values are omitted from API requests. However, any non-pointer,
   646  	// non-interface field appearing in ForceSendFields will be sent to the
   647  	// server regardless of whether the field is empty or not. This may be
   648  	// used to include empty fields in Patch requests.
   649  	ForceSendFields []string `json:"-"`
   650  
   651  	// NullFields is a list of field names (e.g. "Colors") to include in API
   652  	// requests with the JSON null value. By default, fields with empty
   653  	// values are omitted from API requests. However, any field with an
   654  	// empty value appearing in NullFields will be sent to the server as
   655  	// null. It is an error if a field in this list has a non-empty value.
   656  	// This may be used to include null fields in Patch requests.
   657  	NullFields []string `json:"-"`
   658  }
   659  
   660  func (s *AdStyle) MarshalJSON() ([]byte, error) {
   661  	type NoMethod AdStyle
   662  	raw := NoMethod(*s)
   663  	return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
   664  }
   665  
   666  // AdStyleColors: The colors which are included in the style. These are
   667  // represented as six hexadecimal characters, similar to HTML color
   668  // codes, but without the leading hash.
   669  type AdStyleColors struct {
   670  	// Background: The color of the ad background.
   671  	Background string `json:"background,omitempty"`
   672  
   673  	// Border: The color of the ad border.
   674  	Border string `json:"border,omitempty"`
   675  
   676  	// Text: The color of the ad text.
   677  	Text string `json:"text,omitempty"`
   678  
   679  	// Title: The color of the ad title.
   680  	Title string `json:"title,omitempty"`
   681  
   682  	// Url: The color of the ad url.
   683  	Url string `json:"url,omitempty"`
   684  
   685  	// ForceSendFields is a list of field names (e.g. "Background") to
   686  	// unconditionally include in API requests. By default, fields with
   687  	// empty values are omitted from API requests. However, any non-pointer,
   688  	// non-interface field appearing in ForceSendFields will be sent to the
   689  	// server regardless of whether the field is empty or not. This may be
   690  	// used to include empty fields in Patch requests.
   691  	ForceSendFields []string `json:"-"`
   692  
   693  	// NullFields is a list of field names (e.g. "Background") to include in
   694  	// API requests with the JSON null value. By default, fields with empty
   695  	// values are omitted from API requests. However, any field with an
   696  	// empty value appearing in NullFields will be sent to the server as
   697  	// null. It is an error if a field in this list has a non-empty value.
   698  	// This may be used to include null fields in Patch requests.
   699  	NullFields []string `json:"-"`
   700  }
   701  
   702  func (s *AdStyleColors) MarshalJSON() ([]byte, error) {
   703  	type NoMethod AdStyleColors
   704  	raw := NoMethod(*s)
   705  	return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
   706  }
   707  
   708  // AdStyleFont: The font which is included in the style.
   709  type AdStyleFont struct {
   710  	// Family: The family of the font.
   711  	Family string `json:"family,omitempty"`
   712  
   713  	// Size: The size of the font.
   714  	Size string `json:"size,omitempty"`
   715  
   716  	// ForceSendFields is a list of field names (e.g. "Family") to
   717  	// unconditionally include in API requests. By default, fields with
   718  	// empty values are omitted from API requests. However, any non-pointer,
   719  	// non-interface field appearing in ForceSendFields will be sent to the
   720  	// server regardless of whether the field is empty or not. This may be
   721  	// used to include empty fields in Patch requests.
   722  	ForceSendFields []string `json:"-"`
   723  
   724  	// NullFields is a list of field names (e.g. "Family") to include in API
   725  	// requests with the JSON null value. By default, fields with empty
   726  	// values are omitted from API requests. However, any field with an
   727  	// empty value appearing in NullFields will be sent to the server as
   728  	// null. It is an error if a field in this list has a non-empty value.
   729  	// This may be used to include null fields in Patch requests.
   730  	NullFields []string `json:"-"`
   731  }
   732  
   733  func (s *AdStyleFont) MarshalJSON() ([]byte, error) {
   734  	type NoMethod AdStyleFont
   735  	raw := NoMethod(*s)
   736  	return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
   737  }
   738  
   739  type AdUnit struct {
   740  	// Code: Identity code of this ad unit, not necessarily unique across ad
   741  	// clients.
   742  	Code string `json:"code,omitempty"`
   743  
   744  	// ContentAdsSettings: Settings specific to content ads (AFC) and
   745  	// highend mobile content ads (AFMC - deprecated).
   746  	ContentAdsSettings *AdUnitContentAdsSettings `json:"contentAdsSettings,omitempty"`
   747  
   748  	// CustomStyle: Custom style information specific to this ad unit.
   749  	CustomStyle *AdStyle `json:"customStyle,omitempty"`
   750  
   751  	// FeedAdsSettings: Settings specific to feed ads (AFF) - deprecated.
   752  	FeedAdsSettings *AdUnitFeedAdsSettings `json:"feedAdsSettings,omitempty"`
   753  
   754  	// Id: Unique identifier of this ad unit. This should be considered an
   755  	// opaque identifier; it is not safe to rely on it being in any
   756  	// particular format.
   757  	Id string `json:"id,omitempty"`
   758  
   759  	// Kind: Kind of resource this is, in this case adsense#adUnit.
   760  	Kind string `json:"kind,omitempty"`
   761  
   762  	// MobileContentAdsSettings: Settings specific to WAP mobile content ads
   763  	// (AFMC) - deprecated.
   764  	MobileContentAdsSettings *AdUnitMobileContentAdsSettings `json:"mobileContentAdsSettings,omitempty"`
   765  
   766  	// Name: Name of this ad unit.
   767  	Name string `json:"name,omitempty"`
   768  
   769  	// SavedStyleId: ID of the saved ad style which holds this ad unit's
   770  	// style information.
   771  	SavedStyleId string `json:"savedStyleId,omitempty"`
   772  
   773  	// Status: Status of this ad unit. Possible values are:
   774  	// NEW: Indicates that the ad unit was created within the last seven
   775  	// days and does not yet have any activity associated with it.
   776  	//
   777  	// ACTIVE: Indicates that there has been activity on this ad unit in the
   778  	// last seven days.
   779  	//
   780  	// INACTIVE: Indicates that there has been no activity on this ad unit
   781  	// in the last seven days.
   782  	Status string `json:"status,omitempty"`
   783  
   784  	// ServerResponse contains the HTTP response code and headers from the
   785  	// server.
   786  	googleapi.ServerResponse `json:"-"`
   787  
   788  	// ForceSendFields is a list of field names (e.g. "Code") to
   789  	// unconditionally include in API requests. By default, fields with
   790  	// empty values are omitted from API requests. However, any non-pointer,
   791  	// non-interface field appearing in ForceSendFields will be sent to the
   792  	// server regardless of whether the field is empty or not. This may be
   793  	// used to include empty fields in Patch requests.
   794  	ForceSendFields []string `json:"-"`
   795  
   796  	// NullFields is a list of field names (e.g. "Code") to include in API
   797  	// requests with the JSON null value. By default, fields with empty
   798  	// values are omitted from API requests. However, any field with an
   799  	// empty value appearing in NullFields will be sent to the server as
   800  	// null. It is an error if a field in this list has a non-empty value.
   801  	// This may be used to include null fields in Patch requests.
   802  	NullFields []string `json:"-"`
   803  }
   804  
   805  func (s *AdUnit) MarshalJSON() ([]byte, error) {
   806  	type NoMethod AdUnit
   807  	raw := NoMethod(*s)
   808  	return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
   809  }
   810  
   811  // AdUnitContentAdsSettings: Settings specific to content ads (AFC) and
   812  // highend mobile content ads (AFMC - deprecated).
   813  type AdUnitContentAdsSettings struct {
   814  	// BackupOption: The backup option to be used in instances where no ad
   815  	// is available.
   816  	BackupOption *AdUnitContentAdsSettingsBackupOption `json:"backupOption,omitempty"`
   817  
   818  	// Size: Size of this ad unit.
   819  	Size string `json:"size,omitempty"`
   820  
   821  	// Type: Type of this ad unit.
   822  	Type string `json:"type,omitempty"`
   823  
   824  	// ForceSendFields is a list of field names (e.g. "BackupOption") to
   825  	// unconditionally include in API requests. By default, fields with
   826  	// empty values are omitted from API requests. However, any non-pointer,
   827  	// non-interface field appearing in ForceSendFields will be sent to the
   828  	// server regardless of whether the field is empty or not. This may be
   829  	// used to include empty fields in Patch requests.
   830  	ForceSendFields []string `json:"-"`
   831  
   832  	// NullFields is a list of field names (e.g. "BackupOption") to include
   833  	// in API requests with the JSON null value. By default, fields with
   834  	// empty values are omitted from API requests. However, any field with
   835  	// an empty value appearing in NullFields will be sent to the server as
   836  	// null. It is an error if a field in this list has a non-empty value.
   837  	// This may be used to include null fields in Patch requests.
   838  	NullFields []string `json:"-"`
   839  }
   840  
   841  func (s *AdUnitContentAdsSettings) MarshalJSON() ([]byte, error) {
   842  	type NoMethod AdUnitContentAdsSettings
   843  	raw := NoMethod(*s)
   844  	return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
   845  }
   846  
   847  // AdUnitContentAdsSettingsBackupOption: The backup option to be used in
   848  // instances where no ad is available.
   849  type AdUnitContentAdsSettingsBackupOption struct {
   850  	// Color: Color to use when type is set to COLOR.
   851  	Color string `json:"color,omitempty"`
   852  
   853  	// Type: Type of the backup option. Possible values are BLANK, COLOR and
   854  	// URL.
   855  	Type string `json:"type,omitempty"`
   856  
   857  	// Url: URL to use when type is set to URL.
   858  	Url string `json:"url,omitempty"`
   859  
   860  	// ForceSendFields is a list of field names (e.g. "Color") to
   861  	// unconditionally include in API requests. By default, fields with
   862  	// empty values are omitted from API requests. However, any non-pointer,
   863  	// non-interface field appearing in ForceSendFields will be sent to the
   864  	// server regardless of whether the field is empty or not. This may be
   865  	// used to include empty fields in Patch requests.
   866  	ForceSendFields []string `json:"-"`
   867  
   868  	// NullFields is a list of field names (e.g. "Color") to include in API
   869  	// requests with the JSON null value. By default, fields with empty
   870  	// values are omitted from API requests. However, any field with an
   871  	// empty value appearing in NullFields will be sent to the server as
   872  	// null. It is an error if a field in this list has a non-empty value.
   873  	// This may be used to include null fields in Patch requests.
   874  	NullFields []string `json:"-"`
   875  }
   876  
   877  func (s *AdUnitContentAdsSettingsBackupOption) MarshalJSON() ([]byte, error) {
   878  	type NoMethod AdUnitContentAdsSettingsBackupOption
   879  	raw := NoMethod(*s)
   880  	return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
   881  }
   882  
   883  // AdUnitFeedAdsSettings: Settings specific to feed ads (AFF) -
   884  // deprecated.
   885  type AdUnitFeedAdsSettings struct {
   886  	// AdPosition: The position of the ads relative to the feed entries.
   887  	AdPosition string `json:"adPosition,omitempty"`
   888  
   889  	// Frequency: The frequency at which ads should appear in the feed (i.e.
   890  	// every N entries).
   891  	Frequency int64 `json:"frequency,omitempty"`
   892  
   893  	// MinimumWordCount: The minimum length an entry should be in order to
   894  	// have attached ads.
   895  	MinimumWordCount int64 `json:"minimumWordCount,omitempty"`
   896  
   897  	// Type: The type of ads which should appear.
   898  	Type string `json:"type,omitempty"`
   899  
   900  	// ForceSendFields is a list of field names (e.g. "AdPosition") to
   901  	// unconditionally include in API requests. By default, fields with
   902  	// empty values are omitted from API requests. However, any non-pointer,
   903  	// non-interface field appearing in ForceSendFields will be sent to the
   904  	// server regardless of whether the field is empty or not. This may be
   905  	// used to include empty fields in Patch requests.
   906  	ForceSendFields []string `json:"-"`
   907  
   908  	// NullFields is a list of field names (e.g. "AdPosition") to include in
   909  	// API requests with the JSON null value. By default, fields with empty
   910  	// values are omitted from API requests. However, any field with an
   911  	// empty value appearing in NullFields will be sent to the server as
   912  	// null. It is an error if a field in this list has a non-empty value.
   913  	// This may be used to include null fields in Patch requests.
   914  	NullFields []string `json:"-"`
   915  }
   916  
   917  func (s *AdUnitFeedAdsSettings) MarshalJSON() ([]byte, error) {
   918  	type NoMethod AdUnitFeedAdsSettings
   919  	raw := NoMethod(*s)
   920  	return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
   921  }
   922  
   923  // AdUnitMobileContentAdsSettings: Settings specific to WAP mobile
   924  // content ads (AFMC) - deprecated.
   925  type AdUnitMobileContentAdsSettings struct {
   926  	// MarkupLanguage: The markup language to use for this ad unit.
   927  	MarkupLanguage string `json:"markupLanguage,omitempty"`
   928  
   929  	// ScriptingLanguage: The scripting language to use for this ad unit.
   930  	ScriptingLanguage string `json:"scriptingLanguage,omitempty"`
   931  
   932  	// Size: Size of this ad unit.
   933  	Size string `json:"size,omitempty"`
   934  
   935  	// Type: Type of this ad unit.
   936  	Type string `json:"type,omitempty"`
   937  
   938  	// ForceSendFields is a list of field names (e.g. "MarkupLanguage") to
   939  	// unconditionally include in API requests. By default, fields with
   940  	// empty values are omitted from API requests. However, any non-pointer,
   941  	// non-interface field appearing in ForceSendFields will be sent to the
   942  	// server regardless of whether the field is empty or not. This may be
   943  	// used to include empty fields in Patch requests.
   944  	ForceSendFields []string `json:"-"`
   945  
   946  	// NullFields is a list of field names (e.g. "MarkupLanguage") to
   947  	// include in API requests with the JSON null value. By default, fields
   948  	// with empty values are omitted from API requests. However, any field
   949  	// with an empty value appearing in NullFields will be sent to the
   950  	// server as null. It is an error if a field in this list has a
   951  	// non-empty value. This may be used to include null fields in Patch
   952  	// requests.
   953  	NullFields []string `json:"-"`
   954  }
   955  
   956  func (s *AdUnitMobileContentAdsSettings) MarshalJSON() ([]byte, error) {
   957  	type NoMethod AdUnitMobileContentAdsSettings
   958  	raw := NoMethod(*s)
   959  	return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
   960  }
   961  
   962  type AdUnits struct {
   963  	// Etag: ETag of this response for caching purposes.
   964  	Etag string `json:"etag,omitempty"`
   965  
   966  	// Items: The ad units returned in this list response.
   967  	Items []*AdUnit `json:"items,omitempty"`
   968  
   969  	// Kind: Kind of list this is, in this case adsense#adUnits.
   970  	Kind string `json:"kind,omitempty"`
   971  
   972  	// NextPageToken: Continuation token used to page through ad units. To
   973  	// retrieve the next page of results, set the next request's "pageToken"
   974  	// value to this.
   975  	NextPageToken string `json:"nextPageToken,omitempty"`
   976  
   977  	// ServerResponse contains the HTTP response code and headers from the
   978  	// server.
   979  	googleapi.ServerResponse `json:"-"`
   980  
   981  	// ForceSendFields is a list of field names (e.g. "Etag") to
   982  	// unconditionally include in API requests. By default, fields with
   983  	// empty values are omitted from API requests. However, any non-pointer,
   984  	// non-interface field appearing in ForceSendFields will be sent to the
   985  	// server regardless of whether the field is empty or not. This may be
   986  	// used to include empty fields in Patch requests.
   987  	ForceSendFields []string `json:"-"`
   988  
   989  	// NullFields is a list of field names (e.g. "Etag") to include in API
   990  	// requests with the JSON null value. By default, fields with empty
   991  	// values are omitted from API requests. However, any field with an
   992  	// empty value appearing in NullFields will be sent to the server as
   993  	// null. It is an error if a field in this list has a non-empty value.
   994  	// This may be used to include null fields in Patch requests.
   995  	NullFields []string `json:"-"`
   996  }
   997  
   998  func (s *AdUnits) MarshalJSON() ([]byte, error) {
   999  	type NoMethod AdUnits
  1000  	raw := NoMethod(*s)
  1001  	return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  1002  }
  1003  
  1004  type AdsenseReportsGenerateResponse struct {
  1005  	// Averages: The averages of the report. This is the same length as any
  1006  	// other row in the report; cells corresponding to dimension columns are
  1007  	// empty.
  1008  	Averages []string `json:"averages,omitempty"`
  1009  
  1010  	// Headers: The header information of the columns requested in the
  1011  	// report. This is a list of headers; one for each dimension in the
  1012  	// request, followed by one for each metric in the request.
  1013  	Headers []*AdsenseReportsGenerateResponseHeaders `json:"headers,omitempty"`
  1014  
  1015  	// Kind: Kind this is, in this case adsense#report.
  1016  	Kind string `json:"kind,omitempty"`
  1017  
  1018  	// Rows: The output rows of the report. Each row is a list of cells; one
  1019  	// for each dimension in the request, followed by one for each metric in
  1020  	// the request. The dimension cells contain strings, and the metric
  1021  	// cells contain numbers.
  1022  	Rows [][]string `json:"rows,omitempty"`
  1023  
  1024  	// TotalMatchedRows: The total number of rows matched by the report
  1025  	// request. Fewer rows may be returned in the response due to being
  1026  	// limited by the row count requested or the report row limit.
  1027  	TotalMatchedRows int64 `json:"totalMatchedRows,omitempty,string"`
  1028  
  1029  	// Totals: The totals of the report. This is the same length as any
  1030  	// other row in the report; cells corresponding to dimension columns are
  1031  	// empty.
  1032  	Totals []string `json:"totals,omitempty"`
  1033  
  1034  	// Warnings: Any warnings associated with generation of the report.
  1035  	Warnings []string `json:"warnings,omitempty"`
  1036  
  1037  	// ServerResponse contains the HTTP response code and headers from the
  1038  	// server.
  1039  	googleapi.ServerResponse `json:"-"`
  1040  
  1041  	// ForceSendFields is a list of field names (e.g. "Averages") to
  1042  	// unconditionally include in API requests. By default, fields with
  1043  	// empty values are omitted from API requests. However, any non-pointer,
  1044  	// non-interface field appearing in ForceSendFields will be sent to the
  1045  	// server regardless of whether the field is empty or not. This may be
  1046  	// used to include empty fields in Patch requests.
  1047  	ForceSendFields []string `json:"-"`
  1048  
  1049  	// NullFields is a list of field names (e.g. "Averages") to include in
  1050  	// API requests with the JSON null value. By default, fields with empty
  1051  	// values are omitted from API requests. However, any field with an
  1052  	// empty value appearing in NullFields will be sent to the server as
  1053  	// null. It is an error if a field in this list has a non-empty value.
  1054  	// This may be used to include null fields in Patch requests.
  1055  	NullFields []string `json:"-"`
  1056  }
  1057  
  1058  func (s *AdsenseReportsGenerateResponse) MarshalJSON() ([]byte, error) {
  1059  	type NoMethod AdsenseReportsGenerateResponse
  1060  	raw := NoMethod(*s)
  1061  	return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  1062  }
  1063  
  1064  type AdsenseReportsGenerateResponseHeaders struct {
  1065  	// Currency: The currency of this column. Only present if the header
  1066  	// type is METRIC_CURRENCY.
  1067  	Currency string `json:"currency,omitempty"`
  1068  
  1069  	// Name: The name of the header.
  1070  	Name string `json:"name,omitempty"`
  1071  
  1072  	// Type: The type of the header; one of DIMENSION, METRIC_TALLY,
  1073  	// METRIC_RATIO, or METRIC_CURRENCY.
  1074  	Type string `json:"type,omitempty"`
  1075  
  1076  	// ForceSendFields is a list of field names (e.g. "Currency") to
  1077  	// unconditionally include in API requests. By default, fields with
  1078  	// empty values are omitted from API requests. However, any non-pointer,
  1079  	// non-interface field appearing in ForceSendFields will be sent to the
  1080  	// server regardless of whether the field is empty or not. This may be
  1081  	// used to include empty fields in Patch requests.
  1082  	ForceSendFields []string `json:"-"`
  1083  
  1084  	// NullFields is a list of field names (e.g. "Currency") to include in
  1085  	// API requests with the JSON null value. By default, fields with empty
  1086  	// values are omitted from API requests. However, any field with an
  1087  	// empty value appearing in NullFields will be sent to the server as
  1088  	// null. It is an error if a field in this list has a non-empty value.
  1089  	// This may be used to include null fields in Patch requests.
  1090  	NullFields []string `json:"-"`
  1091  }
  1092  
  1093  func (s *AdsenseReportsGenerateResponseHeaders) MarshalJSON() ([]byte, error) {
  1094  	type NoMethod AdsenseReportsGenerateResponseHeaders
  1095  	raw := NoMethod(*s)
  1096  	return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  1097  }
  1098  
  1099  type Alert struct {
  1100  	// Id: Unique identifier of this alert. This should be considered an
  1101  	// opaque identifier; it is not safe to rely on it being in any
  1102  	// particular format.
  1103  	Id string `json:"id,omitempty"`
  1104  
  1105  	// Kind: Kind of resource this is, in this case adsense#alert.
  1106  	Kind string `json:"kind,omitempty"`
  1107  
  1108  	// Message: The localized alert message.
  1109  	Message string `json:"message,omitempty"`
  1110  
  1111  	// Severity: Severity of this alert. Possible values: INFO, WARNING,
  1112  	// SEVERE.
  1113  	Severity string `json:"severity,omitempty"`
  1114  
  1115  	// Type: Type of this alert. Possible values: SELF_HOLD,
  1116  	// MIGRATED_TO_BILLING3, ADDRESS_PIN_VERIFICATION,
  1117  	// PHONE_PIN_VERIFICATION, CORPORATE_ENTITY, GRAYLISTED_PUBLISHER,
  1118  	// API_HOLD.
  1119  	Type string `json:"type,omitempty"`
  1120  
  1121  	// ForceSendFields is a list of field names (e.g. "Id") to
  1122  	// unconditionally include in API requests. By default, fields with
  1123  	// empty values are omitted from API requests. However, any non-pointer,
  1124  	// non-interface field appearing in ForceSendFields will be sent to the
  1125  	// server regardless of whether the field is empty or not. This may be
  1126  	// used to include empty fields in Patch requests.
  1127  	ForceSendFields []string `json:"-"`
  1128  
  1129  	// NullFields is a list of field names (e.g. "Id") to include in API
  1130  	// requests with the JSON null value. By default, fields with empty
  1131  	// values are omitted from API requests. However, any field with an
  1132  	// empty value appearing in NullFields will be sent to the server as
  1133  	// null. It is an error if a field in this list has a non-empty value.
  1134  	// This may be used to include null fields in Patch requests.
  1135  	NullFields []string `json:"-"`
  1136  }
  1137  
  1138  func (s *Alert) MarshalJSON() ([]byte, error) {
  1139  	type NoMethod Alert
  1140  	raw := NoMethod(*s)
  1141  	return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  1142  }
  1143  
  1144  type Alerts struct {
  1145  	// Items: The alerts returned in this list response.
  1146  	Items []*Alert `json:"items,omitempty"`
  1147  
  1148  	// Kind: Kind of list this is, in this case adsense#alerts.
  1149  	Kind string `json:"kind,omitempty"`
  1150  
  1151  	// ServerResponse contains the HTTP response code and headers from the
  1152  	// server.
  1153  	googleapi.ServerResponse `json:"-"`
  1154  
  1155  	// ForceSendFields is a list of field names (e.g. "Items") to
  1156  	// unconditionally include in API requests. By default, fields with
  1157  	// empty values are omitted from API requests. However, any non-pointer,
  1158  	// non-interface field appearing in ForceSendFields will be sent to the
  1159  	// server regardless of whether the field is empty or not. This may be
  1160  	// used to include empty fields in Patch requests.
  1161  	ForceSendFields []string `json:"-"`
  1162  
  1163  	// NullFields is a list of field names (e.g. "Items") to include in API
  1164  	// requests with the JSON null value. By default, fields with empty
  1165  	// values are omitted from API requests. However, any field with an
  1166  	// empty value appearing in NullFields will be sent to the server as
  1167  	// null. It is an error if a field in this list has a non-empty value.
  1168  	// This may be used to include null fields in Patch requests.
  1169  	NullFields []string `json:"-"`
  1170  }
  1171  
  1172  func (s *Alerts) MarshalJSON() ([]byte, error) {
  1173  	type NoMethod Alerts
  1174  	raw := NoMethod(*s)
  1175  	return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  1176  }
  1177  
  1178  type CustomChannel struct {
  1179  	// Code: Code of this custom channel, not necessarily unique across ad
  1180  	// clients.
  1181  	Code string `json:"code,omitempty"`
  1182  
  1183  	// Id: Unique identifier of this custom channel. This should be
  1184  	// considered an opaque identifier; it is not safe to rely on it being
  1185  	// in any particular format.
  1186  	Id string `json:"id,omitempty"`
  1187  
  1188  	// Kind: Kind of resource this is, in this case adsense#customChannel.
  1189  	Kind string `json:"kind,omitempty"`
  1190  
  1191  	// Name: Name of this custom channel.
  1192  	Name string `json:"name,omitempty"`
  1193  
  1194  	// TargetingInfo: The targeting information of this custom channel, if
  1195  	// activated.
  1196  	TargetingInfo *CustomChannelTargetingInfo `json:"targetingInfo,omitempty"`
  1197  
  1198  	// ServerResponse contains the HTTP response code and headers from the
  1199  	// server.
  1200  	googleapi.ServerResponse `json:"-"`
  1201  
  1202  	// ForceSendFields is a list of field names (e.g. "Code") to
  1203  	// unconditionally include in API requests. By default, fields with
  1204  	// empty values are omitted from API requests. However, any non-pointer,
  1205  	// non-interface field appearing in ForceSendFields will be sent to the
  1206  	// server regardless of whether the field is empty or not. This may be
  1207  	// used to include empty fields in Patch requests.
  1208  	ForceSendFields []string `json:"-"`
  1209  
  1210  	// NullFields is a list of field names (e.g. "Code") to include in API
  1211  	// requests with the JSON null value. By default, fields with empty
  1212  	// values are omitted from API requests. However, any field with an
  1213  	// empty value appearing in NullFields will be sent to the server as
  1214  	// null. It is an error if a field in this list has a non-empty value.
  1215  	// This may be used to include null fields in Patch requests.
  1216  	NullFields []string `json:"-"`
  1217  }
  1218  
  1219  func (s *CustomChannel) MarshalJSON() ([]byte, error) {
  1220  	type NoMethod CustomChannel
  1221  	raw := NoMethod(*s)
  1222  	return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  1223  }
  1224  
  1225  // CustomChannelTargetingInfo: The targeting information of this custom
  1226  // channel, if activated.
  1227  type CustomChannelTargetingInfo struct {
  1228  	// AdsAppearOn: The name used to describe this channel externally.
  1229  	AdsAppearOn string `json:"adsAppearOn,omitempty"`
  1230  
  1231  	// Description: The external description of the channel.
  1232  	Description string `json:"description,omitempty"`
  1233  
  1234  	// Location: The locations in which ads appear. (Only valid for content
  1235  	// and mobile content ads (deprecated)). Acceptable values for content
  1236  	// ads are: TOP_LEFT, TOP_CENTER, TOP_RIGHT, MIDDLE_LEFT, MIDDLE_CENTER,
  1237  	// MIDDLE_RIGHT, BOTTOM_LEFT, BOTTOM_CENTER, BOTTOM_RIGHT,
  1238  	// MULTIPLE_LOCATIONS. Acceptable values for mobile content ads
  1239  	// (deprecated) are: TOP, MIDDLE, BOTTOM, MULTIPLE_LOCATIONS.
  1240  	Location string `json:"location,omitempty"`
  1241  
  1242  	// SiteLanguage: The language of the sites ads will be displayed on.
  1243  	SiteLanguage string `json:"siteLanguage,omitempty"`
  1244  
  1245  	// ForceSendFields is a list of field names (e.g. "AdsAppearOn") to
  1246  	// unconditionally include in API requests. By default, fields with
  1247  	// empty values are omitted from API requests. However, any non-pointer,
  1248  	// non-interface field appearing in ForceSendFields will be sent to the
  1249  	// server regardless of whether the field is empty or not. This may be
  1250  	// used to include empty fields in Patch requests.
  1251  	ForceSendFields []string `json:"-"`
  1252  
  1253  	// NullFields is a list of field names (e.g. "AdsAppearOn") to include
  1254  	// in API requests with the JSON null value. By default, fields with
  1255  	// empty values are omitted from API requests. However, any field with
  1256  	// an empty value appearing in NullFields will be sent to the server as
  1257  	// null. It is an error if a field in this list has a non-empty value.
  1258  	// This may be used to include null fields in Patch requests.
  1259  	NullFields []string `json:"-"`
  1260  }
  1261  
  1262  func (s *CustomChannelTargetingInfo) MarshalJSON() ([]byte, error) {
  1263  	type NoMethod CustomChannelTargetingInfo
  1264  	raw := NoMethod(*s)
  1265  	return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  1266  }
  1267  
  1268  type CustomChannels struct {
  1269  	// Etag: ETag of this response for caching purposes.
  1270  	Etag string `json:"etag,omitempty"`
  1271  
  1272  	// Items: The custom channels returned in this list response.
  1273  	Items []*CustomChannel `json:"items,omitempty"`
  1274  
  1275  	// Kind: Kind of list this is, in this case adsense#customChannels.
  1276  	Kind string `json:"kind,omitempty"`
  1277  
  1278  	// NextPageToken: Continuation token used to page through custom
  1279  	// channels. To retrieve the next page of results, set the next
  1280  	// request's "pageToken" value to this.
  1281  	NextPageToken string `json:"nextPageToken,omitempty"`
  1282  
  1283  	// ServerResponse contains the HTTP response code and headers from the
  1284  	// server.
  1285  	googleapi.ServerResponse `json:"-"`
  1286  
  1287  	// ForceSendFields is a list of field names (e.g. "Etag") to
  1288  	// unconditionally include in API requests. By default, fields with
  1289  	// empty values are omitted from API requests. However, any non-pointer,
  1290  	// non-interface field appearing in ForceSendFields will be sent to the
  1291  	// server regardless of whether the field is empty or not. This may be
  1292  	// used to include empty fields in Patch requests.
  1293  	ForceSendFields []string `json:"-"`
  1294  
  1295  	// NullFields is a list of field names (e.g. "Etag") to include in API
  1296  	// requests with the JSON null value. By default, fields with empty
  1297  	// values are omitted from API requests. However, any field with an
  1298  	// empty value appearing in NullFields will be sent to the server as
  1299  	// null. It is an error if a field in this list has a non-empty value.
  1300  	// This may be used to include null fields in Patch requests.
  1301  	NullFields []string `json:"-"`
  1302  }
  1303  
  1304  func (s *CustomChannels) MarshalJSON() ([]byte, error) {
  1305  	type NoMethod CustomChannels
  1306  	raw := NoMethod(*s)
  1307  	return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  1308  }
  1309  
  1310  type Metadata struct {
  1311  	Items []*ReportingMetadataEntry `json:"items,omitempty"`
  1312  
  1313  	// Kind: Kind of list this is, in this case adsense#metadata.
  1314  	Kind string `json:"kind,omitempty"`
  1315  
  1316  	// ServerResponse contains the HTTP response code and headers from the
  1317  	// server.
  1318  	googleapi.ServerResponse `json:"-"`
  1319  
  1320  	// ForceSendFields is a list of field names (e.g. "Items") to
  1321  	// unconditionally include in API requests. By default, fields with
  1322  	// empty values are omitted from API requests. However, any non-pointer,
  1323  	// non-interface field appearing in ForceSendFields will be sent to the
  1324  	// server regardless of whether the field is empty or not. This may be
  1325  	// used to include empty fields in Patch requests.
  1326  	ForceSendFields []string `json:"-"`
  1327  
  1328  	// NullFields is a list of field names (e.g. "Items") to include in API
  1329  	// requests with the JSON null value. By default, fields with empty
  1330  	// values are omitted from API requests. However, any field with an
  1331  	// empty value appearing in NullFields will be sent to the server as
  1332  	// null. It is an error if a field in this list has a non-empty value.
  1333  	// This may be used to include null fields in Patch requests.
  1334  	NullFields []string `json:"-"`
  1335  }
  1336  
  1337  func (s *Metadata) MarshalJSON() ([]byte, error) {
  1338  	type NoMethod Metadata
  1339  	raw := NoMethod(*s)
  1340  	return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  1341  }
  1342  
  1343  type ReportingMetadataEntry struct {
  1344  	// CompatibleDimensions: For metrics this is a list of dimension IDs
  1345  	// which the metric is compatible with, for dimensions it is a list of
  1346  	// compatibility groups the dimension belongs to.
  1347  	CompatibleDimensions []string `json:"compatibleDimensions,omitempty"`
  1348  
  1349  	// CompatibleMetrics: The names of the metrics the dimension or metric
  1350  	// this reporting metadata entry describes is compatible with.
  1351  	CompatibleMetrics []string `json:"compatibleMetrics,omitempty"`
  1352  
  1353  	// Id: Unique identifier of this reporting metadata entry, corresponding
  1354  	// to the name of the appropriate dimension or metric.
  1355  	Id string `json:"id,omitempty"`
  1356  
  1357  	// Kind: Kind of resource this is, in this case
  1358  	// adsense#reportingMetadataEntry.
  1359  	Kind string `json:"kind,omitempty"`
  1360  
  1361  	// RequiredDimensions: The names of the dimensions which the dimension
  1362  	// or metric this reporting metadata entry describes requires to also be
  1363  	// present in order for the report to be valid. Omitting these will not
  1364  	// cause an error or warning, but may result in data which cannot be
  1365  	// correctly interpreted.
  1366  	RequiredDimensions []string `json:"requiredDimensions,omitempty"`
  1367  
  1368  	// RequiredMetrics: The names of the metrics which the dimension or
  1369  	// metric this reporting metadata entry describes requires to also be
  1370  	// present in order for the report to be valid. Omitting these will not
  1371  	// cause an error or warning, but may result in data which cannot be
  1372  	// correctly interpreted.
  1373  	RequiredMetrics []string `json:"requiredMetrics,omitempty"`
  1374  
  1375  	// SupportedProducts: The codes of the projects supported by the
  1376  	// dimension or metric this reporting metadata entry describes.
  1377  	SupportedProducts []string `json:"supportedProducts,omitempty"`
  1378  
  1379  	// ForceSendFields is a list of field names (e.g.
  1380  	// "CompatibleDimensions") to unconditionally include in API requests.
  1381  	// By default, fields with empty values are omitted from API requests.
  1382  	// However, any non-pointer, non-interface field appearing in
  1383  	// ForceSendFields will be sent to the server regardless of whether the
  1384  	// field is empty or not. This may be used to include empty fields in
  1385  	// Patch requests.
  1386  	ForceSendFields []string `json:"-"`
  1387  
  1388  	// NullFields is a list of field names (e.g. "CompatibleDimensions") to
  1389  	// include in API requests with the JSON null value. By default, fields
  1390  	// with empty values are omitted from API requests. However, any field
  1391  	// with an empty value appearing in NullFields will be sent to the
  1392  	// server as null. It is an error if a field in this list has a
  1393  	// non-empty value. This may be used to include null fields in Patch
  1394  	// requests.
  1395  	NullFields []string `json:"-"`
  1396  }
  1397  
  1398  func (s *ReportingMetadataEntry) MarshalJSON() ([]byte, error) {
  1399  	type NoMethod ReportingMetadataEntry
  1400  	raw := NoMethod(*s)
  1401  	return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  1402  }
  1403  
  1404  type SavedAdStyle struct {
  1405  	// AdStyle: The AdStyle itself.
  1406  	AdStyle *AdStyle `json:"adStyle,omitempty"`
  1407  
  1408  	// Id: Unique identifier of this saved ad style. This should be
  1409  	// considered an opaque identifier; it is not safe to rely on it being
  1410  	// in any particular format.
  1411  	Id string `json:"id,omitempty"`
  1412  
  1413  	// Kind: Kind of resource this is, in this case adsense#savedAdStyle.
  1414  	Kind string `json:"kind,omitempty"`
  1415  
  1416  	// Name: The user selected name of this SavedAdStyle.
  1417  	Name string `json:"name,omitempty"`
  1418  
  1419  	// ServerResponse contains the HTTP response code and headers from the
  1420  	// server.
  1421  	googleapi.ServerResponse `json:"-"`
  1422  
  1423  	// ForceSendFields is a list of field names (e.g. "AdStyle") to
  1424  	// unconditionally include in API requests. By default, fields with
  1425  	// empty values are omitted from API requests. However, any non-pointer,
  1426  	// non-interface field appearing in ForceSendFields will be sent to the
  1427  	// server regardless of whether the field is empty or not. This may be
  1428  	// used to include empty fields in Patch requests.
  1429  	ForceSendFields []string `json:"-"`
  1430  
  1431  	// NullFields is a list of field names (e.g. "AdStyle") to include in
  1432  	// API requests with the JSON null value. By default, fields with empty
  1433  	// values are omitted from API requests. However, any field with an
  1434  	// empty value appearing in NullFields will be sent to the server as
  1435  	// null. It is an error if a field in this list has a non-empty value.
  1436  	// This may be used to include null fields in Patch requests.
  1437  	NullFields []string `json:"-"`
  1438  }
  1439  
  1440  func (s *SavedAdStyle) MarshalJSON() ([]byte, error) {
  1441  	type NoMethod SavedAdStyle
  1442  	raw := NoMethod(*s)
  1443  	return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  1444  }
  1445  
  1446  type SavedAdStyles struct {
  1447  	// Etag: ETag of this response for caching purposes.
  1448  	Etag string `json:"etag,omitempty"`
  1449  
  1450  	// Items: The saved ad styles returned in this list response.
  1451  	Items []*SavedAdStyle `json:"items,omitempty"`
  1452  
  1453  	// Kind: Kind of list this is, in this case adsense#savedAdStyles.
  1454  	Kind string `json:"kind,omitempty"`
  1455  
  1456  	// NextPageToken: Continuation token used to page through ad units. To
  1457  	// retrieve the next page of results, set the next request's "pageToken"
  1458  	// value to this.
  1459  	NextPageToken string `json:"nextPageToken,omitempty"`
  1460  
  1461  	// ServerResponse contains the HTTP response code and headers from the
  1462  	// server.
  1463  	googleapi.ServerResponse `json:"-"`
  1464  
  1465  	// ForceSendFields is a list of field names (e.g. "Etag") to
  1466  	// unconditionally include in API requests. By default, fields with
  1467  	// empty values are omitted from API requests. However, any non-pointer,
  1468  	// non-interface field appearing in ForceSendFields will be sent to the
  1469  	// server regardless of whether the field is empty or not. This may be
  1470  	// used to include empty fields in Patch requests.
  1471  	ForceSendFields []string `json:"-"`
  1472  
  1473  	// NullFields is a list of field names (e.g. "Etag") to include in API
  1474  	// requests with the JSON null value. By default, fields with empty
  1475  	// values are omitted from API requests. However, any field with an
  1476  	// empty value appearing in NullFields will be sent to the server as
  1477  	// null. It is an error if a field in this list has a non-empty value.
  1478  	// This may be used to include null fields in Patch requests.
  1479  	NullFields []string `json:"-"`
  1480  }
  1481  
  1482  func (s *SavedAdStyles) MarshalJSON() ([]byte, error) {
  1483  	type NoMethod SavedAdStyles
  1484  	raw := NoMethod(*s)
  1485  	return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  1486  }
  1487  
  1488  type SavedReport struct {
  1489  	// Id: Unique identifier of this saved report.
  1490  	Id string `json:"id,omitempty"`
  1491  
  1492  	// Kind: Kind of resource this is, in this case adsense#savedReport.
  1493  	Kind string `json:"kind,omitempty"`
  1494  
  1495  	// Name: This saved report's name.
  1496  	Name string `json:"name,omitempty"`
  1497  
  1498  	// ForceSendFields is a list of field names (e.g. "Id") to
  1499  	// unconditionally include in API requests. By default, fields with
  1500  	// empty values are omitted from API requests. However, any non-pointer,
  1501  	// non-interface field appearing in ForceSendFields will be sent to the
  1502  	// server regardless of whether the field is empty or not. This may be
  1503  	// used to include empty fields in Patch requests.
  1504  	ForceSendFields []string `json:"-"`
  1505  
  1506  	// NullFields is a list of field names (e.g. "Id") to include in API
  1507  	// requests with the JSON null value. By default, fields with empty
  1508  	// values are omitted from API requests. However, any field with an
  1509  	// empty value appearing in NullFields will be sent to the server as
  1510  	// null. It is an error if a field in this list has a non-empty value.
  1511  	// This may be used to include null fields in Patch requests.
  1512  	NullFields []string `json:"-"`
  1513  }
  1514  
  1515  func (s *SavedReport) MarshalJSON() ([]byte, error) {
  1516  	type NoMethod SavedReport
  1517  	raw := NoMethod(*s)
  1518  	return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  1519  }
  1520  
  1521  type SavedReports struct {
  1522  	// Etag: ETag of this response for caching purposes.
  1523  	Etag string `json:"etag,omitempty"`
  1524  
  1525  	// Items: The saved reports returned in this list response.
  1526  	Items []*SavedReport `json:"items,omitempty"`
  1527  
  1528  	// Kind: Kind of list this is, in this case adsense#savedReports.
  1529  	Kind string `json:"kind,omitempty"`
  1530  
  1531  	// NextPageToken: Continuation token used to page through saved reports.
  1532  	// To retrieve the next page of results, set the next request's
  1533  	// "pageToken" value to this.
  1534  	NextPageToken string `json:"nextPageToken,omitempty"`
  1535  
  1536  	// ServerResponse contains the HTTP response code and headers from the
  1537  	// server.
  1538  	googleapi.ServerResponse `json:"-"`
  1539  
  1540  	// ForceSendFields is a list of field names (e.g. "Etag") to
  1541  	// unconditionally include in API requests. By default, fields with
  1542  	// empty values are omitted from API requests. However, any non-pointer,
  1543  	// non-interface field appearing in ForceSendFields will be sent to the
  1544  	// server regardless of whether the field is empty or not. This may be
  1545  	// used to include empty fields in Patch requests.
  1546  	ForceSendFields []string `json:"-"`
  1547  
  1548  	// NullFields is a list of field names (e.g. "Etag") to include in API
  1549  	// requests with the JSON null value. By default, fields with empty
  1550  	// values are omitted from API requests. However, any field with an
  1551  	// empty value appearing in NullFields will be sent to the server as
  1552  	// null. It is an error if a field in this list has a non-empty value.
  1553  	// This may be used to include null fields in Patch requests.
  1554  	NullFields []string `json:"-"`
  1555  }
  1556  
  1557  func (s *SavedReports) MarshalJSON() ([]byte, error) {
  1558  	type NoMethod SavedReports
  1559  	raw := NoMethod(*s)
  1560  	return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  1561  }
  1562  
  1563  type UrlChannel struct {
  1564  	// Id: Unique identifier of this URL channel. This should be considered
  1565  	// an opaque identifier; it is not safe to rely on it being in any
  1566  	// particular format.
  1567  	Id string `json:"id,omitempty"`
  1568  
  1569  	// Kind: Kind of resource this is, in this case adsense#urlChannel.
  1570  	Kind string `json:"kind,omitempty"`
  1571  
  1572  	// UrlPattern: URL Pattern of this URL channel. Does not include
  1573  	// "http://" or "https://". Example: www.example.com/home
  1574  	UrlPattern string `json:"urlPattern,omitempty"`
  1575  
  1576  	// ForceSendFields is a list of field names (e.g. "Id") to
  1577  	// unconditionally include in API requests. By default, fields with
  1578  	// empty values are omitted from API requests. However, any non-pointer,
  1579  	// non-interface field appearing in ForceSendFields will be sent to the
  1580  	// server regardless of whether the field is empty or not. This may be
  1581  	// used to include empty fields in Patch requests.
  1582  	ForceSendFields []string `json:"-"`
  1583  
  1584  	// NullFields is a list of field names (e.g. "Id") to include in API
  1585  	// requests with the JSON null value. By default, fields with empty
  1586  	// values are omitted from API requests. However, any field with an
  1587  	// empty value appearing in NullFields will be sent to the server as
  1588  	// null. It is an error if a field in this list has a non-empty value.
  1589  	// This may be used to include null fields in Patch requests.
  1590  	NullFields []string `json:"-"`
  1591  }
  1592  
  1593  func (s *UrlChannel) MarshalJSON() ([]byte, error) {
  1594  	type NoMethod UrlChannel
  1595  	raw := NoMethod(*s)
  1596  	return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  1597  }
  1598  
  1599  type UrlChannels struct {
  1600  	// Etag: ETag of this response for caching purposes.
  1601  	Etag string `json:"etag,omitempty"`
  1602  
  1603  	// Items: The URL channels returned in this list response.
  1604  	Items []*UrlChannel `json:"items,omitempty"`
  1605  
  1606  	// Kind: Kind of list this is, in this case adsense#urlChannels.
  1607  	Kind string `json:"kind,omitempty"`
  1608  
  1609  	// NextPageToken: Continuation token used to page through URL channels.
  1610  	// To retrieve the next page of results, set the next request's
  1611  	// "pageToken" value to this.
  1612  	NextPageToken string `json:"nextPageToken,omitempty"`
  1613  
  1614  	// ServerResponse contains the HTTP response code and headers from the
  1615  	// server.
  1616  	googleapi.ServerResponse `json:"-"`
  1617  
  1618  	// ForceSendFields is a list of field names (e.g. "Etag") to
  1619  	// unconditionally include in API requests. By default, fields with
  1620  	// empty values are omitted from API requests. However, any non-pointer,
  1621  	// non-interface field appearing in ForceSendFields will be sent to the
  1622  	// server regardless of whether the field is empty or not. This may be
  1623  	// used to include empty fields in Patch requests.
  1624  	ForceSendFields []string `json:"-"`
  1625  
  1626  	// NullFields is a list of field names (e.g. "Etag") to include in API
  1627  	// requests with the JSON null value. By default, fields with empty
  1628  	// values are omitted from API requests. However, any field with an
  1629  	// empty value appearing in NullFields will be sent to the server as
  1630  	// null. It is an error if a field in this list has a non-empty value.
  1631  	// This may be used to include null fields in Patch requests.
  1632  	NullFields []string `json:"-"`
  1633  }
  1634  
  1635  func (s *UrlChannels) MarshalJSON() ([]byte, error) {
  1636  	type NoMethod UrlChannels
  1637  	raw := NoMethod(*s)
  1638  	return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  1639  }
  1640  
  1641  // method id "adsense.accounts.get":
  1642  
  1643  type AccountsGetCall struct {
  1644  	s            *Service
  1645  	accountId    string
  1646  	urlParams_   gensupport.URLParams
  1647  	ifNoneMatch_ string
  1648  	ctx_         context.Context
  1649  	header_      http.Header
  1650  }
  1651  
  1652  // Get: Get information about the selected AdSense account.
  1653  func (r *AccountsService) Get(accountId string) *AccountsGetCall {
  1654  	c := &AccountsGetCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  1655  	c.accountId = accountId
  1656  	return c
  1657  }
  1658  
  1659  // Tree sets the optional parameter "tree": Whether the tree of sub
  1660  // accounts should be returned.
  1661  func (c *AccountsGetCall) Tree(tree bool) *AccountsGetCall {
  1662  	c.urlParams_.Set("tree", fmt.Sprint(tree))
  1663  	return c
  1664  }
  1665  
  1666  // Fields allows partial responses to be retrieved. See
  1667  // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  1668  // for more information.
  1669  func (c *AccountsGetCall) Fields(s ...googleapi.Field) *AccountsGetCall {
  1670  	c.urlParams_.Set("fields", googleapi.CombineFields(s))
  1671  	return c
  1672  }
  1673  
  1674  // IfNoneMatch sets the optional parameter which makes the operation
  1675  // fail if the object's ETag matches the given value. This is useful for
  1676  // getting updates only after the object has changed since the last
  1677  // request. Use googleapi.IsNotModified to check whether the response
  1678  // error from Do is the result of In-None-Match.
  1679  func (c *AccountsGetCall) IfNoneMatch(entityTag string) *AccountsGetCall {
  1680  	c.ifNoneMatch_ = entityTag
  1681  	return c
  1682  }
  1683  
  1684  // Context sets the context to be used in this call's Do method. Any
  1685  // pending HTTP request will be aborted if the provided context is
  1686  // canceled.
  1687  func (c *AccountsGetCall) Context(ctx context.Context) *AccountsGetCall {
  1688  	c.ctx_ = ctx
  1689  	return c
  1690  }
  1691  
  1692  // Header returns an http.Header that can be modified by the caller to
  1693  // add HTTP headers to the request.
  1694  func (c *AccountsGetCall) Header() http.Header {
  1695  	if c.header_ == nil {
  1696  		c.header_ = make(http.Header)
  1697  	}
  1698  	return c.header_
  1699  }
  1700  
  1701  func (c *AccountsGetCall) doRequest(alt string) (*http.Response, error) {
  1702  	reqHeaders := make(http.Header)
  1703  	reqHeaders.Set("x-goog-api-client", "gl-go/1.13.7 gdcl/20200203")
  1704  	for k, v := range c.header_ {
  1705  		reqHeaders[k] = v
  1706  	}
  1707  	reqHeaders.Set("User-Agent", c.s.userAgent())
  1708  	if c.ifNoneMatch_ != "" {
  1709  		reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  1710  	}
  1711  	var body io.Reader = nil
  1712  	c.urlParams_.Set("alt", alt)
  1713  	c.urlParams_.Set("prettyPrint", "false")
  1714  	urls := googleapi.ResolveRelative(c.s.BasePath, "accounts/{accountId}")
  1715  	urls += "?" + c.urlParams_.Encode()
  1716  	req, err := http.NewRequest("GET", urls, body)
  1717  	if err != nil {
  1718  		return nil, err
  1719  	}
  1720  	req.Header = reqHeaders
  1721  	googleapi.Expand(req.URL, map[string]string{
  1722  		"accountId": c.accountId,
  1723  	})
  1724  	return gensupport.SendRequest(c.ctx_, c.s.client, req)
  1725  }
  1726  
  1727  // Do executes the "adsense.accounts.get" call.
  1728  // Exactly one of *Account or error will be non-nil. Any non-2xx status
  1729  // code is an error. Response headers are in either
  1730  // *Account.ServerResponse.Header or (if a response was returned at all)
  1731  // in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to
  1732  // check whether the returned error was because http.StatusNotModified
  1733  // was returned.
  1734  func (c *AccountsGetCall) Do(opts ...googleapi.CallOption) (*Account, error) {
  1735  	gensupport.SetOptions(c.urlParams_, opts...)
  1736  	res, err := c.doRequest("json")
  1737  	if res != nil && res.StatusCode == http.StatusNotModified {
  1738  		if res.Body != nil {
  1739  			res.Body.Close()
  1740  		}
  1741  		return nil, &googleapi.Error{
  1742  			Code:   res.StatusCode,
  1743  			Header: res.Header,
  1744  		}
  1745  	}
  1746  	if err != nil {
  1747  		return nil, err
  1748  	}
  1749  	defer googleapi.CloseBody(res)
  1750  	if err := googleapi.CheckResponse(res); err != nil {
  1751  		return nil, err
  1752  	}
  1753  	ret := &Account{
  1754  		ServerResponse: googleapi.ServerResponse{
  1755  			Header:         res.Header,
  1756  			HTTPStatusCode: res.StatusCode,
  1757  		},
  1758  	}
  1759  	target := &ret
  1760  	if err := gensupport.DecodeResponse(target, res); err != nil {
  1761  		return nil, err
  1762  	}
  1763  	return ret, nil
  1764  	// {
  1765  	//   "description": "Get information about the selected AdSense account.",
  1766  	//   "httpMethod": "GET",
  1767  	//   "id": "adsense.accounts.get",
  1768  	//   "parameterOrder": [
  1769  	//     "accountId"
  1770  	//   ],
  1771  	//   "parameters": {
  1772  	//     "accountId": {
  1773  	//       "description": "Account to get information about.",
  1774  	//       "location": "path",
  1775  	//       "required": true,
  1776  	//       "type": "string"
  1777  	//     },
  1778  	//     "tree": {
  1779  	//       "description": "Whether the tree of sub accounts should be returned.",
  1780  	//       "location": "query",
  1781  	//       "type": "boolean"
  1782  	//     }
  1783  	//   },
  1784  	//   "path": "accounts/{accountId}",
  1785  	//   "response": {
  1786  	//     "$ref": "Account"
  1787  	//   },
  1788  	//   "scopes": [
  1789  	//     "https://www.googleapis.com/auth/adsense",
  1790  	//     "https://www.googleapis.com/auth/adsense.readonly"
  1791  	//   ]
  1792  	// }
  1793  
  1794  }
  1795  
  1796  // method id "adsense.accounts.list":
  1797  
  1798  type AccountsListCall struct {
  1799  	s            *Service
  1800  	urlParams_   gensupport.URLParams
  1801  	ifNoneMatch_ string
  1802  	ctx_         context.Context
  1803  	header_      http.Header
  1804  }
  1805  
  1806  // List: List all accounts available to this AdSense account.
  1807  func (r *AccountsService) List() *AccountsListCall {
  1808  	c := &AccountsListCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  1809  	return c
  1810  }
  1811  
  1812  // MaxResults sets the optional parameter "maxResults": The maximum
  1813  // number of accounts to include in the response, used for paging.
  1814  func (c *AccountsListCall) MaxResults(maxResults int64) *AccountsListCall {
  1815  	c.urlParams_.Set("maxResults", fmt.Sprint(maxResults))
  1816  	return c
  1817  }
  1818  
  1819  // PageToken sets the optional parameter "pageToken": A continuation
  1820  // token, used to page through accounts. To retrieve the next page, set
  1821  // this parameter to the value of "nextPageToken" from the previous
  1822  // response.
  1823  func (c *AccountsListCall) PageToken(pageToken string) *AccountsListCall {
  1824  	c.urlParams_.Set("pageToken", pageToken)
  1825  	return c
  1826  }
  1827  
  1828  // Fields allows partial responses to be retrieved. See
  1829  // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  1830  // for more information.
  1831  func (c *AccountsListCall) Fields(s ...googleapi.Field) *AccountsListCall {
  1832  	c.urlParams_.Set("fields", googleapi.CombineFields(s))
  1833  	return c
  1834  }
  1835  
  1836  // IfNoneMatch sets the optional parameter which makes the operation
  1837  // fail if the object's ETag matches the given value. This is useful for
  1838  // getting updates only after the object has changed since the last
  1839  // request. Use googleapi.IsNotModified to check whether the response
  1840  // error from Do is the result of In-None-Match.
  1841  func (c *AccountsListCall) IfNoneMatch(entityTag string) *AccountsListCall {
  1842  	c.ifNoneMatch_ = entityTag
  1843  	return c
  1844  }
  1845  
  1846  // Context sets the context to be used in this call's Do method. Any
  1847  // pending HTTP request will be aborted if the provided context is
  1848  // canceled.
  1849  func (c *AccountsListCall) Context(ctx context.Context) *AccountsListCall {
  1850  	c.ctx_ = ctx
  1851  	return c
  1852  }
  1853  
  1854  // Header returns an http.Header that can be modified by the caller to
  1855  // add HTTP headers to the request.
  1856  func (c *AccountsListCall) Header() http.Header {
  1857  	if c.header_ == nil {
  1858  		c.header_ = make(http.Header)
  1859  	}
  1860  	return c.header_
  1861  }
  1862  
  1863  func (c *AccountsListCall) doRequest(alt string) (*http.Response, error) {
  1864  	reqHeaders := make(http.Header)
  1865  	reqHeaders.Set("x-goog-api-client", "gl-go/1.13.7 gdcl/20200203")
  1866  	for k, v := range c.header_ {
  1867  		reqHeaders[k] = v
  1868  	}
  1869  	reqHeaders.Set("User-Agent", c.s.userAgent())
  1870  	if c.ifNoneMatch_ != "" {
  1871  		reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  1872  	}
  1873  	var body io.Reader = nil
  1874  	c.urlParams_.Set("alt", alt)
  1875  	c.urlParams_.Set("prettyPrint", "false")
  1876  	urls := googleapi.ResolveRelative(c.s.BasePath, "accounts")
  1877  	urls += "?" + c.urlParams_.Encode()
  1878  	req, err := http.NewRequest("GET", urls, body)
  1879  	if err != nil {
  1880  		return nil, err
  1881  	}
  1882  	req.Header = reqHeaders
  1883  	return gensupport.SendRequest(c.ctx_, c.s.client, req)
  1884  }
  1885  
  1886  // Do executes the "adsense.accounts.list" call.
  1887  // Exactly one of *Accounts or error will be non-nil. Any non-2xx status
  1888  // code is an error. Response headers are in either
  1889  // *Accounts.ServerResponse.Header or (if a response was returned at
  1890  // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  1891  // to check whether the returned error was because
  1892  // http.StatusNotModified was returned.
  1893  func (c *AccountsListCall) Do(opts ...googleapi.CallOption) (*Accounts, error) {
  1894  	gensupport.SetOptions(c.urlParams_, opts...)
  1895  	res, err := c.doRequest("json")
  1896  	if res != nil && res.StatusCode == http.StatusNotModified {
  1897  		if res.Body != nil {
  1898  			res.Body.Close()
  1899  		}
  1900  		return nil, &googleapi.Error{
  1901  			Code:   res.StatusCode,
  1902  			Header: res.Header,
  1903  		}
  1904  	}
  1905  	if err != nil {
  1906  		return nil, err
  1907  	}
  1908  	defer googleapi.CloseBody(res)
  1909  	if err := googleapi.CheckResponse(res); err != nil {
  1910  		return nil, err
  1911  	}
  1912  	ret := &Accounts{
  1913  		ServerResponse: googleapi.ServerResponse{
  1914  			Header:         res.Header,
  1915  			HTTPStatusCode: res.StatusCode,
  1916  		},
  1917  	}
  1918  	target := &ret
  1919  	if err := gensupport.DecodeResponse(target, res); err != nil {
  1920  		return nil, err
  1921  	}
  1922  	return ret, nil
  1923  	// {
  1924  	//   "description": "List all accounts available to this AdSense account.",
  1925  	//   "httpMethod": "GET",
  1926  	//   "id": "adsense.accounts.list",
  1927  	//   "parameters": {
  1928  	//     "maxResults": {
  1929  	//       "description": "The maximum number of accounts to include in the response, used for paging.",
  1930  	//       "format": "int32",
  1931  	//       "location": "query",
  1932  	//       "maximum": "10000",
  1933  	//       "minimum": "0",
  1934  	//       "type": "integer"
  1935  	//     },
  1936  	//     "pageToken": {
  1937  	//       "description": "A continuation token, used to page through accounts. To retrieve the next page, set this parameter to the value of \"nextPageToken\" from the previous response.",
  1938  	//       "location": "query",
  1939  	//       "type": "string"
  1940  	//     }
  1941  	//   },
  1942  	//   "path": "accounts",
  1943  	//   "response": {
  1944  	//     "$ref": "Accounts"
  1945  	//   },
  1946  	//   "scopes": [
  1947  	//     "https://www.googleapis.com/auth/adsense",
  1948  	//     "https://www.googleapis.com/auth/adsense.readonly"
  1949  	//   ]
  1950  	// }
  1951  
  1952  }
  1953  
  1954  // Pages invokes f for each page of results.
  1955  // A non-nil error returned from f will halt the iteration.
  1956  // The provided context supersedes any context provided to the Context method.
  1957  func (c *AccountsListCall) Pages(ctx context.Context, f func(*Accounts) error) error {
  1958  	c.ctx_ = ctx
  1959  	defer c.PageToken(c.urlParams_.Get("pageToken")) // reset paging to original point
  1960  	for {
  1961  		x, err := c.Do()
  1962  		if err != nil {
  1963  			return err
  1964  		}
  1965  		if err := f(x); err != nil {
  1966  			return err
  1967  		}
  1968  		if x.NextPageToken == "" {
  1969  			return nil
  1970  		}
  1971  		c.PageToken(x.NextPageToken)
  1972  	}
  1973  }
  1974  
  1975  // method id "adsense.accounts.adclients.list":
  1976  
  1977  type AccountsAdclientsListCall struct {
  1978  	s            *Service
  1979  	accountId    string
  1980  	urlParams_   gensupport.URLParams
  1981  	ifNoneMatch_ string
  1982  	ctx_         context.Context
  1983  	header_      http.Header
  1984  }
  1985  
  1986  // List: List all ad clients in the specified account.
  1987  func (r *AccountsAdclientsService) List(accountId string) *AccountsAdclientsListCall {
  1988  	c := &AccountsAdclientsListCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  1989  	c.accountId = accountId
  1990  	return c
  1991  }
  1992  
  1993  // MaxResults sets the optional parameter "maxResults": The maximum
  1994  // number of ad clients to include in the response, used for paging.
  1995  func (c *AccountsAdclientsListCall) MaxResults(maxResults int64) *AccountsAdclientsListCall {
  1996  	c.urlParams_.Set("maxResults", fmt.Sprint(maxResults))
  1997  	return c
  1998  }
  1999  
  2000  // PageToken sets the optional parameter "pageToken": A continuation
  2001  // token, used to page through ad clients. To retrieve the next page,
  2002  // set this parameter to the value of "nextPageToken" from the previous
  2003  // response.
  2004  func (c *AccountsAdclientsListCall) PageToken(pageToken string) *AccountsAdclientsListCall {
  2005  	c.urlParams_.Set("pageToken", pageToken)
  2006  	return c
  2007  }
  2008  
  2009  // Fields allows partial responses to be retrieved. See
  2010  // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  2011  // for more information.
  2012  func (c *AccountsAdclientsListCall) Fields(s ...googleapi.Field) *AccountsAdclientsListCall {
  2013  	c.urlParams_.Set("fields", googleapi.CombineFields(s))
  2014  	return c
  2015  }
  2016  
  2017  // IfNoneMatch sets the optional parameter which makes the operation
  2018  // fail if the object's ETag matches the given value. This is useful for
  2019  // getting updates only after the object has changed since the last
  2020  // request. Use googleapi.IsNotModified to check whether the response
  2021  // error from Do is the result of In-None-Match.
  2022  func (c *AccountsAdclientsListCall) IfNoneMatch(entityTag string) *AccountsAdclientsListCall {
  2023  	c.ifNoneMatch_ = entityTag
  2024  	return c
  2025  }
  2026  
  2027  // Context sets the context to be used in this call's Do method. Any
  2028  // pending HTTP request will be aborted if the provided context is
  2029  // canceled.
  2030  func (c *AccountsAdclientsListCall) Context(ctx context.Context) *AccountsAdclientsListCall {
  2031  	c.ctx_ = ctx
  2032  	return c
  2033  }
  2034  
  2035  // Header returns an http.Header that can be modified by the caller to
  2036  // add HTTP headers to the request.
  2037  func (c *AccountsAdclientsListCall) Header() http.Header {
  2038  	if c.header_ == nil {
  2039  		c.header_ = make(http.Header)
  2040  	}
  2041  	return c.header_
  2042  }
  2043  
  2044  func (c *AccountsAdclientsListCall) doRequest(alt string) (*http.Response, error) {
  2045  	reqHeaders := make(http.Header)
  2046  	reqHeaders.Set("x-goog-api-client", "gl-go/1.13.7 gdcl/20200203")
  2047  	for k, v := range c.header_ {
  2048  		reqHeaders[k] = v
  2049  	}
  2050  	reqHeaders.Set("User-Agent", c.s.userAgent())
  2051  	if c.ifNoneMatch_ != "" {
  2052  		reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  2053  	}
  2054  	var body io.Reader = nil
  2055  	c.urlParams_.Set("alt", alt)
  2056  	c.urlParams_.Set("prettyPrint", "false")
  2057  	urls := googleapi.ResolveRelative(c.s.BasePath, "accounts/{accountId}/adclients")
  2058  	urls += "?" + c.urlParams_.Encode()
  2059  	req, err := http.NewRequest("GET", urls, body)
  2060  	if err != nil {
  2061  		return nil, err
  2062  	}
  2063  	req.Header = reqHeaders
  2064  	googleapi.Expand(req.URL, map[string]string{
  2065  		"accountId": c.accountId,
  2066  	})
  2067  	return gensupport.SendRequest(c.ctx_, c.s.client, req)
  2068  }
  2069  
  2070  // Do executes the "adsense.accounts.adclients.list" call.
  2071  // Exactly one of *AdClients or error will be non-nil. Any non-2xx
  2072  // status code is an error. Response headers are in either
  2073  // *AdClients.ServerResponse.Header or (if a response was returned at
  2074  // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  2075  // to check whether the returned error was because
  2076  // http.StatusNotModified was returned.
  2077  func (c *AccountsAdclientsListCall) Do(opts ...googleapi.CallOption) (*AdClients, error) {
  2078  	gensupport.SetOptions(c.urlParams_, opts...)
  2079  	res, err := c.doRequest("json")
  2080  	if res != nil && res.StatusCode == http.StatusNotModified {
  2081  		if res.Body != nil {
  2082  			res.Body.Close()
  2083  		}
  2084  		return nil, &googleapi.Error{
  2085  			Code:   res.StatusCode,
  2086  			Header: res.Header,
  2087  		}
  2088  	}
  2089  	if err != nil {
  2090  		return nil, err
  2091  	}
  2092  	defer googleapi.CloseBody(res)
  2093  	if err := googleapi.CheckResponse(res); err != nil {
  2094  		return nil, err
  2095  	}
  2096  	ret := &AdClients{
  2097  		ServerResponse: googleapi.ServerResponse{
  2098  			Header:         res.Header,
  2099  			HTTPStatusCode: res.StatusCode,
  2100  		},
  2101  	}
  2102  	target := &ret
  2103  	if err := gensupport.DecodeResponse(target, res); err != nil {
  2104  		return nil, err
  2105  	}
  2106  	return ret, nil
  2107  	// {
  2108  	//   "description": "List all ad clients in the specified account.",
  2109  	//   "httpMethod": "GET",
  2110  	//   "id": "adsense.accounts.adclients.list",
  2111  	//   "parameterOrder": [
  2112  	//     "accountId"
  2113  	//   ],
  2114  	//   "parameters": {
  2115  	//     "accountId": {
  2116  	//       "description": "Account for which to list ad clients.",
  2117  	//       "location": "path",
  2118  	//       "required": true,
  2119  	//       "type": "string"
  2120  	//     },
  2121  	//     "maxResults": {
  2122  	//       "description": "The maximum number of ad clients to include in the response, used for paging.",
  2123  	//       "format": "int32",
  2124  	//       "location": "query",
  2125  	//       "maximum": "10000",
  2126  	//       "minimum": "0",
  2127  	//       "type": "integer"
  2128  	//     },
  2129  	//     "pageToken": {
  2130  	//       "description": "A continuation token, used to page through ad clients. To retrieve the next page, set this parameter to the value of \"nextPageToken\" from the previous response.",
  2131  	//       "location": "query",
  2132  	//       "type": "string"
  2133  	//     }
  2134  	//   },
  2135  	//   "path": "accounts/{accountId}/adclients",
  2136  	//   "response": {
  2137  	//     "$ref": "AdClients"
  2138  	//   },
  2139  	//   "scopes": [
  2140  	//     "https://www.googleapis.com/auth/adsense",
  2141  	//     "https://www.googleapis.com/auth/adsense.readonly"
  2142  	//   ]
  2143  	// }
  2144  
  2145  }
  2146  
  2147  // Pages invokes f for each page of results.
  2148  // A non-nil error returned from f will halt the iteration.
  2149  // The provided context supersedes any context provided to the Context method.
  2150  func (c *AccountsAdclientsListCall) Pages(ctx context.Context, f func(*AdClients) error) error {
  2151  	c.ctx_ = ctx
  2152  	defer c.PageToken(c.urlParams_.Get("pageToken")) // reset paging to original point
  2153  	for {
  2154  		x, err := c.Do()
  2155  		if err != nil {
  2156  			return err
  2157  		}
  2158  		if err := f(x); err != nil {
  2159  			return err
  2160  		}
  2161  		if x.NextPageToken == "" {
  2162  			return nil
  2163  		}
  2164  		c.PageToken(x.NextPageToken)
  2165  	}
  2166  }
  2167  
  2168  // method id "adsense.accounts.adunits.get":
  2169  
  2170  type AccountsAdunitsGetCall struct {
  2171  	s            *Service
  2172  	accountId    string
  2173  	adClientId   string
  2174  	adUnitId     string
  2175  	urlParams_   gensupport.URLParams
  2176  	ifNoneMatch_ string
  2177  	ctx_         context.Context
  2178  	header_      http.Header
  2179  }
  2180  
  2181  // Get: Gets the specified ad unit in the specified ad client for the
  2182  // specified account.
  2183  func (r *AccountsAdunitsService) Get(accountId string, adClientId string, adUnitId string) *AccountsAdunitsGetCall {
  2184  	c := &AccountsAdunitsGetCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  2185  	c.accountId = accountId
  2186  	c.adClientId = adClientId
  2187  	c.adUnitId = adUnitId
  2188  	return c
  2189  }
  2190  
  2191  // Fields allows partial responses to be retrieved. See
  2192  // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  2193  // for more information.
  2194  func (c *AccountsAdunitsGetCall) Fields(s ...googleapi.Field) *AccountsAdunitsGetCall {
  2195  	c.urlParams_.Set("fields", googleapi.CombineFields(s))
  2196  	return c
  2197  }
  2198  
  2199  // IfNoneMatch sets the optional parameter which makes the operation
  2200  // fail if the object's ETag matches the given value. This is useful for
  2201  // getting updates only after the object has changed since the last
  2202  // request. Use googleapi.IsNotModified to check whether the response
  2203  // error from Do is the result of In-None-Match.
  2204  func (c *AccountsAdunitsGetCall) IfNoneMatch(entityTag string) *AccountsAdunitsGetCall {
  2205  	c.ifNoneMatch_ = entityTag
  2206  	return c
  2207  }
  2208  
  2209  // Context sets the context to be used in this call's Do method. Any
  2210  // pending HTTP request will be aborted if the provided context is
  2211  // canceled.
  2212  func (c *AccountsAdunitsGetCall) Context(ctx context.Context) *AccountsAdunitsGetCall {
  2213  	c.ctx_ = ctx
  2214  	return c
  2215  }
  2216  
  2217  // Header returns an http.Header that can be modified by the caller to
  2218  // add HTTP headers to the request.
  2219  func (c *AccountsAdunitsGetCall) Header() http.Header {
  2220  	if c.header_ == nil {
  2221  		c.header_ = make(http.Header)
  2222  	}
  2223  	return c.header_
  2224  }
  2225  
  2226  func (c *AccountsAdunitsGetCall) doRequest(alt string) (*http.Response, error) {
  2227  	reqHeaders := make(http.Header)
  2228  	reqHeaders.Set("x-goog-api-client", "gl-go/1.13.7 gdcl/20200203")
  2229  	for k, v := range c.header_ {
  2230  		reqHeaders[k] = v
  2231  	}
  2232  	reqHeaders.Set("User-Agent", c.s.userAgent())
  2233  	if c.ifNoneMatch_ != "" {
  2234  		reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  2235  	}
  2236  	var body io.Reader = nil
  2237  	c.urlParams_.Set("alt", alt)
  2238  	c.urlParams_.Set("prettyPrint", "false")
  2239  	urls := googleapi.ResolveRelative(c.s.BasePath, "accounts/{accountId}/adclients/{adClientId}/adunits/{adUnitId}")
  2240  	urls += "?" + c.urlParams_.Encode()
  2241  	req, err := http.NewRequest("GET", urls, body)
  2242  	if err != nil {
  2243  		return nil, err
  2244  	}
  2245  	req.Header = reqHeaders
  2246  	googleapi.Expand(req.URL, map[string]string{
  2247  		"accountId":  c.accountId,
  2248  		"adClientId": c.adClientId,
  2249  		"adUnitId":   c.adUnitId,
  2250  	})
  2251  	return gensupport.SendRequest(c.ctx_, c.s.client, req)
  2252  }
  2253  
  2254  // Do executes the "adsense.accounts.adunits.get" call.
  2255  // Exactly one of *AdUnit or error will be non-nil. Any non-2xx status
  2256  // code is an error. Response headers are in either
  2257  // *AdUnit.ServerResponse.Header or (if a response was returned at all)
  2258  // in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to
  2259  // check whether the returned error was because http.StatusNotModified
  2260  // was returned.
  2261  func (c *AccountsAdunitsGetCall) Do(opts ...googleapi.CallOption) (*AdUnit, error) {
  2262  	gensupport.SetOptions(c.urlParams_, opts...)
  2263  	res, err := c.doRequest("json")
  2264  	if res != nil && res.StatusCode == http.StatusNotModified {
  2265  		if res.Body != nil {
  2266  			res.Body.Close()
  2267  		}
  2268  		return nil, &googleapi.Error{
  2269  			Code:   res.StatusCode,
  2270  			Header: res.Header,
  2271  		}
  2272  	}
  2273  	if err != nil {
  2274  		return nil, err
  2275  	}
  2276  	defer googleapi.CloseBody(res)
  2277  	if err := googleapi.CheckResponse(res); err != nil {
  2278  		return nil, err
  2279  	}
  2280  	ret := &AdUnit{
  2281  		ServerResponse: googleapi.ServerResponse{
  2282  			Header:         res.Header,
  2283  			HTTPStatusCode: res.StatusCode,
  2284  		},
  2285  	}
  2286  	target := &ret
  2287  	if err := gensupport.DecodeResponse(target, res); err != nil {
  2288  		return nil, err
  2289  	}
  2290  	return ret, nil
  2291  	// {
  2292  	//   "description": "Gets the specified ad unit in the specified ad client for the specified account.",
  2293  	//   "httpMethod": "GET",
  2294  	//   "id": "adsense.accounts.adunits.get",
  2295  	//   "parameterOrder": [
  2296  	//     "accountId",
  2297  	//     "adClientId",
  2298  	//     "adUnitId"
  2299  	//   ],
  2300  	//   "parameters": {
  2301  	//     "accountId": {
  2302  	//       "description": "Account to which the ad client belongs.",
  2303  	//       "location": "path",
  2304  	//       "required": true,
  2305  	//       "type": "string"
  2306  	//     },
  2307  	//     "adClientId": {
  2308  	//       "description": "Ad client for which to get the ad unit.",
  2309  	//       "location": "path",
  2310  	//       "required": true,
  2311  	//       "type": "string"
  2312  	//     },
  2313  	//     "adUnitId": {
  2314  	//       "description": "Ad unit to retrieve.",
  2315  	//       "location": "path",
  2316  	//       "required": true,
  2317  	//       "type": "string"
  2318  	//     }
  2319  	//   },
  2320  	//   "path": "accounts/{accountId}/adclients/{adClientId}/adunits/{adUnitId}",
  2321  	//   "response": {
  2322  	//     "$ref": "AdUnit"
  2323  	//   },
  2324  	//   "scopes": [
  2325  	//     "https://www.googleapis.com/auth/adsense",
  2326  	//     "https://www.googleapis.com/auth/adsense.readonly"
  2327  	//   ]
  2328  	// }
  2329  
  2330  }
  2331  
  2332  // method id "adsense.accounts.adunits.getAdCode":
  2333  
  2334  type AccountsAdunitsGetAdCodeCall struct {
  2335  	s            *Service
  2336  	accountId    string
  2337  	adClientId   string
  2338  	adUnitId     string
  2339  	urlParams_   gensupport.URLParams
  2340  	ifNoneMatch_ string
  2341  	ctx_         context.Context
  2342  	header_      http.Header
  2343  }
  2344  
  2345  // GetAdCode: Get ad code for the specified ad unit.
  2346  func (r *AccountsAdunitsService) GetAdCode(accountId string, adClientId string, adUnitId string) *AccountsAdunitsGetAdCodeCall {
  2347  	c := &AccountsAdunitsGetAdCodeCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  2348  	c.accountId = accountId
  2349  	c.adClientId = adClientId
  2350  	c.adUnitId = adUnitId
  2351  	return c
  2352  }
  2353  
  2354  // Fields allows partial responses to be retrieved. See
  2355  // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  2356  // for more information.
  2357  func (c *AccountsAdunitsGetAdCodeCall) Fields(s ...googleapi.Field) *AccountsAdunitsGetAdCodeCall {
  2358  	c.urlParams_.Set("fields", googleapi.CombineFields(s))
  2359  	return c
  2360  }
  2361  
  2362  // IfNoneMatch sets the optional parameter which makes the operation
  2363  // fail if the object's ETag matches the given value. This is useful for
  2364  // getting updates only after the object has changed since the last
  2365  // request. Use googleapi.IsNotModified to check whether the response
  2366  // error from Do is the result of In-None-Match.
  2367  func (c *AccountsAdunitsGetAdCodeCall) IfNoneMatch(entityTag string) *AccountsAdunitsGetAdCodeCall {
  2368  	c.ifNoneMatch_ = entityTag
  2369  	return c
  2370  }
  2371  
  2372  // Context sets the context to be used in this call's Do method. Any
  2373  // pending HTTP request will be aborted if the provided context is
  2374  // canceled.
  2375  func (c *AccountsAdunitsGetAdCodeCall) Context(ctx context.Context) *AccountsAdunitsGetAdCodeCall {
  2376  	c.ctx_ = ctx
  2377  	return c
  2378  }
  2379  
  2380  // Header returns an http.Header that can be modified by the caller to
  2381  // add HTTP headers to the request.
  2382  func (c *AccountsAdunitsGetAdCodeCall) Header() http.Header {
  2383  	if c.header_ == nil {
  2384  		c.header_ = make(http.Header)
  2385  	}
  2386  	return c.header_
  2387  }
  2388  
  2389  func (c *AccountsAdunitsGetAdCodeCall) doRequest(alt string) (*http.Response, error) {
  2390  	reqHeaders := make(http.Header)
  2391  	reqHeaders.Set("x-goog-api-client", "gl-go/1.13.7 gdcl/20200203")
  2392  	for k, v := range c.header_ {
  2393  		reqHeaders[k] = v
  2394  	}
  2395  	reqHeaders.Set("User-Agent", c.s.userAgent())
  2396  	if c.ifNoneMatch_ != "" {
  2397  		reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  2398  	}
  2399  	var body io.Reader = nil
  2400  	c.urlParams_.Set("alt", alt)
  2401  	c.urlParams_.Set("prettyPrint", "false")
  2402  	urls := googleapi.ResolveRelative(c.s.BasePath, "accounts/{accountId}/adclients/{adClientId}/adunits/{adUnitId}/adcode")
  2403  	urls += "?" + c.urlParams_.Encode()
  2404  	req, err := http.NewRequest("GET", urls, body)
  2405  	if err != nil {
  2406  		return nil, err
  2407  	}
  2408  	req.Header = reqHeaders
  2409  	googleapi.Expand(req.URL, map[string]string{
  2410  		"accountId":  c.accountId,
  2411  		"adClientId": c.adClientId,
  2412  		"adUnitId":   c.adUnitId,
  2413  	})
  2414  	return gensupport.SendRequest(c.ctx_, c.s.client, req)
  2415  }
  2416  
  2417  // Do executes the "adsense.accounts.adunits.getAdCode" call.
  2418  // Exactly one of *AdCode or error will be non-nil. Any non-2xx status
  2419  // code is an error. Response headers are in either
  2420  // *AdCode.ServerResponse.Header or (if a response was returned at all)
  2421  // in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to
  2422  // check whether the returned error was because http.StatusNotModified
  2423  // was returned.
  2424  func (c *AccountsAdunitsGetAdCodeCall) Do(opts ...googleapi.CallOption) (*AdCode, error) {
  2425  	gensupport.SetOptions(c.urlParams_, opts...)
  2426  	res, err := c.doRequest("json")
  2427  	if res != nil && res.StatusCode == http.StatusNotModified {
  2428  		if res.Body != nil {
  2429  			res.Body.Close()
  2430  		}
  2431  		return nil, &googleapi.Error{
  2432  			Code:   res.StatusCode,
  2433  			Header: res.Header,
  2434  		}
  2435  	}
  2436  	if err != nil {
  2437  		return nil, err
  2438  	}
  2439  	defer googleapi.CloseBody(res)
  2440  	if err := googleapi.CheckResponse(res); err != nil {
  2441  		return nil, err
  2442  	}
  2443  	ret := &AdCode{
  2444  		ServerResponse: googleapi.ServerResponse{
  2445  			Header:         res.Header,
  2446  			HTTPStatusCode: res.StatusCode,
  2447  		},
  2448  	}
  2449  	target := &ret
  2450  	if err := gensupport.DecodeResponse(target, res); err != nil {
  2451  		return nil, err
  2452  	}
  2453  	return ret, nil
  2454  	// {
  2455  	//   "description": "Get ad code for the specified ad unit.",
  2456  	//   "httpMethod": "GET",
  2457  	//   "id": "adsense.accounts.adunits.getAdCode",
  2458  	//   "parameterOrder": [
  2459  	//     "accountId",
  2460  	//     "adClientId",
  2461  	//     "adUnitId"
  2462  	//   ],
  2463  	//   "parameters": {
  2464  	//     "accountId": {
  2465  	//       "description": "Account which contains the ad client.",
  2466  	//       "location": "path",
  2467  	//       "required": true,
  2468  	//       "type": "string"
  2469  	//     },
  2470  	//     "adClientId": {
  2471  	//       "description": "Ad client with contains the ad unit.",
  2472  	//       "location": "path",
  2473  	//       "required": true,
  2474  	//       "type": "string"
  2475  	//     },
  2476  	//     "adUnitId": {
  2477  	//       "description": "Ad unit to get the code for.",
  2478  	//       "location": "path",
  2479  	//       "required": true,
  2480  	//       "type": "string"
  2481  	//     }
  2482  	//   },
  2483  	//   "path": "accounts/{accountId}/adclients/{adClientId}/adunits/{adUnitId}/adcode",
  2484  	//   "response": {
  2485  	//     "$ref": "AdCode"
  2486  	//   },
  2487  	//   "scopes": [
  2488  	//     "https://www.googleapis.com/auth/adsense",
  2489  	//     "https://www.googleapis.com/auth/adsense.readonly"
  2490  	//   ]
  2491  	// }
  2492  
  2493  }
  2494  
  2495  // method id "adsense.accounts.adunits.list":
  2496  
  2497  type AccountsAdunitsListCall struct {
  2498  	s            *Service
  2499  	accountId    string
  2500  	adClientId   string
  2501  	urlParams_   gensupport.URLParams
  2502  	ifNoneMatch_ string
  2503  	ctx_         context.Context
  2504  	header_      http.Header
  2505  }
  2506  
  2507  // List: List all ad units in the specified ad client for the specified
  2508  // account.
  2509  func (r *AccountsAdunitsService) List(accountId string, adClientId string) *AccountsAdunitsListCall {
  2510  	c := &AccountsAdunitsListCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  2511  	c.accountId = accountId
  2512  	c.adClientId = adClientId
  2513  	return c
  2514  }
  2515  
  2516  // IncludeInactive sets the optional parameter "includeInactive":
  2517  // Whether to include inactive ad units. Default: true.
  2518  func (c *AccountsAdunitsListCall) IncludeInactive(includeInactive bool) *AccountsAdunitsListCall {
  2519  	c.urlParams_.Set("includeInactive", fmt.Sprint(includeInactive))
  2520  	return c
  2521  }
  2522  
  2523  // MaxResults sets the optional parameter "maxResults": The maximum
  2524  // number of ad units to include in the response, used for paging.
  2525  func (c *AccountsAdunitsListCall) MaxResults(maxResults int64) *AccountsAdunitsListCall {
  2526  	c.urlParams_.Set("maxResults", fmt.Sprint(maxResults))
  2527  	return c
  2528  }
  2529  
  2530  // PageToken sets the optional parameter "pageToken": A continuation
  2531  // token, used to page through ad units. To retrieve the next page, set
  2532  // this parameter to the value of "nextPageToken" from the previous
  2533  // response.
  2534  func (c *AccountsAdunitsListCall) PageToken(pageToken string) *AccountsAdunitsListCall {
  2535  	c.urlParams_.Set("pageToken", pageToken)
  2536  	return c
  2537  }
  2538  
  2539  // Fields allows partial responses to be retrieved. See
  2540  // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  2541  // for more information.
  2542  func (c *AccountsAdunitsListCall) Fields(s ...googleapi.Field) *AccountsAdunitsListCall {
  2543  	c.urlParams_.Set("fields", googleapi.CombineFields(s))
  2544  	return c
  2545  }
  2546  
  2547  // IfNoneMatch sets the optional parameter which makes the operation
  2548  // fail if the object's ETag matches the given value. This is useful for
  2549  // getting updates only after the object has changed since the last
  2550  // request. Use googleapi.IsNotModified to check whether the response
  2551  // error from Do is the result of In-None-Match.
  2552  func (c *AccountsAdunitsListCall) IfNoneMatch(entityTag string) *AccountsAdunitsListCall {
  2553  	c.ifNoneMatch_ = entityTag
  2554  	return c
  2555  }
  2556  
  2557  // Context sets the context to be used in this call's Do method. Any
  2558  // pending HTTP request will be aborted if the provided context is
  2559  // canceled.
  2560  func (c *AccountsAdunitsListCall) Context(ctx context.Context) *AccountsAdunitsListCall {
  2561  	c.ctx_ = ctx
  2562  	return c
  2563  }
  2564  
  2565  // Header returns an http.Header that can be modified by the caller to
  2566  // add HTTP headers to the request.
  2567  func (c *AccountsAdunitsListCall) Header() http.Header {
  2568  	if c.header_ == nil {
  2569  		c.header_ = make(http.Header)
  2570  	}
  2571  	return c.header_
  2572  }
  2573  
  2574  func (c *AccountsAdunitsListCall) doRequest(alt string) (*http.Response, error) {
  2575  	reqHeaders := make(http.Header)
  2576  	reqHeaders.Set("x-goog-api-client", "gl-go/1.13.7 gdcl/20200203")
  2577  	for k, v := range c.header_ {
  2578  		reqHeaders[k] = v
  2579  	}
  2580  	reqHeaders.Set("User-Agent", c.s.userAgent())
  2581  	if c.ifNoneMatch_ != "" {
  2582  		reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  2583  	}
  2584  	var body io.Reader = nil
  2585  	c.urlParams_.Set("alt", alt)
  2586  	c.urlParams_.Set("prettyPrint", "false")
  2587  	urls := googleapi.ResolveRelative(c.s.BasePath, "accounts/{accountId}/adclients/{adClientId}/adunits")
  2588  	urls += "?" + c.urlParams_.Encode()
  2589  	req, err := http.NewRequest("GET", urls, body)
  2590  	if err != nil {
  2591  		return nil, err
  2592  	}
  2593  	req.Header = reqHeaders
  2594  	googleapi.Expand(req.URL, map[string]string{
  2595  		"accountId":  c.accountId,
  2596  		"adClientId": c.adClientId,
  2597  	})
  2598  	return gensupport.SendRequest(c.ctx_, c.s.client, req)
  2599  }
  2600  
  2601  // Do executes the "adsense.accounts.adunits.list" call.
  2602  // Exactly one of *AdUnits or error will be non-nil. Any non-2xx status
  2603  // code is an error. Response headers are in either
  2604  // *AdUnits.ServerResponse.Header or (if a response was returned at all)
  2605  // in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to
  2606  // check whether the returned error was because http.StatusNotModified
  2607  // was returned.
  2608  func (c *AccountsAdunitsListCall) Do(opts ...googleapi.CallOption) (*AdUnits, error) {
  2609  	gensupport.SetOptions(c.urlParams_, opts...)
  2610  	res, err := c.doRequest("json")
  2611  	if res != nil && res.StatusCode == http.StatusNotModified {
  2612  		if res.Body != nil {
  2613  			res.Body.Close()
  2614  		}
  2615  		return nil, &googleapi.Error{
  2616  			Code:   res.StatusCode,
  2617  			Header: res.Header,
  2618  		}
  2619  	}
  2620  	if err != nil {
  2621  		return nil, err
  2622  	}
  2623  	defer googleapi.CloseBody(res)
  2624  	if err := googleapi.CheckResponse(res); err != nil {
  2625  		return nil, err
  2626  	}
  2627  	ret := &AdUnits{
  2628  		ServerResponse: googleapi.ServerResponse{
  2629  			Header:         res.Header,
  2630  			HTTPStatusCode: res.StatusCode,
  2631  		},
  2632  	}
  2633  	target := &ret
  2634  	if err := gensupport.DecodeResponse(target, res); err != nil {
  2635  		return nil, err
  2636  	}
  2637  	return ret, nil
  2638  	// {
  2639  	//   "description": "List all ad units in the specified ad client for the specified account.",
  2640  	//   "httpMethod": "GET",
  2641  	//   "id": "adsense.accounts.adunits.list",
  2642  	//   "parameterOrder": [
  2643  	//     "accountId",
  2644  	//     "adClientId"
  2645  	//   ],
  2646  	//   "parameters": {
  2647  	//     "accountId": {
  2648  	//       "description": "Account to which the ad client belongs.",
  2649  	//       "location": "path",
  2650  	//       "required": true,
  2651  	//       "type": "string"
  2652  	//     },
  2653  	//     "adClientId": {
  2654  	//       "description": "Ad client for which to list ad units.",
  2655  	//       "location": "path",
  2656  	//       "required": true,
  2657  	//       "type": "string"
  2658  	//     },
  2659  	//     "includeInactive": {
  2660  	//       "description": "Whether to include inactive ad units. Default: true.",
  2661  	//       "location": "query",
  2662  	//       "type": "boolean"
  2663  	//     },
  2664  	//     "maxResults": {
  2665  	//       "description": "The maximum number of ad units to include in the response, used for paging.",
  2666  	//       "format": "int32",
  2667  	//       "location": "query",
  2668  	//       "maximum": "10000",
  2669  	//       "minimum": "0",
  2670  	//       "type": "integer"
  2671  	//     },
  2672  	//     "pageToken": {
  2673  	//       "description": "A continuation token, used to page through ad units. To retrieve the next page, set this parameter to the value of \"nextPageToken\" from the previous response.",
  2674  	//       "location": "query",
  2675  	//       "type": "string"
  2676  	//     }
  2677  	//   },
  2678  	//   "path": "accounts/{accountId}/adclients/{adClientId}/adunits",
  2679  	//   "response": {
  2680  	//     "$ref": "AdUnits"
  2681  	//   },
  2682  	//   "scopes": [
  2683  	//     "https://www.googleapis.com/auth/adsense",
  2684  	//     "https://www.googleapis.com/auth/adsense.readonly"
  2685  	//   ]
  2686  	// }
  2687  
  2688  }
  2689  
  2690  // Pages invokes f for each page of results.
  2691  // A non-nil error returned from f will halt the iteration.
  2692  // The provided context supersedes any context provided to the Context method.
  2693  func (c *AccountsAdunitsListCall) Pages(ctx context.Context, f func(*AdUnits) error) error {
  2694  	c.ctx_ = ctx
  2695  	defer c.PageToken(c.urlParams_.Get("pageToken")) // reset paging to original point
  2696  	for {
  2697  		x, err := c.Do()
  2698  		if err != nil {
  2699  			return err
  2700  		}
  2701  		if err := f(x); err != nil {
  2702  			return err
  2703  		}
  2704  		if x.NextPageToken == "" {
  2705  			return nil
  2706  		}
  2707  		c.PageToken(x.NextPageToken)
  2708  	}
  2709  }
  2710  
  2711  // method id "adsense.accounts.adunits.customchannels.list":
  2712  
  2713  type AccountsAdunitsCustomchannelsListCall struct {
  2714  	s            *Service
  2715  	accountId    string
  2716  	adClientId   string
  2717  	adUnitId     string
  2718  	urlParams_   gensupport.URLParams
  2719  	ifNoneMatch_ string
  2720  	ctx_         context.Context
  2721  	header_      http.Header
  2722  }
  2723  
  2724  // List: List all custom channels which the specified ad unit belongs
  2725  // to.
  2726  func (r *AccountsAdunitsCustomchannelsService) List(accountId string, adClientId string, adUnitId string) *AccountsAdunitsCustomchannelsListCall {
  2727  	c := &AccountsAdunitsCustomchannelsListCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  2728  	c.accountId = accountId
  2729  	c.adClientId = adClientId
  2730  	c.adUnitId = adUnitId
  2731  	return c
  2732  }
  2733  
  2734  // MaxResults sets the optional parameter "maxResults": The maximum
  2735  // number of custom channels to include in the response, used for
  2736  // paging.
  2737  func (c *AccountsAdunitsCustomchannelsListCall) MaxResults(maxResults int64) *AccountsAdunitsCustomchannelsListCall {
  2738  	c.urlParams_.Set("maxResults", fmt.Sprint(maxResults))
  2739  	return c
  2740  }
  2741  
  2742  // PageToken sets the optional parameter "pageToken": A continuation
  2743  // token, used to page through custom channels. To retrieve the next
  2744  // page, set this parameter to the value of "nextPageToken" from the
  2745  // previous response.
  2746  func (c *AccountsAdunitsCustomchannelsListCall) PageToken(pageToken string) *AccountsAdunitsCustomchannelsListCall {
  2747  	c.urlParams_.Set("pageToken", pageToken)
  2748  	return c
  2749  }
  2750  
  2751  // Fields allows partial responses to be retrieved. See
  2752  // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  2753  // for more information.
  2754  func (c *AccountsAdunitsCustomchannelsListCall) Fields(s ...googleapi.Field) *AccountsAdunitsCustomchannelsListCall {
  2755  	c.urlParams_.Set("fields", googleapi.CombineFields(s))
  2756  	return c
  2757  }
  2758  
  2759  // IfNoneMatch sets the optional parameter which makes the operation
  2760  // fail if the object's ETag matches the given value. This is useful for
  2761  // getting updates only after the object has changed since the last
  2762  // request. Use googleapi.IsNotModified to check whether the response
  2763  // error from Do is the result of In-None-Match.
  2764  func (c *AccountsAdunitsCustomchannelsListCall) IfNoneMatch(entityTag string) *AccountsAdunitsCustomchannelsListCall {
  2765  	c.ifNoneMatch_ = entityTag
  2766  	return c
  2767  }
  2768  
  2769  // Context sets the context to be used in this call's Do method. Any
  2770  // pending HTTP request will be aborted if the provided context is
  2771  // canceled.
  2772  func (c *AccountsAdunitsCustomchannelsListCall) Context(ctx context.Context) *AccountsAdunitsCustomchannelsListCall {
  2773  	c.ctx_ = ctx
  2774  	return c
  2775  }
  2776  
  2777  // Header returns an http.Header that can be modified by the caller to
  2778  // add HTTP headers to the request.
  2779  func (c *AccountsAdunitsCustomchannelsListCall) Header() http.Header {
  2780  	if c.header_ == nil {
  2781  		c.header_ = make(http.Header)
  2782  	}
  2783  	return c.header_
  2784  }
  2785  
  2786  func (c *AccountsAdunitsCustomchannelsListCall) doRequest(alt string) (*http.Response, error) {
  2787  	reqHeaders := make(http.Header)
  2788  	reqHeaders.Set("x-goog-api-client", "gl-go/1.13.7 gdcl/20200203")
  2789  	for k, v := range c.header_ {
  2790  		reqHeaders[k] = v
  2791  	}
  2792  	reqHeaders.Set("User-Agent", c.s.userAgent())
  2793  	if c.ifNoneMatch_ != "" {
  2794  		reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  2795  	}
  2796  	var body io.Reader = nil
  2797  	c.urlParams_.Set("alt", alt)
  2798  	c.urlParams_.Set("prettyPrint", "false")
  2799  	urls := googleapi.ResolveRelative(c.s.BasePath, "accounts/{accountId}/adclients/{adClientId}/adunits/{adUnitId}/customchannels")
  2800  	urls += "?" + c.urlParams_.Encode()
  2801  	req, err := http.NewRequest("GET", urls, body)
  2802  	if err != nil {
  2803  		return nil, err
  2804  	}
  2805  	req.Header = reqHeaders
  2806  	googleapi.Expand(req.URL, map[string]string{
  2807  		"accountId":  c.accountId,
  2808  		"adClientId": c.adClientId,
  2809  		"adUnitId":   c.adUnitId,
  2810  	})
  2811  	return gensupport.SendRequest(c.ctx_, c.s.client, req)
  2812  }
  2813  
  2814  // Do executes the "adsense.accounts.adunits.customchannels.list" call.
  2815  // Exactly one of *CustomChannels or error will be non-nil. Any non-2xx
  2816  // status code is an error. Response headers are in either
  2817  // *CustomChannels.ServerResponse.Header or (if a response was returned
  2818  // at all) in error.(*googleapi.Error).Header. Use
  2819  // googleapi.IsNotModified to check whether the returned error was
  2820  // because http.StatusNotModified was returned.
  2821  func (c *AccountsAdunitsCustomchannelsListCall) Do(opts ...googleapi.CallOption) (*CustomChannels, error) {
  2822  	gensupport.SetOptions(c.urlParams_, opts...)
  2823  	res, err := c.doRequest("json")
  2824  	if res != nil && res.StatusCode == http.StatusNotModified {
  2825  		if res.Body != nil {
  2826  			res.Body.Close()
  2827  		}
  2828  		return nil, &googleapi.Error{
  2829  			Code:   res.StatusCode,
  2830  			Header: res.Header,
  2831  		}
  2832  	}
  2833  	if err != nil {
  2834  		return nil, err
  2835  	}
  2836  	defer googleapi.CloseBody(res)
  2837  	if err := googleapi.CheckResponse(res); err != nil {
  2838  		return nil, err
  2839  	}
  2840  	ret := &CustomChannels{
  2841  		ServerResponse: googleapi.ServerResponse{
  2842  			Header:         res.Header,
  2843  			HTTPStatusCode: res.StatusCode,
  2844  		},
  2845  	}
  2846  	target := &ret
  2847  	if err := gensupport.DecodeResponse(target, res); err != nil {
  2848  		return nil, err
  2849  	}
  2850  	return ret, nil
  2851  	// {
  2852  	//   "description": "List all custom channels which the specified ad unit belongs to.",
  2853  	//   "httpMethod": "GET",
  2854  	//   "id": "adsense.accounts.adunits.customchannels.list",
  2855  	//   "parameterOrder": [
  2856  	//     "accountId",
  2857  	//     "adClientId",
  2858  	//     "adUnitId"
  2859  	//   ],
  2860  	//   "parameters": {
  2861  	//     "accountId": {
  2862  	//       "description": "Account to which the ad client belongs.",
  2863  	//       "location": "path",
  2864  	//       "required": true,
  2865  	//       "type": "string"
  2866  	//     },
  2867  	//     "adClientId": {
  2868  	//       "description": "Ad client which contains the ad unit.",
  2869  	//       "location": "path",
  2870  	//       "required": true,
  2871  	//       "type": "string"
  2872  	//     },
  2873  	//     "adUnitId": {
  2874  	//       "description": "Ad unit for which to list custom channels.",
  2875  	//       "location": "path",
  2876  	//       "required": true,
  2877  	//       "type": "string"
  2878  	//     },
  2879  	//     "maxResults": {
  2880  	//       "description": "The maximum number of custom channels to include in the response, used for paging.",
  2881  	//       "format": "int32",
  2882  	//       "location": "query",
  2883  	//       "maximum": "10000",
  2884  	//       "minimum": "0",
  2885  	//       "type": "integer"
  2886  	//     },
  2887  	//     "pageToken": {
  2888  	//       "description": "A continuation token, used to page through custom channels. To retrieve the next page, set this parameter to the value of \"nextPageToken\" from the previous response.",
  2889  	//       "location": "query",
  2890  	//       "type": "string"
  2891  	//     }
  2892  	//   },
  2893  	//   "path": "accounts/{accountId}/adclients/{adClientId}/adunits/{adUnitId}/customchannels",
  2894  	//   "response": {
  2895  	//     "$ref": "CustomChannels"
  2896  	//   },
  2897  	//   "scopes": [
  2898  	//     "https://www.googleapis.com/auth/adsense",
  2899  	//     "https://www.googleapis.com/auth/adsense.readonly"
  2900  	//   ]
  2901  	// }
  2902  
  2903  }
  2904  
  2905  // Pages invokes f for each page of results.
  2906  // A non-nil error returned from f will halt the iteration.
  2907  // The provided context supersedes any context provided to the Context method.
  2908  func (c *AccountsAdunitsCustomchannelsListCall) Pages(ctx context.Context, f func(*CustomChannels) error) error {
  2909  	c.ctx_ = ctx
  2910  	defer c.PageToken(c.urlParams_.Get("pageToken")) // reset paging to original point
  2911  	for {
  2912  		x, err := c.Do()
  2913  		if err != nil {
  2914  			return err
  2915  		}
  2916  		if err := f(x); err != nil {
  2917  			return err
  2918  		}
  2919  		if x.NextPageToken == "" {
  2920  			return nil
  2921  		}
  2922  		c.PageToken(x.NextPageToken)
  2923  	}
  2924  }
  2925  
  2926  // method id "adsense.accounts.alerts.list":
  2927  
  2928  type AccountsAlertsListCall struct {
  2929  	s            *Service
  2930  	accountId    string
  2931  	urlParams_   gensupport.URLParams
  2932  	ifNoneMatch_ string
  2933  	ctx_         context.Context
  2934  	header_      http.Header
  2935  }
  2936  
  2937  // List: List the alerts for the specified AdSense account.
  2938  func (r *AccountsAlertsService) List(accountId string) *AccountsAlertsListCall {
  2939  	c := &AccountsAlertsListCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  2940  	c.accountId = accountId
  2941  	return c
  2942  }
  2943  
  2944  // Locale sets the optional parameter "locale": The locale to use for
  2945  // translating alert messages. The account locale will be used if this
  2946  // is not supplied. The AdSense default (English) will be used if the
  2947  // supplied locale is invalid or unsupported.
  2948  func (c *AccountsAlertsListCall) Locale(locale string) *AccountsAlertsListCall {
  2949  	c.urlParams_.Set("locale", locale)
  2950  	return c
  2951  }
  2952  
  2953  // Fields allows partial responses to be retrieved. See
  2954  // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  2955  // for more information.
  2956  func (c *AccountsAlertsListCall) Fields(s ...googleapi.Field) *AccountsAlertsListCall {
  2957  	c.urlParams_.Set("fields", googleapi.CombineFields(s))
  2958  	return c
  2959  }
  2960  
  2961  // IfNoneMatch sets the optional parameter which makes the operation
  2962  // fail if the object's ETag matches the given value. This is useful for
  2963  // getting updates only after the object has changed since the last
  2964  // request. Use googleapi.IsNotModified to check whether the response
  2965  // error from Do is the result of In-None-Match.
  2966  func (c *AccountsAlertsListCall) IfNoneMatch(entityTag string) *AccountsAlertsListCall {
  2967  	c.ifNoneMatch_ = entityTag
  2968  	return c
  2969  }
  2970  
  2971  // Context sets the context to be used in this call's Do method. Any
  2972  // pending HTTP request will be aborted if the provided context is
  2973  // canceled.
  2974  func (c *AccountsAlertsListCall) Context(ctx context.Context) *AccountsAlertsListCall {
  2975  	c.ctx_ = ctx
  2976  	return c
  2977  }
  2978  
  2979  // Header returns an http.Header that can be modified by the caller to
  2980  // add HTTP headers to the request.
  2981  func (c *AccountsAlertsListCall) Header() http.Header {
  2982  	if c.header_ == nil {
  2983  		c.header_ = make(http.Header)
  2984  	}
  2985  	return c.header_
  2986  }
  2987  
  2988  func (c *AccountsAlertsListCall) doRequest(alt string) (*http.Response, error) {
  2989  	reqHeaders := make(http.Header)
  2990  	reqHeaders.Set("x-goog-api-client", "gl-go/1.13.7 gdcl/20200203")
  2991  	for k, v := range c.header_ {
  2992  		reqHeaders[k] = v
  2993  	}
  2994  	reqHeaders.Set("User-Agent", c.s.userAgent())
  2995  	if c.ifNoneMatch_ != "" {
  2996  		reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  2997  	}
  2998  	var body io.Reader = nil
  2999  	c.urlParams_.Set("alt", alt)
  3000  	c.urlParams_.Set("prettyPrint", "false")
  3001  	urls := googleapi.ResolveRelative(c.s.BasePath, "accounts/{accountId}/alerts")
  3002  	urls += "?" + c.urlParams_.Encode()
  3003  	req, err := http.NewRequest("GET", urls, body)
  3004  	if err != nil {
  3005  		return nil, err
  3006  	}
  3007  	req.Header = reqHeaders
  3008  	googleapi.Expand(req.URL, map[string]string{
  3009  		"accountId": c.accountId,
  3010  	})
  3011  	return gensupport.SendRequest(c.ctx_, c.s.client, req)
  3012  }
  3013  
  3014  // Do executes the "adsense.accounts.alerts.list" call.
  3015  // Exactly one of *Alerts or error will be non-nil. Any non-2xx status
  3016  // code is an error. Response headers are in either
  3017  // *Alerts.ServerResponse.Header or (if a response was returned at all)
  3018  // in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to
  3019  // check whether the returned error was because http.StatusNotModified
  3020  // was returned.
  3021  func (c *AccountsAlertsListCall) Do(opts ...googleapi.CallOption) (*Alerts, error) {
  3022  	gensupport.SetOptions(c.urlParams_, opts...)
  3023  	res, err := c.doRequest("json")
  3024  	if res != nil && res.StatusCode == http.StatusNotModified {
  3025  		if res.Body != nil {
  3026  			res.Body.Close()
  3027  		}
  3028  		return nil, &googleapi.Error{
  3029  			Code:   res.StatusCode,
  3030  			Header: res.Header,
  3031  		}
  3032  	}
  3033  	if err != nil {
  3034  		return nil, err
  3035  	}
  3036  	defer googleapi.CloseBody(res)
  3037  	if err := googleapi.CheckResponse(res); err != nil {
  3038  		return nil, err
  3039  	}
  3040  	ret := &Alerts{
  3041  		ServerResponse: googleapi.ServerResponse{
  3042  			Header:         res.Header,
  3043  			HTTPStatusCode: res.StatusCode,
  3044  		},
  3045  	}
  3046  	target := &ret
  3047  	if err := gensupport.DecodeResponse(target, res); err != nil {
  3048  		return nil, err
  3049  	}
  3050  	return ret, nil
  3051  	// {
  3052  	//   "description": "List the alerts for the specified AdSense account.",
  3053  	//   "httpMethod": "GET",
  3054  	//   "id": "adsense.accounts.alerts.list",
  3055  	//   "parameterOrder": [
  3056  	//     "accountId"
  3057  	//   ],
  3058  	//   "parameters": {
  3059  	//     "accountId": {
  3060  	//       "description": "Account for which to retrieve the alerts.",
  3061  	//       "location": "path",
  3062  	//       "required": true,
  3063  	//       "type": "string"
  3064  	//     },
  3065  	//     "locale": {
  3066  	//       "description": "The locale to use for translating alert messages. The account locale will be used if this is not supplied. The AdSense default (English) will be used if the supplied locale is invalid or unsupported.",
  3067  	//       "location": "query",
  3068  	//       "type": "string"
  3069  	//     }
  3070  	//   },
  3071  	//   "path": "accounts/{accountId}/alerts",
  3072  	//   "response": {
  3073  	//     "$ref": "Alerts"
  3074  	//   },
  3075  	//   "scopes": [
  3076  	//     "https://www.googleapis.com/auth/adsense",
  3077  	//     "https://www.googleapis.com/auth/adsense.readonly"
  3078  	//   ]
  3079  	// }
  3080  
  3081  }
  3082  
  3083  // method id "adsense.accounts.customchannels.get":
  3084  
  3085  type AccountsCustomchannelsGetCall struct {
  3086  	s               *Service
  3087  	accountId       string
  3088  	adClientId      string
  3089  	customChannelId string
  3090  	urlParams_      gensupport.URLParams
  3091  	ifNoneMatch_    string
  3092  	ctx_            context.Context
  3093  	header_         http.Header
  3094  }
  3095  
  3096  // Get: Get the specified custom channel from the specified ad client
  3097  // for the specified account.
  3098  func (r *AccountsCustomchannelsService) Get(accountId string, adClientId string, customChannelId string) *AccountsCustomchannelsGetCall {
  3099  	c := &AccountsCustomchannelsGetCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  3100  	c.accountId = accountId
  3101  	c.adClientId = adClientId
  3102  	c.customChannelId = customChannelId
  3103  	return c
  3104  }
  3105  
  3106  // Fields allows partial responses to be retrieved. See
  3107  // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  3108  // for more information.
  3109  func (c *AccountsCustomchannelsGetCall) Fields(s ...googleapi.Field) *AccountsCustomchannelsGetCall {
  3110  	c.urlParams_.Set("fields", googleapi.CombineFields(s))
  3111  	return c
  3112  }
  3113  
  3114  // IfNoneMatch sets the optional parameter which makes the operation
  3115  // fail if the object's ETag matches the given value. This is useful for
  3116  // getting updates only after the object has changed since the last
  3117  // request. Use googleapi.IsNotModified to check whether the response
  3118  // error from Do is the result of In-None-Match.
  3119  func (c *AccountsCustomchannelsGetCall) IfNoneMatch(entityTag string) *AccountsCustomchannelsGetCall {
  3120  	c.ifNoneMatch_ = entityTag
  3121  	return c
  3122  }
  3123  
  3124  // Context sets the context to be used in this call's Do method. Any
  3125  // pending HTTP request will be aborted if the provided context is
  3126  // canceled.
  3127  func (c *AccountsCustomchannelsGetCall) Context(ctx context.Context) *AccountsCustomchannelsGetCall {
  3128  	c.ctx_ = ctx
  3129  	return c
  3130  }
  3131  
  3132  // Header returns an http.Header that can be modified by the caller to
  3133  // add HTTP headers to the request.
  3134  func (c *AccountsCustomchannelsGetCall) Header() http.Header {
  3135  	if c.header_ == nil {
  3136  		c.header_ = make(http.Header)
  3137  	}
  3138  	return c.header_
  3139  }
  3140  
  3141  func (c *AccountsCustomchannelsGetCall) doRequest(alt string) (*http.Response, error) {
  3142  	reqHeaders := make(http.Header)
  3143  	reqHeaders.Set("x-goog-api-client", "gl-go/1.13.7 gdcl/20200203")
  3144  	for k, v := range c.header_ {
  3145  		reqHeaders[k] = v
  3146  	}
  3147  	reqHeaders.Set("User-Agent", c.s.userAgent())
  3148  	if c.ifNoneMatch_ != "" {
  3149  		reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  3150  	}
  3151  	var body io.Reader = nil
  3152  	c.urlParams_.Set("alt", alt)
  3153  	c.urlParams_.Set("prettyPrint", "false")
  3154  	urls := googleapi.ResolveRelative(c.s.BasePath, "accounts/{accountId}/adclients/{adClientId}/customchannels/{customChannelId}")
  3155  	urls += "?" + c.urlParams_.Encode()
  3156  	req, err := http.NewRequest("GET", urls, body)
  3157  	if err != nil {
  3158  		return nil, err
  3159  	}
  3160  	req.Header = reqHeaders
  3161  	googleapi.Expand(req.URL, map[string]string{
  3162  		"accountId":       c.accountId,
  3163  		"adClientId":      c.adClientId,
  3164  		"customChannelId": c.customChannelId,
  3165  	})
  3166  	return gensupport.SendRequest(c.ctx_, c.s.client, req)
  3167  }
  3168  
  3169  // Do executes the "adsense.accounts.customchannels.get" call.
  3170  // Exactly one of *CustomChannel or error will be non-nil. Any non-2xx
  3171  // status code is an error. Response headers are in either
  3172  // *CustomChannel.ServerResponse.Header or (if a response was returned
  3173  // at all) in error.(*googleapi.Error).Header. Use
  3174  // googleapi.IsNotModified to check whether the returned error was
  3175  // because http.StatusNotModified was returned.
  3176  func (c *AccountsCustomchannelsGetCall) Do(opts ...googleapi.CallOption) (*CustomChannel, error) {
  3177  	gensupport.SetOptions(c.urlParams_, opts...)
  3178  	res, err := c.doRequest("json")
  3179  	if res != nil && res.StatusCode == http.StatusNotModified {
  3180  		if res.Body != nil {
  3181  			res.Body.Close()
  3182  		}
  3183  		return nil, &googleapi.Error{
  3184  			Code:   res.StatusCode,
  3185  			Header: res.Header,
  3186  		}
  3187  	}
  3188  	if err != nil {
  3189  		return nil, err
  3190  	}
  3191  	defer googleapi.CloseBody(res)
  3192  	if err := googleapi.CheckResponse(res); err != nil {
  3193  		return nil, err
  3194  	}
  3195  	ret := &CustomChannel{
  3196  		ServerResponse: googleapi.ServerResponse{
  3197  			Header:         res.Header,
  3198  			HTTPStatusCode: res.StatusCode,
  3199  		},
  3200  	}
  3201  	target := &ret
  3202  	if err := gensupport.DecodeResponse(target, res); err != nil {
  3203  		return nil, err
  3204  	}
  3205  	return ret, nil
  3206  	// {
  3207  	//   "description": "Get the specified custom channel from the specified ad client for the specified account.",
  3208  	//   "httpMethod": "GET",
  3209  	//   "id": "adsense.accounts.customchannels.get",
  3210  	//   "parameterOrder": [
  3211  	//     "accountId",
  3212  	//     "adClientId",
  3213  	//     "customChannelId"
  3214  	//   ],
  3215  	//   "parameters": {
  3216  	//     "accountId": {
  3217  	//       "description": "Account to which the ad client belongs.",
  3218  	//       "location": "path",
  3219  	//       "required": true,
  3220  	//       "type": "string"
  3221  	//     },
  3222  	//     "adClientId": {
  3223  	//       "description": "Ad client which contains the custom channel.",
  3224  	//       "location": "path",
  3225  	//       "required": true,
  3226  	//       "type": "string"
  3227  	//     },
  3228  	//     "customChannelId": {
  3229  	//       "description": "Custom channel to retrieve.",
  3230  	//       "location": "path",
  3231  	//       "required": true,
  3232  	//       "type": "string"
  3233  	//     }
  3234  	//   },
  3235  	//   "path": "accounts/{accountId}/adclients/{adClientId}/customchannels/{customChannelId}",
  3236  	//   "response": {
  3237  	//     "$ref": "CustomChannel"
  3238  	//   },
  3239  	//   "scopes": [
  3240  	//     "https://www.googleapis.com/auth/adsense",
  3241  	//     "https://www.googleapis.com/auth/adsense.readonly"
  3242  	//   ]
  3243  	// }
  3244  
  3245  }
  3246  
  3247  // method id "adsense.accounts.customchannels.list":
  3248  
  3249  type AccountsCustomchannelsListCall struct {
  3250  	s            *Service
  3251  	accountId    string
  3252  	adClientId   string
  3253  	urlParams_   gensupport.URLParams
  3254  	ifNoneMatch_ string
  3255  	ctx_         context.Context
  3256  	header_      http.Header
  3257  }
  3258  
  3259  // List: List all custom channels in the specified ad client for the
  3260  // specified account.
  3261  func (r *AccountsCustomchannelsService) List(accountId string, adClientId string) *AccountsCustomchannelsListCall {
  3262  	c := &AccountsCustomchannelsListCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  3263  	c.accountId = accountId
  3264  	c.adClientId = adClientId
  3265  	return c
  3266  }
  3267  
  3268  // MaxResults sets the optional parameter "maxResults": The maximum
  3269  // number of custom channels to include in the response, used for
  3270  // paging.
  3271  func (c *AccountsCustomchannelsListCall) MaxResults(maxResults int64) *AccountsCustomchannelsListCall {
  3272  	c.urlParams_.Set("maxResults", fmt.Sprint(maxResults))
  3273  	return c
  3274  }
  3275  
  3276  // PageToken sets the optional parameter "pageToken": A continuation
  3277  // token, used to page through custom channels. To retrieve the next
  3278  // page, set this parameter to the value of "nextPageToken" from the
  3279  // previous response.
  3280  func (c *AccountsCustomchannelsListCall) PageToken(pageToken string) *AccountsCustomchannelsListCall {
  3281  	c.urlParams_.Set("pageToken", pageToken)
  3282  	return c
  3283  }
  3284  
  3285  // Fields allows partial responses to be retrieved. See
  3286  // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  3287  // for more information.
  3288  func (c *AccountsCustomchannelsListCall) Fields(s ...googleapi.Field) *AccountsCustomchannelsListCall {
  3289  	c.urlParams_.Set("fields", googleapi.CombineFields(s))
  3290  	return c
  3291  }
  3292  
  3293  // IfNoneMatch sets the optional parameter which makes the operation
  3294  // fail if the object's ETag matches the given value. This is useful for
  3295  // getting updates only after the object has changed since the last
  3296  // request. Use googleapi.IsNotModified to check whether the response
  3297  // error from Do is the result of In-None-Match.
  3298  func (c *AccountsCustomchannelsListCall) IfNoneMatch(entityTag string) *AccountsCustomchannelsListCall {
  3299  	c.ifNoneMatch_ = entityTag
  3300  	return c
  3301  }
  3302  
  3303  // Context sets the context to be used in this call's Do method. Any
  3304  // pending HTTP request will be aborted if the provided context is
  3305  // canceled.
  3306  func (c *AccountsCustomchannelsListCall) Context(ctx context.Context) *AccountsCustomchannelsListCall {
  3307  	c.ctx_ = ctx
  3308  	return c
  3309  }
  3310  
  3311  // Header returns an http.Header that can be modified by the caller to
  3312  // add HTTP headers to the request.
  3313  func (c *AccountsCustomchannelsListCall) Header() http.Header {
  3314  	if c.header_ == nil {
  3315  		c.header_ = make(http.Header)
  3316  	}
  3317  	return c.header_
  3318  }
  3319  
  3320  func (c *AccountsCustomchannelsListCall) doRequest(alt string) (*http.Response, error) {
  3321  	reqHeaders := make(http.Header)
  3322  	reqHeaders.Set("x-goog-api-client", "gl-go/1.13.7 gdcl/20200203")
  3323  	for k, v := range c.header_ {
  3324  		reqHeaders[k] = v
  3325  	}
  3326  	reqHeaders.Set("User-Agent", c.s.userAgent())
  3327  	if c.ifNoneMatch_ != "" {
  3328  		reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  3329  	}
  3330  	var body io.Reader = nil
  3331  	c.urlParams_.Set("alt", alt)
  3332  	c.urlParams_.Set("prettyPrint", "false")
  3333  	urls := googleapi.ResolveRelative(c.s.BasePath, "accounts/{accountId}/adclients/{adClientId}/customchannels")
  3334  	urls += "?" + c.urlParams_.Encode()
  3335  	req, err := http.NewRequest("GET", urls, body)
  3336  	if err != nil {
  3337  		return nil, err
  3338  	}
  3339  	req.Header = reqHeaders
  3340  	googleapi.Expand(req.URL, map[string]string{
  3341  		"accountId":  c.accountId,
  3342  		"adClientId": c.adClientId,
  3343  	})
  3344  	return gensupport.SendRequest(c.ctx_, c.s.client, req)
  3345  }
  3346  
  3347  // Do executes the "adsense.accounts.customchannels.list" call.
  3348  // Exactly one of *CustomChannels or error will be non-nil. Any non-2xx
  3349  // status code is an error. Response headers are in either
  3350  // *CustomChannels.ServerResponse.Header or (if a response was returned
  3351  // at all) in error.(*googleapi.Error).Header. Use
  3352  // googleapi.IsNotModified to check whether the returned error was
  3353  // because http.StatusNotModified was returned.
  3354  func (c *AccountsCustomchannelsListCall) Do(opts ...googleapi.CallOption) (*CustomChannels, error) {
  3355  	gensupport.SetOptions(c.urlParams_, opts...)
  3356  	res, err := c.doRequest("json")
  3357  	if res != nil && res.StatusCode == http.StatusNotModified {
  3358  		if res.Body != nil {
  3359  			res.Body.Close()
  3360  		}
  3361  		return nil, &googleapi.Error{
  3362  			Code:   res.StatusCode,
  3363  			Header: res.Header,
  3364  		}
  3365  	}
  3366  	if err != nil {
  3367  		return nil, err
  3368  	}
  3369  	defer googleapi.CloseBody(res)
  3370  	if err := googleapi.CheckResponse(res); err != nil {
  3371  		return nil, err
  3372  	}
  3373  	ret := &CustomChannels{
  3374  		ServerResponse: googleapi.ServerResponse{
  3375  			Header:         res.Header,
  3376  			HTTPStatusCode: res.StatusCode,
  3377  		},
  3378  	}
  3379  	target := &ret
  3380  	if err := gensupport.DecodeResponse(target, res); err != nil {
  3381  		return nil, err
  3382  	}
  3383  	return ret, nil
  3384  	// {
  3385  	//   "description": "List all custom channels in the specified ad client for the specified account.",
  3386  	//   "httpMethod": "GET",
  3387  	//   "id": "adsense.accounts.customchannels.list",
  3388  	//   "parameterOrder": [
  3389  	//     "accountId",
  3390  	//     "adClientId"
  3391  	//   ],
  3392  	//   "parameters": {
  3393  	//     "accountId": {
  3394  	//       "description": "Account to which the ad client belongs.",
  3395  	//       "location": "path",
  3396  	//       "required": true,
  3397  	//       "type": "string"
  3398  	//     },
  3399  	//     "adClientId": {
  3400  	//       "description": "Ad client for which to list custom channels.",
  3401  	//       "location": "path",
  3402  	//       "required": true,
  3403  	//       "type": "string"
  3404  	//     },
  3405  	//     "maxResults": {
  3406  	//       "description": "The maximum number of custom channels to include in the response, used for paging.",
  3407  	//       "format": "int32",
  3408  	//       "location": "query",
  3409  	//       "maximum": "10000",
  3410  	//       "minimum": "0",
  3411  	//       "type": "integer"
  3412  	//     },
  3413  	//     "pageToken": {
  3414  	//       "description": "A continuation token, used to page through custom channels. To retrieve the next page, set this parameter to the value of \"nextPageToken\" from the previous response.",
  3415  	//       "location": "query",
  3416  	//       "type": "string"
  3417  	//     }
  3418  	//   },
  3419  	//   "path": "accounts/{accountId}/adclients/{adClientId}/customchannels",
  3420  	//   "response": {
  3421  	//     "$ref": "CustomChannels"
  3422  	//   },
  3423  	//   "scopes": [
  3424  	//     "https://www.googleapis.com/auth/adsense",
  3425  	//     "https://www.googleapis.com/auth/adsense.readonly"
  3426  	//   ]
  3427  	// }
  3428  
  3429  }
  3430  
  3431  // Pages invokes f for each page of results.
  3432  // A non-nil error returned from f will halt the iteration.
  3433  // The provided context supersedes any context provided to the Context method.
  3434  func (c *AccountsCustomchannelsListCall) Pages(ctx context.Context, f func(*CustomChannels) error) error {
  3435  	c.ctx_ = ctx
  3436  	defer c.PageToken(c.urlParams_.Get("pageToken")) // reset paging to original point
  3437  	for {
  3438  		x, err := c.Do()
  3439  		if err != nil {
  3440  			return err
  3441  		}
  3442  		if err := f(x); err != nil {
  3443  			return err
  3444  		}
  3445  		if x.NextPageToken == "" {
  3446  			return nil
  3447  		}
  3448  		c.PageToken(x.NextPageToken)
  3449  	}
  3450  }
  3451  
  3452  // method id "adsense.accounts.customchannels.adunits.list":
  3453  
  3454  type AccountsCustomchannelsAdunitsListCall struct {
  3455  	s               *Service
  3456  	accountId       string
  3457  	adClientId      string
  3458  	customChannelId string
  3459  	urlParams_      gensupport.URLParams
  3460  	ifNoneMatch_    string
  3461  	ctx_            context.Context
  3462  	header_         http.Header
  3463  }
  3464  
  3465  // List: List all ad units in the specified custom channel.
  3466  func (r *AccountsCustomchannelsAdunitsService) List(accountId string, adClientId string, customChannelId string) *AccountsCustomchannelsAdunitsListCall {
  3467  	c := &AccountsCustomchannelsAdunitsListCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  3468  	c.accountId = accountId
  3469  	c.adClientId = adClientId
  3470  	c.customChannelId = customChannelId
  3471  	return c
  3472  }
  3473  
  3474  // IncludeInactive sets the optional parameter "includeInactive":
  3475  // Whether to include inactive ad units. Default: true.
  3476  func (c *AccountsCustomchannelsAdunitsListCall) IncludeInactive(includeInactive bool) *AccountsCustomchannelsAdunitsListCall {
  3477  	c.urlParams_.Set("includeInactive", fmt.Sprint(includeInactive))
  3478  	return c
  3479  }
  3480  
  3481  // MaxResults sets the optional parameter "maxResults": The maximum
  3482  // number of ad units to include in the response, used for paging.
  3483  func (c *AccountsCustomchannelsAdunitsListCall) MaxResults(maxResults int64) *AccountsCustomchannelsAdunitsListCall {
  3484  	c.urlParams_.Set("maxResults", fmt.Sprint(maxResults))
  3485  	return c
  3486  }
  3487  
  3488  // PageToken sets the optional parameter "pageToken": A continuation
  3489  // token, used to page through ad units. To retrieve the next page, set
  3490  // this parameter to the value of "nextPageToken" from the previous
  3491  // response.
  3492  func (c *AccountsCustomchannelsAdunitsListCall) PageToken(pageToken string) *AccountsCustomchannelsAdunitsListCall {
  3493  	c.urlParams_.Set("pageToken", pageToken)
  3494  	return c
  3495  }
  3496  
  3497  // Fields allows partial responses to be retrieved. See
  3498  // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  3499  // for more information.
  3500  func (c *AccountsCustomchannelsAdunitsListCall) Fields(s ...googleapi.Field) *AccountsCustomchannelsAdunitsListCall {
  3501  	c.urlParams_.Set("fields", googleapi.CombineFields(s))
  3502  	return c
  3503  }
  3504  
  3505  // IfNoneMatch sets the optional parameter which makes the operation
  3506  // fail if the object's ETag matches the given value. This is useful for
  3507  // getting updates only after the object has changed since the last
  3508  // request. Use googleapi.IsNotModified to check whether the response
  3509  // error from Do is the result of In-None-Match.
  3510  func (c *AccountsCustomchannelsAdunitsListCall) IfNoneMatch(entityTag string) *AccountsCustomchannelsAdunitsListCall {
  3511  	c.ifNoneMatch_ = entityTag
  3512  	return c
  3513  }
  3514  
  3515  // Context sets the context to be used in this call's Do method. Any
  3516  // pending HTTP request will be aborted if the provided context is
  3517  // canceled.
  3518  func (c *AccountsCustomchannelsAdunitsListCall) Context(ctx context.Context) *AccountsCustomchannelsAdunitsListCall {
  3519  	c.ctx_ = ctx
  3520  	return c
  3521  }
  3522  
  3523  // Header returns an http.Header that can be modified by the caller to
  3524  // add HTTP headers to the request.
  3525  func (c *AccountsCustomchannelsAdunitsListCall) Header() http.Header {
  3526  	if c.header_ == nil {
  3527  		c.header_ = make(http.Header)
  3528  	}
  3529  	return c.header_
  3530  }
  3531  
  3532  func (c *AccountsCustomchannelsAdunitsListCall) doRequest(alt string) (*http.Response, error) {
  3533  	reqHeaders := make(http.Header)
  3534  	reqHeaders.Set("x-goog-api-client", "gl-go/1.13.7 gdcl/20200203")
  3535  	for k, v := range c.header_ {
  3536  		reqHeaders[k] = v
  3537  	}
  3538  	reqHeaders.Set("User-Agent", c.s.userAgent())
  3539  	if c.ifNoneMatch_ != "" {
  3540  		reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  3541  	}
  3542  	var body io.Reader = nil
  3543  	c.urlParams_.Set("alt", alt)
  3544  	c.urlParams_.Set("prettyPrint", "false")
  3545  	urls := googleapi.ResolveRelative(c.s.BasePath, "accounts/{accountId}/adclients/{adClientId}/customchannels/{customChannelId}/adunits")
  3546  	urls += "?" + c.urlParams_.Encode()
  3547  	req, err := http.NewRequest("GET", urls, body)
  3548  	if err != nil {
  3549  		return nil, err
  3550  	}
  3551  	req.Header = reqHeaders
  3552  	googleapi.Expand(req.URL, map[string]string{
  3553  		"accountId":       c.accountId,
  3554  		"adClientId":      c.adClientId,
  3555  		"customChannelId": c.customChannelId,
  3556  	})
  3557  	return gensupport.SendRequest(c.ctx_, c.s.client, req)
  3558  }
  3559  
  3560  // Do executes the "adsense.accounts.customchannels.adunits.list" call.
  3561  // Exactly one of *AdUnits or error will be non-nil. Any non-2xx status
  3562  // code is an error. Response headers are in either
  3563  // *AdUnits.ServerResponse.Header or (if a response was returned at all)
  3564  // in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to
  3565  // check whether the returned error was because http.StatusNotModified
  3566  // was returned.
  3567  func (c *AccountsCustomchannelsAdunitsListCall) Do(opts ...googleapi.CallOption) (*AdUnits, error) {
  3568  	gensupport.SetOptions(c.urlParams_, opts...)
  3569  	res, err := c.doRequest("json")
  3570  	if res != nil && res.StatusCode == http.StatusNotModified {
  3571  		if res.Body != nil {
  3572  			res.Body.Close()
  3573  		}
  3574  		return nil, &googleapi.Error{
  3575  			Code:   res.StatusCode,
  3576  			Header: res.Header,
  3577  		}
  3578  	}
  3579  	if err != nil {
  3580  		return nil, err
  3581  	}
  3582  	defer googleapi.CloseBody(res)
  3583  	if err := googleapi.CheckResponse(res); err != nil {
  3584  		return nil, err
  3585  	}
  3586  	ret := &AdUnits{
  3587  		ServerResponse: googleapi.ServerResponse{
  3588  			Header:         res.Header,
  3589  			HTTPStatusCode: res.StatusCode,
  3590  		},
  3591  	}
  3592  	target := &ret
  3593  	if err := gensupport.DecodeResponse(target, res); err != nil {
  3594  		return nil, err
  3595  	}
  3596  	return ret, nil
  3597  	// {
  3598  	//   "description": "List all ad units in the specified custom channel.",
  3599  	//   "httpMethod": "GET",
  3600  	//   "id": "adsense.accounts.customchannels.adunits.list",
  3601  	//   "parameterOrder": [
  3602  	//     "accountId",
  3603  	//     "adClientId",
  3604  	//     "customChannelId"
  3605  	//   ],
  3606  	//   "parameters": {
  3607  	//     "accountId": {
  3608  	//       "description": "Account to which the ad client belongs.",
  3609  	//       "location": "path",
  3610  	//       "required": true,
  3611  	//       "type": "string"
  3612  	//     },
  3613  	//     "adClientId": {
  3614  	//       "description": "Ad client which contains the custom channel.",
  3615  	//       "location": "path",
  3616  	//       "required": true,
  3617  	//       "type": "string"
  3618  	//     },
  3619  	//     "customChannelId": {
  3620  	//       "description": "Custom channel for which to list ad units.",
  3621  	//       "location": "path",
  3622  	//       "required": true,
  3623  	//       "type": "string"
  3624  	//     },
  3625  	//     "includeInactive": {
  3626  	//       "description": "Whether to include inactive ad units. Default: true.",
  3627  	//       "location": "query",
  3628  	//       "type": "boolean"
  3629  	//     },
  3630  	//     "maxResults": {
  3631  	//       "description": "The maximum number of ad units to include in the response, used for paging.",
  3632  	//       "format": "int32",
  3633  	//       "location": "query",
  3634  	//       "maximum": "10000",
  3635  	//       "minimum": "0",
  3636  	//       "type": "integer"
  3637  	//     },
  3638  	//     "pageToken": {
  3639  	//       "description": "A continuation token, used to page through ad units. To retrieve the next page, set this parameter to the value of \"nextPageToken\" from the previous response.",
  3640  	//       "location": "query",
  3641  	//       "type": "string"
  3642  	//     }
  3643  	//   },
  3644  	//   "path": "accounts/{accountId}/adclients/{adClientId}/customchannels/{customChannelId}/adunits",
  3645  	//   "response": {
  3646  	//     "$ref": "AdUnits"
  3647  	//   },
  3648  	//   "scopes": [
  3649  	//     "https://www.googleapis.com/auth/adsense",
  3650  	//     "https://www.googleapis.com/auth/adsense.readonly"
  3651  	//   ]
  3652  	// }
  3653  
  3654  }
  3655  
  3656  // Pages invokes f for each page of results.
  3657  // A non-nil error returned from f will halt the iteration.
  3658  // The provided context supersedes any context provided to the Context method.
  3659  func (c *AccountsCustomchannelsAdunitsListCall) Pages(ctx context.Context, f func(*AdUnits) error) error {
  3660  	c.ctx_ = ctx
  3661  	defer c.PageToken(c.urlParams_.Get("pageToken")) // reset paging to original point
  3662  	for {
  3663  		x, err := c.Do()
  3664  		if err != nil {
  3665  			return err
  3666  		}
  3667  		if err := f(x); err != nil {
  3668  			return err
  3669  		}
  3670  		if x.NextPageToken == "" {
  3671  			return nil
  3672  		}
  3673  		c.PageToken(x.NextPageToken)
  3674  	}
  3675  }
  3676  
  3677  // method id "adsense.accounts.reports.generate":
  3678  
  3679  type AccountsReportsGenerateCall struct {
  3680  	s            *Service
  3681  	accountId    string
  3682  	urlParams_   gensupport.URLParams
  3683  	ifNoneMatch_ string
  3684  	ctx_         context.Context
  3685  	header_      http.Header
  3686  }
  3687  
  3688  // Generate: Generate an AdSense report based on the report request sent
  3689  // in the query parameters. Returns the result as JSON; to retrieve
  3690  // output in CSV format specify "alt=csv" as a query parameter.
  3691  func (r *AccountsReportsService) Generate(accountId string, startDate string, endDate string) *AccountsReportsGenerateCall {
  3692  	c := &AccountsReportsGenerateCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  3693  	c.accountId = accountId
  3694  	c.urlParams_.Set("startDate", startDate)
  3695  	c.urlParams_.Set("endDate", endDate)
  3696  	return c
  3697  }
  3698  
  3699  // Currency sets the optional parameter "currency": Optional currency to
  3700  // use when reporting on monetary metrics. Defaults to the account's
  3701  // currency if not set.
  3702  func (c *AccountsReportsGenerateCall) Currency(currency string) *AccountsReportsGenerateCall {
  3703  	c.urlParams_.Set("currency", currency)
  3704  	return c
  3705  }
  3706  
  3707  // Dimension sets the optional parameter "dimension": Dimensions to base
  3708  // the report on.
  3709  func (c *AccountsReportsGenerateCall) Dimension(dimension ...string) *AccountsReportsGenerateCall {
  3710  	c.urlParams_.SetMulti("dimension", append([]string{}, dimension...))
  3711  	return c
  3712  }
  3713  
  3714  // Filter sets the optional parameter "filter": Filters to be run on the
  3715  // report.
  3716  func (c *AccountsReportsGenerateCall) Filter(filter ...string) *AccountsReportsGenerateCall {
  3717  	c.urlParams_.SetMulti("filter", append([]string{}, filter...))
  3718  	return c
  3719  }
  3720  
  3721  // Locale sets the optional parameter "locale": Optional locale to use
  3722  // for translating report output to a local language. Defaults to
  3723  // "en_US" if not specified.
  3724  func (c *AccountsReportsGenerateCall) Locale(locale string) *AccountsReportsGenerateCall {
  3725  	c.urlParams_.Set("locale", locale)
  3726  	return c
  3727  }
  3728  
  3729  // MaxResults sets the optional parameter "maxResults": The maximum
  3730  // number of rows of report data to return.
  3731  func (c *AccountsReportsGenerateCall) MaxResults(maxResults int64) *AccountsReportsGenerateCall {
  3732  	c.urlParams_.Set("maxResults", fmt.Sprint(maxResults))
  3733  	return c
  3734  }
  3735  
  3736  // Metric sets the optional parameter "metric": Numeric columns to
  3737  // include in the report.
  3738  func (c *AccountsReportsGenerateCall) Metric(metric ...string) *AccountsReportsGenerateCall {
  3739  	c.urlParams_.SetMulti("metric", append([]string{}, metric...))
  3740  	return c
  3741  }
  3742  
  3743  // Sort sets the optional parameter "sort": The name of a dimension or
  3744  // metric to sort the resulting report on, optionally prefixed with "+"
  3745  // to sort ascending or "-" to sort descending. If no prefix is
  3746  // specified, the column is sorted ascending.
  3747  func (c *AccountsReportsGenerateCall) Sort(sort ...string) *AccountsReportsGenerateCall {
  3748  	c.urlParams_.SetMulti("sort", append([]string{}, sort...))
  3749  	return c
  3750  }
  3751  
  3752  // StartIndex sets the optional parameter "startIndex": Index of the
  3753  // first row of report data to return.
  3754  func (c *AccountsReportsGenerateCall) StartIndex(startIndex int64) *AccountsReportsGenerateCall {
  3755  	c.urlParams_.Set("startIndex", fmt.Sprint(startIndex))
  3756  	return c
  3757  }
  3758  
  3759  // UseTimezoneReporting sets the optional parameter
  3760  // "useTimezoneReporting": Whether the report should be generated in the
  3761  // AdSense account's local timezone. If false default PST/PDT timezone
  3762  // will be used.
  3763  func (c *AccountsReportsGenerateCall) UseTimezoneReporting(useTimezoneReporting bool) *AccountsReportsGenerateCall {
  3764  	c.urlParams_.Set("useTimezoneReporting", fmt.Sprint(useTimezoneReporting))
  3765  	return c
  3766  }
  3767  
  3768  // Fields allows partial responses to be retrieved. See
  3769  // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  3770  // for more information.
  3771  func (c *AccountsReportsGenerateCall) Fields(s ...googleapi.Field) *AccountsReportsGenerateCall {
  3772  	c.urlParams_.Set("fields", googleapi.CombineFields(s))
  3773  	return c
  3774  }
  3775  
  3776  // IfNoneMatch sets the optional parameter which makes the operation
  3777  // fail if the object's ETag matches the given value. This is useful for
  3778  // getting updates only after the object has changed since the last
  3779  // request. Use googleapi.IsNotModified to check whether the response
  3780  // error from Do is the result of In-None-Match.
  3781  func (c *AccountsReportsGenerateCall) IfNoneMatch(entityTag string) *AccountsReportsGenerateCall {
  3782  	c.ifNoneMatch_ = entityTag
  3783  	return c
  3784  }
  3785  
  3786  // Context sets the context to be used in this call's Do and Download
  3787  // methods. Any pending HTTP request will be aborted if the provided
  3788  // context is canceled.
  3789  func (c *AccountsReportsGenerateCall) Context(ctx context.Context) *AccountsReportsGenerateCall {
  3790  	c.ctx_ = ctx
  3791  	return c
  3792  }
  3793  
  3794  // Header returns an http.Header that can be modified by the caller to
  3795  // add HTTP headers to the request.
  3796  func (c *AccountsReportsGenerateCall) Header() http.Header {
  3797  	if c.header_ == nil {
  3798  		c.header_ = make(http.Header)
  3799  	}
  3800  	return c.header_
  3801  }
  3802  
  3803  func (c *AccountsReportsGenerateCall) doRequest(alt string) (*http.Response, error) {
  3804  	reqHeaders := make(http.Header)
  3805  	reqHeaders.Set("x-goog-api-client", "gl-go/1.13.7 gdcl/20200203")
  3806  	for k, v := range c.header_ {
  3807  		reqHeaders[k] = v
  3808  	}
  3809  	reqHeaders.Set("User-Agent", c.s.userAgent())
  3810  	if c.ifNoneMatch_ != "" {
  3811  		reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  3812  	}
  3813  	var body io.Reader = nil
  3814  	c.urlParams_.Set("alt", alt)
  3815  	c.urlParams_.Set("prettyPrint", "false")
  3816  	urls := googleapi.ResolveRelative(c.s.BasePath, "accounts/{accountId}/reports")
  3817  	urls += "?" + c.urlParams_.Encode()
  3818  	req, err := http.NewRequest("GET", urls, body)
  3819  	if err != nil {
  3820  		return nil, err
  3821  	}
  3822  	req.Header = reqHeaders
  3823  	googleapi.Expand(req.URL, map[string]string{
  3824  		"accountId": c.accountId,
  3825  	})
  3826  	return gensupport.SendRequest(c.ctx_, c.s.client, req)
  3827  }
  3828  
  3829  // Download fetches the API endpoint's "media" value, instead of the normal
  3830  // API response value. If the returned error is nil, the Response is guaranteed to
  3831  // have a 2xx status code. Callers must close the Response.Body as usual.
  3832  func (c *AccountsReportsGenerateCall) Download(opts ...googleapi.CallOption) (*http.Response, error) {
  3833  	gensupport.SetOptions(c.urlParams_, opts...)
  3834  	res, err := c.doRequest("media")
  3835  	if err != nil {
  3836  		return nil, err
  3837  	}
  3838  	if err := googleapi.CheckMediaResponse(res); err != nil {
  3839  		res.Body.Close()
  3840  		return nil, err
  3841  	}
  3842  	return res, nil
  3843  }
  3844  
  3845  // Do executes the "adsense.accounts.reports.generate" call.
  3846  // Exactly one of *AdsenseReportsGenerateResponse or error will be
  3847  // non-nil. Any non-2xx status code is an error. Response headers are in
  3848  // either *AdsenseReportsGenerateResponse.ServerResponse.Header or (if a
  3849  // response was returned at all) in error.(*googleapi.Error).Header. Use
  3850  // googleapi.IsNotModified to check whether the returned error was
  3851  // because http.StatusNotModified was returned.
  3852  func (c *AccountsReportsGenerateCall) Do(opts ...googleapi.CallOption) (*AdsenseReportsGenerateResponse, error) {
  3853  	gensupport.SetOptions(c.urlParams_, opts...)
  3854  	res, err := c.doRequest("json")
  3855  	if res != nil && res.StatusCode == http.StatusNotModified {
  3856  		if res.Body != nil {
  3857  			res.Body.Close()
  3858  		}
  3859  		return nil, &googleapi.Error{
  3860  			Code:   res.StatusCode,
  3861  			Header: res.Header,
  3862  		}
  3863  	}
  3864  	if err != nil {
  3865  		return nil, err
  3866  	}
  3867  	defer googleapi.CloseBody(res)
  3868  	if err := googleapi.CheckResponse(res); err != nil {
  3869  		return nil, err
  3870  	}
  3871  	ret := &AdsenseReportsGenerateResponse{
  3872  		ServerResponse: googleapi.ServerResponse{
  3873  			Header:         res.Header,
  3874  			HTTPStatusCode: res.StatusCode,
  3875  		},
  3876  	}
  3877  	target := &ret
  3878  	if err := gensupport.DecodeResponse(target, res); err != nil {
  3879  		return nil, err
  3880  	}
  3881  	return ret, nil
  3882  	// {
  3883  	//   "description": "Generate an AdSense report based on the report request sent in the query parameters. Returns the result as JSON; to retrieve output in CSV format specify \"alt=csv\" as a query parameter.",
  3884  	//   "httpMethod": "GET",
  3885  	//   "id": "adsense.accounts.reports.generate",
  3886  	//   "parameterOrder": [
  3887  	//     "accountId",
  3888  	//     "startDate",
  3889  	//     "endDate"
  3890  	//   ],
  3891  	//   "parameters": {
  3892  	//     "accountId": {
  3893  	//       "description": "Account upon which to report.",
  3894  	//       "location": "path",
  3895  	//       "required": true,
  3896  	//       "type": "string"
  3897  	//     },
  3898  	//     "currency": {
  3899  	//       "description": "Optional currency to use when reporting on monetary metrics. Defaults to the account's currency if not set.",
  3900  	//       "location": "query",
  3901  	//       "pattern": "[a-zA-Z]+",
  3902  	//       "type": "string"
  3903  	//     },
  3904  	//     "dimension": {
  3905  	//       "description": "Dimensions to base the report on.",
  3906  	//       "location": "query",
  3907  	//       "pattern": "[a-zA-Z_]+",
  3908  	//       "repeated": true,
  3909  	//       "type": "string"
  3910  	//     },
  3911  	//     "endDate": {
  3912  	//       "description": "End of the date range to report on in \"YYYY-MM-DD\" format, inclusive.",
  3913  	//       "location": "query",
  3914  	//       "pattern": "\\d{4}-\\d{2}-\\d{2}|(today|startOfMonth|startOfYear)(([\\-\\+]\\d+[dwmy]){0,3}?)",
  3915  	//       "required": true,
  3916  	//       "type": "string"
  3917  	//     },
  3918  	//     "filter": {
  3919  	//       "description": "Filters to be run on the report.",
  3920  	//       "location": "query",
  3921  	//       "pattern": "[a-zA-Z_]+(==|=@).+",
  3922  	//       "repeated": true,
  3923  	//       "type": "string"
  3924  	//     },
  3925  	//     "locale": {
  3926  	//       "description": "Optional locale to use for translating report output to a local language. Defaults to \"en_US\" if not specified.",
  3927  	//       "location": "query",
  3928  	//       "pattern": "[a-zA-Z_]+",
  3929  	//       "type": "string"
  3930  	//     },
  3931  	//     "maxResults": {
  3932  	//       "description": "The maximum number of rows of report data to return.",
  3933  	//       "format": "int32",
  3934  	//       "location": "query",
  3935  	//       "maximum": "50000",
  3936  	//       "minimum": "0",
  3937  	//       "type": "integer"
  3938  	//     },
  3939  	//     "metric": {
  3940  	//       "description": "Numeric columns to include in the report.",
  3941  	//       "location": "query",
  3942  	//       "pattern": "[a-zA-Z_]+",
  3943  	//       "repeated": true,
  3944  	//       "type": "string"
  3945  	//     },
  3946  	//     "sort": {
  3947  	//       "description": "The name of a dimension or metric to sort the resulting report on, optionally prefixed with \"+\" to sort ascending or \"-\" to sort descending. If no prefix is specified, the column is sorted ascending.",
  3948  	//       "location": "query",
  3949  	//       "pattern": "(\\+|-)?[a-zA-Z_]+",
  3950  	//       "repeated": true,
  3951  	//       "type": "string"
  3952  	//     },
  3953  	//     "startDate": {
  3954  	//       "description": "Start of the date range to report on in \"YYYY-MM-DD\" format, inclusive.",
  3955  	//       "location": "query",
  3956  	//       "pattern": "\\d{4}-\\d{2}-\\d{2}|(today|startOfMonth|startOfYear)(([\\-\\+]\\d+[dwmy]){0,3}?)",
  3957  	//       "required": true,
  3958  	//       "type": "string"
  3959  	//     },
  3960  	//     "startIndex": {
  3961  	//       "description": "Index of the first row of report data to return.",
  3962  	//       "format": "int32",
  3963  	//       "location": "query",
  3964  	//       "maximum": "5000",
  3965  	//       "minimum": "0",
  3966  	//       "type": "integer"
  3967  	//     },
  3968  	//     "useTimezoneReporting": {
  3969  	//       "description": "Whether the report should be generated in the AdSense account's local timezone. If false default PST/PDT timezone will be used.",
  3970  	//       "location": "query",
  3971  	//       "type": "boolean"
  3972  	//     }
  3973  	//   },
  3974  	//   "path": "accounts/{accountId}/reports",
  3975  	//   "response": {
  3976  	//     "$ref": "AdsenseReportsGenerateResponse"
  3977  	//   },
  3978  	//   "scopes": [
  3979  	//     "https://www.googleapis.com/auth/adsense",
  3980  	//     "https://www.googleapis.com/auth/adsense.readonly"
  3981  	//   ],
  3982  	//   "supportsMediaDownload": true
  3983  	// }
  3984  
  3985  }
  3986  
  3987  // method id "adsense.accounts.reports.saved.generate":
  3988  
  3989  type AccountsReportsSavedGenerateCall struct {
  3990  	s             *Service
  3991  	accountId     string
  3992  	savedReportId string
  3993  	urlParams_    gensupport.URLParams
  3994  	ifNoneMatch_  string
  3995  	ctx_          context.Context
  3996  	header_       http.Header
  3997  }
  3998  
  3999  // Generate: Generate an AdSense report based on the saved report ID
  4000  // sent in the query parameters.
  4001  func (r *AccountsReportsSavedService) Generate(accountId string, savedReportId string) *AccountsReportsSavedGenerateCall {
  4002  	c := &AccountsReportsSavedGenerateCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  4003  	c.accountId = accountId
  4004  	c.savedReportId = savedReportId
  4005  	return c
  4006  }
  4007  
  4008  // Locale sets the optional parameter "locale": Optional locale to use
  4009  // for translating report output to a local language. Defaults to
  4010  // "en_US" if not specified.
  4011  func (c *AccountsReportsSavedGenerateCall) Locale(locale string) *AccountsReportsSavedGenerateCall {
  4012  	c.urlParams_.Set("locale", locale)
  4013  	return c
  4014  }
  4015  
  4016  // MaxResults sets the optional parameter "maxResults": The maximum
  4017  // number of rows of report data to return.
  4018  func (c *AccountsReportsSavedGenerateCall) MaxResults(maxResults int64) *AccountsReportsSavedGenerateCall {
  4019  	c.urlParams_.Set("maxResults", fmt.Sprint(maxResults))
  4020  	return c
  4021  }
  4022  
  4023  // StartIndex sets the optional parameter "startIndex": Index of the
  4024  // first row of report data to return.
  4025  func (c *AccountsReportsSavedGenerateCall) StartIndex(startIndex int64) *AccountsReportsSavedGenerateCall {
  4026  	c.urlParams_.Set("startIndex", fmt.Sprint(startIndex))
  4027  	return c
  4028  }
  4029  
  4030  // Fields allows partial responses to be retrieved. See
  4031  // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  4032  // for more information.
  4033  func (c *AccountsReportsSavedGenerateCall) Fields(s ...googleapi.Field) *AccountsReportsSavedGenerateCall {
  4034  	c.urlParams_.Set("fields", googleapi.CombineFields(s))
  4035  	return c
  4036  }
  4037  
  4038  // IfNoneMatch sets the optional parameter which makes the operation
  4039  // fail if the object's ETag matches the given value. This is useful for
  4040  // getting updates only after the object has changed since the last
  4041  // request. Use googleapi.IsNotModified to check whether the response
  4042  // error from Do is the result of In-None-Match.
  4043  func (c *AccountsReportsSavedGenerateCall) IfNoneMatch(entityTag string) *AccountsReportsSavedGenerateCall {
  4044  	c.ifNoneMatch_ = entityTag
  4045  	return c
  4046  }
  4047  
  4048  // Context sets the context to be used in this call's Do method. Any
  4049  // pending HTTP request will be aborted if the provided context is
  4050  // canceled.
  4051  func (c *AccountsReportsSavedGenerateCall) Context(ctx context.Context) *AccountsReportsSavedGenerateCall {
  4052  	c.ctx_ = ctx
  4053  	return c
  4054  }
  4055  
  4056  // Header returns an http.Header that can be modified by the caller to
  4057  // add HTTP headers to the request.
  4058  func (c *AccountsReportsSavedGenerateCall) Header() http.Header {
  4059  	if c.header_ == nil {
  4060  		c.header_ = make(http.Header)
  4061  	}
  4062  	return c.header_
  4063  }
  4064  
  4065  func (c *AccountsReportsSavedGenerateCall) doRequest(alt string) (*http.Response, error) {
  4066  	reqHeaders := make(http.Header)
  4067  	reqHeaders.Set("x-goog-api-client", "gl-go/1.13.7 gdcl/20200203")
  4068  	for k, v := range c.header_ {
  4069  		reqHeaders[k] = v
  4070  	}
  4071  	reqHeaders.Set("User-Agent", c.s.userAgent())
  4072  	if c.ifNoneMatch_ != "" {
  4073  		reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  4074  	}
  4075  	var body io.Reader = nil
  4076  	c.urlParams_.Set("alt", alt)
  4077  	c.urlParams_.Set("prettyPrint", "false")
  4078  	urls := googleapi.ResolveRelative(c.s.BasePath, "accounts/{accountId}/reports/{savedReportId}")
  4079  	urls += "?" + c.urlParams_.Encode()
  4080  	req, err := http.NewRequest("GET", urls, body)
  4081  	if err != nil {
  4082  		return nil, err
  4083  	}
  4084  	req.Header = reqHeaders
  4085  	googleapi.Expand(req.URL, map[string]string{
  4086  		"accountId":     c.accountId,
  4087  		"savedReportId": c.savedReportId,
  4088  	})
  4089  	return gensupport.SendRequest(c.ctx_, c.s.client, req)
  4090  }
  4091  
  4092  // Do executes the "adsense.accounts.reports.saved.generate" call.
  4093  // Exactly one of *AdsenseReportsGenerateResponse or error will be
  4094  // non-nil. Any non-2xx status code is an error. Response headers are in
  4095  // either *AdsenseReportsGenerateResponse.ServerResponse.Header or (if a
  4096  // response was returned at all) in error.(*googleapi.Error).Header. Use
  4097  // googleapi.IsNotModified to check whether the returned error was
  4098  // because http.StatusNotModified was returned.
  4099  func (c *AccountsReportsSavedGenerateCall) Do(opts ...googleapi.CallOption) (*AdsenseReportsGenerateResponse, error) {
  4100  	gensupport.SetOptions(c.urlParams_, opts...)
  4101  	res, err := c.doRequest("json")
  4102  	if res != nil && res.StatusCode == http.StatusNotModified {
  4103  		if res.Body != nil {
  4104  			res.Body.Close()
  4105  		}
  4106  		return nil, &googleapi.Error{
  4107  			Code:   res.StatusCode,
  4108  			Header: res.Header,
  4109  		}
  4110  	}
  4111  	if err != nil {
  4112  		return nil, err
  4113  	}
  4114  	defer googleapi.CloseBody(res)
  4115  	if err := googleapi.CheckResponse(res); err != nil {
  4116  		return nil, err
  4117  	}
  4118  	ret := &AdsenseReportsGenerateResponse{
  4119  		ServerResponse: googleapi.ServerResponse{
  4120  			Header:         res.Header,
  4121  			HTTPStatusCode: res.StatusCode,
  4122  		},
  4123  	}
  4124  	target := &ret
  4125  	if err := gensupport.DecodeResponse(target, res); err != nil {
  4126  		return nil, err
  4127  	}
  4128  	return ret, nil
  4129  	// {
  4130  	//   "description": "Generate an AdSense report based on the saved report ID sent in the query parameters.",
  4131  	//   "httpMethod": "GET",
  4132  	//   "id": "adsense.accounts.reports.saved.generate",
  4133  	//   "parameterOrder": [
  4134  	//     "accountId",
  4135  	//     "savedReportId"
  4136  	//   ],
  4137  	//   "parameters": {
  4138  	//     "accountId": {
  4139  	//       "description": "Account to which the saved reports belong.",
  4140  	//       "location": "path",
  4141  	//       "required": true,
  4142  	//       "type": "string"
  4143  	//     },
  4144  	//     "locale": {
  4145  	//       "description": "Optional locale to use for translating report output to a local language. Defaults to \"en_US\" if not specified.",
  4146  	//       "location": "query",
  4147  	//       "pattern": "[a-zA-Z_]+",
  4148  	//       "type": "string"
  4149  	//     },
  4150  	//     "maxResults": {
  4151  	//       "description": "The maximum number of rows of report data to return.",
  4152  	//       "format": "int32",
  4153  	//       "location": "query",
  4154  	//       "maximum": "50000",
  4155  	//       "minimum": "0",
  4156  	//       "type": "integer"
  4157  	//     },
  4158  	//     "savedReportId": {
  4159  	//       "description": "The saved report to retrieve.",
  4160  	//       "location": "path",
  4161  	//       "required": true,
  4162  	//       "type": "string"
  4163  	//     },
  4164  	//     "startIndex": {
  4165  	//       "description": "Index of the first row of report data to return.",
  4166  	//       "format": "int32",
  4167  	//       "location": "query",
  4168  	//       "maximum": "5000",
  4169  	//       "minimum": "0",
  4170  	//       "type": "integer"
  4171  	//     }
  4172  	//   },
  4173  	//   "path": "accounts/{accountId}/reports/{savedReportId}",
  4174  	//   "response": {
  4175  	//     "$ref": "AdsenseReportsGenerateResponse"
  4176  	//   },
  4177  	//   "scopes": [
  4178  	//     "https://www.googleapis.com/auth/adsense",
  4179  	//     "https://www.googleapis.com/auth/adsense.readonly"
  4180  	//   ]
  4181  	// }
  4182  
  4183  }
  4184  
  4185  // method id "adsense.accounts.reports.saved.list":
  4186  
  4187  type AccountsReportsSavedListCall struct {
  4188  	s            *Service
  4189  	accountId    string
  4190  	urlParams_   gensupport.URLParams
  4191  	ifNoneMatch_ string
  4192  	ctx_         context.Context
  4193  	header_      http.Header
  4194  }
  4195  
  4196  // List: List all saved reports in the specified AdSense account.
  4197  func (r *AccountsReportsSavedService) List(accountId string) *AccountsReportsSavedListCall {
  4198  	c := &AccountsReportsSavedListCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  4199  	c.accountId = accountId
  4200  	return c
  4201  }
  4202  
  4203  // MaxResults sets the optional parameter "maxResults": The maximum
  4204  // number of saved reports to include in the response, used for paging.
  4205  func (c *AccountsReportsSavedListCall) MaxResults(maxResults int64) *AccountsReportsSavedListCall {
  4206  	c.urlParams_.Set("maxResults", fmt.Sprint(maxResults))
  4207  	return c
  4208  }
  4209  
  4210  // PageToken sets the optional parameter "pageToken": A continuation
  4211  // token, used to page through saved reports. To retrieve the next page,
  4212  // set this parameter to the value of "nextPageToken" from the previous
  4213  // response.
  4214  func (c *AccountsReportsSavedListCall) PageToken(pageToken string) *AccountsReportsSavedListCall {
  4215  	c.urlParams_.Set("pageToken", pageToken)
  4216  	return c
  4217  }
  4218  
  4219  // Fields allows partial responses to be retrieved. See
  4220  // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  4221  // for more information.
  4222  func (c *AccountsReportsSavedListCall) Fields(s ...googleapi.Field) *AccountsReportsSavedListCall {
  4223  	c.urlParams_.Set("fields", googleapi.CombineFields(s))
  4224  	return c
  4225  }
  4226  
  4227  // IfNoneMatch sets the optional parameter which makes the operation
  4228  // fail if the object's ETag matches the given value. This is useful for
  4229  // getting updates only after the object has changed since the last
  4230  // request. Use googleapi.IsNotModified to check whether the response
  4231  // error from Do is the result of In-None-Match.
  4232  func (c *AccountsReportsSavedListCall) IfNoneMatch(entityTag string) *AccountsReportsSavedListCall {
  4233  	c.ifNoneMatch_ = entityTag
  4234  	return c
  4235  }
  4236  
  4237  // Context sets the context to be used in this call's Do method. Any
  4238  // pending HTTP request will be aborted if the provided context is
  4239  // canceled.
  4240  func (c *AccountsReportsSavedListCall) Context(ctx context.Context) *AccountsReportsSavedListCall {
  4241  	c.ctx_ = ctx
  4242  	return c
  4243  }
  4244  
  4245  // Header returns an http.Header that can be modified by the caller to
  4246  // add HTTP headers to the request.
  4247  func (c *AccountsReportsSavedListCall) Header() http.Header {
  4248  	if c.header_ == nil {
  4249  		c.header_ = make(http.Header)
  4250  	}
  4251  	return c.header_
  4252  }
  4253  
  4254  func (c *AccountsReportsSavedListCall) doRequest(alt string) (*http.Response, error) {
  4255  	reqHeaders := make(http.Header)
  4256  	reqHeaders.Set("x-goog-api-client", "gl-go/1.13.7 gdcl/20200203")
  4257  	for k, v := range c.header_ {
  4258  		reqHeaders[k] = v
  4259  	}
  4260  	reqHeaders.Set("User-Agent", c.s.userAgent())
  4261  	if c.ifNoneMatch_ != "" {
  4262  		reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  4263  	}
  4264  	var body io.Reader = nil
  4265  	c.urlParams_.Set("alt", alt)
  4266  	c.urlParams_.Set("prettyPrint", "false")
  4267  	urls := googleapi.ResolveRelative(c.s.BasePath, "accounts/{accountId}/reports/saved")
  4268  	urls += "?" + c.urlParams_.Encode()
  4269  	req, err := http.NewRequest("GET", urls, body)
  4270  	if err != nil {
  4271  		return nil, err
  4272  	}
  4273  	req.Header = reqHeaders
  4274  	googleapi.Expand(req.URL, map[string]string{
  4275  		"accountId": c.accountId,
  4276  	})
  4277  	return gensupport.SendRequest(c.ctx_, c.s.client, req)
  4278  }
  4279  
  4280  // Do executes the "adsense.accounts.reports.saved.list" call.
  4281  // Exactly one of *SavedReports or error will be non-nil. Any non-2xx
  4282  // status code is an error. Response headers are in either
  4283  // *SavedReports.ServerResponse.Header or (if a response was returned at
  4284  // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  4285  // to check whether the returned error was because
  4286  // http.StatusNotModified was returned.
  4287  func (c *AccountsReportsSavedListCall) Do(opts ...googleapi.CallOption) (*SavedReports, error) {
  4288  	gensupport.SetOptions(c.urlParams_, opts...)
  4289  	res, err := c.doRequest("json")
  4290  	if res != nil && res.StatusCode == http.StatusNotModified {
  4291  		if res.Body != nil {
  4292  			res.Body.Close()
  4293  		}
  4294  		return nil, &googleapi.Error{
  4295  			Code:   res.StatusCode,
  4296  			Header: res.Header,
  4297  		}
  4298  	}
  4299  	if err != nil {
  4300  		return nil, err
  4301  	}
  4302  	defer googleapi.CloseBody(res)
  4303  	if err := googleapi.CheckResponse(res); err != nil {
  4304  		return nil, err
  4305  	}
  4306  	ret := &SavedReports{
  4307  		ServerResponse: googleapi.ServerResponse{
  4308  			Header:         res.Header,
  4309  			HTTPStatusCode: res.StatusCode,
  4310  		},
  4311  	}
  4312  	target := &ret
  4313  	if err := gensupport.DecodeResponse(target, res); err != nil {
  4314  		return nil, err
  4315  	}
  4316  	return ret, nil
  4317  	// {
  4318  	//   "description": "List all saved reports in the specified AdSense account.",
  4319  	//   "httpMethod": "GET",
  4320  	//   "id": "adsense.accounts.reports.saved.list",
  4321  	//   "parameterOrder": [
  4322  	//     "accountId"
  4323  	//   ],
  4324  	//   "parameters": {
  4325  	//     "accountId": {
  4326  	//       "description": "Account to which the saved reports belong.",
  4327  	//       "location": "path",
  4328  	//       "required": true,
  4329  	//       "type": "string"
  4330  	//     },
  4331  	//     "maxResults": {
  4332  	//       "description": "The maximum number of saved reports to include in the response, used for paging.",
  4333  	//       "format": "int32",
  4334  	//       "location": "query",
  4335  	//       "maximum": "100",
  4336  	//       "minimum": "0",
  4337  	//       "type": "integer"
  4338  	//     },
  4339  	//     "pageToken": {
  4340  	//       "description": "A continuation token, used to page through saved reports. To retrieve the next page, set this parameter to the value of \"nextPageToken\" from the previous response.",
  4341  	//       "location": "query",
  4342  	//       "type": "string"
  4343  	//     }
  4344  	//   },
  4345  	//   "path": "accounts/{accountId}/reports/saved",
  4346  	//   "response": {
  4347  	//     "$ref": "SavedReports"
  4348  	//   },
  4349  	//   "scopes": [
  4350  	//     "https://www.googleapis.com/auth/adsense",
  4351  	//     "https://www.googleapis.com/auth/adsense.readonly"
  4352  	//   ]
  4353  	// }
  4354  
  4355  }
  4356  
  4357  // Pages invokes f for each page of results.
  4358  // A non-nil error returned from f will halt the iteration.
  4359  // The provided context supersedes any context provided to the Context method.
  4360  func (c *AccountsReportsSavedListCall) Pages(ctx context.Context, f func(*SavedReports) error) error {
  4361  	c.ctx_ = ctx
  4362  	defer c.PageToken(c.urlParams_.Get("pageToken")) // reset paging to original point
  4363  	for {
  4364  		x, err := c.Do()
  4365  		if err != nil {
  4366  			return err
  4367  		}
  4368  		if err := f(x); err != nil {
  4369  			return err
  4370  		}
  4371  		if x.NextPageToken == "" {
  4372  			return nil
  4373  		}
  4374  		c.PageToken(x.NextPageToken)
  4375  	}
  4376  }
  4377  
  4378  // method id "adsense.accounts.savedadstyles.get":
  4379  
  4380  type AccountsSavedadstylesGetCall struct {
  4381  	s              *Service
  4382  	accountId      string
  4383  	savedAdStyleId string
  4384  	urlParams_     gensupport.URLParams
  4385  	ifNoneMatch_   string
  4386  	ctx_           context.Context
  4387  	header_        http.Header
  4388  }
  4389  
  4390  // Get: List a specific saved ad style for the specified account.
  4391  func (r *AccountsSavedadstylesService) Get(accountId string, savedAdStyleId string) *AccountsSavedadstylesGetCall {
  4392  	c := &AccountsSavedadstylesGetCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  4393  	c.accountId = accountId
  4394  	c.savedAdStyleId = savedAdStyleId
  4395  	return c
  4396  }
  4397  
  4398  // Fields allows partial responses to be retrieved. See
  4399  // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  4400  // for more information.
  4401  func (c *AccountsSavedadstylesGetCall) Fields(s ...googleapi.Field) *AccountsSavedadstylesGetCall {
  4402  	c.urlParams_.Set("fields", googleapi.CombineFields(s))
  4403  	return c
  4404  }
  4405  
  4406  // IfNoneMatch sets the optional parameter which makes the operation
  4407  // fail if the object's ETag matches the given value. This is useful for
  4408  // getting updates only after the object has changed since the last
  4409  // request. Use googleapi.IsNotModified to check whether the response
  4410  // error from Do is the result of In-None-Match.
  4411  func (c *AccountsSavedadstylesGetCall) IfNoneMatch(entityTag string) *AccountsSavedadstylesGetCall {
  4412  	c.ifNoneMatch_ = entityTag
  4413  	return c
  4414  }
  4415  
  4416  // Context sets the context to be used in this call's Do method. Any
  4417  // pending HTTP request will be aborted if the provided context is
  4418  // canceled.
  4419  func (c *AccountsSavedadstylesGetCall) Context(ctx context.Context) *AccountsSavedadstylesGetCall {
  4420  	c.ctx_ = ctx
  4421  	return c
  4422  }
  4423  
  4424  // Header returns an http.Header that can be modified by the caller to
  4425  // add HTTP headers to the request.
  4426  func (c *AccountsSavedadstylesGetCall) Header() http.Header {
  4427  	if c.header_ == nil {
  4428  		c.header_ = make(http.Header)
  4429  	}
  4430  	return c.header_
  4431  }
  4432  
  4433  func (c *AccountsSavedadstylesGetCall) doRequest(alt string) (*http.Response, error) {
  4434  	reqHeaders := make(http.Header)
  4435  	reqHeaders.Set("x-goog-api-client", "gl-go/1.13.7 gdcl/20200203")
  4436  	for k, v := range c.header_ {
  4437  		reqHeaders[k] = v
  4438  	}
  4439  	reqHeaders.Set("User-Agent", c.s.userAgent())
  4440  	if c.ifNoneMatch_ != "" {
  4441  		reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  4442  	}
  4443  	var body io.Reader = nil
  4444  	c.urlParams_.Set("alt", alt)
  4445  	c.urlParams_.Set("prettyPrint", "false")
  4446  	urls := googleapi.ResolveRelative(c.s.BasePath, "accounts/{accountId}/savedadstyles/{savedAdStyleId}")
  4447  	urls += "?" + c.urlParams_.Encode()
  4448  	req, err := http.NewRequest("GET", urls, body)
  4449  	if err != nil {
  4450  		return nil, err
  4451  	}
  4452  	req.Header = reqHeaders
  4453  	googleapi.Expand(req.URL, map[string]string{
  4454  		"accountId":      c.accountId,
  4455  		"savedAdStyleId": c.savedAdStyleId,
  4456  	})
  4457  	return gensupport.SendRequest(c.ctx_, c.s.client, req)
  4458  }
  4459  
  4460  // Do executes the "adsense.accounts.savedadstyles.get" call.
  4461  // Exactly one of *SavedAdStyle or error will be non-nil. Any non-2xx
  4462  // status code is an error. Response headers are in either
  4463  // *SavedAdStyle.ServerResponse.Header or (if a response was returned at
  4464  // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  4465  // to check whether the returned error was because
  4466  // http.StatusNotModified was returned.
  4467  func (c *AccountsSavedadstylesGetCall) Do(opts ...googleapi.CallOption) (*SavedAdStyle, error) {
  4468  	gensupport.SetOptions(c.urlParams_, opts...)
  4469  	res, err := c.doRequest("json")
  4470  	if res != nil && res.StatusCode == http.StatusNotModified {
  4471  		if res.Body != nil {
  4472  			res.Body.Close()
  4473  		}
  4474  		return nil, &googleapi.Error{
  4475  			Code:   res.StatusCode,
  4476  			Header: res.Header,
  4477  		}
  4478  	}
  4479  	if err != nil {
  4480  		return nil, err
  4481  	}
  4482  	defer googleapi.CloseBody(res)
  4483  	if err := googleapi.CheckResponse(res); err != nil {
  4484  		return nil, err
  4485  	}
  4486  	ret := &SavedAdStyle{
  4487  		ServerResponse: googleapi.ServerResponse{
  4488  			Header:         res.Header,
  4489  			HTTPStatusCode: res.StatusCode,
  4490  		},
  4491  	}
  4492  	target := &ret
  4493  	if err := gensupport.DecodeResponse(target, res); err != nil {
  4494  		return nil, err
  4495  	}
  4496  	return ret, nil
  4497  	// {
  4498  	//   "description": "List a specific saved ad style for the specified account.",
  4499  	//   "httpMethod": "GET",
  4500  	//   "id": "adsense.accounts.savedadstyles.get",
  4501  	//   "parameterOrder": [
  4502  	//     "accountId",
  4503  	//     "savedAdStyleId"
  4504  	//   ],
  4505  	//   "parameters": {
  4506  	//     "accountId": {
  4507  	//       "description": "Account for which to get the saved ad style.",
  4508  	//       "location": "path",
  4509  	//       "required": true,
  4510  	//       "type": "string"
  4511  	//     },
  4512  	//     "savedAdStyleId": {
  4513  	//       "description": "Saved ad style to retrieve.",
  4514  	//       "location": "path",
  4515  	//       "required": true,
  4516  	//       "type": "string"
  4517  	//     }
  4518  	//   },
  4519  	//   "path": "accounts/{accountId}/savedadstyles/{savedAdStyleId}",
  4520  	//   "response": {
  4521  	//     "$ref": "SavedAdStyle"
  4522  	//   },
  4523  	//   "scopes": [
  4524  	//     "https://www.googleapis.com/auth/adsense",
  4525  	//     "https://www.googleapis.com/auth/adsense.readonly"
  4526  	//   ]
  4527  	// }
  4528  
  4529  }
  4530  
  4531  // method id "adsense.accounts.savedadstyles.list":
  4532  
  4533  type AccountsSavedadstylesListCall struct {
  4534  	s            *Service
  4535  	accountId    string
  4536  	urlParams_   gensupport.URLParams
  4537  	ifNoneMatch_ string
  4538  	ctx_         context.Context
  4539  	header_      http.Header
  4540  }
  4541  
  4542  // List: List all saved ad styles in the specified account.
  4543  func (r *AccountsSavedadstylesService) List(accountId string) *AccountsSavedadstylesListCall {
  4544  	c := &AccountsSavedadstylesListCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  4545  	c.accountId = accountId
  4546  	return c
  4547  }
  4548  
  4549  // MaxResults sets the optional parameter "maxResults": The maximum
  4550  // number of saved ad styles to include in the response, used for
  4551  // paging.
  4552  func (c *AccountsSavedadstylesListCall) MaxResults(maxResults int64) *AccountsSavedadstylesListCall {
  4553  	c.urlParams_.Set("maxResults", fmt.Sprint(maxResults))
  4554  	return c
  4555  }
  4556  
  4557  // PageToken sets the optional parameter "pageToken": A continuation
  4558  // token, used to page through saved ad styles. To retrieve the next
  4559  // page, set this parameter to the value of "nextPageToken" from the
  4560  // previous response.
  4561  func (c *AccountsSavedadstylesListCall) PageToken(pageToken string) *AccountsSavedadstylesListCall {
  4562  	c.urlParams_.Set("pageToken", pageToken)
  4563  	return c
  4564  }
  4565  
  4566  // Fields allows partial responses to be retrieved. See
  4567  // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  4568  // for more information.
  4569  func (c *AccountsSavedadstylesListCall) Fields(s ...googleapi.Field) *AccountsSavedadstylesListCall {
  4570  	c.urlParams_.Set("fields", googleapi.CombineFields(s))
  4571  	return c
  4572  }
  4573  
  4574  // IfNoneMatch sets the optional parameter which makes the operation
  4575  // fail if the object's ETag matches the given value. This is useful for
  4576  // getting updates only after the object has changed since the last
  4577  // request. Use googleapi.IsNotModified to check whether the response
  4578  // error from Do is the result of In-None-Match.
  4579  func (c *AccountsSavedadstylesListCall) IfNoneMatch(entityTag string) *AccountsSavedadstylesListCall {
  4580  	c.ifNoneMatch_ = entityTag
  4581  	return c
  4582  }
  4583  
  4584  // Context sets the context to be used in this call's Do method. Any
  4585  // pending HTTP request will be aborted if the provided context is
  4586  // canceled.
  4587  func (c *AccountsSavedadstylesListCall) Context(ctx context.Context) *AccountsSavedadstylesListCall {
  4588  	c.ctx_ = ctx
  4589  	return c
  4590  }
  4591  
  4592  // Header returns an http.Header that can be modified by the caller to
  4593  // add HTTP headers to the request.
  4594  func (c *AccountsSavedadstylesListCall) Header() http.Header {
  4595  	if c.header_ == nil {
  4596  		c.header_ = make(http.Header)
  4597  	}
  4598  	return c.header_
  4599  }
  4600  
  4601  func (c *AccountsSavedadstylesListCall) doRequest(alt string) (*http.Response, error) {
  4602  	reqHeaders := make(http.Header)
  4603  	reqHeaders.Set("x-goog-api-client", "gl-go/1.13.7 gdcl/20200203")
  4604  	for k, v := range c.header_ {
  4605  		reqHeaders[k] = v
  4606  	}
  4607  	reqHeaders.Set("User-Agent", c.s.userAgent())
  4608  	if c.ifNoneMatch_ != "" {
  4609  		reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  4610  	}
  4611  	var body io.Reader = nil
  4612  	c.urlParams_.Set("alt", alt)
  4613  	c.urlParams_.Set("prettyPrint", "false")
  4614  	urls := googleapi.ResolveRelative(c.s.BasePath, "accounts/{accountId}/savedadstyles")
  4615  	urls += "?" + c.urlParams_.Encode()
  4616  	req, err := http.NewRequest("GET", urls, body)
  4617  	if err != nil {
  4618  		return nil, err
  4619  	}
  4620  	req.Header = reqHeaders
  4621  	googleapi.Expand(req.URL, map[string]string{
  4622  		"accountId": c.accountId,
  4623  	})
  4624  	return gensupport.SendRequest(c.ctx_, c.s.client, req)
  4625  }
  4626  
  4627  // Do executes the "adsense.accounts.savedadstyles.list" call.
  4628  // Exactly one of *SavedAdStyles or error will be non-nil. Any non-2xx
  4629  // status code is an error. Response headers are in either
  4630  // *SavedAdStyles.ServerResponse.Header or (if a response was returned
  4631  // at all) in error.(*googleapi.Error).Header. Use
  4632  // googleapi.IsNotModified to check whether the returned error was
  4633  // because http.StatusNotModified was returned.
  4634  func (c *AccountsSavedadstylesListCall) Do(opts ...googleapi.CallOption) (*SavedAdStyles, error) {
  4635  	gensupport.SetOptions(c.urlParams_, opts...)
  4636  	res, err := c.doRequest("json")
  4637  	if res != nil && res.StatusCode == http.StatusNotModified {
  4638  		if res.Body != nil {
  4639  			res.Body.Close()
  4640  		}
  4641  		return nil, &googleapi.Error{
  4642  			Code:   res.StatusCode,
  4643  			Header: res.Header,
  4644  		}
  4645  	}
  4646  	if err != nil {
  4647  		return nil, err
  4648  	}
  4649  	defer googleapi.CloseBody(res)
  4650  	if err := googleapi.CheckResponse(res); err != nil {
  4651  		return nil, err
  4652  	}
  4653  	ret := &SavedAdStyles{
  4654  		ServerResponse: googleapi.ServerResponse{
  4655  			Header:         res.Header,
  4656  			HTTPStatusCode: res.StatusCode,
  4657  		},
  4658  	}
  4659  	target := &ret
  4660  	if err := gensupport.DecodeResponse(target, res); err != nil {
  4661  		return nil, err
  4662  	}
  4663  	return ret, nil
  4664  	// {
  4665  	//   "description": "List all saved ad styles in the specified account.",
  4666  	//   "httpMethod": "GET",
  4667  	//   "id": "adsense.accounts.savedadstyles.list",
  4668  	//   "parameterOrder": [
  4669  	//     "accountId"
  4670  	//   ],
  4671  	//   "parameters": {
  4672  	//     "accountId": {
  4673  	//       "description": "Account for which to list saved ad styles.",
  4674  	//       "location": "path",
  4675  	//       "required": true,
  4676  	//       "type": "string"
  4677  	//     },
  4678  	//     "maxResults": {
  4679  	//       "description": "The maximum number of saved ad styles to include in the response, used for paging.",
  4680  	//       "format": "int32",
  4681  	//       "location": "query",
  4682  	//       "maximum": "10000",
  4683  	//       "minimum": "0",
  4684  	//       "type": "integer"
  4685  	//     },
  4686  	//     "pageToken": {
  4687  	//       "description": "A continuation token, used to page through saved ad styles. To retrieve the next page, set this parameter to the value of \"nextPageToken\" from the previous response.",
  4688  	//       "location": "query",
  4689  	//       "type": "string"
  4690  	//     }
  4691  	//   },
  4692  	//   "path": "accounts/{accountId}/savedadstyles",
  4693  	//   "response": {
  4694  	//     "$ref": "SavedAdStyles"
  4695  	//   },
  4696  	//   "scopes": [
  4697  	//     "https://www.googleapis.com/auth/adsense",
  4698  	//     "https://www.googleapis.com/auth/adsense.readonly"
  4699  	//   ]
  4700  	// }
  4701  
  4702  }
  4703  
  4704  // Pages invokes f for each page of results.
  4705  // A non-nil error returned from f will halt the iteration.
  4706  // The provided context supersedes any context provided to the Context method.
  4707  func (c *AccountsSavedadstylesListCall) Pages(ctx context.Context, f func(*SavedAdStyles) error) error {
  4708  	c.ctx_ = ctx
  4709  	defer c.PageToken(c.urlParams_.Get("pageToken")) // reset paging to original point
  4710  	for {
  4711  		x, err := c.Do()
  4712  		if err != nil {
  4713  			return err
  4714  		}
  4715  		if err := f(x); err != nil {
  4716  			return err
  4717  		}
  4718  		if x.NextPageToken == "" {
  4719  			return nil
  4720  		}
  4721  		c.PageToken(x.NextPageToken)
  4722  	}
  4723  }
  4724  
  4725  // method id "adsense.accounts.urlchannels.list":
  4726  
  4727  type AccountsUrlchannelsListCall struct {
  4728  	s            *Service
  4729  	accountId    string
  4730  	adClientId   string
  4731  	urlParams_   gensupport.URLParams
  4732  	ifNoneMatch_ string
  4733  	ctx_         context.Context
  4734  	header_      http.Header
  4735  }
  4736  
  4737  // List: List all URL channels in the specified ad client for the
  4738  // specified account.
  4739  func (r *AccountsUrlchannelsService) List(accountId string, adClientId string) *AccountsUrlchannelsListCall {
  4740  	c := &AccountsUrlchannelsListCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  4741  	c.accountId = accountId
  4742  	c.adClientId = adClientId
  4743  	return c
  4744  }
  4745  
  4746  // MaxResults sets the optional parameter "maxResults": The maximum
  4747  // number of URL channels to include in the response, used for paging.
  4748  func (c *AccountsUrlchannelsListCall) MaxResults(maxResults int64) *AccountsUrlchannelsListCall {
  4749  	c.urlParams_.Set("maxResults", fmt.Sprint(maxResults))
  4750  	return c
  4751  }
  4752  
  4753  // PageToken sets the optional parameter "pageToken": A continuation
  4754  // token, used to page through URL channels. To retrieve the next page,
  4755  // set this parameter to the value of "nextPageToken" from the previous
  4756  // response.
  4757  func (c *AccountsUrlchannelsListCall) PageToken(pageToken string) *AccountsUrlchannelsListCall {
  4758  	c.urlParams_.Set("pageToken", pageToken)
  4759  	return c
  4760  }
  4761  
  4762  // Fields allows partial responses to be retrieved. See
  4763  // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  4764  // for more information.
  4765  func (c *AccountsUrlchannelsListCall) Fields(s ...googleapi.Field) *AccountsUrlchannelsListCall {
  4766  	c.urlParams_.Set("fields", googleapi.CombineFields(s))
  4767  	return c
  4768  }
  4769  
  4770  // IfNoneMatch sets the optional parameter which makes the operation
  4771  // fail if the object's ETag matches the given value. This is useful for
  4772  // getting updates only after the object has changed since the last
  4773  // request. Use googleapi.IsNotModified to check whether the response
  4774  // error from Do is the result of In-None-Match.
  4775  func (c *AccountsUrlchannelsListCall) IfNoneMatch(entityTag string) *AccountsUrlchannelsListCall {
  4776  	c.ifNoneMatch_ = entityTag
  4777  	return c
  4778  }
  4779  
  4780  // Context sets the context to be used in this call's Do method. Any
  4781  // pending HTTP request will be aborted if the provided context is
  4782  // canceled.
  4783  func (c *AccountsUrlchannelsListCall) Context(ctx context.Context) *AccountsUrlchannelsListCall {
  4784  	c.ctx_ = ctx
  4785  	return c
  4786  }
  4787  
  4788  // Header returns an http.Header that can be modified by the caller to
  4789  // add HTTP headers to the request.
  4790  func (c *AccountsUrlchannelsListCall) Header() http.Header {
  4791  	if c.header_ == nil {
  4792  		c.header_ = make(http.Header)
  4793  	}
  4794  	return c.header_
  4795  }
  4796  
  4797  func (c *AccountsUrlchannelsListCall) doRequest(alt string) (*http.Response, error) {
  4798  	reqHeaders := make(http.Header)
  4799  	reqHeaders.Set("x-goog-api-client", "gl-go/1.13.7 gdcl/20200203")
  4800  	for k, v := range c.header_ {
  4801  		reqHeaders[k] = v
  4802  	}
  4803  	reqHeaders.Set("User-Agent", c.s.userAgent())
  4804  	if c.ifNoneMatch_ != "" {
  4805  		reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  4806  	}
  4807  	var body io.Reader = nil
  4808  	c.urlParams_.Set("alt", alt)
  4809  	c.urlParams_.Set("prettyPrint", "false")
  4810  	urls := googleapi.ResolveRelative(c.s.BasePath, "accounts/{accountId}/adclients/{adClientId}/urlchannels")
  4811  	urls += "?" + c.urlParams_.Encode()
  4812  	req, err := http.NewRequest("GET", urls, body)
  4813  	if err != nil {
  4814  		return nil, err
  4815  	}
  4816  	req.Header = reqHeaders
  4817  	googleapi.Expand(req.URL, map[string]string{
  4818  		"accountId":  c.accountId,
  4819  		"adClientId": c.adClientId,
  4820  	})
  4821  	return gensupport.SendRequest(c.ctx_, c.s.client, req)
  4822  }
  4823  
  4824  // Do executes the "adsense.accounts.urlchannels.list" call.
  4825  // Exactly one of *UrlChannels or error will be non-nil. Any non-2xx
  4826  // status code is an error. Response headers are in either
  4827  // *UrlChannels.ServerResponse.Header or (if a response was returned at
  4828  // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  4829  // to check whether the returned error was because
  4830  // http.StatusNotModified was returned.
  4831  func (c *AccountsUrlchannelsListCall) Do(opts ...googleapi.CallOption) (*UrlChannels, error) {
  4832  	gensupport.SetOptions(c.urlParams_, opts...)
  4833  	res, err := c.doRequest("json")
  4834  	if res != nil && res.StatusCode == http.StatusNotModified {
  4835  		if res.Body != nil {
  4836  			res.Body.Close()
  4837  		}
  4838  		return nil, &googleapi.Error{
  4839  			Code:   res.StatusCode,
  4840  			Header: res.Header,
  4841  		}
  4842  	}
  4843  	if err != nil {
  4844  		return nil, err
  4845  	}
  4846  	defer googleapi.CloseBody(res)
  4847  	if err := googleapi.CheckResponse(res); err != nil {
  4848  		return nil, err
  4849  	}
  4850  	ret := &UrlChannels{
  4851  		ServerResponse: googleapi.ServerResponse{
  4852  			Header:         res.Header,
  4853  			HTTPStatusCode: res.StatusCode,
  4854  		},
  4855  	}
  4856  	target := &ret
  4857  	if err := gensupport.DecodeResponse(target, res); err != nil {
  4858  		return nil, err
  4859  	}
  4860  	return ret, nil
  4861  	// {
  4862  	//   "description": "List all URL channels in the specified ad client for the specified account.",
  4863  	//   "httpMethod": "GET",
  4864  	//   "id": "adsense.accounts.urlchannels.list",
  4865  	//   "parameterOrder": [
  4866  	//     "accountId",
  4867  	//     "adClientId"
  4868  	//   ],
  4869  	//   "parameters": {
  4870  	//     "accountId": {
  4871  	//       "description": "Account to which the ad client belongs.",
  4872  	//       "location": "path",
  4873  	//       "required": true,
  4874  	//       "type": "string"
  4875  	//     },
  4876  	//     "adClientId": {
  4877  	//       "description": "Ad client for which to list URL channels.",
  4878  	//       "location": "path",
  4879  	//       "required": true,
  4880  	//       "type": "string"
  4881  	//     },
  4882  	//     "maxResults": {
  4883  	//       "description": "The maximum number of URL channels to include in the response, used for paging.",
  4884  	//       "format": "int32",
  4885  	//       "location": "query",
  4886  	//       "maximum": "10000",
  4887  	//       "minimum": "0",
  4888  	//       "type": "integer"
  4889  	//     },
  4890  	//     "pageToken": {
  4891  	//       "description": "A continuation token, used to page through URL channels. To retrieve the next page, set this parameter to the value of \"nextPageToken\" from the previous response.",
  4892  	//       "location": "query",
  4893  	//       "type": "string"
  4894  	//     }
  4895  	//   },
  4896  	//   "path": "accounts/{accountId}/adclients/{adClientId}/urlchannels",
  4897  	//   "response": {
  4898  	//     "$ref": "UrlChannels"
  4899  	//   },
  4900  	//   "scopes": [
  4901  	//     "https://www.googleapis.com/auth/adsense",
  4902  	//     "https://www.googleapis.com/auth/adsense.readonly"
  4903  	//   ]
  4904  	// }
  4905  
  4906  }
  4907  
  4908  // Pages invokes f for each page of results.
  4909  // A non-nil error returned from f will halt the iteration.
  4910  // The provided context supersedes any context provided to the Context method.
  4911  func (c *AccountsUrlchannelsListCall) Pages(ctx context.Context, f func(*UrlChannels) error) error {
  4912  	c.ctx_ = ctx
  4913  	defer c.PageToken(c.urlParams_.Get("pageToken")) // reset paging to original point
  4914  	for {
  4915  		x, err := c.Do()
  4916  		if err != nil {
  4917  			return err
  4918  		}
  4919  		if err := f(x); err != nil {
  4920  			return err
  4921  		}
  4922  		if x.NextPageToken == "" {
  4923  			return nil
  4924  		}
  4925  		c.PageToken(x.NextPageToken)
  4926  	}
  4927  }
  4928  
  4929  // method id "adsense.adclients.list":
  4930  
  4931  type AdclientsListCall struct {
  4932  	s            *Service
  4933  	urlParams_   gensupport.URLParams
  4934  	ifNoneMatch_ string
  4935  	ctx_         context.Context
  4936  	header_      http.Header
  4937  }
  4938  
  4939  // List: List all ad clients in this AdSense account.
  4940  func (r *AdclientsService) List() *AdclientsListCall {
  4941  	c := &AdclientsListCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  4942  	return c
  4943  }
  4944  
  4945  // MaxResults sets the optional parameter "maxResults": The maximum
  4946  // number of ad clients to include in the response, used for paging.
  4947  func (c *AdclientsListCall) MaxResults(maxResults int64) *AdclientsListCall {
  4948  	c.urlParams_.Set("maxResults", fmt.Sprint(maxResults))
  4949  	return c
  4950  }
  4951  
  4952  // PageToken sets the optional parameter "pageToken": A continuation
  4953  // token, used to page through ad clients. To retrieve the next page,
  4954  // set this parameter to the value of "nextPageToken" from the previous
  4955  // response.
  4956  func (c *AdclientsListCall) PageToken(pageToken string) *AdclientsListCall {
  4957  	c.urlParams_.Set("pageToken", pageToken)
  4958  	return c
  4959  }
  4960  
  4961  // Fields allows partial responses to be retrieved. See
  4962  // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  4963  // for more information.
  4964  func (c *AdclientsListCall) Fields(s ...googleapi.Field) *AdclientsListCall {
  4965  	c.urlParams_.Set("fields", googleapi.CombineFields(s))
  4966  	return c
  4967  }
  4968  
  4969  // IfNoneMatch sets the optional parameter which makes the operation
  4970  // fail if the object's ETag matches the given value. This is useful for
  4971  // getting updates only after the object has changed since the last
  4972  // request. Use googleapi.IsNotModified to check whether the response
  4973  // error from Do is the result of In-None-Match.
  4974  func (c *AdclientsListCall) IfNoneMatch(entityTag string) *AdclientsListCall {
  4975  	c.ifNoneMatch_ = entityTag
  4976  	return c
  4977  }
  4978  
  4979  // Context sets the context to be used in this call's Do method. Any
  4980  // pending HTTP request will be aborted if the provided context is
  4981  // canceled.
  4982  func (c *AdclientsListCall) Context(ctx context.Context) *AdclientsListCall {
  4983  	c.ctx_ = ctx
  4984  	return c
  4985  }
  4986  
  4987  // Header returns an http.Header that can be modified by the caller to
  4988  // add HTTP headers to the request.
  4989  func (c *AdclientsListCall) Header() http.Header {
  4990  	if c.header_ == nil {
  4991  		c.header_ = make(http.Header)
  4992  	}
  4993  	return c.header_
  4994  }
  4995  
  4996  func (c *AdclientsListCall) doRequest(alt string) (*http.Response, error) {
  4997  	reqHeaders := make(http.Header)
  4998  	reqHeaders.Set("x-goog-api-client", "gl-go/1.13.7 gdcl/20200203")
  4999  	for k, v := range c.header_ {
  5000  		reqHeaders[k] = v
  5001  	}
  5002  	reqHeaders.Set("User-Agent", c.s.userAgent())
  5003  	if c.ifNoneMatch_ != "" {
  5004  		reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  5005  	}
  5006  	var body io.Reader = nil
  5007  	c.urlParams_.Set("alt", alt)
  5008  	c.urlParams_.Set("prettyPrint", "false")
  5009  	urls := googleapi.ResolveRelative(c.s.BasePath, "adclients")
  5010  	urls += "?" + c.urlParams_.Encode()
  5011  	req, err := http.NewRequest("GET", urls, body)
  5012  	if err != nil {
  5013  		return nil, err
  5014  	}
  5015  	req.Header = reqHeaders
  5016  	return gensupport.SendRequest(c.ctx_, c.s.client, req)
  5017  }
  5018  
  5019  // Do executes the "adsense.adclients.list" call.
  5020  // Exactly one of *AdClients or error will be non-nil. Any non-2xx
  5021  // status code is an error. Response headers are in either
  5022  // *AdClients.ServerResponse.Header or (if a response was returned at
  5023  // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  5024  // to check whether the returned error was because
  5025  // http.StatusNotModified was returned.
  5026  func (c *AdclientsListCall) Do(opts ...googleapi.CallOption) (*AdClients, error) {
  5027  	gensupport.SetOptions(c.urlParams_, opts...)
  5028  	res, err := c.doRequest("json")
  5029  	if res != nil && res.StatusCode == http.StatusNotModified {
  5030  		if res.Body != nil {
  5031  			res.Body.Close()
  5032  		}
  5033  		return nil, &googleapi.Error{
  5034  			Code:   res.StatusCode,
  5035  			Header: res.Header,
  5036  		}
  5037  	}
  5038  	if err != nil {
  5039  		return nil, err
  5040  	}
  5041  	defer googleapi.CloseBody(res)
  5042  	if err := googleapi.CheckResponse(res); err != nil {
  5043  		return nil, err
  5044  	}
  5045  	ret := &AdClients{
  5046  		ServerResponse: googleapi.ServerResponse{
  5047  			Header:         res.Header,
  5048  			HTTPStatusCode: res.StatusCode,
  5049  		},
  5050  	}
  5051  	target := &ret
  5052  	if err := gensupport.DecodeResponse(target, res); err != nil {
  5053  		return nil, err
  5054  	}
  5055  	return ret, nil
  5056  	// {
  5057  	//   "description": "List all ad clients in this AdSense account.",
  5058  	//   "httpMethod": "GET",
  5059  	//   "id": "adsense.adclients.list",
  5060  	//   "parameters": {
  5061  	//     "maxResults": {
  5062  	//       "description": "The maximum number of ad clients to include in the response, used for paging.",
  5063  	//       "format": "int32",
  5064  	//       "location": "query",
  5065  	//       "maximum": "10000",
  5066  	//       "minimum": "0",
  5067  	//       "type": "integer"
  5068  	//     },
  5069  	//     "pageToken": {
  5070  	//       "description": "A continuation token, used to page through ad clients. To retrieve the next page, set this parameter to the value of \"nextPageToken\" from the previous response.",
  5071  	//       "location": "query",
  5072  	//       "type": "string"
  5073  	//     }
  5074  	//   },
  5075  	//   "path": "adclients",
  5076  	//   "response": {
  5077  	//     "$ref": "AdClients"
  5078  	//   },
  5079  	//   "scopes": [
  5080  	//     "https://www.googleapis.com/auth/adsense",
  5081  	//     "https://www.googleapis.com/auth/adsense.readonly"
  5082  	//   ]
  5083  	// }
  5084  
  5085  }
  5086  
  5087  // Pages invokes f for each page of results.
  5088  // A non-nil error returned from f will halt the iteration.
  5089  // The provided context supersedes any context provided to the Context method.
  5090  func (c *AdclientsListCall) Pages(ctx context.Context, f func(*AdClients) error) error {
  5091  	c.ctx_ = ctx
  5092  	defer c.PageToken(c.urlParams_.Get("pageToken")) // reset paging to original point
  5093  	for {
  5094  		x, err := c.Do()
  5095  		if err != nil {
  5096  			return err
  5097  		}
  5098  		if err := f(x); err != nil {
  5099  			return err
  5100  		}
  5101  		if x.NextPageToken == "" {
  5102  			return nil
  5103  		}
  5104  		c.PageToken(x.NextPageToken)
  5105  	}
  5106  }
  5107  
  5108  // method id "adsense.adunits.get":
  5109  
  5110  type AdunitsGetCall struct {
  5111  	s            *Service
  5112  	adClientId   string
  5113  	adUnitId     string
  5114  	urlParams_   gensupport.URLParams
  5115  	ifNoneMatch_ string
  5116  	ctx_         context.Context
  5117  	header_      http.Header
  5118  }
  5119  
  5120  // Get: Gets the specified ad unit in the specified ad client.
  5121  func (r *AdunitsService) Get(adClientId string, adUnitId string) *AdunitsGetCall {
  5122  	c := &AdunitsGetCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  5123  	c.adClientId = adClientId
  5124  	c.adUnitId = adUnitId
  5125  	return c
  5126  }
  5127  
  5128  // Fields allows partial responses to be retrieved. See
  5129  // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  5130  // for more information.
  5131  func (c *AdunitsGetCall) Fields(s ...googleapi.Field) *AdunitsGetCall {
  5132  	c.urlParams_.Set("fields", googleapi.CombineFields(s))
  5133  	return c
  5134  }
  5135  
  5136  // IfNoneMatch sets the optional parameter which makes the operation
  5137  // fail if the object's ETag matches the given value. This is useful for
  5138  // getting updates only after the object has changed since the last
  5139  // request. Use googleapi.IsNotModified to check whether the response
  5140  // error from Do is the result of In-None-Match.
  5141  func (c *AdunitsGetCall) IfNoneMatch(entityTag string) *AdunitsGetCall {
  5142  	c.ifNoneMatch_ = entityTag
  5143  	return c
  5144  }
  5145  
  5146  // Context sets the context to be used in this call's Do method. Any
  5147  // pending HTTP request will be aborted if the provided context is
  5148  // canceled.
  5149  func (c *AdunitsGetCall) Context(ctx context.Context) *AdunitsGetCall {
  5150  	c.ctx_ = ctx
  5151  	return c
  5152  }
  5153  
  5154  // Header returns an http.Header that can be modified by the caller to
  5155  // add HTTP headers to the request.
  5156  func (c *AdunitsGetCall) Header() http.Header {
  5157  	if c.header_ == nil {
  5158  		c.header_ = make(http.Header)
  5159  	}
  5160  	return c.header_
  5161  }
  5162  
  5163  func (c *AdunitsGetCall) doRequest(alt string) (*http.Response, error) {
  5164  	reqHeaders := make(http.Header)
  5165  	reqHeaders.Set("x-goog-api-client", "gl-go/1.13.7 gdcl/20200203")
  5166  	for k, v := range c.header_ {
  5167  		reqHeaders[k] = v
  5168  	}
  5169  	reqHeaders.Set("User-Agent", c.s.userAgent())
  5170  	if c.ifNoneMatch_ != "" {
  5171  		reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  5172  	}
  5173  	var body io.Reader = nil
  5174  	c.urlParams_.Set("alt", alt)
  5175  	c.urlParams_.Set("prettyPrint", "false")
  5176  	urls := googleapi.ResolveRelative(c.s.BasePath, "adclients/{adClientId}/adunits/{adUnitId}")
  5177  	urls += "?" + c.urlParams_.Encode()
  5178  	req, err := http.NewRequest("GET", urls, body)
  5179  	if err != nil {
  5180  		return nil, err
  5181  	}
  5182  	req.Header = reqHeaders
  5183  	googleapi.Expand(req.URL, map[string]string{
  5184  		"adClientId": c.adClientId,
  5185  		"adUnitId":   c.adUnitId,
  5186  	})
  5187  	return gensupport.SendRequest(c.ctx_, c.s.client, req)
  5188  }
  5189  
  5190  // Do executes the "adsense.adunits.get" call.
  5191  // Exactly one of *AdUnit or error will be non-nil. Any non-2xx status
  5192  // code is an error. Response headers are in either
  5193  // *AdUnit.ServerResponse.Header or (if a response was returned at all)
  5194  // in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to
  5195  // check whether the returned error was because http.StatusNotModified
  5196  // was returned.
  5197  func (c *AdunitsGetCall) Do(opts ...googleapi.CallOption) (*AdUnit, error) {
  5198  	gensupport.SetOptions(c.urlParams_, opts...)
  5199  	res, err := c.doRequest("json")
  5200  	if res != nil && res.StatusCode == http.StatusNotModified {
  5201  		if res.Body != nil {
  5202  			res.Body.Close()
  5203  		}
  5204  		return nil, &googleapi.Error{
  5205  			Code:   res.StatusCode,
  5206  			Header: res.Header,
  5207  		}
  5208  	}
  5209  	if err != nil {
  5210  		return nil, err
  5211  	}
  5212  	defer googleapi.CloseBody(res)
  5213  	if err := googleapi.CheckResponse(res); err != nil {
  5214  		return nil, err
  5215  	}
  5216  	ret := &AdUnit{
  5217  		ServerResponse: googleapi.ServerResponse{
  5218  			Header:         res.Header,
  5219  			HTTPStatusCode: res.StatusCode,
  5220  		},
  5221  	}
  5222  	target := &ret
  5223  	if err := gensupport.DecodeResponse(target, res); err != nil {
  5224  		return nil, err
  5225  	}
  5226  	return ret, nil
  5227  	// {
  5228  	//   "description": "Gets the specified ad unit in the specified ad client.",
  5229  	//   "httpMethod": "GET",
  5230  	//   "id": "adsense.adunits.get",
  5231  	//   "parameterOrder": [
  5232  	//     "adClientId",
  5233  	//     "adUnitId"
  5234  	//   ],
  5235  	//   "parameters": {
  5236  	//     "adClientId": {
  5237  	//       "description": "Ad client for which to get the ad unit.",
  5238  	//       "location": "path",
  5239  	//       "required": true,
  5240  	//       "type": "string"
  5241  	//     },
  5242  	//     "adUnitId": {
  5243  	//       "description": "Ad unit to retrieve.",
  5244  	//       "location": "path",
  5245  	//       "required": true,
  5246  	//       "type": "string"
  5247  	//     }
  5248  	//   },
  5249  	//   "path": "adclients/{adClientId}/adunits/{adUnitId}",
  5250  	//   "response": {
  5251  	//     "$ref": "AdUnit"
  5252  	//   },
  5253  	//   "scopes": [
  5254  	//     "https://www.googleapis.com/auth/adsense",
  5255  	//     "https://www.googleapis.com/auth/adsense.readonly"
  5256  	//   ]
  5257  	// }
  5258  
  5259  }
  5260  
  5261  // method id "adsense.adunits.getAdCode":
  5262  
  5263  type AdunitsGetAdCodeCall struct {
  5264  	s            *Service
  5265  	adClientId   string
  5266  	adUnitId     string
  5267  	urlParams_   gensupport.URLParams
  5268  	ifNoneMatch_ string
  5269  	ctx_         context.Context
  5270  	header_      http.Header
  5271  }
  5272  
  5273  // GetAdCode: Get ad code for the specified ad unit.
  5274  func (r *AdunitsService) GetAdCode(adClientId string, adUnitId string) *AdunitsGetAdCodeCall {
  5275  	c := &AdunitsGetAdCodeCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  5276  	c.adClientId = adClientId
  5277  	c.adUnitId = adUnitId
  5278  	return c
  5279  }
  5280  
  5281  // Fields allows partial responses to be retrieved. See
  5282  // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  5283  // for more information.
  5284  func (c *AdunitsGetAdCodeCall) Fields(s ...googleapi.Field) *AdunitsGetAdCodeCall {
  5285  	c.urlParams_.Set("fields", googleapi.CombineFields(s))
  5286  	return c
  5287  }
  5288  
  5289  // IfNoneMatch sets the optional parameter which makes the operation
  5290  // fail if the object's ETag matches the given value. This is useful for
  5291  // getting updates only after the object has changed since the last
  5292  // request. Use googleapi.IsNotModified to check whether the response
  5293  // error from Do is the result of In-None-Match.
  5294  func (c *AdunitsGetAdCodeCall) IfNoneMatch(entityTag string) *AdunitsGetAdCodeCall {
  5295  	c.ifNoneMatch_ = entityTag
  5296  	return c
  5297  }
  5298  
  5299  // Context sets the context to be used in this call's Do method. Any
  5300  // pending HTTP request will be aborted if the provided context is
  5301  // canceled.
  5302  func (c *AdunitsGetAdCodeCall) Context(ctx context.Context) *AdunitsGetAdCodeCall {
  5303  	c.ctx_ = ctx
  5304  	return c
  5305  }
  5306  
  5307  // Header returns an http.Header that can be modified by the caller to
  5308  // add HTTP headers to the request.
  5309  func (c *AdunitsGetAdCodeCall) Header() http.Header {
  5310  	if c.header_ == nil {
  5311  		c.header_ = make(http.Header)
  5312  	}
  5313  	return c.header_
  5314  }
  5315  
  5316  func (c *AdunitsGetAdCodeCall) doRequest(alt string) (*http.Response, error) {
  5317  	reqHeaders := make(http.Header)
  5318  	reqHeaders.Set("x-goog-api-client", "gl-go/1.13.7 gdcl/20200203")
  5319  	for k, v := range c.header_ {
  5320  		reqHeaders[k] = v
  5321  	}
  5322  	reqHeaders.Set("User-Agent", c.s.userAgent())
  5323  	if c.ifNoneMatch_ != "" {
  5324  		reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  5325  	}
  5326  	var body io.Reader = nil
  5327  	c.urlParams_.Set("alt", alt)
  5328  	c.urlParams_.Set("prettyPrint", "false")
  5329  	urls := googleapi.ResolveRelative(c.s.BasePath, "adclients/{adClientId}/adunits/{adUnitId}/adcode")
  5330  	urls += "?" + c.urlParams_.Encode()
  5331  	req, err := http.NewRequest("GET", urls, body)
  5332  	if err != nil {
  5333  		return nil, err
  5334  	}
  5335  	req.Header = reqHeaders
  5336  	googleapi.Expand(req.URL, map[string]string{
  5337  		"adClientId": c.adClientId,
  5338  		"adUnitId":   c.adUnitId,
  5339  	})
  5340  	return gensupport.SendRequest(c.ctx_, c.s.client, req)
  5341  }
  5342  
  5343  // Do executes the "adsense.adunits.getAdCode" call.
  5344  // Exactly one of *AdCode or error will be non-nil. Any non-2xx status
  5345  // code is an error. Response headers are in either
  5346  // *AdCode.ServerResponse.Header or (if a response was returned at all)
  5347  // in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to
  5348  // check whether the returned error was because http.StatusNotModified
  5349  // was returned.
  5350  func (c *AdunitsGetAdCodeCall) Do(opts ...googleapi.CallOption) (*AdCode, error) {
  5351  	gensupport.SetOptions(c.urlParams_, opts...)
  5352  	res, err := c.doRequest("json")
  5353  	if res != nil && res.StatusCode == http.StatusNotModified {
  5354  		if res.Body != nil {
  5355  			res.Body.Close()
  5356  		}
  5357  		return nil, &googleapi.Error{
  5358  			Code:   res.StatusCode,
  5359  			Header: res.Header,
  5360  		}
  5361  	}
  5362  	if err != nil {
  5363  		return nil, err
  5364  	}
  5365  	defer googleapi.CloseBody(res)
  5366  	if err := googleapi.CheckResponse(res); err != nil {
  5367  		return nil, err
  5368  	}
  5369  	ret := &AdCode{
  5370  		ServerResponse: googleapi.ServerResponse{
  5371  			Header:         res.Header,
  5372  			HTTPStatusCode: res.StatusCode,
  5373  		},
  5374  	}
  5375  	target := &ret
  5376  	if err := gensupport.DecodeResponse(target, res); err != nil {
  5377  		return nil, err
  5378  	}
  5379  	return ret, nil
  5380  	// {
  5381  	//   "description": "Get ad code for the specified ad unit.",
  5382  	//   "httpMethod": "GET",
  5383  	//   "id": "adsense.adunits.getAdCode",
  5384  	//   "parameterOrder": [
  5385  	//     "adClientId",
  5386  	//     "adUnitId"
  5387  	//   ],
  5388  	//   "parameters": {
  5389  	//     "adClientId": {
  5390  	//       "description": "Ad client with contains the ad unit.",
  5391  	//       "location": "path",
  5392  	//       "required": true,
  5393  	//       "type": "string"
  5394  	//     },
  5395  	//     "adUnitId": {
  5396  	//       "description": "Ad unit to get the code for.",
  5397  	//       "location": "path",
  5398  	//       "required": true,
  5399  	//       "type": "string"
  5400  	//     }
  5401  	//   },
  5402  	//   "path": "adclients/{adClientId}/adunits/{adUnitId}/adcode",
  5403  	//   "response": {
  5404  	//     "$ref": "AdCode"
  5405  	//   },
  5406  	//   "scopes": [
  5407  	//     "https://www.googleapis.com/auth/adsense",
  5408  	//     "https://www.googleapis.com/auth/adsense.readonly"
  5409  	//   ]
  5410  	// }
  5411  
  5412  }
  5413  
  5414  // method id "adsense.adunits.list":
  5415  
  5416  type AdunitsListCall struct {
  5417  	s            *Service
  5418  	adClientId   string
  5419  	urlParams_   gensupport.URLParams
  5420  	ifNoneMatch_ string
  5421  	ctx_         context.Context
  5422  	header_      http.Header
  5423  }
  5424  
  5425  // List: List all ad units in the specified ad client for this AdSense
  5426  // account.
  5427  func (r *AdunitsService) List(adClientId string) *AdunitsListCall {
  5428  	c := &AdunitsListCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  5429  	c.adClientId = adClientId
  5430  	return c
  5431  }
  5432  
  5433  // IncludeInactive sets the optional parameter "includeInactive":
  5434  // Whether to include inactive ad units. Default: true.
  5435  func (c *AdunitsListCall) IncludeInactive(includeInactive bool) *AdunitsListCall {
  5436  	c.urlParams_.Set("includeInactive", fmt.Sprint(includeInactive))
  5437  	return c
  5438  }
  5439  
  5440  // MaxResults sets the optional parameter "maxResults": The maximum
  5441  // number of ad units to include in the response, used for paging.
  5442  func (c *AdunitsListCall) MaxResults(maxResults int64) *AdunitsListCall {
  5443  	c.urlParams_.Set("maxResults", fmt.Sprint(maxResults))
  5444  	return c
  5445  }
  5446  
  5447  // PageToken sets the optional parameter "pageToken": A continuation
  5448  // token, used to page through ad units. To retrieve the next page, set
  5449  // this parameter to the value of "nextPageToken" from the previous
  5450  // response.
  5451  func (c *AdunitsListCall) PageToken(pageToken string) *AdunitsListCall {
  5452  	c.urlParams_.Set("pageToken", pageToken)
  5453  	return c
  5454  }
  5455  
  5456  // Fields allows partial responses to be retrieved. See
  5457  // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  5458  // for more information.
  5459  func (c *AdunitsListCall) Fields(s ...googleapi.Field) *AdunitsListCall {
  5460  	c.urlParams_.Set("fields", googleapi.CombineFields(s))
  5461  	return c
  5462  }
  5463  
  5464  // IfNoneMatch sets the optional parameter which makes the operation
  5465  // fail if the object's ETag matches the given value. This is useful for
  5466  // getting updates only after the object has changed since the last
  5467  // request. Use googleapi.IsNotModified to check whether the response
  5468  // error from Do is the result of In-None-Match.
  5469  func (c *AdunitsListCall) IfNoneMatch(entityTag string) *AdunitsListCall {
  5470  	c.ifNoneMatch_ = entityTag
  5471  	return c
  5472  }
  5473  
  5474  // Context sets the context to be used in this call's Do method. Any
  5475  // pending HTTP request will be aborted if the provided context is
  5476  // canceled.
  5477  func (c *AdunitsListCall) Context(ctx context.Context) *AdunitsListCall {
  5478  	c.ctx_ = ctx
  5479  	return c
  5480  }
  5481  
  5482  // Header returns an http.Header that can be modified by the caller to
  5483  // add HTTP headers to the request.
  5484  func (c *AdunitsListCall) Header() http.Header {
  5485  	if c.header_ == nil {
  5486  		c.header_ = make(http.Header)
  5487  	}
  5488  	return c.header_
  5489  }
  5490  
  5491  func (c *AdunitsListCall) doRequest(alt string) (*http.Response, error) {
  5492  	reqHeaders := make(http.Header)
  5493  	reqHeaders.Set("x-goog-api-client", "gl-go/1.13.7 gdcl/20200203")
  5494  	for k, v := range c.header_ {
  5495  		reqHeaders[k] = v
  5496  	}
  5497  	reqHeaders.Set("User-Agent", c.s.userAgent())
  5498  	if c.ifNoneMatch_ != "" {
  5499  		reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  5500  	}
  5501  	var body io.Reader = nil
  5502  	c.urlParams_.Set("alt", alt)
  5503  	c.urlParams_.Set("prettyPrint", "false")
  5504  	urls := googleapi.ResolveRelative(c.s.BasePath, "adclients/{adClientId}/adunits")
  5505  	urls += "?" + c.urlParams_.Encode()
  5506  	req, err := http.NewRequest("GET", urls, body)
  5507  	if err != nil {
  5508  		return nil, err
  5509  	}
  5510  	req.Header = reqHeaders
  5511  	googleapi.Expand(req.URL, map[string]string{
  5512  		"adClientId": c.adClientId,
  5513  	})
  5514  	return gensupport.SendRequest(c.ctx_, c.s.client, req)
  5515  }
  5516  
  5517  // Do executes the "adsense.adunits.list" call.
  5518  // Exactly one of *AdUnits or error will be non-nil. Any non-2xx status
  5519  // code is an error. Response headers are in either
  5520  // *AdUnits.ServerResponse.Header or (if a response was returned at all)
  5521  // in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to
  5522  // check whether the returned error was because http.StatusNotModified
  5523  // was returned.
  5524  func (c *AdunitsListCall) Do(opts ...googleapi.CallOption) (*AdUnits, error) {
  5525  	gensupport.SetOptions(c.urlParams_, opts...)
  5526  	res, err := c.doRequest("json")
  5527  	if res != nil && res.StatusCode == http.StatusNotModified {
  5528  		if res.Body != nil {
  5529  			res.Body.Close()
  5530  		}
  5531  		return nil, &googleapi.Error{
  5532  			Code:   res.StatusCode,
  5533  			Header: res.Header,
  5534  		}
  5535  	}
  5536  	if err != nil {
  5537  		return nil, err
  5538  	}
  5539  	defer googleapi.CloseBody(res)
  5540  	if err := googleapi.CheckResponse(res); err != nil {
  5541  		return nil, err
  5542  	}
  5543  	ret := &AdUnits{
  5544  		ServerResponse: googleapi.ServerResponse{
  5545  			Header:         res.Header,
  5546  			HTTPStatusCode: res.StatusCode,
  5547  		},
  5548  	}
  5549  	target := &ret
  5550  	if err := gensupport.DecodeResponse(target, res); err != nil {
  5551  		return nil, err
  5552  	}
  5553  	return ret, nil
  5554  	// {
  5555  	//   "description": "List all ad units in the specified ad client for this AdSense account.",
  5556  	//   "httpMethod": "GET",
  5557  	//   "id": "adsense.adunits.list",
  5558  	//   "parameterOrder": [
  5559  	//     "adClientId"
  5560  	//   ],
  5561  	//   "parameters": {
  5562  	//     "adClientId": {
  5563  	//       "description": "Ad client for which to list ad units.",
  5564  	//       "location": "path",
  5565  	//       "required": true,
  5566  	//       "type": "string"
  5567  	//     },
  5568  	//     "includeInactive": {
  5569  	//       "description": "Whether to include inactive ad units. Default: true.",
  5570  	//       "location": "query",
  5571  	//       "type": "boolean"
  5572  	//     },
  5573  	//     "maxResults": {
  5574  	//       "description": "The maximum number of ad units to include in the response, used for paging.",
  5575  	//       "format": "int32",
  5576  	//       "location": "query",
  5577  	//       "maximum": "10000",
  5578  	//       "minimum": "0",
  5579  	//       "type": "integer"
  5580  	//     },
  5581  	//     "pageToken": {
  5582  	//       "description": "A continuation token, used to page through ad units. To retrieve the next page, set this parameter to the value of \"nextPageToken\" from the previous response.",
  5583  	//       "location": "query",
  5584  	//       "type": "string"
  5585  	//     }
  5586  	//   },
  5587  	//   "path": "adclients/{adClientId}/adunits",
  5588  	//   "response": {
  5589  	//     "$ref": "AdUnits"
  5590  	//   },
  5591  	//   "scopes": [
  5592  	//     "https://www.googleapis.com/auth/adsense",
  5593  	//     "https://www.googleapis.com/auth/adsense.readonly"
  5594  	//   ]
  5595  	// }
  5596  
  5597  }
  5598  
  5599  // Pages invokes f for each page of results.
  5600  // A non-nil error returned from f will halt the iteration.
  5601  // The provided context supersedes any context provided to the Context method.
  5602  func (c *AdunitsListCall) Pages(ctx context.Context, f func(*AdUnits) error) error {
  5603  	c.ctx_ = ctx
  5604  	defer c.PageToken(c.urlParams_.Get("pageToken")) // reset paging to original point
  5605  	for {
  5606  		x, err := c.Do()
  5607  		if err != nil {
  5608  			return err
  5609  		}
  5610  		if err := f(x); err != nil {
  5611  			return err
  5612  		}
  5613  		if x.NextPageToken == "" {
  5614  			return nil
  5615  		}
  5616  		c.PageToken(x.NextPageToken)
  5617  	}
  5618  }
  5619  
  5620  // method id "adsense.adunits.customchannels.list":
  5621  
  5622  type AdunitsCustomchannelsListCall struct {
  5623  	s            *Service
  5624  	adClientId   string
  5625  	adUnitId     string
  5626  	urlParams_   gensupport.URLParams
  5627  	ifNoneMatch_ string
  5628  	ctx_         context.Context
  5629  	header_      http.Header
  5630  }
  5631  
  5632  // List: List all custom channels which the specified ad unit belongs
  5633  // to.
  5634  func (r *AdunitsCustomchannelsService) List(adClientId string, adUnitId string) *AdunitsCustomchannelsListCall {
  5635  	c := &AdunitsCustomchannelsListCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  5636  	c.adClientId = adClientId
  5637  	c.adUnitId = adUnitId
  5638  	return c
  5639  }
  5640  
  5641  // MaxResults sets the optional parameter "maxResults": The maximum
  5642  // number of custom channels to include in the response, used for
  5643  // paging.
  5644  func (c *AdunitsCustomchannelsListCall) MaxResults(maxResults int64) *AdunitsCustomchannelsListCall {
  5645  	c.urlParams_.Set("maxResults", fmt.Sprint(maxResults))
  5646  	return c
  5647  }
  5648  
  5649  // PageToken sets the optional parameter "pageToken": A continuation
  5650  // token, used to page through custom channels. To retrieve the next
  5651  // page, set this parameter to the value of "nextPageToken" from the
  5652  // previous response.
  5653  func (c *AdunitsCustomchannelsListCall) PageToken(pageToken string) *AdunitsCustomchannelsListCall {
  5654  	c.urlParams_.Set("pageToken", pageToken)
  5655  	return c
  5656  }
  5657  
  5658  // Fields allows partial responses to be retrieved. See
  5659  // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  5660  // for more information.
  5661  func (c *AdunitsCustomchannelsListCall) Fields(s ...googleapi.Field) *AdunitsCustomchannelsListCall {
  5662  	c.urlParams_.Set("fields", googleapi.CombineFields(s))
  5663  	return c
  5664  }
  5665  
  5666  // IfNoneMatch sets the optional parameter which makes the operation
  5667  // fail if the object's ETag matches the given value. This is useful for
  5668  // getting updates only after the object has changed since the last
  5669  // request. Use googleapi.IsNotModified to check whether the response
  5670  // error from Do is the result of In-None-Match.
  5671  func (c *AdunitsCustomchannelsListCall) IfNoneMatch(entityTag string) *AdunitsCustomchannelsListCall {
  5672  	c.ifNoneMatch_ = entityTag
  5673  	return c
  5674  }
  5675  
  5676  // Context sets the context to be used in this call's Do method. Any
  5677  // pending HTTP request will be aborted if the provided context is
  5678  // canceled.
  5679  func (c *AdunitsCustomchannelsListCall) Context(ctx context.Context) *AdunitsCustomchannelsListCall {
  5680  	c.ctx_ = ctx
  5681  	return c
  5682  }
  5683  
  5684  // Header returns an http.Header that can be modified by the caller to
  5685  // add HTTP headers to the request.
  5686  func (c *AdunitsCustomchannelsListCall) Header() http.Header {
  5687  	if c.header_ == nil {
  5688  		c.header_ = make(http.Header)
  5689  	}
  5690  	return c.header_
  5691  }
  5692  
  5693  func (c *AdunitsCustomchannelsListCall) doRequest(alt string) (*http.Response, error) {
  5694  	reqHeaders := make(http.Header)
  5695  	reqHeaders.Set("x-goog-api-client", "gl-go/1.13.7 gdcl/20200203")
  5696  	for k, v := range c.header_ {
  5697  		reqHeaders[k] = v
  5698  	}
  5699  	reqHeaders.Set("User-Agent", c.s.userAgent())
  5700  	if c.ifNoneMatch_ != "" {
  5701  		reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  5702  	}
  5703  	var body io.Reader = nil
  5704  	c.urlParams_.Set("alt", alt)
  5705  	c.urlParams_.Set("prettyPrint", "false")
  5706  	urls := googleapi.ResolveRelative(c.s.BasePath, "adclients/{adClientId}/adunits/{adUnitId}/customchannels")
  5707  	urls += "?" + c.urlParams_.Encode()
  5708  	req, err := http.NewRequest("GET", urls, body)
  5709  	if err != nil {
  5710  		return nil, err
  5711  	}
  5712  	req.Header = reqHeaders
  5713  	googleapi.Expand(req.URL, map[string]string{
  5714  		"adClientId": c.adClientId,
  5715  		"adUnitId":   c.adUnitId,
  5716  	})
  5717  	return gensupport.SendRequest(c.ctx_, c.s.client, req)
  5718  }
  5719  
  5720  // Do executes the "adsense.adunits.customchannels.list" call.
  5721  // Exactly one of *CustomChannels or error will be non-nil. Any non-2xx
  5722  // status code is an error. Response headers are in either
  5723  // *CustomChannels.ServerResponse.Header or (if a response was returned
  5724  // at all) in error.(*googleapi.Error).Header. Use
  5725  // googleapi.IsNotModified to check whether the returned error was
  5726  // because http.StatusNotModified was returned.
  5727  func (c *AdunitsCustomchannelsListCall) Do(opts ...googleapi.CallOption) (*CustomChannels, error) {
  5728  	gensupport.SetOptions(c.urlParams_, opts...)
  5729  	res, err := c.doRequest("json")
  5730  	if res != nil && res.StatusCode == http.StatusNotModified {
  5731  		if res.Body != nil {
  5732  			res.Body.Close()
  5733  		}
  5734  		return nil, &googleapi.Error{
  5735  			Code:   res.StatusCode,
  5736  			Header: res.Header,
  5737  		}
  5738  	}
  5739  	if err != nil {
  5740  		return nil, err
  5741  	}
  5742  	defer googleapi.CloseBody(res)
  5743  	if err := googleapi.CheckResponse(res); err != nil {
  5744  		return nil, err
  5745  	}
  5746  	ret := &CustomChannels{
  5747  		ServerResponse: googleapi.ServerResponse{
  5748  			Header:         res.Header,
  5749  			HTTPStatusCode: res.StatusCode,
  5750  		},
  5751  	}
  5752  	target := &ret
  5753  	if err := gensupport.DecodeResponse(target, res); err != nil {
  5754  		return nil, err
  5755  	}
  5756  	return ret, nil
  5757  	// {
  5758  	//   "description": "List all custom channels which the specified ad unit belongs to.",
  5759  	//   "httpMethod": "GET",
  5760  	//   "id": "adsense.adunits.customchannels.list",
  5761  	//   "parameterOrder": [
  5762  	//     "adClientId",
  5763  	//     "adUnitId"
  5764  	//   ],
  5765  	//   "parameters": {
  5766  	//     "adClientId": {
  5767  	//       "description": "Ad client which contains the ad unit.",
  5768  	//       "location": "path",
  5769  	//       "required": true,
  5770  	//       "type": "string"
  5771  	//     },
  5772  	//     "adUnitId": {
  5773  	//       "description": "Ad unit for which to list custom channels.",
  5774  	//       "location": "path",
  5775  	//       "required": true,
  5776  	//       "type": "string"
  5777  	//     },
  5778  	//     "maxResults": {
  5779  	//       "description": "The maximum number of custom channels to include in the response, used for paging.",
  5780  	//       "format": "int32",
  5781  	//       "location": "query",
  5782  	//       "maximum": "10000",
  5783  	//       "minimum": "0",
  5784  	//       "type": "integer"
  5785  	//     },
  5786  	//     "pageToken": {
  5787  	//       "description": "A continuation token, used to page through custom channels. To retrieve the next page, set this parameter to the value of \"nextPageToken\" from the previous response.",
  5788  	//       "location": "query",
  5789  	//       "type": "string"
  5790  	//     }
  5791  	//   },
  5792  	//   "path": "adclients/{adClientId}/adunits/{adUnitId}/customchannels",
  5793  	//   "response": {
  5794  	//     "$ref": "CustomChannels"
  5795  	//   },
  5796  	//   "scopes": [
  5797  	//     "https://www.googleapis.com/auth/adsense",
  5798  	//     "https://www.googleapis.com/auth/adsense.readonly"
  5799  	//   ]
  5800  	// }
  5801  
  5802  }
  5803  
  5804  // Pages invokes f for each page of results.
  5805  // A non-nil error returned from f will halt the iteration.
  5806  // The provided context supersedes any context provided to the Context method.
  5807  func (c *AdunitsCustomchannelsListCall) Pages(ctx context.Context, f func(*CustomChannels) error) error {
  5808  	c.ctx_ = ctx
  5809  	defer c.PageToken(c.urlParams_.Get("pageToken")) // reset paging to original point
  5810  	for {
  5811  		x, err := c.Do()
  5812  		if err != nil {
  5813  			return err
  5814  		}
  5815  		if err := f(x); err != nil {
  5816  			return err
  5817  		}
  5818  		if x.NextPageToken == "" {
  5819  			return nil
  5820  		}
  5821  		c.PageToken(x.NextPageToken)
  5822  	}
  5823  }
  5824  
  5825  // method id "adsense.alerts.list":
  5826  
  5827  type AlertsListCall struct {
  5828  	s            *Service
  5829  	urlParams_   gensupport.URLParams
  5830  	ifNoneMatch_ string
  5831  	ctx_         context.Context
  5832  	header_      http.Header
  5833  }
  5834  
  5835  // List: List the alerts for this AdSense account.
  5836  func (r *AlertsService) List() *AlertsListCall {
  5837  	c := &AlertsListCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  5838  	return c
  5839  }
  5840  
  5841  // Locale sets the optional parameter "locale": The locale to use for
  5842  // translating alert messages. The account locale will be used if this
  5843  // is not supplied. The AdSense default (English) will be used if the
  5844  // supplied locale is invalid or unsupported.
  5845  func (c *AlertsListCall) Locale(locale string) *AlertsListCall {
  5846  	c.urlParams_.Set("locale", locale)
  5847  	return c
  5848  }
  5849  
  5850  // Fields allows partial responses to be retrieved. See
  5851  // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  5852  // for more information.
  5853  func (c *AlertsListCall) Fields(s ...googleapi.Field) *AlertsListCall {
  5854  	c.urlParams_.Set("fields", googleapi.CombineFields(s))
  5855  	return c
  5856  }
  5857  
  5858  // IfNoneMatch sets the optional parameter which makes the operation
  5859  // fail if the object's ETag matches the given value. This is useful for
  5860  // getting updates only after the object has changed since the last
  5861  // request. Use googleapi.IsNotModified to check whether the response
  5862  // error from Do is the result of In-None-Match.
  5863  func (c *AlertsListCall) IfNoneMatch(entityTag string) *AlertsListCall {
  5864  	c.ifNoneMatch_ = entityTag
  5865  	return c
  5866  }
  5867  
  5868  // Context sets the context to be used in this call's Do method. Any
  5869  // pending HTTP request will be aborted if the provided context is
  5870  // canceled.
  5871  func (c *AlertsListCall) Context(ctx context.Context) *AlertsListCall {
  5872  	c.ctx_ = ctx
  5873  	return c
  5874  }
  5875  
  5876  // Header returns an http.Header that can be modified by the caller to
  5877  // add HTTP headers to the request.
  5878  func (c *AlertsListCall) Header() http.Header {
  5879  	if c.header_ == nil {
  5880  		c.header_ = make(http.Header)
  5881  	}
  5882  	return c.header_
  5883  }
  5884  
  5885  func (c *AlertsListCall) doRequest(alt string) (*http.Response, error) {
  5886  	reqHeaders := make(http.Header)
  5887  	reqHeaders.Set("x-goog-api-client", "gl-go/1.13.7 gdcl/20200203")
  5888  	for k, v := range c.header_ {
  5889  		reqHeaders[k] = v
  5890  	}
  5891  	reqHeaders.Set("User-Agent", c.s.userAgent())
  5892  	if c.ifNoneMatch_ != "" {
  5893  		reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  5894  	}
  5895  	var body io.Reader = nil
  5896  	c.urlParams_.Set("alt", alt)
  5897  	c.urlParams_.Set("prettyPrint", "false")
  5898  	urls := googleapi.ResolveRelative(c.s.BasePath, "alerts")
  5899  	urls += "?" + c.urlParams_.Encode()
  5900  	req, err := http.NewRequest("GET", urls, body)
  5901  	if err != nil {
  5902  		return nil, err
  5903  	}
  5904  	req.Header = reqHeaders
  5905  	return gensupport.SendRequest(c.ctx_, c.s.client, req)
  5906  }
  5907  
  5908  // Do executes the "adsense.alerts.list" call.
  5909  // Exactly one of *Alerts or error will be non-nil. Any non-2xx status
  5910  // code is an error. Response headers are in either
  5911  // *Alerts.ServerResponse.Header or (if a response was returned at all)
  5912  // in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to
  5913  // check whether the returned error was because http.StatusNotModified
  5914  // was returned.
  5915  func (c *AlertsListCall) Do(opts ...googleapi.CallOption) (*Alerts, error) {
  5916  	gensupport.SetOptions(c.urlParams_, opts...)
  5917  	res, err := c.doRequest("json")
  5918  	if res != nil && res.StatusCode == http.StatusNotModified {
  5919  		if res.Body != nil {
  5920  			res.Body.Close()
  5921  		}
  5922  		return nil, &googleapi.Error{
  5923  			Code:   res.StatusCode,
  5924  			Header: res.Header,
  5925  		}
  5926  	}
  5927  	if err != nil {
  5928  		return nil, err
  5929  	}
  5930  	defer googleapi.CloseBody(res)
  5931  	if err := googleapi.CheckResponse(res); err != nil {
  5932  		return nil, err
  5933  	}
  5934  	ret := &Alerts{
  5935  		ServerResponse: googleapi.ServerResponse{
  5936  			Header:         res.Header,
  5937  			HTTPStatusCode: res.StatusCode,
  5938  		},
  5939  	}
  5940  	target := &ret
  5941  	if err := gensupport.DecodeResponse(target, res); err != nil {
  5942  		return nil, err
  5943  	}
  5944  	return ret, nil
  5945  	// {
  5946  	//   "description": "List the alerts for this AdSense account.",
  5947  	//   "httpMethod": "GET",
  5948  	//   "id": "adsense.alerts.list",
  5949  	//   "parameters": {
  5950  	//     "locale": {
  5951  	//       "description": "The locale to use for translating alert messages. The account locale will be used if this is not supplied. The AdSense default (English) will be used if the supplied locale is invalid or unsupported.",
  5952  	//       "location": "query",
  5953  	//       "type": "string"
  5954  	//     }
  5955  	//   },
  5956  	//   "path": "alerts",
  5957  	//   "response": {
  5958  	//     "$ref": "Alerts"
  5959  	//   },
  5960  	//   "scopes": [
  5961  	//     "https://www.googleapis.com/auth/adsense",
  5962  	//     "https://www.googleapis.com/auth/adsense.readonly"
  5963  	//   ]
  5964  	// }
  5965  
  5966  }
  5967  
  5968  // method id "adsense.customchannels.get":
  5969  
  5970  type CustomchannelsGetCall struct {
  5971  	s               *Service
  5972  	adClientId      string
  5973  	customChannelId string
  5974  	urlParams_      gensupport.URLParams
  5975  	ifNoneMatch_    string
  5976  	ctx_            context.Context
  5977  	header_         http.Header
  5978  }
  5979  
  5980  // Get: Get the specified custom channel from the specified ad client.
  5981  func (r *CustomchannelsService) Get(adClientId string, customChannelId string) *CustomchannelsGetCall {
  5982  	c := &CustomchannelsGetCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  5983  	c.adClientId = adClientId
  5984  	c.customChannelId = customChannelId
  5985  	return c
  5986  }
  5987  
  5988  // Fields allows partial responses to be retrieved. See
  5989  // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  5990  // for more information.
  5991  func (c *CustomchannelsGetCall) Fields(s ...googleapi.Field) *CustomchannelsGetCall {
  5992  	c.urlParams_.Set("fields", googleapi.CombineFields(s))
  5993  	return c
  5994  }
  5995  
  5996  // IfNoneMatch sets the optional parameter which makes the operation
  5997  // fail if the object's ETag matches the given value. This is useful for
  5998  // getting updates only after the object has changed since the last
  5999  // request. Use googleapi.IsNotModified to check whether the response
  6000  // error from Do is the result of In-None-Match.
  6001  func (c *CustomchannelsGetCall) IfNoneMatch(entityTag string) *CustomchannelsGetCall {
  6002  	c.ifNoneMatch_ = entityTag
  6003  	return c
  6004  }
  6005  
  6006  // Context sets the context to be used in this call's Do method. Any
  6007  // pending HTTP request will be aborted if the provided context is
  6008  // canceled.
  6009  func (c *CustomchannelsGetCall) Context(ctx context.Context) *CustomchannelsGetCall {
  6010  	c.ctx_ = ctx
  6011  	return c
  6012  }
  6013  
  6014  // Header returns an http.Header that can be modified by the caller to
  6015  // add HTTP headers to the request.
  6016  func (c *CustomchannelsGetCall) Header() http.Header {
  6017  	if c.header_ == nil {
  6018  		c.header_ = make(http.Header)
  6019  	}
  6020  	return c.header_
  6021  }
  6022  
  6023  func (c *CustomchannelsGetCall) doRequest(alt string) (*http.Response, error) {
  6024  	reqHeaders := make(http.Header)
  6025  	reqHeaders.Set("x-goog-api-client", "gl-go/1.13.7 gdcl/20200203")
  6026  	for k, v := range c.header_ {
  6027  		reqHeaders[k] = v
  6028  	}
  6029  	reqHeaders.Set("User-Agent", c.s.userAgent())
  6030  	if c.ifNoneMatch_ != "" {
  6031  		reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  6032  	}
  6033  	var body io.Reader = nil
  6034  	c.urlParams_.Set("alt", alt)
  6035  	c.urlParams_.Set("prettyPrint", "false")
  6036  	urls := googleapi.ResolveRelative(c.s.BasePath, "adclients/{adClientId}/customchannels/{customChannelId}")
  6037  	urls += "?" + c.urlParams_.Encode()
  6038  	req, err := http.NewRequest("GET", urls, body)
  6039  	if err != nil {
  6040  		return nil, err
  6041  	}
  6042  	req.Header = reqHeaders
  6043  	googleapi.Expand(req.URL, map[string]string{
  6044  		"adClientId":      c.adClientId,
  6045  		"customChannelId": c.customChannelId,
  6046  	})
  6047  	return gensupport.SendRequest(c.ctx_, c.s.client, req)
  6048  }
  6049  
  6050  // Do executes the "adsense.customchannels.get" call.
  6051  // Exactly one of *CustomChannel or error will be non-nil. Any non-2xx
  6052  // status code is an error. Response headers are in either
  6053  // *CustomChannel.ServerResponse.Header or (if a response was returned
  6054  // at all) in error.(*googleapi.Error).Header. Use
  6055  // googleapi.IsNotModified to check whether the returned error was
  6056  // because http.StatusNotModified was returned.
  6057  func (c *CustomchannelsGetCall) Do(opts ...googleapi.CallOption) (*CustomChannel, error) {
  6058  	gensupport.SetOptions(c.urlParams_, opts...)
  6059  	res, err := c.doRequest("json")
  6060  	if res != nil && res.StatusCode == http.StatusNotModified {
  6061  		if res.Body != nil {
  6062  			res.Body.Close()
  6063  		}
  6064  		return nil, &googleapi.Error{
  6065  			Code:   res.StatusCode,
  6066  			Header: res.Header,
  6067  		}
  6068  	}
  6069  	if err != nil {
  6070  		return nil, err
  6071  	}
  6072  	defer googleapi.CloseBody(res)
  6073  	if err := googleapi.CheckResponse(res); err != nil {
  6074  		return nil, err
  6075  	}
  6076  	ret := &CustomChannel{
  6077  		ServerResponse: googleapi.ServerResponse{
  6078  			Header:         res.Header,
  6079  			HTTPStatusCode: res.StatusCode,
  6080  		},
  6081  	}
  6082  	target := &ret
  6083  	if err := gensupport.DecodeResponse(target, res); err != nil {
  6084  		return nil, err
  6085  	}
  6086  	return ret, nil
  6087  	// {
  6088  	//   "description": "Get the specified custom channel from the specified ad client.",
  6089  	//   "httpMethod": "GET",
  6090  	//   "id": "adsense.customchannels.get",
  6091  	//   "parameterOrder": [
  6092  	//     "adClientId",
  6093  	//     "customChannelId"
  6094  	//   ],
  6095  	//   "parameters": {
  6096  	//     "adClientId": {
  6097  	//       "description": "Ad client which contains the custom channel.",
  6098  	//       "location": "path",
  6099  	//       "required": true,
  6100  	//       "type": "string"
  6101  	//     },
  6102  	//     "customChannelId": {
  6103  	//       "description": "Custom channel to retrieve.",
  6104  	//       "location": "path",
  6105  	//       "required": true,
  6106  	//       "type": "string"
  6107  	//     }
  6108  	//   },
  6109  	//   "path": "adclients/{adClientId}/customchannels/{customChannelId}",
  6110  	//   "response": {
  6111  	//     "$ref": "CustomChannel"
  6112  	//   },
  6113  	//   "scopes": [
  6114  	//     "https://www.googleapis.com/auth/adsense",
  6115  	//     "https://www.googleapis.com/auth/adsense.readonly"
  6116  	//   ]
  6117  	// }
  6118  
  6119  }
  6120  
  6121  // method id "adsense.customchannels.list":
  6122  
  6123  type CustomchannelsListCall struct {
  6124  	s            *Service
  6125  	adClientId   string
  6126  	urlParams_   gensupport.URLParams
  6127  	ifNoneMatch_ string
  6128  	ctx_         context.Context
  6129  	header_      http.Header
  6130  }
  6131  
  6132  // List: List all custom channels in the specified ad client for this
  6133  // AdSense account.
  6134  func (r *CustomchannelsService) List(adClientId string) *CustomchannelsListCall {
  6135  	c := &CustomchannelsListCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  6136  	c.adClientId = adClientId
  6137  	return c
  6138  }
  6139  
  6140  // MaxResults sets the optional parameter "maxResults": The maximum
  6141  // number of custom channels to include in the response, used for
  6142  // paging.
  6143  func (c *CustomchannelsListCall) MaxResults(maxResults int64) *CustomchannelsListCall {
  6144  	c.urlParams_.Set("maxResults", fmt.Sprint(maxResults))
  6145  	return c
  6146  }
  6147  
  6148  // PageToken sets the optional parameter "pageToken": A continuation
  6149  // token, used to page through custom channels. To retrieve the next
  6150  // page, set this parameter to the value of "nextPageToken" from the
  6151  // previous response.
  6152  func (c *CustomchannelsListCall) PageToken(pageToken string) *CustomchannelsListCall {
  6153  	c.urlParams_.Set("pageToken", pageToken)
  6154  	return c
  6155  }
  6156  
  6157  // Fields allows partial responses to be retrieved. See
  6158  // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  6159  // for more information.
  6160  func (c *CustomchannelsListCall) Fields(s ...googleapi.Field) *CustomchannelsListCall {
  6161  	c.urlParams_.Set("fields", googleapi.CombineFields(s))
  6162  	return c
  6163  }
  6164  
  6165  // IfNoneMatch sets the optional parameter which makes the operation
  6166  // fail if the object's ETag matches the given value. This is useful for
  6167  // getting updates only after the object has changed since the last
  6168  // request. Use googleapi.IsNotModified to check whether the response
  6169  // error from Do is the result of In-None-Match.
  6170  func (c *CustomchannelsListCall) IfNoneMatch(entityTag string) *CustomchannelsListCall {
  6171  	c.ifNoneMatch_ = entityTag
  6172  	return c
  6173  }
  6174  
  6175  // Context sets the context to be used in this call's Do method. Any
  6176  // pending HTTP request will be aborted if the provided context is
  6177  // canceled.
  6178  func (c *CustomchannelsListCall) Context(ctx context.Context) *CustomchannelsListCall {
  6179  	c.ctx_ = ctx
  6180  	return c
  6181  }
  6182  
  6183  // Header returns an http.Header that can be modified by the caller to
  6184  // add HTTP headers to the request.
  6185  func (c *CustomchannelsListCall) Header() http.Header {
  6186  	if c.header_ == nil {
  6187  		c.header_ = make(http.Header)
  6188  	}
  6189  	return c.header_
  6190  }
  6191  
  6192  func (c *CustomchannelsListCall) doRequest(alt string) (*http.Response, error) {
  6193  	reqHeaders := make(http.Header)
  6194  	reqHeaders.Set("x-goog-api-client", "gl-go/1.13.7 gdcl/20200203")
  6195  	for k, v := range c.header_ {
  6196  		reqHeaders[k] = v
  6197  	}
  6198  	reqHeaders.Set("User-Agent", c.s.userAgent())
  6199  	if c.ifNoneMatch_ != "" {
  6200  		reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  6201  	}
  6202  	var body io.Reader = nil
  6203  	c.urlParams_.Set("alt", alt)
  6204  	c.urlParams_.Set("prettyPrint", "false")
  6205  	urls := googleapi.ResolveRelative(c.s.BasePath, "adclients/{adClientId}/customchannels")
  6206  	urls += "?" + c.urlParams_.Encode()
  6207  	req, err := http.NewRequest("GET", urls, body)
  6208  	if err != nil {
  6209  		return nil, err
  6210  	}
  6211  	req.Header = reqHeaders
  6212  	googleapi.Expand(req.URL, map[string]string{
  6213  		"adClientId": c.adClientId,
  6214  	})
  6215  	return gensupport.SendRequest(c.ctx_, c.s.client, req)
  6216  }
  6217  
  6218  // Do executes the "adsense.customchannels.list" call.
  6219  // Exactly one of *CustomChannels or error will be non-nil. Any non-2xx
  6220  // status code is an error. Response headers are in either
  6221  // *CustomChannels.ServerResponse.Header or (if a response was returned
  6222  // at all) in error.(*googleapi.Error).Header. Use
  6223  // googleapi.IsNotModified to check whether the returned error was
  6224  // because http.StatusNotModified was returned.
  6225  func (c *CustomchannelsListCall) Do(opts ...googleapi.CallOption) (*CustomChannels, error) {
  6226  	gensupport.SetOptions(c.urlParams_, opts...)
  6227  	res, err := c.doRequest("json")
  6228  	if res != nil && res.StatusCode == http.StatusNotModified {
  6229  		if res.Body != nil {
  6230  			res.Body.Close()
  6231  		}
  6232  		return nil, &googleapi.Error{
  6233  			Code:   res.StatusCode,
  6234  			Header: res.Header,
  6235  		}
  6236  	}
  6237  	if err != nil {
  6238  		return nil, err
  6239  	}
  6240  	defer googleapi.CloseBody(res)
  6241  	if err := googleapi.CheckResponse(res); err != nil {
  6242  		return nil, err
  6243  	}
  6244  	ret := &CustomChannels{
  6245  		ServerResponse: googleapi.ServerResponse{
  6246  			Header:         res.Header,
  6247  			HTTPStatusCode: res.StatusCode,
  6248  		},
  6249  	}
  6250  	target := &ret
  6251  	if err := gensupport.DecodeResponse(target, res); err != nil {
  6252  		return nil, err
  6253  	}
  6254  	return ret, nil
  6255  	// {
  6256  	//   "description": "List all custom channels in the specified ad client for this AdSense account.",
  6257  	//   "httpMethod": "GET",
  6258  	//   "id": "adsense.customchannels.list",
  6259  	//   "parameterOrder": [
  6260  	//     "adClientId"
  6261  	//   ],
  6262  	//   "parameters": {
  6263  	//     "adClientId": {
  6264  	//       "description": "Ad client for which to list custom channels.",
  6265  	//       "location": "path",
  6266  	//       "required": true,
  6267  	//       "type": "string"
  6268  	//     },
  6269  	//     "maxResults": {
  6270  	//       "description": "The maximum number of custom channels to include in the response, used for paging.",
  6271  	//       "format": "int32",
  6272  	//       "location": "query",
  6273  	//       "maximum": "10000",
  6274  	//       "minimum": "0",
  6275  	//       "type": "integer"
  6276  	//     },
  6277  	//     "pageToken": {
  6278  	//       "description": "A continuation token, used to page through custom channels. To retrieve the next page, set this parameter to the value of \"nextPageToken\" from the previous response.",
  6279  	//       "location": "query",
  6280  	//       "type": "string"
  6281  	//     }
  6282  	//   },
  6283  	//   "path": "adclients/{adClientId}/customchannels",
  6284  	//   "response": {
  6285  	//     "$ref": "CustomChannels"
  6286  	//   },
  6287  	//   "scopes": [
  6288  	//     "https://www.googleapis.com/auth/adsense",
  6289  	//     "https://www.googleapis.com/auth/adsense.readonly"
  6290  	//   ]
  6291  	// }
  6292  
  6293  }
  6294  
  6295  // Pages invokes f for each page of results.
  6296  // A non-nil error returned from f will halt the iteration.
  6297  // The provided context supersedes any context provided to the Context method.
  6298  func (c *CustomchannelsListCall) Pages(ctx context.Context, f func(*CustomChannels) error) error {
  6299  	c.ctx_ = ctx
  6300  	defer c.PageToken(c.urlParams_.Get("pageToken")) // reset paging to original point
  6301  	for {
  6302  		x, err := c.Do()
  6303  		if err != nil {
  6304  			return err
  6305  		}
  6306  		if err := f(x); err != nil {
  6307  			return err
  6308  		}
  6309  		if x.NextPageToken == "" {
  6310  			return nil
  6311  		}
  6312  		c.PageToken(x.NextPageToken)
  6313  	}
  6314  }
  6315  
  6316  // method id "adsense.customchannels.adunits.list":
  6317  
  6318  type CustomchannelsAdunitsListCall struct {
  6319  	s               *Service
  6320  	adClientId      string
  6321  	customChannelId string
  6322  	urlParams_      gensupport.URLParams
  6323  	ifNoneMatch_    string
  6324  	ctx_            context.Context
  6325  	header_         http.Header
  6326  }
  6327  
  6328  // List: List all ad units in the specified custom channel.
  6329  func (r *CustomchannelsAdunitsService) List(adClientId string, customChannelId string) *CustomchannelsAdunitsListCall {
  6330  	c := &CustomchannelsAdunitsListCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  6331  	c.adClientId = adClientId
  6332  	c.customChannelId = customChannelId
  6333  	return c
  6334  }
  6335  
  6336  // IncludeInactive sets the optional parameter "includeInactive":
  6337  // Whether to include inactive ad units. Default: true.
  6338  func (c *CustomchannelsAdunitsListCall) IncludeInactive(includeInactive bool) *CustomchannelsAdunitsListCall {
  6339  	c.urlParams_.Set("includeInactive", fmt.Sprint(includeInactive))
  6340  	return c
  6341  }
  6342  
  6343  // MaxResults sets the optional parameter "maxResults": The maximum
  6344  // number of ad units to include in the response, used for paging.
  6345  func (c *CustomchannelsAdunitsListCall) MaxResults(maxResults int64) *CustomchannelsAdunitsListCall {
  6346  	c.urlParams_.Set("maxResults", fmt.Sprint(maxResults))
  6347  	return c
  6348  }
  6349  
  6350  // PageToken sets the optional parameter "pageToken": A continuation
  6351  // token, used to page through ad units. To retrieve the next page, set
  6352  // this parameter to the value of "nextPageToken" from the previous
  6353  // response.
  6354  func (c *CustomchannelsAdunitsListCall) PageToken(pageToken string) *CustomchannelsAdunitsListCall {
  6355  	c.urlParams_.Set("pageToken", pageToken)
  6356  	return c
  6357  }
  6358  
  6359  // Fields allows partial responses to be retrieved. See
  6360  // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  6361  // for more information.
  6362  func (c *CustomchannelsAdunitsListCall) Fields(s ...googleapi.Field) *CustomchannelsAdunitsListCall {
  6363  	c.urlParams_.Set("fields", googleapi.CombineFields(s))
  6364  	return c
  6365  }
  6366  
  6367  // IfNoneMatch sets the optional parameter which makes the operation
  6368  // fail if the object's ETag matches the given value. This is useful for
  6369  // getting updates only after the object has changed since the last
  6370  // request. Use googleapi.IsNotModified to check whether the response
  6371  // error from Do is the result of In-None-Match.
  6372  func (c *CustomchannelsAdunitsListCall) IfNoneMatch(entityTag string) *CustomchannelsAdunitsListCall {
  6373  	c.ifNoneMatch_ = entityTag
  6374  	return c
  6375  }
  6376  
  6377  // Context sets the context to be used in this call's Do method. Any
  6378  // pending HTTP request will be aborted if the provided context is
  6379  // canceled.
  6380  func (c *CustomchannelsAdunitsListCall) Context(ctx context.Context) *CustomchannelsAdunitsListCall {
  6381  	c.ctx_ = ctx
  6382  	return c
  6383  }
  6384  
  6385  // Header returns an http.Header that can be modified by the caller to
  6386  // add HTTP headers to the request.
  6387  func (c *CustomchannelsAdunitsListCall) Header() http.Header {
  6388  	if c.header_ == nil {
  6389  		c.header_ = make(http.Header)
  6390  	}
  6391  	return c.header_
  6392  }
  6393  
  6394  func (c *CustomchannelsAdunitsListCall) doRequest(alt string) (*http.Response, error) {
  6395  	reqHeaders := make(http.Header)
  6396  	reqHeaders.Set("x-goog-api-client", "gl-go/1.13.7 gdcl/20200203")
  6397  	for k, v := range c.header_ {
  6398  		reqHeaders[k] = v
  6399  	}
  6400  	reqHeaders.Set("User-Agent", c.s.userAgent())
  6401  	if c.ifNoneMatch_ != "" {
  6402  		reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  6403  	}
  6404  	var body io.Reader = nil
  6405  	c.urlParams_.Set("alt", alt)
  6406  	c.urlParams_.Set("prettyPrint", "false")
  6407  	urls := googleapi.ResolveRelative(c.s.BasePath, "adclients/{adClientId}/customchannels/{customChannelId}/adunits")
  6408  	urls += "?" + c.urlParams_.Encode()
  6409  	req, err := http.NewRequest("GET", urls, body)
  6410  	if err != nil {
  6411  		return nil, err
  6412  	}
  6413  	req.Header = reqHeaders
  6414  	googleapi.Expand(req.URL, map[string]string{
  6415  		"adClientId":      c.adClientId,
  6416  		"customChannelId": c.customChannelId,
  6417  	})
  6418  	return gensupport.SendRequest(c.ctx_, c.s.client, req)
  6419  }
  6420  
  6421  // Do executes the "adsense.customchannels.adunits.list" call.
  6422  // Exactly one of *AdUnits or error will be non-nil. Any non-2xx status
  6423  // code is an error. Response headers are in either
  6424  // *AdUnits.ServerResponse.Header or (if a response was returned at all)
  6425  // in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to
  6426  // check whether the returned error was because http.StatusNotModified
  6427  // was returned.
  6428  func (c *CustomchannelsAdunitsListCall) Do(opts ...googleapi.CallOption) (*AdUnits, error) {
  6429  	gensupport.SetOptions(c.urlParams_, opts...)
  6430  	res, err := c.doRequest("json")
  6431  	if res != nil && res.StatusCode == http.StatusNotModified {
  6432  		if res.Body != nil {
  6433  			res.Body.Close()
  6434  		}
  6435  		return nil, &googleapi.Error{
  6436  			Code:   res.StatusCode,
  6437  			Header: res.Header,
  6438  		}
  6439  	}
  6440  	if err != nil {
  6441  		return nil, err
  6442  	}
  6443  	defer googleapi.CloseBody(res)
  6444  	if err := googleapi.CheckResponse(res); err != nil {
  6445  		return nil, err
  6446  	}
  6447  	ret := &AdUnits{
  6448  		ServerResponse: googleapi.ServerResponse{
  6449  			Header:         res.Header,
  6450  			HTTPStatusCode: res.StatusCode,
  6451  		},
  6452  	}
  6453  	target := &ret
  6454  	if err := gensupport.DecodeResponse(target, res); err != nil {
  6455  		return nil, err
  6456  	}
  6457  	return ret, nil
  6458  	// {
  6459  	//   "description": "List all ad units in the specified custom channel.",
  6460  	//   "httpMethod": "GET",
  6461  	//   "id": "adsense.customchannels.adunits.list",
  6462  	//   "parameterOrder": [
  6463  	//     "adClientId",
  6464  	//     "customChannelId"
  6465  	//   ],
  6466  	//   "parameters": {
  6467  	//     "adClientId": {
  6468  	//       "description": "Ad client which contains the custom channel.",
  6469  	//       "location": "path",
  6470  	//       "required": true,
  6471  	//       "type": "string"
  6472  	//     },
  6473  	//     "customChannelId": {
  6474  	//       "description": "Custom channel for which to list ad units.",
  6475  	//       "location": "path",
  6476  	//       "required": true,
  6477  	//       "type": "string"
  6478  	//     },
  6479  	//     "includeInactive": {
  6480  	//       "description": "Whether to include inactive ad units. Default: true.",
  6481  	//       "location": "query",
  6482  	//       "type": "boolean"
  6483  	//     },
  6484  	//     "maxResults": {
  6485  	//       "description": "The maximum number of ad units to include in the response, used for paging.",
  6486  	//       "format": "int32",
  6487  	//       "location": "query",
  6488  	//       "maximum": "10000",
  6489  	//       "minimum": "0",
  6490  	//       "type": "integer"
  6491  	//     },
  6492  	//     "pageToken": {
  6493  	//       "description": "A continuation token, used to page through ad units. To retrieve the next page, set this parameter to the value of \"nextPageToken\" from the previous response.",
  6494  	//       "location": "query",
  6495  	//       "type": "string"
  6496  	//     }
  6497  	//   },
  6498  	//   "path": "adclients/{adClientId}/customchannels/{customChannelId}/adunits",
  6499  	//   "response": {
  6500  	//     "$ref": "AdUnits"
  6501  	//   },
  6502  	//   "scopes": [
  6503  	//     "https://www.googleapis.com/auth/adsense",
  6504  	//     "https://www.googleapis.com/auth/adsense.readonly"
  6505  	//   ]
  6506  	// }
  6507  
  6508  }
  6509  
  6510  // Pages invokes f for each page of results.
  6511  // A non-nil error returned from f will halt the iteration.
  6512  // The provided context supersedes any context provided to the Context method.
  6513  func (c *CustomchannelsAdunitsListCall) Pages(ctx context.Context, f func(*AdUnits) error) error {
  6514  	c.ctx_ = ctx
  6515  	defer c.PageToken(c.urlParams_.Get("pageToken")) // reset paging to original point
  6516  	for {
  6517  		x, err := c.Do()
  6518  		if err != nil {
  6519  			return err
  6520  		}
  6521  		if err := f(x); err != nil {
  6522  			return err
  6523  		}
  6524  		if x.NextPageToken == "" {
  6525  			return nil
  6526  		}
  6527  		c.PageToken(x.NextPageToken)
  6528  	}
  6529  }
  6530  
  6531  // method id "adsense.metadata.dimensions.list":
  6532  
  6533  type MetadataDimensionsListCall struct {
  6534  	s            *Service
  6535  	urlParams_   gensupport.URLParams
  6536  	ifNoneMatch_ string
  6537  	ctx_         context.Context
  6538  	header_      http.Header
  6539  }
  6540  
  6541  // List: List the metadata for the dimensions available to this AdSense
  6542  // account.
  6543  func (r *MetadataDimensionsService) List() *MetadataDimensionsListCall {
  6544  	c := &MetadataDimensionsListCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  6545  	return c
  6546  }
  6547  
  6548  // Fields allows partial responses to be retrieved. See
  6549  // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  6550  // for more information.
  6551  func (c *MetadataDimensionsListCall) Fields(s ...googleapi.Field) *MetadataDimensionsListCall {
  6552  	c.urlParams_.Set("fields", googleapi.CombineFields(s))
  6553  	return c
  6554  }
  6555  
  6556  // IfNoneMatch sets the optional parameter which makes the operation
  6557  // fail if the object's ETag matches the given value. This is useful for
  6558  // getting updates only after the object has changed since the last
  6559  // request. Use googleapi.IsNotModified to check whether the response
  6560  // error from Do is the result of In-None-Match.
  6561  func (c *MetadataDimensionsListCall) IfNoneMatch(entityTag string) *MetadataDimensionsListCall {
  6562  	c.ifNoneMatch_ = entityTag
  6563  	return c
  6564  }
  6565  
  6566  // Context sets the context to be used in this call's Do method. Any
  6567  // pending HTTP request will be aborted if the provided context is
  6568  // canceled.
  6569  func (c *MetadataDimensionsListCall) Context(ctx context.Context) *MetadataDimensionsListCall {
  6570  	c.ctx_ = ctx
  6571  	return c
  6572  }
  6573  
  6574  // Header returns an http.Header that can be modified by the caller to
  6575  // add HTTP headers to the request.
  6576  func (c *MetadataDimensionsListCall) Header() http.Header {
  6577  	if c.header_ == nil {
  6578  		c.header_ = make(http.Header)
  6579  	}
  6580  	return c.header_
  6581  }
  6582  
  6583  func (c *MetadataDimensionsListCall) doRequest(alt string) (*http.Response, error) {
  6584  	reqHeaders := make(http.Header)
  6585  	reqHeaders.Set("x-goog-api-client", "gl-go/1.13.7 gdcl/20200203")
  6586  	for k, v := range c.header_ {
  6587  		reqHeaders[k] = v
  6588  	}
  6589  	reqHeaders.Set("User-Agent", c.s.userAgent())
  6590  	if c.ifNoneMatch_ != "" {
  6591  		reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  6592  	}
  6593  	var body io.Reader = nil
  6594  	c.urlParams_.Set("alt", alt)
  6595  	c.urlParams_.Set("prettyPrint", "false")
  6596  	urls := googleapi.ResolveRelative(c.s.BasePath, "metadata/dimensions")
  6597  	urls += "?" + c.urlParams_.Encode()
  6598  	req, err := http.NewRequest("GET", urls, body)
  6599  	if err != nil {
  6600  		return nil, err
  6601  	}
  6602  	req.Header = reqHeaders
  6603  	return gensupport.SendRequest(c.ctx_, c.s.client, req)
  6604  }
  6605  
  6606  // Do executes the "adsense.metadata.dimensions.list" call.
  6607  // Exactly one of *Metadata or error will be non-nil. Any non-2xx status
  6608  // code is an error. Response headers are in either
  6609  // *Metadata.ServerResponse.Header or (if a response was returned at
  6610  // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  6611  // to check whether the returned error was because
  6612  // http.StatusNotModified was returned.
  6613  func (c *MetadataDimensionsListCall) Do(opts ...googleapi.CallOption) (*Metadata, error) {
  6614  	gensupport.SetOptions(c.urlParams_, opts...)
  6615  	res, err := c.doRequest("json")
  6616  	if res != nil && res.StatusCode == http.StatusNotModified {
  6617  		if res.Body != nil {
  6618  			res.Body.Close()
  6619  		}
  6620  		return nil, &googleapi.Error{
  6621  			Code:   res.StatusCode,
  6622  			Header: res.Header,
  6623  		}
  6624  	}
  6625  	if err != nil {
  6626  		return nil, err
  6627  	}
  6628  	defer googleapi.CloseBody(res)
  6629  	if err := googleapi.CheckResponse(res); err != nil {
  6630  		return nil, err
  6631  	}
  6632  	ret := &Metadata{
  6633  		ServerResponse: googleapi.ServerResponse{
  6634  			Header:         res.Header,
  6635  			HTTPStatusCode: res.StatusCode,
  6636  		},
  6637  	}
  6638  	target := &ret
  6639  	if err := gensupport.DecodeResponse(target, res); err != nil {
  6640  		return nil, err
  6641  	}
  6642  	return ret, nil
  6643  	// {
  6644  	//   "description": "List the metadata for the dimensions available to this AdSense account.",
  6645  	//   "httpMethod": "GET",
  6646  	//   "id": "adsense.metadata.dimensions.list",
  6647  	//   "path": "metadata/dimensions",
  6648  	//   "response": {
  6649  	//     "$ref": "Metadata"
  6650  	//   },
  6651  	//   "scopes": [
  6652  	//     "https://www.googleapis.com/auth/adsense",
  6653  	//     "https://www.googleapis.com/auth/adsense.readonly"
  6654  	//   ]
  6655  	// }
  6656  
  6657  }
  6658  
  6659  // method id "adsense.metadata.metrics.list":
  6660  
  6661  type MetadataMetricsListCall struct {
  6662  	s            *Service
  6663  	urlParams_   gensupport.URLParams
  6664  	ifNoneMatch_ string
  6665  	ctx_         context.Context
  6666  	header_      http.Header
  6667  }
  6668  
  6669  // List: List the metadata for the metrics available to this AdSense
  6670  // account.
  6671  func (r *MetadataMetricsService) List() *MetadataMetricsListCall {
  6672  	c := &MetadataMetricsListCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  6673  	return c
  6674  }
  6675  
  6676  // Fields allows partial responses to be retrieved. See
  6677  // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  6678  // for more information.
  6679  func (c *MetadataMetricsListCall) Fields(s ...googleapi.Field) *MetadataMetricsListCall {
  6680  	c.urlParams_.Set("fields", googleapi.CombineFields(s))
  6681  	return c
  6682  }
  6683  
  6684  // IfNoneMatch sets the optional parameter which makes the operation
  6685  // fail if the object's ETag matches the given value. This is useful for
  6686  // getting updates only after the object has changed since the last
  6687  // request. Use googleapi.IsNotModified to check whether the response
  6688  // error from Do is the result of In-None-Match.
  6689  func (c *MetadataMetricsListCall) IfNoneMatch(entityTag string) *MetadataMetricsListCall {
  6690  	c.ifNoneMatch_ = entityTag
  6691  	return c
  6692  }
  6693  
  6694  // Context sets the context to be used in this call's Do method. Any
  6695  // pending HTTP request will be aborted if the provided context is
  6696  // canceled.
  6697  func (c *MetadataMetricsListCall) Context(ctx context.Context) *MetadataMetricsListCall {
  6698  	c.ctx_ = ctx
  6699  	return c
  6700  }
  6701  
  6702  // Header returns an http.Header that can be modified by the caller to
  6703  // add HTTP headers to the request.
  6704  func (c *MetadataMetricsListCall) Header() http.Header {
  6705  	if c.header_ == nil {
  6706  		c.header_ = make(http.Header)
  6707  	}
  6708  	return c.header_
  6709  }
  6710  
  6711  func (c *MetadataMetricsListCall) doRequest(alt string) (*http.Response, error) {
  6712  	reqHeaders := make(http.Header)
  6713  	reqHeaders.Set("x-goog-api-client", "gl-go/1.13.7 gdcl/20200203")
  6714  	for k, v := range c.header_ {
  6715  		reqHeaders[k] = v
  6716  	}
  6717  	reqHeaders.Set("User-Agent", c.s.userAgent())
  6718  	if c.ifNoneMatch_ != "" {
  6719  		reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  6720  	}
  6721  	var body io.Reader = nil
  6722  	c.urlParams_.Set("alt", alt)
  6723  	c.urlParams_.Set("prettyPrint", "false")
  6724  	urls := googleapi.ResolveRelative(c.s.BasePath, "metadata/metrics")
  6725  	urls += "?" + c.urlParams_.Encode()
  6726  	req, err := http.NewRequest("GET", urls, body)
  6727  	if err != nil {
  6728  		return nil, err
  6729  	}
  6730  	req.Header = reqHeaders
  6731  	return gensupport.SendRequest(c.ctx_, c.s.client, req)
  6732  }
  6733  
  6734  // Do executes the "adsense.metadata.metrics.list" call.
  6735  // Exactly one of *Metadata or error will be non-nil. Any non-2xx status
  6736  // code is an error. Response headers are in either
  6737  // *Metadata.ServerResponse.Header or (if a response was returned at
  6738  // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  6739  // to check whether the returned error was because
  6740  // http.StatusNotModified was returned.
  6741  func (c *MetadataMetricsListCall) Do(opts ...googleapi.CallOption) (*Metadata, error) {
  6742  	gensupport.SetOptions(c.urlParams_, opts...)
  6743  	res, err := c.doRequest("json")
  6744  	if res != nil && res.StatusCode == http.StatusNotModified {
  6745  		if res.Body != nil {
  6746  			res.Body.Close()
  6747  		}
  6748  		return nil, &googleapi.Error{
  6749  			Code:   res.StatusCode,
  6750  			Header: res.Header,
  6751  		}
  6752  	}
  6753  	if err != nil {
  6754  		return nil, err
  6755  	}
  6756  	defer googleapi.CloseBody(res)
  6757  	if err := googleapi.CheckResponse(res); err != nil {
  6758  		return nil, err
  6759  	}
  6760  	ret := &Metadata{
  6761  		ServerResponse: googleapi.ServerResponse{
  6762  			Header:         res.Header,
  6763  			HTTPStatusCode: res.StatusCode,
  6764  		},
  6765  	}
  6766  	target := &ret
  6767  	if err := gensupport.DecodeResponse(target, res); err != nil {
  6768  		return nil, err
  6769  	}
  6770  	return ret, nil
  6771  	// {
  6772  	//   "description": "List the metadata for the metrics available to this AdSense account.",
  6773  	//   "httpMethod": "GET",
  6774  	//   "id": "adsense.metadata.metrics.list",
  6775  	//   "path": "metadata/metrics",
  6776  	//   "response": {
  6777  	//     "$ref": "Metadata"
  6778  	//   },
  6779  	//   "scopes": [
  6780  	//     "https://www.googleapis.com/auth/adsense",
  6781  	//     "https://www.googleapis.com/auth/adsense.readonly"
  6782  	//   ]
  6783  	// }
  6784  
  6785  }
  6786  
  6787  // method id "adsense.reports.generate":
  6788  
  6789  type ReportsGenerateCall struct {
  6790  	s            *Service
  6791  	urlParams_   gensupport.URLParams
  6792  	ifNoneMatch_ string
  6793  	ctx_         context.Context
  6794  	header_      http.Header
  6795  }
  6796  
  6797  // Generate: Generate an AdSense report based on the report request sent
  6798  // in the query parameters. Returns the result as JSON; to retrieve
  6799  // output in CSV format specify "alt=csv" as a query parameter.
  6800  func (r *ReportsService) Generate(startDate string, endDate string) *ReportsGenerateCall {
  6801  	c := &ReportsGenerateCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  6802  	c.urlParams_.Set("startDate", startDate)
  6803  	c.urlParams_.Set("endDate", endDate)
  6804  	return c
  6805  }
  6806  
  6807  // AccountId sets the optional parameter "accountId": Accounts upon
  6808  // which to report.
  6809  func (c *ReportsGenerateCall) AccountId(accountId ...string) *ReportsGenerateCall {
  6810  	c.urlParams_.SetMulti("accountId", append([]string{}, accountId...))
  6811  	return c
  6812  }
  6813  
  6814  // Currency sets the optional parameter "currency": Optional currency to
  6815  // use when reporting on monetary metrics. Defaults to the account's
  6816  // currency if not set.
  6817  func (c *ReportsGenerateCall) Currency(currency string) *ReportsGenerateCall {
  6818  	c.urlParams_.Set("currency", currency)
  6819  	return c
  6820  }
  6821  
  6822  // Dimension sets the optional parameter "dimension": Dimensions to base
  6823  // the report on.
  6824  func (c *ReportsGenerateCall) Dimension(dimension ...string) *ReportsGenerateCall {
  6825  	c.urlParams_.SetMulti("dimension", append([]string{}, dimension...))
  6826  	return c
  6827  }
  6828  
  6829  // Filter sets the optional parameter "filter": Filters to be run on the
  6830  // report.
  6831  func (c *ReportsGenerateCall) Filter(filter ...string) *ReportsGenerateCall {
  6832  	c.urlParams_.SetMulti("filter", append([]string{}, filter...))
  6833  	return c
  6834  }
  6835  
  6836  // Locale sets the optional parameter "locale": Optional locale to use
  6837  // for translating report output to a local language. Defaults to
  6838  // "en_US" if not specified.
  6839  func (c *ReportsGenerateCall) Locale(locale string) *ReportsGenerateCall {
  6840  	c.urlParams_.Set("locale", locale)
  6841  	return c
  6842  }
  6843  
  6844  // MaxResults sets the optional parameter "maxResults": The maximum
  6845  // number of rows of report data to return.
  6846  func (c *ReportsGenerateCall) MaxResults(maxResults int64) *ReportsGenerateCall {
  6847  	c.urlParams_.Set("maxResults", fmt.Sprint(maxResults))
  6848  	return c
  6849  }
  6850  
  6851  // Metric sets the optional parameter "metric": Numeric columns to
  6852  // include in the report.
  6853  func (c *ReportsGenerateCall) Metric(metric ...string) *ReportsGenerateCall {
  6854  	c.urlParams_.SetMulti("metric", append([]string{}, metric...))
  6855  	return c
  6856  }
  6857  
  6858  // Sort sets the optional parameter "sort": The name of a dimension or
  6859  // metric to sort the resulting report on, optionally prefixed with "+"
  6860  // to sort ascending or "-" to sort descending. If no prefix is
  6861  // specified, the column is sorted ascending.
  6862  func (c *ReportsGenerateCall) Sort(sort ...string) *ReportsGenerateCall {
  6863  	c.urlParams_.SetMulti("sort", append([]string{}, sort...))
  6864  	return c
  6865  }
  6866  
  6867  // StartIndex sets the optional parameter "startIndex": Index of the
  6868  // first row of report data to return.
  6869  func (c *ReportsGenerateCall) StartIndex(startIndex int64) *ReportsGenerateCall {
  6870  	c.urlParams_.Set("startIndex", fmt.Sprint(startIndex))
  6871  	return c
  6872  }
  6873  
  6874  // UseTimezoneReporting sets the optional parameter
  6875  // "useTimezoneReporting": Whether the report should be generated in the
  6876  // AdSense account's local timezone. If false default PST/PDT timezone
  6877  // will be used.
  6878  func (c *ReportsGenerateCall) UseTimezoneReporting(useTimezoneReporting bool) *ReportsGenerateCall {
  6879  	c.urlParams_.Set("useTimezoneReporting", fmt.Sprint(useTimezoneReporting))
  6880  	return c
  6881  }
  6882  
  6883  // Fields allows partial responses to be retrieved. See
  6884  // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  6885  // for more information.
  6886  func (c *ReportsGenerateCall) Fields(s ...googleapi.Field) *ReportsGenerateCall {
  6887  	c.urlParams_.Set("fields", googleapi.CombineFields(s))
  6888  	return c
  6889  }
  6890  
  6891  // IfNoneMatch sets the optional parameter which makes the operation
  6892  // fail if the object's ETag matches the given value. This is useful for
  6893  // getting updates only after the object has changed since the last
  6894  // request. Use googleapi.IsNotModified to check whether the response
  6895  // error from Do is the result of In-None-Match.
  6896  func (c *ReportsGenerateCall) IfNoneMatch(entityTag string) *ReportsGenerateCall {
  6897  	c.ifNoneMatch_ = entityTag
  6898  	return c
  6899  }
  6900  
  6901  // Context sets the context to be used in this call's Do and Download
  6902  // methods. Any pending HTTP request will be aborted if the provided
  6903  // context is canceled.
  6904  func (c *ReportsGenerateCall) Context(ctx context.Context) *ReportsGenerateCall {
  6905  	c.ctx_ = ctx
  6906  	return c
  6907  }
  6908  
  6909  // Header returns an http.Header that can be modified by the caller to
  6910  // add HTTP headers to the request.
  6911  func (c *ReportsGenerateCall) Header() http.Header {
  6912  	if c.header_ == nil {
  6913  		c.header_ = make(http.Header)
  6914  	}
  6915  	return c.header_
  6916  }
  6917  
  6918  func (c *ReportsGenerateCall) doRequest(alt string) (*http.Response, error) {
  6919  	reqHeaders := make(http.Header)
  6920  	reqHeaders.Set("x-goog-api-client", "gl-go/1.13.7 gdcl/20200203")
  6921  	for k, v := range c.header_ {
  6922  		reqHeaders[k] = v
  6923  	}
  6924  	reqHeaders.Set("User-Agent", c.s.userAgent())
  6925  	if c.ifNoneMatch_ != "" {
  6926  		reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  6927  	}
  6928  	var body io.Reader = nil
  6929  	c.urlParams_.Set("alt", alt)
  6930  	c.urlParams_.Set("prettyPrint", "false")
  6931  	urls := googleapi.ResolveRelative(c.s.BasePath, "reports")
  6932  	urls += "?" + c.urlParams_.Encode()
  6933  	req, err := http.NewRequest("GET", urls, body)
  6934  	if err != nil {
  6935  		return nil, err
  6936  	}
  6937  	req.Header = reqHeaders
  6938  	return gensupport.SendRequest(c.ctx_, c.s.client, req)
  6939  }
  6940  
  6941  // Download fetches the API endpoint's "media" value, instead of the normal
  6942  // API response value. If the returned error is nil, the Response is guaranteed to
  6943  // have a 2xx status code. Callers must close the Response.Body as usual.
  6944  func (c *ReportsGenerateCall) Download(opts ...googleapi.CallOption) (*http.Response, error) {
  6945  	gensupport.SetOptions(c.urlParams_, opts...)
  6946  	res, err := c.doRequest("media")
  6947  	if err != nil {
  6948  		return nil, err
  6949  	}
  6950  	if err := googleapi.CheckMediaResponse(res); err != nil {
  6951  		res.Body.Close()
  6952  		return nil, err
  6953  	}
  6954  	return res, nil
  6955  }
  6956  
  6957  // Do executes the "adsense.reports.generate" call.
  6958  // Exactly one of *AdsenseReportsGenerateResponse or error will be
  6959  // non-nil. Any non-2xx status code is an error. Response headers are in
  6960  // either *AdsenseReportsGenerateResponse.ServerResponse.Header or (if a
  6961  // response was returned at all) in error.(*googleapi.Error).Header. Use
  6962  // googleapi.IsNotModified to check whether the returned error was
  6963  // because http.StatusNotModified was returned.
  6964  func (c *ReportsGenerateCall) Do(opts ...googleapi.CallOption) (*AdsenseReportsGenerateResponse, error) {
  6965  	gensupport.SetOptions(c.urlParams_, opts...)
  6966  	res, err := c.doRequest("json")
  6967  	if res != nil && res.StatusCode == http.StatusNotModified {
  6968  		if res.Body != nil {
  6969  			res.Body.Close()
  6970  		}
  6971  		return nil, &googleapi.Error{
  6972  			Code:   res.StatusCode,
  6973  			Header: res.Header,
  6974  		}
  6975  	}
  6976  	if err != nil {
  6977  		return nil, err
  6978  	}
  6979  	defer googleapi.CloseBody(res)
  6980  	if err := googleapi.CheckResponse(res); err != nil {
  6981  		return nil, err
  6982  	}
  6983  	ret := &AdsenseReportsGenerateResponse{
  6984  		ServerResponse: googleapi.ServerResponse{
  6985  			Header:         res.Header,
  6986  			HTTPStatusCode: res.StatusCode,
  6987  		},
  6988  	}
  6989  	target := &ret
  6990  	if err := gensupport.DecodeResponse(target, res); err != nil {
  6991  		return nil, err
  6992  	}
  6993  	return ret, nil
  6994  	// {
  6995  	//   "description": "Generate an AdSense report based on the report request sent in the query parameters. Returns the result as JSON; to retrieve output in CSV format specify \"alt=csv\" as a query parameter.",
  6996  	//   "httpMethod": "GET",
  6997  	//   "id": "adsense.reports.generate",
  6998  	//   "parameterOrder": [
  6999  	//     "startDate",
  7000  	//     "endDate"
  7001  	//   ],
  7002  	//   "parameters": {
  7003  	//     "accountId": {
  7004  	//       "description": "Accounts upon which to report.",
  7005  	//       "location": "query",
  7006  	//       "repeated": true,
  7007  	//       "type": "string"
  7008  	//     },
  7009  	//     "currency": {
  7010  	//       "description": "Optional currency to use when reporting on monetary metrics. Defaults to the account's currency if not set.",
  7011  	//       "location": "query",
  7012  	//       "pattern": "[a-zA-Z]+",
  7013  	//       "type": "string"
  7014  	//     },
  7015  	//     "dimension": {
  7016  	//       "description": "Dimensions to base the report on.",
  7017  	//       "location": "query",
  7018  	//       "pattern": "[a-zA-Z_]+",
  7019  	//       "repeated": true,
  7020  	//       "type": "string"
  7021  	//     },
  7022  	//     "endDate": {
  7023  	//       "description": "End of the date range to report on in \"YYYY-MM-DD\" format, inclusive.",
  7024  	//       "location": "query",
  7025  	//       "pattern": "\\d{4}-\\d{2}-\\d{2}|(today|startOfMonth|startOfYear)(([\\-\\+]\\d+[dwmy]){0,3}?)",
  7026  	//       "required": true,
  7027  	//       "type": "string"
  7028  	//     },
  7029  	//     "filter": {
  7030  	//       "description": "Filters to be run on the report.",
  7031  	//       "location": "query",
  7032  	//       "pattern": "[a-zA-Z_]+(==|=@).+",
  7033  	//       "repeated": true,
  7034  	//       "type": "string"
  7035  	//     },
  7036  	//     "locale": {
  7037  	//       "description": "Optional locale to use for translating report output to a local language. Defaults to \"en_US\" if not specified.",
  7038  	//       "location": "query",
  7039  	//       "pattern": "[a-zA-Z_]+",
  7040  	//       "type": "string"
  7041  	//     },
  7042  	//     "maxResults": {
  7043  	//       "description": "The maximum number of rows of report data to return.",
  7044  	//       "format": "int32",
  7045  	//       "location": "query",
  7046  	//       "maximum": "50000",
  7047  	//       "minimum": "0",
  7048  	//       "type": "integer"
  7049  	//     },
  7050  	//     "metric": {
  7051  	//       "description": "Numeric columns to include in the report.",
  7052  	//       "location": "query",
  7053  	//       "pattern": "[a-zA-Z_]+",
  7054  	//       "repeated": true,
  7055  	//       "type": "string"
  7056  	//     },
  7057  	//     "sort": {
  7058  	//       "description": "The name of a dimension or metric to sort the resulting report on, optionally prefixed with \"+\" to sort ascending or \"-\" to sort descending. If no prefix is specified, the column is sorted ascending.",
  7059  	//       "location": "query",
  7060  	//       "pattern": "(\\+|-)?[a-zA-Z_]+",
  7061  	//       "repeated": true,
  7062  	//       "type": "string"
  7063  	//     },
  7064  	//     "startDate": {
  7065  	//       "description": "Start of the date range to report on in \"YYYY-MM-DD\" format, inclusive.",
  7066  	//       "location": "query",
  7067  	//       "pattern": "\\d{4}-\\d{2}-\\d{2}|(today|startOfMonth|startOfYear)(([\\-\\+]\\d+[dwmy]){0,3}?)",
  7068  	//       "required": true,
  7069  	//       "type": "string"
  7070  	//     },
  7071  	//     "startIndex": {
  7072  	//       "description": "Index of the first row of report data to return.",
  7073  	//       "format": "int32",
  7074  	//       "location": "query",
  7075  	//       "maximum": "5000",
  7076  	//       "minimum": "0",
  7077  	//       "type": "integer"
  7078  	//     },
  7079  	//     "useTimezoneReporting": {
  7080  	//       "description": "Whether the report should be generated in the AdSense account's local timezone. If false default PST/PDT timezone will be used.",
  7081  	//       "location": "query",
  7082  	//       "type": "boolean"
  7083  	//     }
  7084  	//   },
  7085  	//   "path": "reports",
  7086  	//   "response": {
  7087  	//     "$ref": "AdsenseReportsGenerateResponse"
  7088  	//   },
  7089  	//   "scopes": [
  7090  	//     "https://www.googleapis.com/auth/adsense",
  7091  	//     "https://www.googleapis.com/auth/adsense.readonly"
  7092  	//   ],
  7093  	//   "supportsMediaDownload": true
  7094  	// }
  7095  
  7096  }
  7097  
  7098  // method id "adsense.reports.saved.generate":
  7099  
  7100  type ReportsSavedGenerateCall struct {
  7101  	s             *Service
  7102  	savedReportId string
  7103  	urlParams_    gensupport.URLParams
  7104  	ifNoneMatch_  string
  7105  	ctx_          context.Context
  7106  	header_       http.Header
  7107  }
  7108  
  7109  // Generate: Generate an AdSense report based on the saved report ID
  7110  // sent in the query parameters.
  7111  func (r *ReportsSavedService) Generate(savedReportId string) *ReportsSavedGenerateCall {
  7112  	c := &ReportsSavedGenerateCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  7113  	c.savedReportId = savedReportId
  7114  	return c
  7115  }
  7116  
  7117  // Locale sets the optional parameter "locale": Optional locale to use
  7118  // for translating report output to a local language. Defaults to
  7119  // "en_US" if not specified.
  7120  func (c *ReportsSavedGenerateCall) Locale(locale string) *ReportsSavedGenerateCall {
  7121  	c.urlParams_.Set("locale", locale)
  7122  	return c
  7123  }
  7124  
  7125  // MaxResults sets the optional parameter "maxResults": The maximum
  7126  // number of rows of report data to return.
  7127  func (c *ReportsSavedGenerateCall) MaxResults(maxResults int64) *ReportsSavedGenerateCall {
  7128  	c.urlParams_.Set("maxResults", fmt.Sprint(maxResults))
  7129  	return c
  7130  }
  7131  
  7132  // StartIndex sets the optional parameter "startIndex": Index of the
  7133  // first row of report data to return.
  7134  func (c *ReportsSavedGenerateCall) StartIndex(startIndex int64) *ReportsSavedGenerateCall {
  7135  	c.urlParams_.Set("startIndex", fmt.Sprint(startIndex))
  7136  	return c
  7137  }
  7138  
  7139  // Fields allows partial responses to be retrieved. See
  7140  // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  7141  // for more information.
  7142  func (c *ReportsSavedGenerateCall) Fields(s ...googleapi.Field) *ReportsSavedGenerateCall {
  7143  	c.urlParams_.Set("fields", googleapi.CombineFields(s))
  7144  	return c
  7145  }
  7146  
  7147  // IfNoneMatch sets the optional parameter which makes the operation
  7148  // fail if the object's ETag matches the given value. This is useful for
  7149  // getting updates only after the object has changed since the last
  7150  // request. Use googleapi.IsNotModified to check whether the response
  7151  // error from Do is the result of In-None-Match.
  7152  func (c *ReportsSavedGenerateCall) IfNoneMatch(entityTag string) *ReportsSavedGenerateCall {
  7153  	c.ifNoneMatch_ = entityTag
  7154  	return c
  7155  }
  7156  
  7157  // Context sets the context to be used in this call's Do method. Any
  7158  // pending HTTP request will be aborted if the provided context is
  7159  // canceled.
  7160  func (c *ReportsSavedGenerateCall) Context(ctx context.Context) *ReportsSavedGenerateCall {
  7161  	c.ctx_ = ctx
  7162  	return c
  7163  }
  7164  
  7165  // Header returns an http.Header that can be modified by the caller to
  7166  // add HTTP headers to the request.
  7167  func (c *ReportsSavedGenerateCall) Header() http.Header {
  7168  	if c.header_ == nil {
  7169  		c.header_ = make(http.Header)
  7170  	}
  7171  	return c.header_
  7172  }
  7173  
  7174  func (c *ReportsSavedGenerateCall) doRequest(alt string) (*http.Response, error) {
  7175  	reqHeaders := make(http.Header)
  7176  	reqHeaders.Set("x-goog-api-client", "gl-go/1.13.7 gdcl/20200203")
  7177  	for k, v := range c.header_ {
  7178  		reqHeaders[k] = v
  7179  	}
  7180  	reqHeaders.Set("User-Agent", c.s.userAgent())
  7181  	if c.ifNoneMatch_ != "" {
  7182  		reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  7183  	}
  7184  	var body io.Reader = nil
  7185  	c.urlParams_.Set("alt", alt)
  7186  	c.urlParams_.Set("prettyPrint", "false")
  7187  	urls := googleapi.ResolveRelative(c.s.BasePath, "reports/{savedReportId}")
  7188  	urls += "?" + c.urlParams_.Encode()
  7189  	req, err := http.NewRequest("GET", urls, body)
  7190  	if err != nil {
  7191  		return nil, err
  7192  	}
  7193  	req.Header = reqHeaders
  7194  	googleapi.Expand(req.URL, map[string]string{
  7195  		"savedReportId": c.savedReportId,
  7196  	})
  7197  	return gensupport.SendRequest(c.ctx_, c.s.client, req)
  7198  }
  7199  
  7200  // Do executes the "adsense.reports.saved.generate" call.
  7201  // Exactly one of *AdsenseReportsGenerateResponse or error will be
  7202  // non-nil. Any non-2xx status code is an error. Response headers are in
  7203  // either *AdsenseReportsGenerateResponse.ServerResponse.Header or (if a
  7204  // response was returned at all) in error.(*googleapi.Error).Header. Use
  7205  // googleapi.IsNotModified to check whether the returned error was
  7206  // because http.StatusNotModified was returned.
  7207  func (c *ReportsSavedGenerateCall) Do(opts ...googleapi.CallOption) (*AdsenseReportsGenerateResponse, error) {
  7208  	gensupport.SetOptions(c.urlParams_, opts...)
  7209  	res, err := c.doRequest("json")
  7210  	if res != nil && res.StatusCode == http.StatusNotModified {
  7211  		if res.Body != nil {
  7212  			res.Body.Close()
  7213  		}
  7214  		return nil, &googleapi.Error{
  7215  			Code:   res.StatusCode,
  7216  			Header: res.Header,
  7217  		}
  7218  	}
  7219  	if err != nil {
  7220  		return nil, err
  7221  	}
  7222  	defer googleapi.CloseBody(res)
  7223  	if err := googleapi.CheckResponse(res); err != nil {
  7224  		return nil, err
  7225  	}
  7226  	ret := &AdsenseReportsGenerateResponse{
  7227  		ServerResponse: googleapi.ServerResponse{
  7228  			Header:         res.Header,
  7229  			HTTPStatusCode: res.StatusCode,
  7230  		},
  7231  	}
  7232  	target := &ret
  7233  	if err := gensupport.DecodeResponse(target, res); err != nil {
  7234  		return nil, err
  7235  	}
  7236  	return ret, nil
  7237  	// {
  7238  	//   "description": "Generate an AdSense report based on the saved report ID sent in the query parameters.",
  7239  	//   "httpMethod": "GET",
  7240  	//   "id": "adsense.reports.saved.generate",
  7241  	//   "parameterOrder": [
  7242  	//     "savedReportId"
  7243  	//   ],
  7244  	//   "parameters": {
  7245  	//     "locale": {
  7246  	//       "description": "Optional locale to use for translating report output to a local language. Defaults to \"en_US\" if not specified.",
  7247  	//       "location": "query",
  7248  	//       "pattern": "[a-zA-Z_]+",
  7249  	//       "type": "string"
  7250  	//     },
  7251  	//     "maxResults": {
  7252  	//       "description": "The maximum number of rows of report data to return.",
  7253  	//       "format": "int32",
  7254  	//       "location": "query",
  7255  	//       "maximum": "50000",
  7256  	//       "minimum": "0",
  7257  	//       "type": "integer"
  7258  	//     },
  7259  	//     "savedReportId": {
  7260  	//       "description": "The saved report to retrieve.",
  7261  	//       "location": "path",
  7262  	//       "required": true,
  7263  	//       "type": "string"
  7264  	//     },
  7265  	//     "startIndex": {
  7266  	//       "description": "Index of the first row of report data to return.",
  7267  	//       "format": "int32",
  7268  	//       "location": "query",
  7269  	//       "maximum": "5000",
  7270  	//       "minimum": "0",
  7271  	//       "type": "integer"
  7272  	//     }
  7273  	//   },
  7274  	//   "path": "reports/{savedReportId}",
  7275  	//   "response": {
  7276  	//     "$ref": "AdsenseReportsGenerateResponse"
  7277  	//   },
  7278  	//   "scopes": [
  7279  	//     "https://www.googleapis.com/auth/adsense",
  7280  	//     "https://www.googleapis.com/auth/adsense.readonly"
  7281  	//   ]
  7282  	// }
  7283  
  7284  }
  7285  
  7286  // method id "adsense.reports.saved.list":
  7287  
  7288  type ReportsSavedListCall struct {
  7289  	s            *Service
  7290  	urlParams_   gensupport.URLParams
  7291  	ifNoneMatch_ string
  7292  	ctx_         context.Context
  7293  	header_      http.Header
  7294  }
  7295  
  7296  // List: List all saved reports in this AdSense account.
  7297  func (r *ReportsSavedService) List() *ReportsSavedListCall {
  7298  	c := &ReportsSavedListCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  7299  	return c
  7300  }
  7301  
  7302  // MaxResults sets the optional parameter "maxResults": The maximum
  7303  // number of saved reports to include in the response, used for paging.
  7304  func (c *ReportsSavedListCall) MaxResults(maxResults int64) *ReportsSavedListCall {
  7305  	c.urlParams_.Set("maxResults", fmt.Sprint(maxResults))
  7306  	return c
  7307  }
  7308  
  7309  // PageToken sets the optional parameter "pageToken": A continuation
  7310  // token, used to page through saved reports. To retrieve the next page,
  7311  // set this parameter to the value of "nextPageToken" from the previous
  7312  // response.
  7313  func (c *ReportsSavedListCall) PageToken(pageToken string) *ReportsSavedListCall {
  7314  	c.urlParams_.Set("pageToken", pageToken)
  7315  	return c
  7316  }
  7317  
  7318  // Fields allows partial responses to be retrieved. See
  7319  // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  7320  // for more information.
  7321  func (c *ReportsSavedListCall) Fields(s ...googleapi.Field) *ReportsSavedListCall {
  7322  	c.urlParams_.Set("fields", googleapi.CombineFields(s))
  7323  	return c
  7324  }
  7325  
  7326  // IfNoneMatch sets the optional parameter which makes the operation
  7327  // fail if the object's ETag matches the given value. This is useful for
  7328  // getting updates only after the object has changed since the last
  7329  // request. Use googleapi.IsNotModified to check whether the response
  7330  // error from Do is the result of In-None-Match.
  7331  func (c *ReportsSavedListCall) IfNoneMatch(entityTag string) *ReportsSavedListCall {
  7332  	c.ifNoneMatch_ = entityTag
  7333  	return c
  7334  }
  7335  
  7336  // Context sets the context to be used in this call's Do method. Any
  7337  // pending HTTP request will be aborted if the provided context is
  7338  // canceled.
  7339  func (c *ReportsSavedListCall) Context(ctx context.Context) *ReportsSavedListCall {
  7340  	c.ctx_ = ctx
  7341  	return c
  7342  }
  7343  
  7344  // Header returns an http.Header that can be modified by the caller to
  7345  // add HTTP headers to the request.
  7346  func (c *ReportsSavedListCall) Header() http.Header {
  7347  	if c.header_ == nil {
  7348  		c.header_ = make(http.Header)
  7349  	}
  7350  	return c.header_
  7351  }
  7352  
  7353  func (c *ReportsSavedListCall) doRequest(alt string) (*http.Response, error) {
  7354  	reqHeaders := make(http.Header)
  7355  	reqHeaders.Set("x-goog-api-client", "gl-go/1.13.7 gdcl/20200203")
  7356  	for k, v := range c.header_ {
  7357  		reqHeaders[k] = v
  7358  	}
  7359  	reqHeaders.Set("User-Agent", c.s.userAgent())
  7360  	if c.ifNoneMatch_ != "" {
  7361  		reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  7362  	}
  7363  	var body io.Reader = nil
  7364  	c.urlParams_.Set("alt", alt)
  7365  	c.urlParams_.Set("prettyPrint", "false")
  7366  	urls := googleapi.ResolveRelative(c.s.BasePath, "reports/saved")
  7367  	urls += "?" + c.urlParams_.Encode()
  7368  	req, err := http.NewRequest("GET", urls, body)
  7369  	if err != nil {
  7370  		return nil, err
  7371  	}
  7372  	req.Header = reqHeaders
  7373  	return gensupport.SendRequest(c.ctx_, c.s.client, req)
  7374  }
  7375  
  7376  // Do executes the "adsense.reports.saved.list" call.
  7377  // Exactly one of *SavedReports or error will be non-nil. Any non-2xx
  7378  // status code is an error. Response headers are in either
  7379  // *SavedReports.ServerResponse.Header or (if a response was returned at
  7380  // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  7381  // to check whether the returned error was because
  7382  // http.StatusNotModified was returned.
  7383  func (c *ReportsSavedListCall) Do(opts ...googleapi.CallOption) (*SavedReports, error) {
  7384  	gensupport.SetOptions(c.urlParams_, opts...)
  7385  	res, err := c.doRequest("json")
  7386  	if res != nil && res.StatusCode == http.StatusNotModified {
  7387  		if res.Body != nil {
  7388  			res.Body.Close()
  7389  		}
  7390  		return nil, &googleapi.Error{
  7391  			Code:   res.StatusCode,
  7392  			Header: res.Header,
  7393  		}
  7394  	}
  7395  	if err != nil {
  7396  		return nil, err
  7397  	}
  7398  	defer googleapi.CloseBody(res)
  7399  	if err := googleapi.CheckResponse(res); err != nil {
  7400  		return nil, err
  7401  	}
  7402  	ret := &SavedReports{
  7403  		ServerResponse: googleapi.ServerResponse{
  7404  			Header:         res.Header,
  7405  			HTTPStatusCode: res.StatusCode,
  7406  		},
  7407  	}
  7408  	target := &ret
  7409  	if err := gensupport.DecodeResponse(target, res); err != nil {
  7410  		return nil, err
  7411  	}
  7412  	return ret, nil
  7413  	// {
  7414  	//   "description": "List all saved reports in this AdSense account.",
  7415  	//   "httpMethod": "GET",
  7416  	//   "id": "adsense.reports.saved.list",
  7417  	//   "parameters": {
  7418  	//     "maxResults": {
  7419  	//       "description": "The maximum number of saved reports to include in the response, used for paging.",
  7420  	//       "format": "int32",
  7421  	//       "location": "query",
  7422  	//       "maximum": "100",
  7423  	//       "minimum": "0",
  7424  	//       "type": "integer"
  7425  	//     },
  7426  	//     "pageToken": {
  7427  	//       "description": "A continuation token, used to page through saved reports. To retrieve the next page, set this parameter to the value of \"nextPageToken\" from the previous response.",
  7428  	//       "location": "query",
  7429  	//       "type": "string"
  7430  	//     }
  7431  	//   },
  7432  	//   "path": "reports/saved",
  7433  	//   "response": {
  7434  	//     "$ref": "SavedReports"
  7435  	//   },
  7436  	//   "scopes": [
  7437  	//     "https://www.googleapis.com/auth/adsense",
  7438  	//     "https://www.googleapis.com/auth/adsense.readonly"
  7439  	//   ]
  7440  	// }
  7441  
  7442  }
  7443  
  7444  // Pages invokes f for each page of results.
  7445  // A non-nil error returned from f will halt the iteration.
  7446  // The provided context supersedes any context provided to the Context method.
  7447  func (c *ReportsSavedListCall) Pages(ctx context.Context, f func(*SavedReports) error) error {
  7448  	c.ctx_ = ctx
  7449  	defer c.PageToken(c.urlParams_.Get("pageToken")) // reset paging to original point
  7450  	for {
  7451  		x, err := c.Do()
  7452  		if err != nil {
  7453  			return err
  7454  		}
  7455  		if err := f(x); err != nil {
  7456  			return err
  7457  		}
  7458  		if x.NextPageToken == "" {
  7459  			return nil
  7460  		}
  7461  		c.PageToken(x.NextPageToken)
  7462  	}
  7463  }
  7464  
  7465  // method id "adsense.savedadstyles.get":
  7466  
  7467  type SavedadstylesGetCall struct {
  7468  	s              *Service
  7469  	savedAdStyleId string
  7470  	urlParams_     gensupport.URLParams
  7471  	ifNoneMatch_   string
  7472  	ctx_           context.Context
  7473  	header_        http.Header
  7474  }
  7475  
  7476  // Get: Get a specific saved ad style from the user's account.
  7477  func (r *SavedadstylesService) Get(savedAdStyleId string) *SavedadstylesGetCall {
  7478  	c := &SavedadstylesGetCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  7479  	c.savedAdStyleId = savedAdStyleId
  7480  	return c
  7481  }
  7482  
  7483  // Fields allows partial responses to be retrieved. See
  7484  // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  7485  // for more information.
  7486  func (c *SavedadstylesGetCall) Fields(s ...googleapi.Field) *SavedadstylesGetCall {
  7487  	c.urlParams_.Set("fields", googleapi.CombineFields(s))
  7488  	return c
  7489  }
  7490  
  7491  // IfNoneMatch sets the optional parameter which makes the operation
  7492  // fail if the object's ETag matches the given value. This is useful for
  7493  // getting updates only after the object has changed since the last
  7494  // request. Use googleapi.IsNotModified to check whether the response
  7495  // error from Do is the result of In-None-Match.
  7496  func (c *SavedadstylesGetCall) IfNoneMatch(entityTag string) *SavedadstylesGetCall {
  7497  	c.ifNoneMatch_ = entityTag
  7498  	return c
  7499  }
  7500  
  7501  // Context sets the context to be used in this call's Do method. Any
  7502  // pending HTTP request will be aborted if the provided context is
  7503  // canceled.
  7504  func (c *SavedadstylesGetCall) Context(ctx context.Context) *SavedadstylesGetCall {
  7505  	c.ctx_ = ctx
  7506  	return c
  7507  }
  7508  
  7509  // Header returns an http.Header that can be modified by the caller to
  7510  // add HTTP headers to the request.
  7511  func (c *SavedadstylesGetCall) Header() http.Header {
  7512  	if c.header_ == nil {
  7513  		c.header_ = make(http.Header)
  7514  	}
  7515  	return c.header_
  7516  }
  7517  
  7518  func (c *SavedadstylesGetCall) doRequest(alt string) (*http.Response, error) {
  7519  	reqHeaders := make(http.Header)
  7520  	reqHeaders.Set("x-goog-api-client", "gl-go/1.13.7 gdcl/20200203")
  7521  	for k, v := range c.header_ {
  7522  		reqHeaders[k] = v
  7523  	}
  7524  	reqHeaders.Set("User-Agent", c.s.userAgent())
  7525  	if c.ifNoneMatch_ != "" {
  7526  		reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  7527  	}
  7528  	var body io.Reader = nil
  7529  	c.urlParams_.Set("alt", alt)
  7530  	c.urlParams_.Set("prettyPrint", "false")
  7531  	urls := googleapi.ResolveRelative(c.s.BasePath, "savedadstyles/{savedAdStyleId}")
  7532  	urls += "?" + c.urlParams_.Encode()
  7533  	req, err := http.NewRequest("GET", urls, body)
  7534  	if err != nil {
  7535  		return nil, err
  7536  	}
  7537  	req.Header = reqHeaders
  7538  	googleapi.Expand(req.URL, map[string]string{
  7539  		"savedAdStyleId": c.savedAdStyleId,
  7540  	})
  7541  	return gensupport.SendRequest(c.ctx_, c.s.client, req)
  7542  }
  7543  
  7544  // Do executes the "adsense.savedadstyles.get" call.
  7545  // Exactly one of *SavedAdStyle or error will be non-nil. Any non-2xx
  7546  // status code is an error. Response headers are in either
  7547  // *SavedAdStyle.ServerResponse.Header or (if a response was returned at
  7548  // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  7549  // to check whether the returned error was because
  7550  // http.StatusNotModified was returned.
  7551  func (c *SavedadstylesGetCall) Do(opts ...googleapi.CallOption) (*SavedAdStyle, error) {
  7552  	gensupport.SetOptions(c.urlParams_, opts...)
  7553  	res, err := c.doRequest("json")
  7554  	if res != nil && res.StatusCode == http.StatusNotModified {
  7555  		if res.Body != nil {
  7556  			res.Body.Close()
  7557  		}
  7558  		return nil, &googleapi.Error{
  7559  			Code:   res.StatusCode,
  7560  			Header: res.Header,
  7561  		}
  7562  	}
  7563  	if err != nil {
  7564  		return nil, err
  7565  	}
  7566  	defer googleapi.CloseBody(res)
  7567  	if err := googleapi.CheckResponse(res); err != nil {
  7568  		return nil, err
  7569  	}
  7570  	ret := &SavedAdStyle{
  7571  		ServerResponse: googleapi.ServerResponse{
  7572  			Header:         res.Header,
  7573  			HTTPStatusCode: res.StatusCode,
  7574  		},
  7575  	}
  7576  	target := &ret
  7577  	if err := gensupport.DecodeResponse(target, res); err != nil {
  7578  		return nil, err
  7579  	}
  7580  	return ret, nil
  7581  	// {
  7582  	//   "description": "Get a specific saved ad style from the user's account.",
  7583  	//   "httpMethod": "GET",
  7584  	//   "id": "adsense.savedadstyles.get",
  7585  	//   "parameterOrder": [
  7586  	//     "savedAdStyleId"
  7587  	//   ],
  7588  	//   "parameters": {
  7589  	//     "savedAdStyleId": {
  7590  	//       "description": "Saved ad style to retrieve.",
  7591  	//       "location": "path",
  7592  	//       "required": true,
  7593  	//       "type": "string"
  7594  	//     }
  7595  	//   },
  7596  	//   "path": "savedadstyles/{savedAdStyleId}",
  7597  	//   "response": {
  7598  	//     "$ref": "SavedAdStyle"
  7599  	//   },
  7600  	//   "scopes": [
  7601  	//     "https://www.googleapis.com/auth/adsense",
  7602  	//     "https://www.googleapis.com/auth/adsense.readonly"
  7603  	//   ]
  7604  	// }
  7605  
  7606  }
  7607  
  7608  // method id "adsense.savedadstyles.list":
  7609  
  7610  type SavedadstylesListCall struct {
  7611  	s            *Service
  7612  	urlParams_   gensupport.URLParams
  7613  	ifNoneMatch_ string
  7614  	ctx_         context.Context
  7615  	header_      http.Header
  7616  }
  7617  
  7618  // List: List all saved ad styles in the user's account.
  7619  func (r *SavedadstylesService) List() *SavedadstylesListCall {
  7620  	c := &SavedadstylesListCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  7621  	return c
  7622  }
  7623  
  7624  // MaxResults sets the optional parameter "maxResults": The maximum
  7625  // number of saved ad styles to include in the response, used for
  7626  // paging.
  7627  func (c *SavedadstylesListCall) MaxResults(maxResults int64) *SavedadstylesListCall {
  7628  	c.urlParams_.Set("maxResults", fmt.Sprint(maxResults))
  7629  	return c
  7630  }
  7631  
  7632  // PageToken sets the optional parameter "pageToken": A continuation
  7633  // token, used to page through saved ad styles. To retrieve the next
  7634  // page, set this parameter to the value of "nextPageToken" from the
  7635  // previous response.
  7636  func (c *SavedadstylesListCall) PageToken(pageToken string) *SavedadstylesListCall {
  7637  	c.urlParams_.Set("pageToken", pageToken)
  7638  	return c
  7639  }
  7640  
  7641  // Fields allows partial responses to be retrieved. See
  7642  // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  7643  // for more information.
  7644  func (c *SavedadstylesListCall) Fields(s ...googleapi.Field) *SavedadstylesListCall {
  7645  	c.urlParams_.Set("fields", googleapi.CombineFields(s))
  7646  	return c
  7647  }
  7648  
  7649  // IfNoneMatch sets the optional parameter which makes the operation
  7650  // fail if the object's ETag matches the given value. This is useful for
  7651  // getting updates only after the object has changed since the last
  7652  // request. Use googleapi.IsNotModified to check whether the response
  7653  // error from Do is the result of In-None-Match.
  7654  func (c *SavedadstylesListCall) IfNoneMatch(entityTag string) *SavedadstylesListCall {
  7655  	c.ifNoneMatch_ = entityTag
  7656  	return c
  7657  }
  7658  
  7659  // Context sets the context to be used in this call's Do method. Any
  7660  // pending HTTP request will be aborted if the provided context is
  7661  // canceled.
  7662  func (c *SavedadstylesListCall) Context(ctx context.Context) *SavedadstylesListCall {
  7663  	c.ctx_ = ctx
  7664  	return c
  7665  }
  7666  
  7667  // Header returns an http.Header that can be modified by the caller to
  7668  // add HTTP headers to the request.
  7669  func (c *SavedadstylesListCall) Header() http.Header {
  7670  	if c.header_ == nil {
  7671  		c.header_ = make(http.Header)
  7672  	}
  7673  	return c.header_
  7674  }
  7675  
  7676  func (c *SavedadstylesListCall) doRequest(alt string) (*http.Response, error) {
  7677  	reqHeaders := make(http.Header)
  7678  	reqHeaders.Set("x-goog-api-client", "gl-go/1.13.7 gdcl/20200203")
  7679  	for k, v := range c.header_ {
  7680  		reqHeaders[k] = v
  7681  	}
  7682  	reqHeaders.Set("User-Agent", c.s.userAgent())
  7683  	if c.ifNoneMatch_ != "" {
  7684  		reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  7685  	}
  7686  	var body io.Reader = nil
  7687  	c.urlParams_.Set("alt", alt)
  7688  	c.urlParams_.Set("prettyPrint", "false")
  7689  	urls := googleapi.ResolveRelative(c.s.BasePath, "savedadstyles")
  7690  	urls += "?" + c.urlParams_.Encode()
  7691  	req, err := http.NewRequest("GET", urls, body)
  7692  	if err != nil {
  7693  		return nil, err
  7694  	}
  7695  	req.Header = reqHeaders
  7696  	return gensupport.SendRequest(c.ctx_, c.s.client, req)
  7697  }
  7698  
  7699  // Do executes the "adsense.savedadstyles.list" call.
  7700  // Exactly one of *SavedAdStyles or error will be non-nil. Any non-2xx
  7701  // status code is an error. Response headers are in either
  7702  // *SavedAdStyles.ServerResponse.Header or (if a response was returned
  7703  // at all) in error.(*googleapi.Error).Header. Use
  7704  // googleapi.IsNotModified to check whether the returned error was
  7705  // because http.StatusNotModified was returned.
  7706  func (c *SavedadstylesListCall) Do(opts ...googleapi.CallOption) (*SavedAdStyles, error) {
  7707  	gensupport.SetOptions(c.urlParams_, opts...)
  7708  	res, err := c.doRequest("json")
  7709  	if res != nil && res.StatusCode == http.StatusNotModified {
  7710  		if res.Body != nil {
  7711  			res.Body.Close()
  7712  		}
  7713  		return nil, &googleapi.Error{
  7714  			Code:   res.StatusCode,
  7715  			Header: res.Header,
  7716  		}
  7717  	}
  7718  	if err != nil {
  7719  		return nil, err
  7720  	}
  7721  	defer googleapi.CloseBody(res)
  7722  	if err := googleapi.CheckResponse(res); err != nil {
  7723  		return nil, err
  7724  	}
  7725  	ret := &SavedAdStyles{
  7726  		ServerResponse: googleapi.ServerResponse{
  7727  			Header:         res.Header,
  7728  			HTTPStatusCode: res.StatusCode,
  7729  		},
  7730  	}
  7731  	target := &ret
  7732  	if err := gensupport.DecodeResponse(target, res); err != nil {
  7733  		return nil, err
  7734  	}
  7735  	return ret, nil
  7736  	// {
  7737  	//   "description": "List all saved ad styles in the user's account.",
  7738  	//   "httpMethod": "GET",
  7739  	//   "id": "adsense.savedadstyles.list",
  7740  	//   "parameters": {
  7741  	//     "maxResults": {
  7742  	//       "description": "The maximum number of saved ad styles to include in the response, used for paging.",
  7743  	//       "format": "int32",
  7744  	//       "location": "query",
  7745  	//       "maximum": "10000",
  7746  	//       "minimum": "0",
  7747  	//       "type": "integer"
  7748  	//     },
  7749  	//     "pageToken": {
  7750  	//       "description": "A continuation token, used to page through saved ad styles. To retrieve the next page, set this parameter to the value of \"nextPageToken\" from the previous response.",
  7751  	//       "location": "query",
  7752  	//       "type": "string"
  7753  	//     }
  7754  	//   },
  7755  	//   "path": "savedadstyles",
  7756  	//   "response": {
  7757  	//     "$ref": "SavedAdStyles"
  7758  	//   },
  7759  	//   "scopes": [
  7760  	//     "https://www.googleapis.com/auth/adsense",
  7761  	//     "https://www.googleapis.com/auth/adsense.readonly"
  7762  	//   ]
  7763  	// }
  7764  
  7765  }
  7766  
  7767  // Pages invokes f for each page of results.
  7768  // A non-nil error returned from f will halt the iteration.
  7769  // The provided context supersedes any context provided to the Context method.
  7770  func (c *SavedadstylesListCall) Pages(ctx context.Context, f func(*SavedAdStyles) error) error {
  7771  	c.ctx_ = ctx
  7772  	defer c.PageToken(c.urlParams_.Get("pageToken")) // reset paging to original point
  7773  	for {
  7774  		x, err := c.Do()
  7775  		if err != nil {
  7776  			return err
  7777  		}
  7778  		if err := f(x); err != nil {
  7779  			return err
  7780  		}
  7781  		if x.NextPageToken == "" {
  7782  			return nil
  7783  		}
  7784  		c.PageToken(x.NextPageToken)
  7785  	}
  7786  }
  7787  
  7788  // method id "adsense.urlchannels.list":
  7789  
  7790  type UrlchannelsListCall struct {
  7791  	s            *Service
  7792  	adClientId   string
  7793  	urlParams_   gensupport.URLParams
  7794  	ifNoneMatch_ string
  7795  	ctx_         context.Context
  7796  	header_      http.Header
  7797  }
  7798  
  7799  // List: List all URL channels in the specified ad client for this
  7800  // AdSense account.
  7801  func (r *UrlchannelsService) List(adClientId string) *UrlchannelsListCall {
  7802  	c := &UrlchannelsListCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  7803  	c.adClientId = adClientId
  7804  	return c
  7805  }
  7806  
  7807  // MaxResults sets the optional parameter "maxResults": The maximum
  7808  // number of URL channels to include in the response, used for paging.
  7809  func (c *UrlchannelsListCall) MaxResults(maxResults int64) *UrlchannelsListCall {
  7810  	c.urlParams_.Set("maxResults", fmt.Sprint(maxResults))
  7811  	return c
  7812  }
  7813  
  7814  // PageToken sets the optional parameter "pageToken": A continuation
  7815  // token, used to page through URL channels. To retrieve the next page,
  7816  // set this parameter to the value of "nextPageToken" from the previous
  7817  // response.
  7818  func (c *UrlchannelsListCall) PageToken(pageToken string) *UrlchannelsListCall {
  7819  	c.urlParams_.Set("pageToken", pageToken)
  7820  	return c
  7821  }
  7822  
  7823  // Fields allows partial responses to be retrieved. See
  7824  // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  7825  // for more information.
  7826  func (c *UrlchannelsListCall) Fields(s ...googleapi.Field) *UrlchannelsListCall {
  7827  	c.urlParams_.Set("fields", googleapi.CombineFields(s))
  7828  	return c
  7829  }
  7830  
  7831  // IfNoneMatch sets the optional parameter which makes the operation
  7832  // fail if the object's ETag matches the given value. This is useful for
  7833  // getting updates only after the object has changed since the last
  7834  // request. Use googleapi.IsNotModified to check whether the response
  7835  // error from Do is the result of In-None-Match.
  7836  func (c *UrlchannelsListCall) IfNoneMatch(entityTag string) *UrlchannelsListCall {
  7837  	c.ifNoneMatch_ = entityTag
  7838  	return c
  7839  }
  7840  
  7841  // Context sets the context to be used in this call's Do method. Any
  7842  // pending HTTP request will be aborted if the provided context is
  7843  // canceled.
  7844  func (c *UrlchannelsListCall) Context(ctx context.Context) *UrlchannelsListCall {
  7845  	c.ctx_ = ctx
  7846  	return c
  7847  }
  7848  
  7849  // Header returns an http.Header that can be modified by the caller to
  7850  // add HTTP headers to the request.
  7851  func (c *UrlchannelsListCall) Header() http.Header {
  7852  	if c.header_ == nil {
  7853  		c.header_ = make(http.Header)
  7854  	}
  7855  	return c.header_
  7856  }
  7857  
  7858  func (c *UrlchannelsListCall) doRequest(alt string) (*http.Response, error) {
  7859  	reqHeaders := make(http.Header)
  7860  	reqHeaders.Set("x-goog-api-client", "gl-go/1.13.7 gdcl/20200203")
  7861  	for k, v := range c.header_ {
  7862  		reqHeaders[k] = v
  7863  	}
  7864  	reqHeaders.Set("User-Agent", c.s.userAgent())
  7865  	if c.ifNoneMatch_ != "" {
  7866  		reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  7867  	}
  7868  	var body io.Reader = nil
  7869  	c.urlParams_.Set("alt", alt)
  7870  	c.urlParams_.Set("prettyPrint", "false")
  7871  	urls := googleapi.ResolveRelative(c.s.BasePath, "adclients/{adClientId}/urlchannels")
  7872  	urls += "?" + c.urlParams_.Encode()
  7873  	req, err := http.NewRequest("GET", urls, body)
  7874  	if err != nil {
  7875  		return nil, err
  7876  	}
  7877  	req.Header = reqHeaders
  7878  	googleapi.Expand(req.URL, map[string]string{
  7879  		"adClientId": c.adClientId,
  7880  	})
  7881  	return gensupport.SendRequest(c.ctx_, c.s.client, req)
  7882  }
  7883  
  7884  // Do executes the "adsense.urlchannels.list" call.
  7885  // Exactly one of *UrlChannels or error will be non-nil. Any non-2xx
  7886  // status code is an error. Response headers are in either
  7887  // *UrlChannels.ServerResponse.Header or (if a response was returned at
  7888  // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  7889  // to check whether the returned error was because
  7890  // http.StatusNotModified was returned.
  7891  func (c *UrlchannelsListCall) Do(opts ...googleapi.CallOption) (*UrlChannels, error) {
  7892  	gensupport.SetOptions(c.urlParams_, opts...)
  7893  	res, err := c.doRequest("json")
  7894  	if res != nil && res.StatusCode == http.StatusNotModified {
  7895  		if res.Body != nil {
  7896  			res.Body.Close()
  7897  		}
  7898  		return nil, &googleapi.Error{
  7899  			Code:   res.StatusCode,
  7900  			Header: res.Header,
  7901  		}
  7902  	}
  7903  	if err != nil {
  7904  		return nil, err
  7905  	}
  7906  	defer googleapi.CloseBody(res)
  7907  	if err := googleapi.CheckResponse(res); err != nil {
  7908  		return nil, err
  7909  	}
  7910  	ret := &UrlChannels{
  7911  		ServerResponse: googleapi.ServerResponse{
  7912  			Header:         res.Header,
  7913  			HTTPStatusCode: res.StatusCode,
  7914  		},
  7915  	}
  7916  	target := &ret
  7917  	if err := gensupport.DecodeResponse(target, res); err != nil {
  7918  		return nil, err
  7919  	}
  7920  	return ret, nil
  7921  	// {
  7922  	//   "description": "List all URL channels in the specified ad client for this AdSense account.",
  7923  	//   "httpMethod": "GET",
  7924  	//   "id": "adsense.urlchannels.list",
  7925  	//   "parameterOrder": [
  7926  	//     "adClientId"
  7927  	//   ],
  7928  	//   "parameters": {
  7929  	//     "adClientId": {
  7930  	//       "description": "Ad client for which to list URL channels.",
  7931  	//       "location": "path",
  7932  	//       "required": true,
  7933  	//       "type": "string"
  7934  	//     },
  7935  	//     "maxResults": {
  7936  	//       "description": "The maximum number of URL channels to include in the response, used for paging.",
  7937  	//       "format": "int32",
  7938  	//       "location": "query",
  7939  	//       "maximum": "10000",
  7940  	//       "minimum": "0",
  7941  	//       "type": "integer"
  7942  	//     },
  7943  	//     "pageToken": {
  7944  	//       "description": "A continuation token, used to page through URL channels. To retrieve the next page, set this parameter to the value of \"nextPageToken\" from the previous response.",
  7945  	//       "location": "query",
  7946  	//       "type": "string"
  7947  	//     }
  7948  	//   },
  7949  	//   "path": "adclients/{adClientId}/urlchannels",
  7950  	//   "response": {
  7951  	//     "$ref": "UrlChannels"
  7952  	//   },
  7953  	//   "scopes": [
  7954  	//     "https://www.googleapis.com/auth/adsense",
  7955  	//     "https://www.googleapis.com/auth/adsense.readonly"
  7956  	//   ]
  7957  	// }
  7958  
  7959  }
  7960  
  7961  // Pages invokes f for each page of results.
  7962  // A non-nil error returned from f will halt the iteration.
  7963  // The provided context supersedes any context provided to the Context method.
  7964  func (c *UrlchannelsListCall) Pages(ctx context.Context, f func(*UrlChannels) error) error {
  7965  	c.ctx_ = ctx
  7966  	defer c.PageToken(c.urlParams_.Get("pageToken")) // reset paging to original point
  7967  	for {
  7968  		x, err := c.Do()
  7969  		if err != nil {
  7970  			return err
  7971  		}
  7972  		if err := f(x); err != nil {
  7973  			return err
  7974  		}
  7975  		if x.NextPageToken == "" {
  7976  			return nil
  7977  		}
  7978  		c.PageToken(x.NextPageToken)
  7979  	}
  7980  }
  7981  

View as plain text