...

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

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

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

View as plain text