...

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

Documentation: google.golang.org/api/adsense/v2

     1  // Copyright 2024 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  // # Library status
    12  //
    13  // These client libraries are officially supported by Google. However, this
    14  // library is considered complete and is in maintenance mode. This means
    15  // that we will address critical bugs and security issues but will not add
    16  // any new features.
    17  //
    18  // When possible, we recommend using our newer
    19  // [Cloud Client Libraries for Go](https://pkg.go.dev/cloud.google.com/go)
    20  // that are still actively being worked and iterated on.
    21  //
    22  // # Creating a client
    23  //
    24  // Usage example:
    25  //
    26  //	import "google.golang.org/api/adsense/v2"
    27  //	...
    28  //	ctx := context.Background()
    29  //	adsenseService, err := adsense.NewService(ctx)
    30  //
    31  // In this example, Google Application Default Credentials are used for
    32  // authentication. For information on how to create and obtain Application
    33  // Default Credentials, see https://developers.google.com/identity/protocols/application-default-credentials.
    34  //
    35  // # Other authentication options
    36  //
    37  // By default, all available scopes (see "Constants") are used to authenticate.
    38  // To restrict scopes, use [google.golang.org/api/option.WithScopes]:
    39  //
    40  //	adsenseService, err := adsense.NewService(ctx, option.WithScopes(adsense.AdsenseReadonlyScope))
    41  //
    42  // To use an API key for authentication (note: some APIs do not support API
    43  // keys), use [google.golang.org/api/option.WithAPIKey]:
    44  //
    45  //	adsenseService, err := adsense.NewService(ctx, option.WithAPIKey("AIza..."))
    46  //
    47  // To use an OAuth token (e.g., a user token obtained via a three-legged OAuth
    48  // flow, use [google.golang.org/api/option.WithTokenSource]:
    49  //
    50  //	config := &oauth2.Config{...}
    51  //	// ...
    52  //	token, err := config.Exchange(ctx, ...)
    53  //	adsenseService, err := adsense.NewService(ctx, option.WithTokenSource(config.TokenSource(ctx, token)))
    54  //
    55  // See [google.golang.org/api/option.ClientOption] for details on options.
    56  package adsense // import "google.golang.org/api/adsense/v2"
    57  
    58  import (
    59  	"bytes"
    60  	"context"
    61  	"encoding/json"
    62  	"errors"
    63  	"fmt"
    64  	"io"
    65  	"net/http"
    66  	"net/url"
    67  	"strconv"
    68  	"strings"
    69  
    70  	googleapi "google.golang.org/api/googleapi"
    71  	internal "google.golang.org/api/internal"
    72  	gensupport "google.golang.org/api/internal/gensupport"
    73  	option "google.golang.org/api/option"
    74  	internaloption "google.golang.org/api/option/internaloption"
    75  	htransport "google.golang.org/api/transport/http"
    76  )
    77  
    78  // Always reference these packages, just in case the auto-generated code
    79  // below doesn't.
    80  var _ = bytes.NewBuffer
    81  var _ = strconv.Itoa
    82  var _ = fmt.Sprintf
    83  var _ = json.NewDecoder
    84  var _ = io.Copy
    85  var _ = url.Parse
    86  var _ = gensupport.MarshalJSON
    87  var _ = googleapi.Version
    88  var _ = errors.New
    89  var _ = strings.Replace
    90  var _ = context.Canceled
    91  var _ = internaloption.WithDefaultEndpoint
    92  var _ = internal.Version
    93  
    94  const apiId = "adsense:v2"
    95  const apiName = "adsense"
    96  const apiVersion = "v2"
    97  const basePath = "https://adsense.googleapis.com/"
    98  const basePathTemplate = "https://adsense.UNIVERSE_DOMAIN/"
    99  const mtlsBasePath = "https://adsense.mtls.googleapis.com/"
   100  
   101  // OAuth2 scopes used by this API.
   102  const (
   103  	// View and manage your AdSense data
   104  	AdsenseScope = "https://www.googleapis.com/auth/adsense"
   105  
   106  	// View your AdSense data
   107  	AdsenseReadonlyScope = "https://www.googleapis.com/auth/adsense.readonly"
   108  )
   109  
   110  // NewService creates a new Service.
   111  func NewService(ctx context.Context, opts ...option.ClientOption) (*Service, error) {
   112  	scopesOption := internaloption.WithDefaultScopes(
   113  		"https://www.googleapis.com/auth/adsense",
   114  		"https://www.googleapis.com/auth/adsense.readonly",
   115  	)
   116  	// NOTE: prepend, so we don't override user-specified scopes.
   117  	opts = append([]option.ClientOption{scopesOption}, opts...)
   118  	opts = append(opts, internaloption.WithDefaultEndpoint(basePath))
   119  	opts = append(opts, internaloption.WithDefaultEndpointTemplate(basePathTemplate))
   120  	opts = append(opts, internaloption.WithDefaultMTLSEndpoint(mtlsBasePath))
   121  	opts = append(opts, internaloption.EnableNewAuthLibrary())
   122  	client, endpoint, err := htransport.NewClient(ctx, opts...)
   123  	if err != nil {
   124  		return nil, err
   125  	}
   126  	s, err := New(client)
   127  	if err != nil {
   128  		return nil, err
   129  	}
   130  	if endpoint != "" {
   131  		s.BasePath = endpoint
   132  	}
   133  	return s, nil
   134  }
   135  
   136  // New creates a new Service. It uses the provided http.Client for requests.
   137  //
   138  // Deprecated: please use NewService instead.
   139  // To provide a custom HTTP client, use option.WithHTTPClient.
   140  // If you are using google.golang.org/api/googleapis/transport.APIKey, use option.WithAPIKey with NewService instead.
   141  func New(client *http.Client) (*Service, error) {
   142  	if client == nil {
   143  		return nil, errors.New("client is nil")
   144  	}
   145  	s := &Service{client: client, BasePath: basePath}
   146  	s.Accounts = NewAccountsService(s)
   147  	return s, nil
   148  }
   149  
   150  type Service struct {
   151  	client    *http.Client
   152  	BasePath  string // API endpoint base URL
   153  	UserAgent string // optional additional User-Agent fragment
   154  
   155  	Accounts *AccountsService
   156  }
   157  
   158  func (s *Service) userAgent() string {
   159  	if s.UserAgent == "" {
   160  		return googleapi.UserAgent
   161  	}
   162  	return googleapi.UserAgent + " " + s.UserAgent
   163  }
   164  
   165  func NewAccountsService(s *Service) *AccountsService {
   166  	rs := &AccountsService{s: s}
   167  	rs.Adclients = NewAccountsAdclientsService(s)
   168  	rs.Alerts = NewAccountsAlertsService(s)
   169  	rs.Payments = NewAccountsPaymentsService(s)
   170  	rs.PolicyIssues = NewAccountsPolicyIssuesService(s)
   171  	rs.Reports = NewAccountsReportsService(s)
   172  	rs.Sites = NewAccountsSitesService(s)
   173  	return rs
   174  }
   175  
   176  type AccountsService struct {
   177  	s *Service
   178  
   179  	Adclients *AccountsAdclientsService
   180  
   181  	Alerts *AccountsAlertsService
   182  
   183  	Payments *AccountsPaymentsService
   184  
   185  	PolicyIssues *AccountsPolicyIssuesService
   186  
   187  	Reports *AccountsReportsService
   188  
   189  	Sites *AccountsSitesService
   190  }
   191  
   192  func NewAccountsAdclientsService(s *Service) *AccountsAdclientsService {
   193  	rs := &AccountsAdclientsService{s: s}
   194  	rs.Adunits = NewAccountsAdclientsAdunitsService(s)
   195  	rs.Customchannels = NewAccountsAdclientsCustomchannelsService(s)
   196  	rs.Urlchannels = NewAccountsAdclientsUrlchannelsService(s)
   197  	return rs
   198  }
   199  
   200  type AccountsAdclientsService struct {
   201  	s *Service
   202  
   203  	Adunits *AccountsAdclientsAdunitsService
   204  
   205  	Customchannels *AccountsAdclientsCustomchannelsService
   206  
   207  	Urlchannels *AccountsAdclientsUrlchannelsService
   208  }
   209  
   210  func NewAccountsAdclientsAdunitsService(s *Service) *AccountsAdclientsAdunitsService {
   211  	rs := &AccountsAdclientsAdunitsService{s: s}
   212  	return rs
   213  }
   214  
   215  type AccountsAdclientsAdunitsService struct {
   216  	s *Service
   217  }
   218  
   219  func NewAccountsAdclientsCustomchannelsService(s *Service) *AccountsAdclientsCustomchannelsService {
   220  	rs := &AccountsAdclientsCustomchannelsService{s: s}
   221  	return rs
   222  }
   223  
   224  type AccountsAdclientsCustomchannelsService struct {
   225  	s *Service
   226  }
   227  
   228  func NewAccountsAdclientsUrlchannelsService(s *Service) *AccountsAdclientsUrlchannelsService {
   229  	rs := &AccountsAdclientsUrlchannelsService{s: s}
   230  	return rs
   231  }
   232  
   233  type AccountsAdclientsUrlchannelsService struct {
   234  	s *Service
   235  }
   236  
   237  func NewAccountsAlertsService(s *Service) *AccountsAlertsService {
   238  	rs := &AccountsAlertsService{s: s}
   239  	return rs
   240  }
   241  
   242  type AccountsAlertsService struct {
   243  	s *Service
   244  }
   245  
   246  func NewAccountsPaymentsService(s *Service) *AccountsPaymentsService {
   247  	rs := &AccountsPaymentsService{s: s}
   248  	return rs
   249  }
   250  
   251  type AccountsPaymentsService struct {
   252  	s *Service
   253  }
   254  
   255  func NewAccountsPolicyIssuesService(s *Service) *AccountsPolicyIssuesService {
   256  	rs := &AccountsPolicyIssuesService{s: s}
   257  	return rs
   258  }
   259  
   260  type AccountsPolicyIssuesService struct {
   261  	s *Service
   262  }
   263  
   264  func NewAccountsReportsService(s *Service) *AccountsReportsService {
   265  	rs := &AccountsReportsService{s: s}
   266  	rs.Saved = NewAccountsReportsSavedService(s)
   267  	return rs
   268  }
   269  
   270  type AccountsReportsService struct {
   271  	s *Service
   272  
   273  	Saved *AccountsReportsSavedService
   274  }
   275  
   276  func NewAccountsReportsSavedService(s *Service) *AccountsReportsSavedService {
   277  	rs := &AccountsReportsSavedService{s: s}
   278  	return rs
   279  }
   280  
   281  type AccountsReportsSavedService struct {
   282  	s *Service
   283  }
   284  
   285  func NewAccountsSitesService(s *Service) *AccountsSitesService {
   286  	rs := &AccountsSitesService{s: s}
   287  	return rs
   288  }
   289  
   290  type AccountsSitesService struct {
   291  	s *Service
   292  }
   293  
   294  // Account: Representation of an account.
   295  type Account struct {
   296  	// CreateTime: Output only. Creation time of the account.
   297  	CreateTime string `json:"createTime,omitempty"`
   298  	// DisplayName: Output only. Display name of this account.
   299  	DisplayName string `json:"displayName,omitempty"`
   300  	// Name: Output only. Resource name of the account. Format: accounts/pub-[0-9]+
   301  	Name string `json:"name,omitempty"`
   302  	// PendingTasks: Output only. Outstanding tasks that need to be completed as
   303  	// part of the sign-up process for a new account. e.g.
   304  	// "billing-profile-creation", "phone-pin-verification".
   305  	PendingTasks []string `json:"pendingTasks,omitempty"`
   306  	// Premium: Output only. Whether this account is premium.
   307  	Premium bool `json:"premium,omitempty"`
   308  	// State: Output only. State of the account.
   309  	//
   310  	// Possible values:
   311  	//   "STATE_UNSPECIFIED" - State unspecified.
   312  	//   "READY" - The account is open and ready to serve ads.
   313  	//   "NEEDS_ATTENTION" - There are some issues with this account. Publishers
   314  	// should visit AdSense in order to fix the account.
   315  	//   "CLOSED" - The account is closed and can't serve ads.
   316  	State string `json:"state,omitempty"`
   317  	// TimeZone: The account time zone, as used by reporting. For more information,
   318  	// see changing the time zone of your reports
   319  	// (https://support.google.com/adsense/answer/9830725).
   320  	TimeZone *TimeZone `json:"timeZone,omitempty"`
   321  
   322  	// ServerResponse contains the HTTP response code and headers from the server.
   323  	googleapi.ServerResponse `json:"-"`
   324  	// ForceSendFields is a list of field names (e.g. "CreateTime") to
   325  	// unconditionally include in API requests. By default, fields with empty or
   326  	// default values are omitted from API requests. See
   327  	// https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more
   328  	// details.
   329  	ForceSendFields []string `json:"-"`
   330  	// NullFields is a list of field names (e.g. "CreateTime") to include in API
   331  	// requests with the JSON null value. By default, fields with empty values are
   332  	// omitted from API requests. See
   333  	// https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details.
   334  	NullFields []string `json:"-"`
   335  }
   336  
   337  func (s *Account) MarshalJSON() ([]byte, error) {
   338  	type NoMethod Account
   339  	return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields)
   340  }
   341  
   342  // AdBlockingRecoveryTag: Representation of an ad blocking recovery tag. See
   343  // https://support.google.com/adsense/answer/11575177.
   344  type AdBlockingRecoveryTag struct {
   345  	// ErrorProtectionCode: Error protection code that can be used in conjunction
   346  	// with the tag. It'll display a message to users if an ad blocking extension
   347  	// blocks their access to your site
   348  	// (https://support.google.com/adsense/answer/11575480).
   349  	ErrorProtectionCode string `json:"errorProtectionCode,omitempty"`
   350  	// Tag: The ad blocking recovery tag. Note that the message generated by the
   351  	// tag can be blocked by an ad blocking extension. If this is not your desired
   352  	// outcome, then you'll need to use it in conjunction with the error protection
   353  	// code.
   354  	Tag string `json:"tag,omitempty"`
   355  
   356  	// ServerResponse contains the HTTP response code and headers from the server.
   357  	googleapi.ServerResponse `json:"-"`
   358  	// ForceSendFields is a list of field names (e.g. "ErrorProtectionCode") to
   359  	// unconditionally include in API requests. By default, fields with empty or
   360  	// default values are omitted from API requests. See
   361  	// https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more
   362  	// details.
   363  	ForceSendFields []string `json:"-"`
   364  	// NullFields is a list of field names (e.g. "ErrorProtectionCode") to include
   365  	// in API requests with the JSON null value. By default, fields with empty
   366  	// values are omitted from API requests. See
   367  	// https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details.
   368  	NullFields []string `json:"-"`
   369  }
   370  
   371  func (s *AdBlockingRecoveryTag) MarshalJSON() ([]byte, error) {
   372  	type NoMethod AdBlockingRecoveryTag
   373  	return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields)
   374  }
   375  
   376  // AdClient: Representation of an ad client. An ad client represents a user's
   377  // subscription with a specific AdSense product.
   378  type AdClient struct {
   379  	// Name: Output only. Resource name of the ad client. Format:
   380  	// accounts/{account}/adclients/{adclient}
   381  	Name string `json:"name,omitempty"`
   382  	// ProductCode: Output only. Reporting product code of the ad client. For
   383  	// example, "AFC" for AdSense for Content. Corresponds to the `PRODUCT_CODE`
   384  	// dimension, and present only if the ad client supports reporting.
   385  	ProductCode string `json:"productCode,omitempty"`
   386  	// ReportingDimensionId: Output only. Unique ID of the ad client as used in the
   387  	// `AD_CLIENT_ID` reporting dimension. Present only if the ad client supports
   388  	// reporting.
   389  	ReportingDimensionId string `json:"reportingDimensionId,omitempty"`
   390  	// State: Output only. State of the ad client.
   391  	//
   392  	// Possible values:
   393  	//   "STATE_UNSPECIFIED" - State unspecified.
   394  	//   "READY" - The ad client is ready to show ads.
   395  	//   "GETTING_READY" - Running some checks on the ad client before it is ready
   396  	// to serve ads.
   397  	//   "REQUIRES_REVIEW" - The ad client hasn't been checked yet. There are tasks
   398  	// pending before AdSense will start the review.
   399  	State string `json:"state,omitempty"`
   400  
   401  	// ServerResponse contains the HTTP response code and headers from the server.
   402  	googleapi.ServerResponse `json:"-"`
   403  	// ForceSendFields is a list of field names (e.g. "Name") to unconditionally
   404  	// include in API requests. By default, fields with empty or default values are
   405  	// omitted from API requests. See
   406  	// https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more
   407  	// details.
   408  	ForceSendFields []string `json:"-"`
   409  	// NullFields is a list of field names (e.g. "Name") to include in API requests
   410  	// with the JSON null value. By default, fields with empty values are omitted
   411  	// from API requests. See
   412  	// https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details.
   413  	NullFields []string `json:"-"`
   414  }
   415  
   416  func (s *AdClient) MarshalJSON() ([]byte, error) {
   417  	type NoMethod AdClient
   418  	return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields)
   419  }
   420  
   421  // AdClientAdCode: Representation of the AdSense code for a given ad client.
   422  // For more information, see About the AdSense code
   423  // (https://support.google.com/adsense/answer/9274634).
   424  type AdClientAdCode struct {
   425  	// AdCode: Output only. The AdSense code snippet to add to the head of an HTML
   426  	// page.
   427  	AdCode string `json:"adCode,omitempty"`
   428  	// AmpBody: Output only. The AdSense code snippet to add to the body of an AMP
   429  	// page.
   430  	AmpBody string `json:"ampBody,omitempty"`
   431  	// AmpHead: Output only. The AdSense code snippet to add to the head of an AMP
   432  	// page.
   433  	AmpHead string `json:"ampHead,omitempty"`
   434  
   435  	// ServerResponse contains the HTTP response code and headers from the server.
   436  	googleapi.ServerResponse `json:"-"`
   437  	// ForceSendFields is a list of field names (e.g. "AdCode") to unconditionally
   438  	// include in API requests. By default, fields with empty or default values are
   439  	// omitted from API requests. See
   440  	// https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more
   441  	// details.
   442  	ForceSendFields []string `json:"-"`
   443  	// NullFields is a list of field names (e.g. "AdCode") to include in API
   444  	// requests with the JSON null value. By default, fields with empty values are
   445  	// omitted from API requests. See
   446  	// https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details.
   447  	NullFields []string `json:"-"`
   448  }
   449  
   450  func (s *AdClientAdCode) MarshalJSON() ([]byte, error) {
   451  	type NoMethod AdClientAdCode
   452  	return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields)
   453  }
   454  
   455  // AdUnit: Representation of an ad unit. An ad unit represents a saved ad unit
   456  // with a specific set of ad settings that have been customized within an
   457  // account.
   458  type AdUnit struct {
   459  	// ContentAdsSettings: Required. Settings specific to content ads (AFC).
   460  	ContentAdsSettings *ContentAdsSettings `json:"contentAdsSettings,omitempty"`
   461  	// DisplayName: Required. Display name of the ad unit, as provided when the ad
   462  	// unit was created.
   463  	DisplayName string `json:"displayName,omitempty"`
   464  	// Name: Output only. Resource name of the ad unit. Format:
   465  	// accounts/{account}/adclients/{adclient}/adunits/{adunit}
   466  	Name string `json:"name,omitempty"`
   467  	// ReportingDimensionId: Output only. Unique ID of the ad unit as used in the
   468  	// `AD_UNIT_ID` reporting dimension.
   469  	ReportingDimensionId string `json:"reportingDimensionId,omitempty"`
   470  	// State: Required. State of the ad unit.
   471  	//
   472  	// Possible values:
   473  	//   "STATE_UNSPECIFIED" - State unspecified.
   474  	//   "ACTIVE" - Ad unit has been activated by the user.
   475  	//   "ARCHIVED" - Ad unit has been archived by the user. Note that archived ad
   476  	// units are only removed from the default view in the UI. Archived ad units
   477  	// can still serve ads.
   478  	State string `json:"state,omitempty"`
   479  
   480  	// ServerResponse contains the HTTP response code and headers from the server.
   481  	googleapi.ServerResponse `json:"-"`
   482  	// ForceSendFields is a list of field names (e.g. "ContentAdsSettings") to
   483  	// unconditionally include in API requests. By default, fields with empty or
   484  	// default values are omitted from API requests. See
   485  	// https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more
   486  	// details.
   487  	ForceSendFields []string `json:"-"`
   488  	// NullFields is a list of field names (e.g. "ContentAdsSettings") to include
   489  	// in API requests with the JSON null value. By default, fields with empty
   490  	// values are omitted from API requests. See
   491  	// https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details.
   492  	NullFields []string `json:"-"`
   493  }
   494  
   495  func (s *AdUnit) MarshalJSON() ([]byte, error) {
   496  	type NoMethod AdUnit
   497  	return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields)
   498  }
   499  
   500  // AdUnitAdCode: Representation of the ad unit code for a given ad unit. For
   501  // more information, see About the AdSense code
   502  // (https://support.google.com/adsense/answer/9274634) and Where to place the
   503  // ad code in your HTML (https://support.google.com/adsense/answer/9190028).
   504  type AdUnitAdCode struct {
   505  	// AdCode: Output only. The code snippet to add to the body of an HTML page.
   506  	AdCode string `json:"adCode,omitempty"`
   507  
   508  	// ServerResponse contains the HTTP response code and headers from the server.
   509  	googleapi.ServerResponse `json:"-"`
   510  	// ForceSendFields is a list of field names (e.g. "AdCode") to unconditionally
   511  	// include in API requests. By default, fields with empty or default values are
   512  	// omitted from API requests. See
   513  	// https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more
   514  	// details.
   515  	ForceSendFields []string `json:"-"`
   516  	// NullFields is a list of field names (e.g. "AdCode") to include in API
   517  	// requests with the JSON null value. By default, fields with empty values are
   518  	// omitted from API requests. See
   519  	// https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details.
   520  	NullFields []string `json:"-"`
   521  }
   522  
   523  func (s *AdUnitAdCode) MarshalJSON() ([]byte, error) {
   524  	type NoMethod AdUnitAdCode
   525  	return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields)
   526  }
   527  
   528  // Alert: Representation of an alert.
   529  type Alert struct {
   530  	// Message: Output only. The localized alert message. This may contain HTML
   531  	// markup, such as phrase elements or links.
   532  	Message string `json:"message,omitempty"`
   533  	// Name: Output only. Resource name of the alert. Format:
   534  	// accounts/{account}/alerts/{alert}
   535  	Name string `json:"name,omitempty"`
   536  	// Severity: Output only. Severity of this alert.
   537  	//
   538  	// Possible values:
   539  	//   "SEVERITY_UNSPECIFIED" - Unspecified severity.
   540  	//   "INFO" - Info.
   541  	//   "WARNING" - Warning.
   542  	//   "SEVERE" - Severe.
   543  	Severity string `json:"severity,omitempty"`
   544  	// Type: Output only. Type of alert. This identifies the broad type of this
   545  	// alert, and provides a stable machine-readable identifier that will not be
   546  	// translated. For example, "payment-hold".
   547  	Type string `json:"type,omitempty"`
   548  	// ForceSendFields is a list of field names (e.g. "Message") to unconditionally
   549  	// include in API requests. By default, fields with empty or default values are
   550  	// omitted from API requests. See
   551  	// https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more
   552  	// details.
   553  	ForceSendFields []string `json:"-"`
   554  	// NullFields is a list of field names (e.g. "Message") to include in API
   555  	// requests with the JSON null value. By default, fields with empty values are
   556  	// omitted from API requests. See
   557  	// https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details.
   558  	NullFields []string `json:"-"`
   559  }
   560  
   561  func (s *Alert) MarshalJSON() ([]byte, error) {
   562  	type NoMethod Alert
   563  	return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields)
   564  }
   565  
   566  // Cell: Cell representation.
   567  type Cell struct {
   568  	// Value: Value in the cell. The dimension cells contain strings, and the
   569  	// metric cells contain numbers.
   570  	Value string `json:"value,omitempty"`
   571  	// ForceSendFields is a list of field names (e.g. "Value") to unconditionally
   572  	// include in API requests. By default, fields with empty or default values are
   573  	// omitted from API requests. See
   574  	// https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more
   575  	// details.
   576  	ForceSendFields []string `json:"-"`
   577  	// NullFields is a list of field names (e.g. "Value") to include in API
   578  	// requests with the JSON null value. By default, fields with empty values are
   579  	// omitted from API requests. See
   580  	// https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details.
   581  	NullFields []string `json:"-"`
   582  }
   583  
   584  func (s *Cell) MarshalJSON() ([]byte, error) {
   585  	type NoMethod Cell
   586  	return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields)
   587  }
   588  
   589  // ContentAdsSettings: Settings specific to content ads (AFC).
   590  type ContentAdsSettings struct {
   591  	// Size: Required. Size of the ad unit. e.g. "728x90", "1x3" (for responsive ad
   592  	// units).
   593  	Size string `json:"size,omitempty"`
   594  	// Type: Required. Type of the ad unit.
   595  	//
   596  	// Possible values:
   597  	//   "TYPE_UNSPECIFIED" - Unspecified ad unit type.
   598  	//   "DISPLAY" - Display ad unit.
   599  	//   "FEED" - In-feed ad unit.
   600  	//   "ARTICLE" - In-article ad unit.
   601  	//   "MATCHED_CONTENT" - Matched content unit.
   602  	//   "LINK" - Link ad unit. Note that link ad units have now been retired, see
   603  	// https://support.google.com/adsense/answer/9987221.
   604  	Type string `json:"type,omitempty"`
   605  	// ForceSendFields is a list of field names (e.g. "Size") to unconditionally
   606  	// include in API requests. By default, fields with empty or default values are
   607  	// omitted from API requests. See
   608  	// https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more
   609  	// details.
   610  	ForceSendFields []string `json:"-"`
   611  	// NullFields is a list of field names (e.g. "Size") to include in API requests
   612  	// with the JSON null value. By default, fields with empty values are omitted
   613  	// from API requests. See
   614  	// https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details.
   615  	NullFields []string `json:"-"`
   616  }
   617  
   618  func (s *ContentAdsSettings) MarshalJSON() ([]byte, error) {
   619  	type NoMethod ContentAdsSettings
   620  	return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields)
   621  }
   622  
   623  // CustomChannel: Representation of a custom channel.
   624  type CustomChannel struct {
   625  	// Active: Whether the custom channel is active and collecting data. See
   626  	// https://support.google.com/adsense/answer/10077192.
   627  	Active bool `json:"active,omitempty"`
   628  	// DisplayName: Required. Display name of the custom channel.
   629  	DisplayName string `json:"displayName,omitempty"`
   630  	// Name: Output only. Resource name of the custom channel. Format:
   631  	// accounts/{account}/adclients/{adclient}/customchannels/{customchannel}
   632  	Name string `json:"name,omitempty"`
   633  	// ReportingDimensionId: Output only. Unique ID of the custom channel as used
   634  	// in the `CUSTOM_CHANNEL_ID` reporting dimension.
   635  	ReportingDimensionId string `json:"reportingDimensionId,omitempty"`
   636  
   637  	// ServerResponse contains the HTTP response code and headers from the server.
   638  	googleapi.ServerResponse `json:"-"`
   639  	// ForceSendFields is a list of field names (e.g. "Active") to unconditionally
   640  	// include in API requests. By default, fields with empty or default values are
   641  	// omitted from API requests. See
   642  	// https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more
   643  	// details.
   644  	ForceSendFields []string `json:"-"`
   645  	// NullFields is a list of field names (e.g. "Active") to include in API
   646  	// requests with the JSON null value. By default, fields with empty values are
   647  	// omitted from API requests. See
   648  	// https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details.
   649  	NullFields []string `json:"-"`
   650  }
   651  
   652  func (s *CustomChannel) MarshalJSON() ([]byte, error) {
   653  	type NoMethod CustomChannel
   654  	return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields)
   655  }
   656  
   657  // Date: Represents a whole or partial calendar date, such as a birthday. The
   658  // time of day and time zone are either specified elsewhere or are
   659  // insignificant. The date is relative to the Gregorian Calendar. This can
   660  // represent one of the following: * A full date, with non-zero year, month,
   661  // and day values. * A month and day, with a zero year (for example, an
   662  // anniversary). * A year on its own, with a zero month and a zero day. * A
   663  // year and month, with a zero day (for example, a credit card expiration
   664  // date). Related types: * google.type.TimeOfDay * google.type.DateTime *
   665  // google.protobuf.Timestamp
   666  type Date struct {
   667  	// Day: Day of a month. Must be from 1 to 31 and valid for the year and month,
   668  	// or 0 to specify a year by itself or a year and month where the day isn't
   669  	// significant.
   670  	Day int64 `json:"day,omitempty"`
   671  	// Month: Month of a year. Must be from 1 to 12, or 0 to specify a year without
   672  	// a month and day.
   673  	Month int64 `json:"month,omitempty"`
   674  	// Year: Year of the date. Must be from 1 to 9999, or 0 to specify a date
   675  	// without a year.
   676  	Year int64 `json:"year,omitempty"`
   677  	// ForceSendFields is a list of field names (e.g. "Day") to unconditionally
   678  	// include in API requests. By default, fields with empty or default values are
   679  	// omitted from API requests. See
   680  	// https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more
   681  	// details.
   682  	ForceSendFields []string `json:"-"`
   683  	// NullFields is a list of field names (e.g. "Day") to include in API requests
   684  	// with the JSON null value. By default, fields with empty values are omitted
   685  	// from API requests. See
   686  	// https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details.
   687  	NullFields []string `json:"-"`
   688  }
   689  
   690  func (s *Date) MarshalJSON() ([]byte, error) {
   691  	type NoMethod Date
   692  	return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields)
   693  }
   694  
   695  // Empty: A generic empty message that you can re-use to avoid defining
   696  // duplicated empty messages in your APIs. A typical example is to use it as
   697  // the request or the response type of an API method. For instance: service Foo
   698  // { rpc Bar(google.protobuf.Empty) returns (google.protobuf.Empty); }
   699  type Empty struct {
   700  	// ServerResponse contains the HTTP response code and headers from the server.
   701  	googleapi.ServerResponse `json:"-"`
   702  }
   703  
   704  // Header: The header information of the columns requested in the report.
   705  type Header struct {
   706  	// CurrencyCode: The ISO-4217 currency code
   707  	// (https://en.wikipedia.org/wiki/ISO_4217) of this column. Only present if the
   708  	// header type is METRIC_CURRENCY.
   709  	CurrencyCode string `json:"currencyCode,omitempty"`
   710  	// Name: Required. Name of the header.
   711  	Name string `json:"name,omitempty"`
   712  	// Type: Required. Type of the header.
   713  	//
   714  	// Possible values:
   715  	//   "HEADER_TYPE_UNSPECIFIED" - Unspecified header.
   716  	//   "DIMENSION" - Dimension header type.
   717  	//   "METRIC_TALLY" - Tally header type.
   718  	//   "METRIC_RATIO" - Ratio header type.
   719  	//   "METRIC_CURRENCY" - Currency header type.
   720  	//   "METRIC_MILLISECONDS" - Milliseconds header type.
   721  	//   "METRIC_DECIMAL" - Decimal header type.
   722  	Type string `json:"type,omitempty"`
   723  	// ForceSendFields is a list of field names (e.g. "CurrencyCode") to
   724  	// unconditionally include in API requests. By default, fields with empty or
   725  	// default values are omitted from API requests. See
   726  	// https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more
   727  	// details.
   728  	ForceSendFields []string `json:"-"`
   729  	// NullFields is a list of field names (e.g. "CurrencyCode") to include in API
   730  	// requests with the JSON null value. By default, fields with empty values are
   731  	// omitted from API requests. See
   732  	// https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details.
   733  	NullFields []string `json:"-"`
   734  }
   735  
   736  func (s *Header) MarshalJSON() ([]byte, error) {
   737  	type NoMethod Header
   738  	return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields)
   739  }
   740  
   741  // HttpBody: Message that represents an arbitrary HTTP body. It should only be
   742  // used for payload formats that can't be represented as JSON, such as raw
   743  // binary or an HTML page. This message can be used both in streaming and
   744  // non-streaming API methods in the request as well as the response. It can be
   745  // used as a top-level request field, which is convenient if one wants to
   746  // extract parameters from either the URL or HTTP template into the request
   747  // fields and also want access to the raw HTTP body. Example: message
   748  // GetResourceRequest { // A unique request id. string request_id = 1; // The
   749  // raw HTTP body is bound to this field. google.api.HttpBody http_body = 2; }
   750  // service ResourceService { rpc GetResource(GetResourceRequest) returns
   751  // (google.api.HttpBody); rpc UpdateResource(google.api.HttpBody) returns
   752  // (google.protobuf.Empty); } Example with streaming methods: service
   753  // CaldavService { rpc GetCalendar(stream google.api.HttpBody) returns (stream
   754  // google.api.HttpBody); rpc UpdateCalendar(stream google.api.HttpBody) returns
   755  // (stream google.api.HttpBody); } Use of this type only changes how the
   756  // request and response bodies are handled, all other features will continue to
   757  // work unchanged.
   758  type HttpBody struct {
   759  	// ContentType: The HTTP Content-Type header value specifying the content type
   760  	// of the body.
   761  	ContentType string `json:"contentType,omitempty"`
   762  	// Data: The HTTP request/response body as raw binary.
   763  	Data string `json:"data,omitempty"`
   764  	// Extensions: Application specific response metadata. Must be set in the first
   765  	// response for streaming APIs.
   766  	Extensions []googleapi.RawMessage `json:"extensions,omitempty"`
   767  
   768  	// ServerResponse contains the HTTP response code and headers from the server.
   769  	googleapi.ServerResponse `json:"-"`
   770  	// ForceSendFields is a list of field names (e.g. "ContentType") to
   771  	// unconditionally include in API requests. By default, fields with empty or
   772  	// default values are omitted from API requests. See
   773  	// https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more
   774  	// details.
   775  	ForceSendFields []string `json:"-"`
   776  	// NullFields is a list of field names (e.g. "ContentType") to include in API
   777  	// requests with the JSON null value. By default, fields with empty values are
   778  	// omitted from API requests. See
   779  	// https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details.
   780  	NullFields []string `json:"-"`
   781  }
   782  
   783  func (s *HttpBody) MarshalJSON() ([]byte, error) {
   784  	type NoMethod HttpBody
   785  	return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields)
   786  }
   787  
   788  // ListAccountsResponse: Response definition for the account list rpc.
   789  type ListAccountsResponse struct {
   790  	// Accounts: The accounts returned in this list response.
   791  	Accounts []*Account `json:"accounts,omitempty"`
   792  	// NextPageToken: Continuation token used to page through accounts. To retrieve
   793  	// the next page of the results, set the next request's "page_token" value to
   794  	// this.
   795  	NextPageToken string `json:"nextPageToken,omitempty"`
   796  
   797  	// ServerResponse contains the HTTP response code and headers from the server.
   798  	googleapi.ServerResponse `json:"-"`
   799  	// ForceSendFields is a list of field names (e.g. "Accounts") to
   800  	// unconditionally include in API requests. By default, fields with empty or
   801  	// default values are omitted from API requests. See
   802  	// https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more
   803  	// details.
   804  	ForceSendFields []string `json:"-"`
   805  	// NullFields is a list of field names (e.g. "Accounts") to include in API
   806  	// requests with the JSON null value. By default, fields with empty values are
   807  	// omitted from API requests. See
   808  	// https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details.
   809  	NullFields []string `json:"-"`
   810  }
   811  
   812  func (s *ListAccountsResponse) MarshalJSON() ([]byte, error) {
   813  	type NoMethod ListAccountsResponse
   814  	return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields)
   815  }
   816  
   817  // ListAdClientsResponse: Response definition for the ad client list rpc.
   818  type ListAdClientsResponse struct {
   819  	// AdClients: The ad clients returned in this list response.
   820  	AdClients []*AdClient `json:"adClients,omitempty"`
   821  	// NextPageToken: Continuation token used to page through ad clients. To
   822  	// retrieve the next page of the results, set the next request's "page_token"
   823  	// value to this.
   824  	NextPageToken string `json:"nextPageToken,omitempty"`
   825  
   826  	// ServerResponse contains the HTTP response code and headers from the server.
   827  	googleapi.ServerResponse `json:"-"`
   828  	// ForceSendFields is a list of field names (e.g. "AdClients") to
   829  	// unconditionally include in API requests. By default, fields with empty or
   830  	// default values are omitted from API requests. See
   831  	// https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more
   832  	// details.
   833  	ForceSendFields []string `json:"-"`
   834  	// NullFields is a list of field names (e.g. "AdClients") to include in API
   835  	// requests with the JSON null value. By default, fields with empty values are
   836  	// omitted from API requests. See
   837  	// https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details.
   838  	NullFields []string `json:"-"`
   839  }
   840  
   841  func (s *ListAdClientsResponse) MarshalJSON() ([]byte, error) {
   842  	type NoMethod ListAdClientsResponse
   843  	return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields)
   844  }
   845  
   846  // ListAdUnitsResponse: Response definition for the adunit list rpc.
   847  type ListAdUnitsResponse struct {
   848  	// AdUnits: The ad units returned in the list response.
   849  	AdUnits []*AdUnit `json:"adUnits,omitempty"`
   850  	// NextPageToken: Continuation token used to page through ad units. To retrieve
   851  	// the next page of the results, set the next request's "page_token" value to
   852  	// this.
   853  	NextPageToken string `json:"nextPageToken,omitempty"`
   854  
   855  	// ServerResponse contains the HTTP response code and headers from the server.
   856  	googleapi.ServerResponse `json:"-"`
   857  	// ForceSendFields is a list of field names (e.g. "AdUnits") to unconditionally
   858  	// include in API requests. By default, fields with empty or default values are
   859  	// omitted from API requests. See
   860  	// https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more
   861  	// details.
   862  	ForceSendFields []string `json:"-"`
   863  	// NullFields is a list of field names (e.g. "AdUnits") to include in API
   864  	// requests with the JSON null value. By default, fields with empty values are
   865  	// omitted from API requests. See
   866  	// https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details.
   867  	NullFields []string `json:"-"`
   868  }
   869  
   870  func (s *ListAdUnitsResponse) MarshalJSON() ([]byte, error) {
   871  	type NoMethod ListAdUnitsResponse
   872  	return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields)
   873  }
   874  
   875  // ListAlertsResponse: Response definition for the alerts list rpc.
   876  type ListAlertsResponse struct {
   877  	// Alerts: The alerts returned in this list response.
   878  	Alerts []*Alert `json:"alerts,omitempty"`
   879  
   880  	// ServerResponse contains the HTTP response code and headers from the server.
   881  	googleapi.ServerResponse `json:"-"`
   882  	// ForceSendFields is a list of field names (e.g. "Alerts") to unconditionally
   883  	// include in API requests. By default, fields with empty or default values are
   884  	// omitted from API requests. See
   885  	// https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more
   886  	// details.
   887  	ForceSendFields []string `json:"-"`
   888  	// NullFields is a list of field names (e.g. "Alerts") to include in API
   889  	// requests with the JSON null value. By default, fields with empty values are
   890  	// omitted from API requests. See
   891  	// https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details.
   892  	NullFields []string `json:"-"`
   893  }
   894  
   895  func (s *ListAlertsResponse) MarshalJSON() ([]byte, error) {
   896  	type NoMethod ListAlertsResponse
   897  	return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields)
   898  }
   899  
   900  // ListChildAccountsResponse: Response definition for the child account list
   901  // rpc.
   902  type ListChildAccountsResponse struct {
   903  	// Accounts: The accounts returned in this list response.
   904  	Accounts []*Account `json:"accounts,omitempty"`
   905  	// NextPageToken: Continuation token used to page through accounts. To retrieve
   906  	// the next page of the results, set the next request's "page_token" value to
   907  	// this.
   908  	NextPageToken string `json:"nextPageToken,omitempty"`
   909  
   910  	// ServerResponse contains the HTTP response code and headers from the server.
   911  	googleapi.ServerResponse `json:"-"`
   912  	// ForceSendFields is a list of field names (e.g. "Accounts") to
   913  	// unconditionally include in API requests. By default, fields with empty or
   914  	// default values are omitted from API requests. See
   915  	// https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more
   916  	// details.
   917  	ForceSendFields []string `json:"-"`
   918  	// NullFields is a list of field names (e.g. "Accounts") to include in API
   919  	// requests with the JSON null value. By default, fields with empty values are
   920  	// omitted from API requests. See
   921  	// https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details.
   922  	NullFields []string `json:"-"`
   923  }
   924  
   925  func (s *ListChildAccountsResponse) MarshalJSON() ([]byte, error) {
   926  	type NoMethod ListChildAccountsResponse
   927  	return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields)
   928  }
   929  
   930  // ListCustomChannelsResponse: Response definition for the custom channel list
   931  // rpc.
   932  type ListCustomChannelsResponse struct {
   933  	// CustomChannels: The custom channels returned in this list response.
   934  	CustomChannels []*CustomChannel `json:"customChannels,omitempty"`
   935  	// NextPageToken: Continuation token used to page through alerts. To retrieve
   936  	// the next page of the results, set the next request's "page_token" value to
   937  	// this.
   938  	NextPageToken string `json:"nextPageToken,omitempty"`
   939  
   940  	// ServerResponse contains the HTTP response code and headers from the server.
   941  	googleapi.ServerResponse `json:"-"`
   942  	// ForceSendFields is a list of field names (e.g. "CustomChannels") to
   943  	// unconditionally include in API requests. By default, fields with empty or
   944  	// default values are omitted from API requests. See
   945  	// https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more
   946  	// details.
   947  	ForceSendFields []string `json:"-"`
   948  	// NullFields is a list of field names (e.g. "CustomChannels") to include in
   949  	// API requests with the JSON null value. By default, fields with empty values
   950  	// are omitted from API requests. See
   951  	// https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details.
   952  	NullFields []string `json:"-"`
   953  }
   954  
   955  func (s *ListCustomChannelsResponse) MarshalJSON() ([]byte, error) {
   956  	type NoMethod ListCustomChannelsResponse
   957  	return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields)
   958  }
   959  
   960  // ListLinkedAdUnitsResponse: Response definition for the ad units linked to a
   961  // custom channel list rpc.
   962  type ListLinkedAdUnitsResponse struct {
   963  	// AdUnits: The ad units returned in the list response.
   964  	AdUnits []*AdUnit `json:"adUnits,omitempty"`
   965  	// NextPageToken: Continuation token used to page through ad units. To retrieve
   966  	// the next page of the results, set the next request's "page_token" value to
   967  	// this.
   968  	NextPageToken string `json:"nextPageToken,omitempty"`
   969  
   970  	// ServerResponse contains the HTTP response code and headers from the server.
   971  	googleapi.ServerResponse `json:"-"`
   972  	// ForceSendFields is a list of field names (e.g. "AdUnits") to unconditionally
   973  	// include in API requests. By default, fields with empty or default values are
   974  	// omitted from API requests. See
   975  	// https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more
   976  	// details.
   977  	ForceSendFields []string `json:"-"`
   978  	// NullFields is a list of field names (e.g. "AdUnits") to include in API
   979  	// requests with the JSON null value. By default, fields with empty values are
   980  	// omitted from API requests. See
   981  	// https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details.
   982  	NullFields []string `json:"-"`
   983  }
   984  
   985  func (s *ListLinkedAdUnitsResponse) MarshalJSON() ([]byte, error) {
   986  	type NoMethod ListLinkedAdUnitsResponse
   987  	return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields)
   988  }
   989  
   990  // ListLinkedCustomChannelsResponse: Response definition for the custom
   991  // channels linked to an adunit list rpc.
   992  type ListLinkedCustomChannelsResponse struct {
   993  	// CustomChannels: The custom channels returned in this list response.
   994  	CustomChannels []*CustomChannel `json:"customChannels,omitempty"`
   995  	// NextPageToken: Continuation token used to page through alerts. To retrieve
   996  	// the next page of the results, set the next request's "page_token" value to
   997  	// this.
   998  	NextPageToken string `json:"nextPageToken,omitempty"`
   999  
  1000  	// ServerResponse contains the HTTP response code and headers from the server.
  1001  	googleapi.ServerResponse `json:"-"`
  1002  	// ForceSendFields is a list of field names (e.g. "CustomChannels") to
  1003  	// unconditionally include in API requests. By default, fields with empty or
  1004  	// default values are omitted from API requests. See
  1005  	// https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more
  1006  	// details.
  1007  	ForceSendFields []string `json:"-"`
  1008  	// NullFields is a list of field names (e.g. "CustomChannels") to include in
  1009  	// API requests with the JSON null value. By default, fields with empty values
  1010  	// are omitted from API requests. See
  1011  	// https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details.
  1012  	NullFields []string `json:"-"`
  1013  }
  1014  
  1015  func (s *ListLinkedCustomChannelsResponse) MarshalJSON() ([]byte, error) {
  1016  	type NoMethod ListLinkedCustomChannelsResponse
  1017  	return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields)
  1018  }
  1019  
  1020  // ListPaymentsResponse: Response definition for the payments list rpc.
  1021  type ListPaymentsResponse struct {
  1022  	// Payments: The payments returned in this list response.
  1023  	Payments []*Payment `json:"payments,omitempty"`
  1024  
  1025  	// ServerResponse contains the HTTP response code and headers from the server.
  1026  	googleapi.ServerResponse `json:"-"`
  1027  	// ForceSendFields is a list of field names (e.g. "Payments") to
  1028  	// unconditionally include in API requests. By default, fields with empty or
  1029  	// default values are omitted from API requests. See
  1030  	// https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more
  1031  	// details.
  1032  	ForceSendFields []string `json:"-"`
  1033  	// NullFields is a list of field names (e.g. "Payments") to include in API
  1034  	// requests with the JSON null value. By default, fields with empty values are
  1035  	// omitted from API requests. See
  1036  	// https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details.
  1037  	NullFields []string `json:"-"`
  1038  }
  1039  
  1040  func (s *ListPaymentsResponse) MarshalJSON() ([]byte, error) {
  1041  	type NoMethod ListPaymentsResponse
  1042  	return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields)
  1043  }
  1044  
  1045  // ListPolicyIssuesResponse: Response definition for the policy issues list
  1046  // rpc. Policy issues are reported only if the publisher has at least one AFC
  1047  // ad client in READY or GETTING_READY state. If the publisher has no such AFC
  1048  // ad client, the response will be an empty list.
  1049  type ListPolicyIssuesResponse struct {
  1050  	// NextPageToken: Continuation token used to page through policy issues. To
  1051  	// retrieve the next page of the results, set the next request's "page_token"
  1052  	// value to this.
  1053  	NextPageToken string `json:"nextPageToken,omitempty"`
  1054  	// PolicyIssues: The policy issues returned in the list response.
  1055  	PolicyIssues []*PolicyIssue `json:"policyIssues,omitempty"`
  1056  
  1057  	// ServerResponse contains the HTTP response code and headers from the server.
  1058  	googleapi.ServerResponse `json:"-"`
  1059  	// ForceSendFields is a list of field names (e.g. "NextPageToken") to
  1060  	// unconditionally include in API requests. By default, fields with empty or
  1061  	// default values are omitted from API requests. See
  1062  	// https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more
  1063  	// details.
  1064  	ForceSendFields []string `json:"-"`
  1065  	// NullFields is a list of field names (e.g. "NextPageToken") to include in API
  1066  	// requests with the JSON null value. By default, fields with empty values are
  1067  	// omitted from API requests. See
  1068  	// https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details.
  1069  	NullFields []string `json:"-"`
  1070  }
  1071  
  1072  func (s *ListPolicyIssuesResponse) MarshalJSON() ([]byte, error) {
  1073  	type NoMethod ListPolicyIssuesResponse
  1074  	return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields)
  1075  }
  1076  
  1077  // ListSavedReportsResponse: Response definition for the saved reports list
  1078  // rpc.
  1079  type ListSavedReportsResponse struct {
  1080  	// NextPageToken: Continuation token used to page through reports. To retrieve
  1081  	// the next page of the results, set the next request's "page_token" value to
  1082  	// this.
  1083  	NextPageToken string `json:"nextPageToken,omitempty"`
  1084  	// SavedReports: The reports returned in this list response.
  1085  	SavedReports []*SavedReport `json:"savedReports,omitempty"`
  1086  
  1087  	// ServerResponse contains the HTTP response code and headers from the server.
  1088  	googleapi.ServerResponse `json:"-"`
  1089  	// ForceSendFields is a list of field names (e.g. "NextPageToken") to
  1090  	// unconditionally include in API requests. By default, fields with empty or
  1091  	// default values are omitted from API requests. See
  1092  	// https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more
  1093  	// details.
  1094  	ForceSendFields []string `json:"-"`
  1095  	// NullFields is a list of field names (e.g. "NextPageToken") to include in API
  1096  	// requests with the JSON null value. By default, fields with empty values are
  1097  	// omitted from API requests. See
  1098  	// https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details.
  1099  	NullFields []string `json:"-"`
  1100  }
  1101  
  1102  func (s *ListSavedReportsResponse) MarshalJSON() ([]byte, error) {
  1103  	type NoMethod ListSavedReportsResponse
  1104  	return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields)
  1105  }
  1106  
  1107  // ListSitesResponse: Response definition for the sites list rpc.
  1108  type ListSitesResponse struct {
  1109  	// NextPageToken: Continuation token used to page through sites. To retrieve
  1110  	// the next page of the results, set the next request's "page_token" value to
  1111  	// this.
  1112  	NextPageToken string `json:"nextPageToken,omitempty"`
  1113  	// Sites: The sites returned in this list response.
  1114  	Sites []*Site `json:"sites,omitempty"`
  1115  
  1116  	// ServerResponse contains the HTTP response code and headers from the server.
  1117  	googleapi.ServerResponse `json:"-"`
  1118  	// ForceSendFields is a list of field names (e.g. "NextPageToken") to
  1119  	// unconditionally include in API requests. By default, fields with empty or
  1120  	// default values are omitted from API requests. See
  1121  	// https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more
  1122  	// details.
  1123  	ForceSendFields []string `json:"-"`
  1124  	// NullFields is a list of field names (e.g. "NextPageToken") to include in API
  1125  	// requests with the JSON null value. By default, fields with empty values are
  1126  	// omitted from API requests. See
  1127  	// https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details.
  1128  	NullFields []string `json:"-"`
  1129  }
  1130  
  1131  func (s *ListSitesResponse) MarshalJSON() ([]byte, error) {
  1132  	type NoMethod ListSitesResponse
  1133  	return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields)
  1134  }
  1135  
  1136  // ListUrlChannelsResponse: Response definition for the url channels list rpc.
  1137  type ListUrlChannelsResponse struct {
  1138  	// NextPageToken: Continuation token used to page through url channels. To
  1139  	// retrieve the next page of the results, set the next request's "page_token"
  1140  	// value to this.
  1141  	NextPageToken string `json:"nextPageToken,omitempty"`
  1142  	// UrlChannels: The url channels returned in this list response.
  1143  	UrlChannels []*UrlChannel `json:"urlChannels,omitempty"`
  1144  
  1145  	// ServerResponse contains the HTTP response code and headers from the server.
  1146  	googleapi.ServerResponse `json:"-"`
  1147  	// ForceSendFields is a list of field names (e.g. "NextPageToken") to
  1148  	// unconditionally include in API requests. By default, fields with empty or
  1149  	// default values are omitted from API requests. See
  1150  	// https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more
  1151  	// details.
  1152  	ForceSendFields []string `json:"-"`
  1153  	// NullFields is a list of field names (e.g. "NextPageToken") to include in API
  1154  	// requests with the JSON null value. By default, fields with empty values are
  1155  	// omitted from API requests. See
  1156  	// https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details.
  1157  	NullFields []string `json:"-"`
  1158  }
  1159  
  1160  func (s *ListUrlChannelsResponse) MarshalJSON() ([]byte, error) {
  1161  	type NoMethod ListUrlChannelsResponse
  1162  	return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields)
  1163  }
  1164  
  1165  // Payment: Representation of an unpaid or paid payment. See Payment timelines
  1166  // for AdSense (https://support.google.com/adsense/answer/7164703) for more
  1167  // information about payments and the YouTube homepage and payments account
  1168  // (https://support.google.com/adsense/answer/11622510) article for information
  1169  // about dedicated payments accounts for YouTube.
  1170  type Payment struct {
  1171  	// Amount: Output only. The amount of unpaid or paid earnings, as a formatted
  1172  	// string, including the currency. E.g. "Â¥1,235 JPY", "$1,234.57", "£87.65".
  1173  	Amount string `json:"amount,omitempty"`
  1174  	// Date: Output only. For paid earnings, the date that the payment was
  1175  	// credited. For unpaid earnings, this field is empty. Payment dates are always
  1176  	// returned in the billing timezone (America/Los_Angeles).
  1177  	Date *Date `json:"date,omitempty"`
  1178  	// Name: Output only. Resource name of the payment. Format: -
  1179  	// accounts/{account}/payments/unpaid for unpaid (current) AdSense earnings. -
  1180  	// accounts/{account}/payments/youtube-unpaid for unpaid (current) YouTube
  1181  	// earnings. - accounts/{account}/payments/yyyy-MM-dd for paid AdSense
  1182  	// earnings. - accounts/{account}/payments/youtube-yyyy-MM-dd for paid YouTube
  1183  	// earnings.
  1184  	Name string `json:"name,omitempty"`
  1185  	// ForceSendFields is a list of field names (e.g. "Amount") to unconditionally
  1186  	// include in API requests. By default, fields with empty or default values are
  1187  	// omitted from API requests. See
  1188  	// https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more
  1189  	// details.
  1190  	ForceSendFields []string `json:"-"`
  1191  	// NullFields is a list of field names (e.g. "Amount") to include in API
  1192  	// requests with the JSON null value. By default, fields with empty values are
  1193  	// omitted from API requests. See
  1194  	// https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details.
  1195  	NullFields []string `json:"-"`
  1196  }
  1197  
  1198  func (s *Payment) MarshalJSON() ([]byte, error) {
  1199  	type NoMethod Payment
  1200  	return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields)
  1201  }
  1202  
  1203  // PolicyIssue: Representation of a policy issue for a single entity (site,
  1204  // site-section, or page). All issues for a single entity are represented by a
  1205  // single PolicyIssue resource, though that PolicyIssue can have multiple
  1206  // causes (or "topics") that can change over time. Policy issues are removed if
  1207  // there are no issues detected recently or if there's a recent successful
  1208  // appeal for the entity.
  1209  type PolicyIssue struct {
  1210  	// Action: Required. The most severe action taken on the entity over the past
  1211  	// seven days.
  1212  	//
  1213  	// Possible values:
  1214  	//   "ENFORCEMENT_ACTION_UNSPECIFIED" - The action is unspecified.
  1215  	//   "WARNED" - No ad serving enforcement is currently present, but enforcement
  1216  	// will start on the `warning_escalation_date` if the issue is not resolved.
  1217  	//   "AD_SERVING_RESTRICTED" - Ad serving demand has been restricted on the
  1218  	// entity.
  1219  	//   "AD_SERVING_DISABLED" - Ad serving has been disabled on the entity.
  1220  	//   "AD_SERVED_WITH_CLICK_CONFIRMATION" - Ads are being served for the entity
  1221  	// but Confirmed Click is being applied to the ads. See
  1222  	// https://support.google.com/adsense/answer/10025624.
  1223  	//   "AD_PERSONALIZATION_RESTRICTED" - Ad personalization is restricted because
  1224  	// the ad requests coming from the EEA and UK do not have a TCF string or the
  1225  	// Consent Management Platform (CMP) indicated by the TCF string is not Google
  1226  	// certified. As a result, basic/limited ads will be served. See
  1227  	// https://support.google.com/adsense/answer/13554116
  1228  	Action string `json:"action,omitempty"`
  1229  	// AdClients: Optional. List of ad clients associated with the policy issue
  1230  	// (either as the primary ad client or an associated host/secondary ad client).
  1231  	// In the latter case, this will be an ad client that is not owned by the
  1232  	// current account.
  1233  	AdClients []string `json:"adClients,omitempty"`
  1234  	// AdRequestCount: Required. Total number of ad requests affected by the policy
  1235  	// violations over the past seven days.
  1236  	AdRequestCount int64 `json:"adRequestCount,omitempty,string"`
  1237  	// EntityType: Required. Type of the entity indicating if the entity is a site,
  1238  	// site-section, or page.
  1239  	//
  1240  	// Possible values:
  1241  	//   "ENTITY_TYPE_UNSPECIFIED" - The entity type is unspecified.
  1242  	//   "SITE" - The enforced entity is an entire website.
  1243  	//   "SITE_SECTION" - The enforced entity is a particular section of a website.
  1244  	// All the pages with this prefix are enforced.
  1245  	//   "PAGE" - The enforced entity is a single web page.
  1246  	EntityType string `json:"entityType,omitempty"`
  1247  	// FirstDetectedDate: Required. The date (in the America/Los_Angeles timezone)
  1248  	// when policy violations were first detected on the entity.
  1249  	FirstDetectedDate *Date `json:"firstDetectedDate,omitempty"`
  1250  	// LastDetectedDate: Required. The date (in the America/Los_Angeles timezone)
  1251  	// when policy violations were last detected on the entity.
  1252  	LastDetectedDate *Date `json:"lastDetectedDate,omitempty"`
  1253  	// Name: Required. Resource name of the entity with policy issues. Format:
  1254  	// accounts/{account}/policyIssues/{policy_issue}
  1255  	Name string `json:"name,omitempty"`
  1256  	// PolicyTopics: Required. Unordered list. The policy topics that this entity
  1257  	// was found to violate over the past seven days.
  1258  	PolicyTopics []*PolicyTopic `json:"policyTopics,omitempty"`
  1259  	// Site: Required. Hostname/domain of the entity (for example "foo.com" or
  1260  	// "www.foo.com"). This _should_ be a bare domain/host name without any
  1261  	// protocol. This will be present for all policy issues.
  1262  	Site string `json:"site,omitempty"`
  1263  	// SiteSection: Optional. Prefix of the site-section having policy issues (For
  1264  	// example "foo.com/bar-section"). This will be present if the `entity_type` is
  1265  	// `SITE_SECTION` and will be absent for other entity types.
  1266  	SiteSection string `json:"siteSection,omitempty"`
  1267  	// Uri: Optional. URI of the page having policy violations (for example
  1268  	// "foo.com/bar" or "www.foo.com/bar"). This will be present if the
  1269  	// `entity_type` is `PAGE` and will be absent for other entity types.
  1270  	Uri string `json:"uri,omitempty"`
  1271  	// WarningEscalationDate: Optional. The date (in the America/Los_Angeles
  1272  	// timezone) when the entity will have ad serving demand restricted or ad
  1273  	// serving disabled. This is present only for issues with a `WARNED`
  1274  	// enforcement action. See https://support.google.com/adsense/answer/11066888.
  1275  	WarningEscalationDate *Date `json:"warningEscalationDate,omitempty"`
  1276  
  1277  	// ServerResponse contains the HTTP response code and headers from the server.
  1278  	googleapi.ServerResponse `json:"-"`
  1279  	// ForceSendFields is a list of field names (e.g. "Action") to unconditionally
  1280  	// include in API requests. By default, fields with empty or default values are
  1281  	// omitted from API requests. See
  1282  	// https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more
  1283  	// details.
  1284  	ForceSendFields []string `json:"-"`
  1285  	// NullFields is a list of field names (e.g. "Action") to include in API
  1286  	// requests with the JSON null value. By default, fields with empty values are
  1287  	// omitted from API requests. See
  1288  	// https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details.
  1289  	NullFields []string `json:"-"`
  1290  }
  1291  
  1292  func (s *PolicyIssue) MarshalJSON() ([]byte, error) {
  1293  	type NoMethod PolicyIssue
  1294  	return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields)
  1295  }
  1296  
  1297  // PolicyTopic: Information about a particular policy topic. A policy topic
  1298  // represents a single class of policy issue that can impact ad serving for
  1299  // your site. For example, sexual content or having ads that obscure your
  1300  // content. A single policy issue can have multiple policy topics for a single
  1301  // entity.
  1302  type PolicyTopic struct {
  1303  	// MustFix: Required. Indicates if this is a policy violation or not. When the
  1304  	// value is true, issues that are instances of this topic must be addressed to
  1305  	// remain in compliance with the partner's agreements with Google. A false
  1306  	// value indicates that it's not mandatory to fix the issues but advertising
  1307  	// demand might be restricted.
  1308  	MustFix bool `json:"mustFix,omitempty"`
  1309  	// Topic: Required. The policy topic. For example, "sexual-content" or
  1310  	// "ads-obscuring-content"."
  1311  	Topic string `json:"topic,omitempty"`
  1312  	// ForceSendFields is a list of field names (e.g. "MustFix") to unconditionally
  1313  	// include in API requests. By default, fields with empty or default values are
  1314  	// omitted from API requests. See
  1315  	// https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more
  1316  	// details.
  1317  	ForceSendFields []string `json:"-"`
  1318  	// NullFields is a list of field names (e.g. "MustFix") to include in API
  1319  	// requests with the JSON null value. By default, fields with empty values are
  1320  	// omitted from API requests. See
  1321  	// https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details.
  1322  	NullFields []string `json:"-"`
  1323  }
  1324  
  1325  func (s *PolicyTopic) MarshalJSON() ([]byte, error) {
  1326  	type NoMethod PolicyTopic
  1327  	return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields)
  1328  }
  1329  
  1330  // ReportResult: Result of a generated report.
  1331  type ReportResult struct {
  1332  	// Averages: The averages of the report. This is the same length as any other
  1333  	// row in the report; cells corresponding to dimension columns are empty.
  1334  	Averages *Row `json:"averages,omitempty"`
  1335  	// EndDate: Required. End date of the range (inclusive).
  1336  	EndDate *Date `json:"endDate,omitempty"`
  1337  	// Headers: The header information; one for each dimension in the request,
  1338  	// followed by one for each metric in the request.
  1339  	Headers []*Header `json:"headers,omitempty"`
  1340  	// Rows: The output rows of the report. Each row is a list of cells; one for
  1341  	// each dimension in the request, followed by one for each metric in the
  1342  	// request.
  1343  	Rows []*Row `json:"rows,omitempty"`
  1344  	// StartDate: Required. Start date of the range (inclusive).
  1345  	StartDate *Date `json:"startDate,omitempty"`
  1346  	// TotalMatchedRows: The total number of rows matched by the report request.
  1347  	TotalMatchedRows int64 `json:"totalMatchedRows,omitempty,string"`
  1348  	// Totals: The totals of the report. This is the same length as any other row
  1349  	// in the report; cells corresponding to dimension columns are empty.
  1350  	Totals *Row `json:"totals,omitempty"`
  1351  	// Warnings: Any warnings associated with generation of the report. These
  1352  	// warnings are always returned in English.
  1353  	Warnings []string `json:"warnings,omitempty"`
  1354  
  1355  	// ServerResponse contains the HTTP response code and headers from the server.
  1356  	googleapi.ServerResponse `json:"-"`
  1357  	// ForceSendFields is a list of field names (e.g. "Averages") to
  1358  	// unconditionally include in API requests. By default, fields with empty or
  1359  	// default values are omitted from API requests. See
  1360  	// https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more
  1361  	// details.
  1362  	ForceSendFields []string `json:"-"`
  1363  	// NullFields is a list of field names (e.g. "Averages") to include in API
  1364  	// requests with the JSON null value. By default, fields with empty values are
  1365  	// omitted from API requests. See
  1366  	// https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details.
  1367  	NullFields []string `json:"-"`
  1368  }
  1369  
  1370  func (s *ReportResult) MarshalJSON() ([]byte, error) {
  1371  	type NoMethod ReportResult
  1372  	return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields)
  1373  }
  1374  
  1375  // Row: Row representation.
  1376  type Row struct {
  1377  	// Cells: Cells in the row.
  1378  	Cells []*Cell `json:"cells,omitempty"`
  1379  	// ForceSendFields is a list of field names (e.g. "Cells") to unconditionally
  1380  	// include in API requests. By default, fields with empty or default values are
  1381  	// omitted from API requests. See
  1382  	// https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more
  1383  	// details.
  1384  	ForceSendFields []string `json:"-"`
  1385  	// NullFields is a list of field names (e.g. "Cells") to include in API
  1386  	// requests with the JSON null value. By default, fields with empty values are
  1387  	// omitted from API requests. See
  1388  	// https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details.
  1389  	NullFields []string `json:"-"`
  1390  }
  1391  
  1392  func (s *Row) MarshalJSON() ([]byte, error) {
  1393  	type NoMethod Row
  1394  	return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields)
  1395  }
  1396  
  1397  // SavedReport: Representation of a saved report.
  1398  type SavedReport struct {
  1399  	// Name: Output only. Resource name of the report. Format:
  1400  	// accounts/{account}/reports/{report}
  1401  	Name string `json:"name,omitempty"`
  1402  	// Title: Report title as specified by publisher.
  1403  	Title string `json:"title,omitempty"`
  1404  
  1405  	// ServerResponse contains the HTTP response code and headers from the server.
  1406  	googleapi.ServerResponse `json:"-"`
  1407  	// ForceSendFields is a list of field names (e.g. "Name") to unconditionally
  1408  	// include in API requests. By default, fields with empty or default values are
  1409  	// omitted from API requests. See
  1410  	// https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more
  1411  	// details.
  1412  	ForceSendFields []string `json:"-"`
  1413  	// NullFields is a list of field names (e.g. "Name") to include in API requests
  1414  	// with the JSON null value. By default, fields with empty values are omitted
  1415  	// from API requests. See
  1416  	// https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details.
  1417  	NullFields []string `json:"-"`
  1418  }
  1419  
  1420  func (s *SavedReport) MarshalJSON() ([]byte, error) {
  1421  	type NoMethod SavedReport
  1422  	return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields)
  1423  }
  1424  
  1425  // Site: Representation of a Site.
  1426  type Site struct {
  1427  	// AutoAdsEnabled: Whether auto ads is turned on for the site.
  1428  	AutoAdsEnabled bool `json:"autoAdsEnabled,omitempty"`
  1429  	// Domain: Domain (or subdomain) of the site, e.g. "example.com" or
  1430  	// "www.example.com". This is used in the `OWNED_SITE_DOMAIN_NAME` reporting
  1431  	// dimension.
  1432  	Domain string `json:"domain,omitempty"`
  1433  	// Name: Output only. Resource name of a site. Format:
  1434  	// accounts/{account}/sites/{site}
  1435  	Name string `json:"name,omitempty"`
  1436  	// ReportingDimensionId: Output only. Unique ID of the site as used in the
  1437  	// `OWNED_SITE_ID` reporting dimension.
  1438  	ReportingDimensionId string `json:"reportingDimensionId,omitempty"`
  1439  	// State: Output only. State of a site.
  1440  	//
  1441  	// Possible values:
  1442  	//   "STATE_UNSPECIFIED" - State unspecified.
  1443  	//   "REQUIRES_REVIEW" - Either: * The site hasn't been checked yet. * The site
  1444  	// is inactive and needs another review before it can show ads again. Learn how
  1445  	// to [request a review for an inactive
  1446  	// site](https://support.google.com/adsense/answer/9393996).
  1447  	//   "GETTING_READY" - Google is running some checks on the site. This usually
  1448  	// takes a few days, but in some cases it can take two to four weeks.
  1449  	//   "READY" - The site is ready to show ads. Learn how to [set up ads on the
  1450  	// site](https://support.google.com/adsense/answer/7037624).
  1451  	//   "NEEDS_ATTENTION" - Publisher needs to fix some issues before the site is
  1452  	// ready to show ads. Learn what to do [if a new site isn't
  1453  	// ready](https://support.google.com/adsense/answer/9061852).
  1454  	State string `json:"state,omitempty"`
  1455  
  1456  	// ServerResponse contains the HTTP response code and headers from the server.
  1457  	googleapi.ServerResponse `json:"-"`
  1458  	// ForceSendFields is a list of field names (e.g. "AutoAdsEnabled") to
  1459  	// unconditionally include in API requests. By default, fields with empty or
  1460  	// default values are omitted from API requests. See
  1461  	// https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more
  1462  	// details.
  1463  	ForceSendFields []string `json:"-"`
  1464  	// NullFields is a list of field names (e.g. "AutoAdsEnabled") to include in
  1465  	// API requests with the JSON null value. By default, fields with empty values
  1466  	// are omitted from API requests. See
  1467  	// https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details.
  1468  	NullFields []string `json:"-"`
  1469  }
  1470  
  1471  func (s *Site) MarshalJSON() ([]byte, error) {
  1472  	type NoMethod Site
  1473  	return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields)
  1474  }
  1475  
  1476  // TimeZone: Represents a time zone from the IANA Time Zone Database
  1477  // (https://www.iana.org/time-zones).
  1478  type TimeZone struct {
  1479  	// Id: IANA Time Zone Database time zone, e.g. "America/New_York".
  1480  	Id string `json:"id,omitempty"`
  1481  	// Version: Optional. IANA Time Zone Database version number, e.g. "2019a".
  1482  	Version string `json:"version,omitempty"`
  1483  	// ForceSendFields is a list of field names (e.g. "Id") to unconditionally
  1484  	// include in API requests. By default, fields with empty or default values are
  1485  	// omitted from API requests. See
  1486  	// https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more
  1487  	// details.
  1488  	ForceSendFields []string `json:"-"`
  1489  	// NullFields is a list of field names (e.g. "Id") to include in API requests
  1490  	// with the JSON null value. By default, fields with empty values are omitted
  1491  	// from API requests. See
  1492  	// https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details.
  1493  	NullFields []string `json:"-"`
  1494  }
  1495  
  1496  func (s *TimeZone) MarshalJSON() ([]byte, error) {
  1497  	type NoMethod TimeZone
  1498  	return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields)
  1499  }
  1500  
  1501  // UrlChannel: Representation of a URL channel. URL channels allow you to track
  1502  // the performance of particular pages in your site; see URL channels
  1503  // (https://support.google.com/adsense/answer/2923836) for more information.
  1504  type UrlChannel struct {
  1505  	// Name: Output only. Resource name of the URL channel. Format:
  1506  	// accounts/{account}/adclients/{adclient}/urlchannels/{urlchannel}
  1507  	Name string `json:"name,omitempty"`
  1508  	// ReportingDimensionId: Output only. Unique ID of the custom channel as used
  1509  	// in the `URL_CHANNEL_ID` reporting dimension.
  1510  	ReportingDimensionId string `json:"reportingDimensionId,omitempty"`
  1511  	// UriPattern: URI pattern of the channel. Does not include "http://" or
  1512  	// "https://". Example: www.example.com/home
  1513  	UriPattern string `json:"uriPattern,omitempty"`
  1514  
  1515  	// ServerResponse contains the HTTP response code and headers from the server.
  1516  	googleapi.ServerResponse `json:"-"`
  1517  	// ForceSendFields is a list of field names (e.g. "Name") to unconditionally
  1518  	// include in API requests. By default, fields with empty or default values are
  1519  	// omitted from API requests. See
  1520  	// https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more
  1521  	// details.
  1522  	ForceSendFields []string `json:"-"`
  1523  	// NullFields is a list of field names (e.g. "Name") to include in API requests
  1524  	// with the JSON null value. By default, fields with empty values are omitted
  1525  	// from API requests. See
  1526  	// https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details.
  1527  	NullFields []string `json:"-"`
  1528  }
  1529  
  1530  func (s *UrlChannel) MarshalJSON() ([]byte, error) {
  1531  	type NoMethod UrlChannel
  1532  	return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields)
  1533  }
  1534  
  1535  type AccountsGetCall struct {
  1536  	s            *Service
  1537  	name         string
  1538  	urlParams_   gensupport.URLParams
  1539  	ifNoneMatch_ string
  1540  	ctx_         context.Context
  1541  	header_      http.Header
  1542  }
  1543  
  1544  // Get: Gets information about the selected AdSense account.
  1545  //
  1546  // - name: Account to get information about. Format: accounts/{account}.
  1547  func (r *AccountsService) Get(name string) *AccountsGetCall {
  1548  	c := &AccountsGetCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  1549  	c.name = name
  1550  	return c
  1551  }
  1552  
  1553  // Fields allows partial responses to be retrieved. See
  1554  // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse for more
  1555  // details.
  1556  func (c *AccountsGetCall) Fields(s ...googleapi.Field) *AccountsGetCall {
  1557  	c.urlParams_.Set("fields", googleapi.CombineFields(s))
  1558  	return c
  1559  }
  1560  
  1561  // IfNoneMatch sets an optional parameter which makes the operation fail if the
  1562  // object's ETag matches the given value. This is useful for getting updates
  1563  // only after the object has changed since the last request.
  1564  func (c *AccountsGetCall) IfNoneMatch(entityTag string) *AccountsGetCall {
  1565  	c.ifNoneMatch_ = entityTag
  1566  	return c
  1567  }
  1568  
  1569  // Context sets the context to be used in this call's Do method.
  1570  func (c *AccountsGetCall) Context(ctx context.Context) *AccountsGetCall {
  1571  	c.ctx_ = ctx
  1572  	return c
  1573  }
  1574  
  1575  // Header returns a http.Header that can be modified by the caller to add
  1576  // headers to the request.
  1577  func (c *AccountsGetCall) Header() http.Header {
  1578  	if c.header_ == nil {
  1579  		c.header_ = make(http.Header)
  1580  	}
  1581  	return c.header_
  1582  }
  1583  
  1584  func (c *AccountsGetCall) doRequest(alt string) (*http.Response, error) {
  1585  	reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_)
  1586  	if c.ifNoneMatch_ != "" {
  1587  		reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  1588  	}
  1589  	var body io.Reader = nil
  1590  	c.urlParams_.Set("alt", alt)
  1591  	c.urlParams_.Set("prettyPrint", "false")
  1592  	urls := googleapi.ResolveRelative(c.s.BasePath, "v2/{+name}")
  1593  	urls += "?" + c.urlParams_.Encode()
  1594  	req, err := http.NewRequest("GET", urls, body)
  1595  	if err != nil {
  1596  		return nil, err
  1597  	}
  1598  	req.Header = reqHeaders
  1599  	googleapi.Expand(req.URL, map[string]string{
  1600  		"name": c.name,
  1601  	})
  1602  	return gensupport.SendRequest(c.ctx_, c.s.client, req)
  1603  }
  1604  
  1605  // Do executes the "adsense.accounts.get" call.
  1606  // Any non-2xx status code is an error. Response headers are in either
  1607  // *Account.ServerResponse.Header or (if a response was returned at all) in
  1608  // error.(*googleapi.Error).Header. Use googleapi.IsNotModified to check
  1609  // whether the returned error was because http.StatusNotModified was returned.
  1610  func (c *AccountsGetCall) Do(opts ...googleapi.CallOption) (*Account, error) {
  1611  	gensupport.SetOptions(c.urlParams_, opts...)
  1612  	res, err := c.doRequest("json")
  1613  	if res != nil && res.StatusCode == http.StatusNotModified {
  1614  		if res.Body != nil {
  1615  			res.Body.Close()
  1616  		}
  1617  		return nil, gensupport.WrapError(&googleapi.Error{
  1618  			Code:   res.StatusCode,
  1619  			Header: res.Header,
  1620  		})
  1621  	}
  1622  	if err != nil {
  1623  		return nil, err
  1624  	}
  1625  	defer googleapi.CloseBody(res)
  1626  	if err := googleapi.CheckResponse(res); err != nil {
  1627  		return nil, gensupport.WrapError(err)
  1628  	}
  1629  	ret := &Account{
  1630  		ServerResponse: googleapi.ServerResponse{
  1631  			Header:         res.Header,
  1632  			HTTPStatusCode: res.StatusCode,
  1633  		},
  1634  	}
  1635  	target := &ret
  1636  	if err := gensupport.DecodeResponse(target, res); err != nil {
  1637  		return nil, err
  1638  	}
  1639  	return ret, nil
  1640  }
  1641  
  1642  type AccountsGetAdBlockingRecoveryTagCall struct {
  1643  	s            *Service
  1644  	name         string
  1645  	urlParams_   gensupport.URLParams
  1646  	ifNoneMatch_ string
  1647  	ctx_         context.Context
  1648  	header_      http.Header
  1649  }
  1650  
  1651  // GetAdBlockingRecoveryTag: Gets the ad blocking recovery tag of an account.
  1652  //
  1653  //   - name: The name of the account to get the tag for. Format:
  1654  //     accounts/{account}.
  1655  func (r *AccountsService) GetAdBlockingRecoveryTag(name string) *AccountsGetAdBlockingRecoveryTagCall {
  1656  	c := &AccountsGetAdBlockingRecoveryTagCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  1657  	c.name = name
  1658  	return c
  1659  }
  1660  
  1661  // Fields allows partial responses to be retrieved. See
  1662  // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse for more
  1663  // details.
  1664  func (c *AccountsGetAdBlockingRecoveryTagCall) Fields(s ...googleapi.Field) *AccountsGetAdBlockingRecoveryTagCall {
  1665  	c.urlParams_.Set("fields", googleapi.CombineFields(s))
  1666  	return c
  1667  }
  1668  
  1669  // IfNoneMatch sets an optional parameter which makes the operation fail if the
  1670  // object's ETag matches the given value. This is useful for getting updates
  1671  // only after the object has changed since the last request.
  1672  func (c *AccountsGetAdBlockingRecoveryTagCall) IfNoneMatch(entityTag string) *AccountsGetAdBlockingRecoveryTagCall {
  1673  	c.ifNoneMatch_ = entityTag
  1674  	return c
  1675  }
  1676  
  1677  // Context sets the context to be used in this call's Do method.
  1678  func (c *AccountsGetAdBlockingRecoveryTagCall) Context(ctx context.Context) *AccountsGetAdBlockingRecoveryTagCall {
  1679  	c.ctx_ = ctx
  1680  	return c
  1681  }
  1682  
  1683  // Header returns a http.Header that can be modified by the caller to add
  1684  // headers to the request.
  1685  func (c *AccountsGetAdBlockingRecoveryTagCall) Header() http.Header {
  1686  	if c.header_ == nil {
  1687  		c.header_ = make(http.Header)
  1688  	}
  1689  	return c.header_
  1690  }
  1691  
  1692  func (c *AccountsGetAdBlockingRecoveryTagCall) doRequest(alt string) (*http.Response, error) {
  1693  	reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_)
  1694  	if c.ifNoneMatch_ != "" {
  1695  		reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  1696  	}
  1697  	var body io.Reader = nil
  1698  	c.urlParams_.Set("alt", alt)
  1699  	c.urlParams_.Set("prettyPrint", "false")
  1700  	urls := googleapi.ResolveRelative(c.s.BasePath, "v2/{+name}/adBlockingRecoveryTag")
  1701  	urls += "?" + c.urlParams_.Encode()
  1702  	req, err := http.NewRequest("GET", urls, body)
  1703  	if err != nil {
  1704  		return nil, err
  1705  	}
  1706  	req.Header = reqHeaders
  1707  	googleapi.Expand(req.URL, map[string]string{
  1708  		"name": c.name,
  1709  	})
  1710  	return gensupport.SendRequest(c.ctx_, c.s.client, req)
  1711  }
  1712  
  1713  // Do executes the "adsense.accounts.getAdBlockingRecoveryTag" call.
  1714  // Any non-2xx status code is an error. Response headers are in either
  1715  // *AdBlockingRecoveryTag.ServerResponse.Header or (if a response was returned
  1716  // at all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to
  1717  // check whether the returned error was because http.StatusNotModified was
  1718  // returned.
  1719  func (c *AccountsGetAdBlockingRecoveryTagCall) Do(opts ...googleapi.CallOption) (*AdBlockingRecoveryTag, error) {
  1720  	gensupport.SetOptions(c.urlParams_, opts...)
  1721  	res, err := c.doRequest("json")
  1722  	if res != nil && res.StatusCode == http.StatusNotModified {
  1723  		if res.Body != nil {
  1724  			res.Body.Close()
  1725  		}
  1726  		return nil, gensupport.WrapError(&googleapi.Error{
  1727  			Code:   res.StatusCode,
  1728  			Header: res.Header,
  1729  		})
  1730  	}
  1731  	if err != nil {
  1732  		return nil, err
  1733  	}
  1734  	defer googleapi.CloseBody(res)
  1735  	if err := googleapi.CheckResponse(res); err != nil {
  1736  		return nil, gensupport.WrapError(err)
  1737  	}
  1738  	ret := &AdBlockingRecoveryTag{
  1739  		ServerResponse: googleapi.ServerResponse{
  1740  			Header:         res.Header,
  1741  			HTTPStatusCode: res.StatusCode,
  1742  		},
  1743  	}
  1744  	target := &ret
  1745  	if err := gensupport.DecodeResponse(target, res); err != nil {
  1746  		return nil, err
  1747  	}
  1748  	return ret, nil
  1749  }
  1750  
  1751  type AccountsListCall struct {
  1752  	s            *Service
  1753  	urlParams_   gensupport.URLParams
  1754  	ifNoneMatch_ string
  1755  	ctx_         context.Context
  1756  	header_      http.Header
  1757  }
  1758  
  1759  // List: Lists all accounts available to this user.
  1760  func (r *AccountsService) List() *AccountsListCall {
  1761  	c := &AccountsListCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  1762  	return c
  1763  }
  1764  
  1765  // PageSize sets the optional parameter "pageSize": The maximum number of
  1766  // accounts to include in the response, used for paging. If unspecified, at
  1767  // most 10000 accounts will be returned. The maximum value is 10000; values
  1768  // above 10000 will be coerced to 10000.
  1769  func (c *AccountsListCall) PageSize(pageSize int64) *AccountsListCall {
  1770  	c.urlParams_.Set("pageSize", fmt.Sprint(pageSize))
  1771  	return c
  1772  }
  1773  
  1774  // PageToken sets the optional parameter "pageToken": A page token, received
  1775  // from a previous `ListAccounts` call. Provide this to retrieve the subsequent
  1776  // page. When paginating, all other parameters provided to `ListAccounts` must
  1777  // match the call that provided the page token.
  1778  func (c *AccountsListCall) PageToken(pageToken string) *AccountsListCall {
  1779  	c.urlParams_.Set("pageToken", pageToken)
  1780  	return c
  1781  }
  1782  
  1783  // Fields allows partial responses to be retrieved. See
  1784  // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse for more
  1785  // details.
  1786  func (c *AccountsListCall) Fields(s ...googleapi.Field) *AccountsListCall {
  1787  	c.urlParams_.Set("fields", googleapi.CombineFields(s))
  1788  	return c
  1789  }
  1790  
  1791  // IfNoneMatch sets an optional parameter which makes the operation fail if the
  1792  // object's ETag matches the given value. This is useful for getting updates
  1793  // only after the object has changed since the last request.
  1794  func (c *AccountsListCall) IfNoneMatch(entityTag string) *AccountsListCall {
  1795  	c.ifNoneMatch_ = entityTag
  1796  	return c
  1797  }
  1798  
  1799  // Context sets the context to be used in this call's Do method.
  1800  func (c *AccountsListCall) Context(ctx context.Context) *AccountsListCall {
  1801  	c.ctx_ = ctx
  1802  	return c
  1803  }
  1804  
  1805  // Header returns a http.Header that can be modified by the caller to add
  1806  // headers to the request.
  1807  func (c *AccountsListCall) Header() http.Header {
  1808  	if c.header_ == nil {
  1809  		c.header_ = make(http.Header)
  1810  	}
  1811  	return c.header_
  1812  }
  1813  
  1814  func (c *AccountsListCall) doRequest(alt string) (*http.Response, error) {
  1815  	reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_)
  1816  	if c.ifNoneMatch_ != "" {
  1817  		reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  1818  	}
  1819  	var body io.Reader = nil
  1820  	c.urlParams_.Set("alt", alt)
  1821  	c.urlParams_.Set("prettyPrint", "false")
  1822  	urls := googleapi.ResolveRelative(c.s.BasePath, "v2/accounts")
  1823  	urls += "?" + c.urlParams_.Encode()
  1824  	req, err := http.NewRequest("GET", urls, body)
  1825  	if err != nil {
  1826  		return nil, err
  1827  	}
  1828  	req.Header = reqHeaders
  1829  	return gensupport.SendRequest(c.ctx_, c.s.client, req)
  1830  }
  1831  
  1832  // Do executes the "adsense.accounts.list" call.
  1833  // Any non-2xx status code is an error. Response headers are in either
  1834  // *ListAccountsResponse.ServerResponse.Header or (if a response was returned
  1835  // at all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to
  1836  // check whether the returned error was because http.StatusNotModified was
  1837  // returned.
  1838  func (c *AccountsListCall) Do(opts ...googleapi.CallOption) (*ListAccountsResponse, error) {
  1839  	gensupport.SetOptions(c.urlParams_, opts...)
  1840  	res, err := c.doRequest("json")
  1841  	if res != nil && res.StatusCode == http.StatusNotModified {
  1842  		if res.Body != nil {
  1843  			res.Body.Close()
  1844  		}
  1845  		return nil, gensupport.WrapError(&googleapi.Error{
  1846  			Code:   res.StatusCode,
  1847  			Header: res.Header,
  1848  		})
  1849  	}
  1850  	if err != nil {
  1851  		return nil, err
  1852  	}
  1853  	defer googleapi.CloseBody(res)
  1854  	if err := googleapi.CheckResponse(res); err != nil {
  1855  		return nil, gensupport.WrapError(err)
  1856  	}
  1857  	ret := &ListAccountsResponse{
  1858  		ServerResponse: googleapi.ServerResponse{
  1859  			Header:         res.Header,
  1860  			HTTPStatusCode: res.StatusCode,
  1861  		},
  1862  	}
  1863  	target := &ret
  1864  	if err := gensupport.DecodeResponse(target, res); err != nil {
  1865  		return nil, err
  1866  	}
  1867  	return ret, nil
  1868  }
  1869  
  1870  // Pages invokes f for each page of results.
  1871  // A non-nil error returned from f will halt the iteration.
  1872  // The provided context supersedes any context provided to the Context method.
  1873  func (c *AccountsListCall) Pages(ctx context.Context, f func(*ListAccountsResponse) error) error {
  1874  	c.ctx_ = ctx
  1875  	defer c.PageToken(c.urlParams_.Get("pageToken"))
  1876  	for {
  1877  		x, err := c.Do()
  1878  		if err != nil {
  1879  			return err
  1880  		}
  1881  		if err := f(x); err != nil {
  1882  			return err
  1883  		}
  1884  		if x.NextPageToken == "" {
  1885  			return nil
  1886  		}
  1887  		c.PageToken(x.NextPageToken)
  1888  	}
  1889  }
  1890  
  1891  type AccountsListChildAccountsCall struct {
  1892  	s            *Service
  1893  	parent       string
  1894  	urlParams_   gensupport.URLParams
  1895  	ifNoneMatch_ string
  1896  	ctx_         context.Context
  1897  	header_      http.Header
  1898  }
  1899  
  1900  // ListChildAccounts: Lists all accounts directly managed by the given AdSense
  1901  // account.
  1902  //
  1903  //   - parent: The parent account, which owns the child accounts. Format:
  1904  //     accounts/{account}.
  1905  func (r *AccountsService) ListChildAccounts(parent string) *AccountsListChildAccountsCall {
  1906  	c := &AccountsListChildAccountsCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  1907  	c.parent = parent
  1908  	return c
  1909  }
  1910  
  1911  // PageSize sets the optional parameter "pageSize": The maximum number of
  1912  // accounts to include in the response, used for paging. If unspecified, at
  1913  // most 10000 accounts will be returned. The maximum value is 10000; values
  1914  // above 10000 will be coerced to 10000.
  1915  func (c *AccountsListChildAccountsCall) PageSize(pageSize int64) *AccountsListChildAccountsCall {
  1916  	c.urlParams_.Set("pageSize", fmt.Sprint(pageSize))
  1917  	return c
  1918  }
  1919  
  1920  // PageToken sets the optional parameter "pageToken": A page token, received
  1921  // from a previous `ListChildAccounts` call. Provide this to retrieve the
  1922  // subsequent page. When paginating, all other parameters provided to
  1923  // `ListChildAccounts` must match the call that provided the page token.
  1924  func (c *AccountsListChildAccountsCall) PageToken(pageToken string) *AccountsListChildAccountsCall {
  1925  	c.urlParams_.Set("pageToken", pageToken)
  1926  	return c
  1927  }
  1928  
  1929  // Fields allows partial responses to be retrieved. See
  1930  // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse for more
  1931  // details.
  1932  func (c *AccountsListChildAccountsCall) Fields(s ...googleapi.Field) *AccountsListChildAccountsCall {
  1933  	c.urlParams_.Set("fields", googleapi.CombineFields(s))
  1934  	return c
  1935  }
  1936  
  1937  // IfNoneMatch sets an optional parameter which makes the operation fail if the
  1938  // object's ETag matches the given value. This is useful for getting updates
  1939  // only after the object has changed since the last request.
  1940  func (c *AccountsListChildAccountsCall) IfNoneMatch(entityTag string) *AccountsListChildAccountsCall {
  1941  	c.ifNoneMatch_ = entityTag
  1942  	return c
  1943  }
  1944  
  1945  // Context sets the context to be used in this call's Do method.
  1946  func (c *AccountsListChildAccountsCall) Context(ctx context.Context) *AccountsListChildAccountsCall {
  1947  	c.ctx_ = ctx
  1948  	return c
  1949  }
  1950  
  1951  // Header returns a http.Header that can be modified by the caller to add
  1952  // headers to the request.
  1953  func (c *AccountsListChildAccountsCall) Header() http.Header {
  1954  	if c.header_ == nil {
  1955  		c.header_ = make(http.Header)
  1956  	}
  1957  	return c.header_
  1958  }
  1959  
  1960  func (c *AccountsListChildAccountsCall) doRequest(alt string) (*http.Response, error) {
  1961  	reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_)
  1962  	if c.ifNoneMatch_ != "" {
  1963  		reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  1964  	}
  1965  	var body io.Reader = nil
  1966  	c.urlParams_.Set("alt", alt)
  1967  	c.urlParams_.Set("prettyPrint", "false")
  1968  	urls := googleapi.ResolveRelative(c.s.BasePath, "v2/{+parent}:listChildAccounts")
  1969  	urls += "?" + c.urlParams_.Encode()
  1970  	req, err := http.NewRequest("GET", urls, body)
  1971  	if err != nil {
  1972  		return nil, err
  1973  	}
  1974  	req.Header = reqHeaders
  1975  	googleapi.Expand(req.URL, map[string]string{
  1976  		"parent": c.parent,
  1977  	})
  1978  	return gensupport.SendRequest(c.ctx_, c.s.client, req)
  1979  }
  1980  
  1981  // Do executes the "adsense.accounts.listChildAccounts" call.
  1982  // Any non-2xx status code is an error. Response headers are in either
  1983  // *ListChildAccountsResponse.ServerResponse.Header or (if a response was
  1984  // returned at all) in error.(*googleapi.Error).Header. Use
  1985  // googleapi.IsNotModified to check whether the returned error was because
  1986  // http.StatusNotModified was returned.
  1987  func (c *AccountsListChildAccountsCall) Do(opts ...googleapi.CallOption) (*ListChildAccountsResponse, error) {
  1988  	gensupport.SetOptions(c.urlParams_, opts...)
  1989  	res, err := c.doRequest("json")
  1990  	if res != nil && res.StatusCode == http.StatusNotModified {
  1991  		if res.Body != nil {
  1992  			res.Body.Close()
  1993  		}
  1994  		return nil, gensupport.WrapError(&googleapi.Error{
  1995  			Code:   res.StatusCode,
  1996  			Header: res.Header,
  1997  		})
  1998  	}
  1999  	if err != nil {
  2000  		return nil, err
  2001  	}
  2002  	defer googleapi.CloseBody(res)
  2003  	if err := googleapi.CheckResponse(res); err != nil {
  2004  		return nil, gensupport.WrapError(err)
  2005  	}
  2006  	ret := &ListChildAccountsResponse{
  2007  		ServerResponse: googleapi.ServerResponse{
  2008  			Header:         res.Header,
  2009  			HTTPStatusCode: res.StatusCode,
  2010  		},
  2011  	}
  2012  	target := &ret
  2013  	if err := gensupport.DecodeResponse(target, res); err != nil {
  2014  		return nil, err
  2015  	}
  2016  	return ret, nil
  2017  }
  2018  
  2019  // Pages invokes f for each page of results.
  2020  // A non-nil error returned from f will halt the iteration.
  2021  // The provided context supersedes any context provided to the Context method.
  2022  func (c *AccountsListChildAccountsCall) Pages(ctx context.Context, f func(*ListChildAccountsResponse) error) error {
  2023  	c.ctx_ = ctx
  2024  	defer c.PageToken(c.urlParams_.Get("pageToken"))
  2025  	for {
  2026  		x, err := c.Do()
  2027  		if err != nil {
  2028  			return err
  2029  		}
  2030  		if err := f(x); err != nil {
  2031  			return err
  2032  		}
  2033  		if x.NextPageToken == "" {
  2034  			return nil
  2035  		}
  2036  		c.PageToken(x.NextPageToken)
  2037  	}
  2038  }
  2039  
  2040  type AccountsAdclientsGetCall struct {
  2041  	s            *Service
  2042  	name         string
  2043  	urlParams_   gensupport.URLParams
  2044  	ifNoneMatch_ string
  2045  	ctx_         context.Context
  2046  	header_      http.Header
  2047  }
  2048  
  2049  // Get: Gets the ad client from the given resource name.
  2050  //
  2051  //   - name: The name of the ad client to retrieve. Format:
  2052  //     accounts/{account}/adclients/{adclient}.
  2053  func (r *AccountsAdclientsService) Get(name string) *AccountsAdclientsGetCall {
  2054  	c := &AccountsAdclientsGetCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  2055  	c.name = name
  2056  	return c
  2057  }
  2058  
  2059  // Fields allows partial responses to be retrieved. See
  2060  // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse for more
  2061  // details.
  2062  func (c *AccountsAdclientsGetCall) Fields(s ...googleapi.Field) *AccountsAdclientsGetCall {
  2063  	c.urlParams_.Set("fields", googleapi.CombineFields(s))
  2064  	return c
  2065  }
  2066  
  2067  // IfNoneMatch sets an optional parameter which makes the operation fail if the
  2068  // object's ETag matches the given value. This is useful for getting updates
  2069  // only after the object has changed since the last request.
  2070  func (c *AccountsAdclientsGetCall) IfNoneMatch(entityTag string) *AccountsAdclientsGetCall {
  2071  	c.ifNoneMatch_ = entityTag
  2072  	return c
  2073  }
  2074  
  2075  // Context sets the context to be used in this call's Do method.
  2076  func (c *AccountsAdclientsGetCall) Context(ctx context.Context) *AccountsAdclientsGetCall {
  2077  	c.ctx_ = ctx
  2078  	return c
  2079  }
  2080  
  2081  // Header returns a http.Header that can be modified by the caller to add
  2082  // headers to the request.
  2083  func (c *AccountsAdclientsGetCall) Header() http.Header {
  2084  	if c.header_ == nil {
  2085  		c.header_ = make(http.Header)
  2086  	}
  2087  	return c.header_
  2088  }
  2089  
  2090  func (c *AccountsAdclientsGetCall) doRequest(alt string) (*http.Response, error) {
  2091  	reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_)
  2092  	if c.ifNoneMatch_ != "" {
  2093  		reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  2094  	}
  2095  	var body io.Reader = nil
  2096  	c.urlParams_.Set("alt", alt)
  2097  	c.urlParams_.Set("prettyPrint", "false")
  2098  	urls := googleapi.ResolveRelative(c.s.BasePath, "v2/{+name}")
  2099  	urls += "?" + c.urlParams_.Encode()
  2100  	req, err := http.NewRequest("GET", urls, body)
  2101  	if err != nil {
  2102  		return nil, err
  2103  	}
  2104  	req.Header = reqHeaders
  2105  	googleapi.Expand(req.URL, map[string]string{
  2106  		"name": c.name,
  2107  	})
  2108  	return gensupport.SendRequest(c.ctx_, c.s.client, req)
  2109  }
  2110  
  2111  // Do executes the "adsense.accounts.adclients.get" call.
  2112  // Any non-2xx status code is an error. Response headers are in either
  2113  // *AdClient.ServerResponse.Header or (if a response was returned at all) in
  2114  // error.(*googleapi.Error).Header. Use googleapi.IsNotModified to check
  2115  // whether the returned error was because http.StatusNotModified was returned.
  2116  func (c *AccountsAdclientsGetCall) Do(opts ...googleapi.CallOption) (*AdClient, error) {
  2117  	gensupport.SetOptions(c.urlParams_, opts...)
  2118  	res, err := c.doRequest("json")
  2119  	if res != nil && res.StatusCode == http.StatusNotModified {
  2120  		if res.Body != nil {
  2121  			res.Body.Close()
  2122  		}
  2123  		return nil, gensupport.WrapError(&googleapi.Error{
  2124  			Code:   res.StatusCode,
  2125  			Header: res.Header,
  2126  		})
  2127  	}
  2128  	if err != nil {
  2129  		return nil, err
  2130  	}
  2131  	defer googleapi.CloseBody(res)
  2132  	if err := googleapi.CheckResponse(res); err != nil {
  2133  		return nil, gensupport.WrapError(err)
  2134  	}
  2135  	ret := &AdClient{
  2136  		ServerResponse: googleapi.ServerResponse{
  2137  			Header:         res.Header,
  2138  			HTTPStatusCode: res.StatusCode,
  2139  		},
  2140  	}
  2141  	target := &ret
  2142  	if err := gensupport.DecodeResponse(target, res); err != nil {
  2143  		return nil, err
  2144  	}
  2145  	return ret, nil
  2146  }
  2147  
  2148  type AccountsAdclientsGetAdcodeCall struct {
  2149  	s            *Service
  2150  	name         string
  2151  	urlParams_   gensupport.URLParams
  2152  	ifNoneMatch_ string
  2153  	ctx_         context.Context
  2154  	header_      http.Header
  2155  }
  2156  
  2157  // GetAdcode: Gets the AdSense code for a given ad client. This returns what
  2158  // was previously known as the 'auto ad code'. This is only supported for ad
  2159  // clients with a product_code of AFC. For more information, see About the
  2160  // AdSense code (https://support.google.com/adsense/answer/9274634).
  2161  //
  2162  //   - name: Name of the ad client for which to get the adcode. Format:
  2163  //     accounts/{account}/adclients/{adclient}.
  2164  func (r *AccountsAdclientsService) GetAdcode(name string) *AccountsAdclientsGetAdcodeCall {
  2165  	c := &AccountsAdclientsGetAdcodeCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  2166  	c.name = name
  2167  	return c
  2168  }
  2169  
  2170  // Fields allows partial responses to be retrieved. See
  2171  // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse for more
  2172  // details.
  2173  func (c *AccountsAdclientsGetAdcodeCall) Fields(s ...googleapi.Field) *AccountsAdclientsGetAdcodeCall {
  2174  	c.urlParams_.Set("fields", googleapi.CombineFields(s))
  2175  	return c
  2176  }
  2177  
  2178  // IfNoneMatch sets an optional parameter which makes the operation fail if the
  2179  // object's ETag matches the given value. This is useful for getting updates
  2180  // only after the object has changed since the last request.
  2181  func (c *AccountsAdclientsGetAdcodeCall) IfNoneMatch(entityTag string) *AccountsAdclientsGetAdcodeCall {
  2182  	c.ifNoneMatch_ = entityTag
  2183  	return c
  2184  }
  2185  
  2186  // Context sets the context to be used in this call's Do method.
  2187  func (c *AccountsAdclientsGetAdcodeCall) Context(ctx context.Context) *AccountsAdclientsGetAdcodeCall {
  2188  	c.ctx_ = ctx
  2189  	return c
  2190  }
  2191  
  2192  // Header returns a http.Header that can be modified by the caller to add
  2193  // headers to the request.
  2194  func (c *AccountsAdclientsGetAdcodeCall) Header() http.Header {
  2195  	if c.header_ == nil {
  2196  		c.header_ = make(http.Header)
  2197  	}
  2198  	return c.header_
  2199  }
  2200  
  2201  func (c *AccountsAdclientsGetAdcodeCall) doRequest(alt string) (*http.Response, error) {
  2202  	reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_)
  2203  	if c.ifNoneMatch_ != "" {
  2204  		reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  2205  	}
  2206  	var body io.Reader = nil
  2207  	c.urlParams_.Set("alt", alt)
  2208  	c.urlParams_.Set("prettyPrint", "false")
  2209  	urls := googleapi.ResolveRelative(c.s.BasePath, "v2/{+name}/adcode")
  2210  	urls += "?" + c.urlParams_.Encode()
  2211  	req, err := http.NewRequest("GET", urls, body)
  2212  	if err != nil {
  2213  		return nil, err
  2214  	}
  2215  	req.Header = reqHeaders
  2216  	googleapi.Expand(req.URL, map[string]string{
  2217  		"name": c.name,
  2218  	})
  2219  	return gensupport.SendRequest(c.ctx_, c.s.client, req)
  2220  }
  2221  
  2222  // Do executes the "adsense.accounts.adclients.getAdcode" call.
  2223  // Any non-2xx status code is an error. Response headers are in either
  2224  // *AdClientAdCode.ServerResponse.Header or (if a response was returned at all)
  2225  // in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to check
  2226  // whether the returned error was because http.StatusNotModified was returned.
  2227  func (c *AccountsAdclientsGetAdcodeCall) Do(opts ...googleapi.CallOption) (*AdClientAdCode, error) {
  2228  	gensupport.SetOptions(c.urlParams_, opts...)
  2229  	res, err := c.doRequest("json")
  2230  	if res != nil && res.StatusCode == http.StatusNotModified {
  2231  		if res.Body != nil {
  2232  			res.Body.Close()
  2233  		}
  2234  		return nil, gensupport.WrapError(&googleapi.Error{
  2235  			Code:   res.StatusCode,
  2236  			Header: res.Header,
  2237  		})
  2238  	}
  2239  	if err != nil {
  2240  		return nil, err
  2241  	}
  2242  	defer googleapi.CloseBody(res)
  2243  	if err := googleapi.CheckResponse(res); err != nil {
  2244  		return nil, gensupport.WrapError(err)
  2245  	}
  2246  	ret := &AdClientAdCode{
  2247  		ServerResponse: googleapi.ServerResponse{
  2248  			Header:         res.Header,
  2249  			HTTPStatusCode: res.StatusCode,
  2250  		},
  2251  	}
  2252  	target := &ret
  2253  	if err := gensupport.DecodeResponse(target, res); err != nil {
  2254  		return nil, err
  2255  	}
  2256  	return ret, nil
  2257  }
  2258  
  2259  type AccountsAdclientsListCall struct {
  2260  	s            *Service
  2261  	parent       string
  2262  	urlParams_   gensupport.URLParams
  2263  	ifNoneMatch_ string
  2264  	ctx_         context.Context
  2265  	header_      http.Header
  2266  }
  2267  
  2268  // List: Lists all the ad clients available in an account.
  2269  //
  2270  //   - parent: The account which owns the collection of ad clients. Format:
  2271  //     accounts/{account}.
  2272  func (r *AccountsAdclientsService) List(parent string) *AccountsAdclientsListCall {
  2273  	c := &AccountsAdclientsListCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  2274  	c.parent = parent
  2275  	return c
  2276  }
  2277  
  2278  // PageSize sets the optional parameter "pageSize": The maximum number of ad
  2279  // clients to include in the response, used for paging. If unspecified, at most
  2280  // 10000 ad clients will be returned. The maximum value is 10000; values above
  2281  // 10000 will be coerced to 10000.
  2282  func (c *AccountsAdclientsListCall) PageSize(pageSize int64) *AccountsAdclientsListCall {
  2283  	c.urlParams_.Set("pageSize", fmt.Sprint(pageSize))
  2284  	return c
  2285  }
  2286  
  2287  // PageToken sets the optional parameter "pageToken": A page token, received
  2288  // from a previous `ListAdClients` call. Provide this to retrieve the
  2289  // subsequent page. When paginating, all other parameters provided to
  2290  // `ListAdClients` must match the call that provided the page token.
  2291  func (c *AccountsAdclientsListCall) PageToken(pageToken string) *AccountsAdclientsListCall {
  2292  	c.urlParams_.Set("pageToken", pageToken)
  2293  	return c
  2294  }
  2295  
  2296  // Fields allows partial responses to be retrieved. See
  2297  // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse for more
  2298  // details.
  2299  func (c *AccountsAdclientsListCall) Fields(s ...googleapi.Field) *AccountsAdclientsListCall {
  2300  	c.urlParams_.Set("fields", googleapi.CombineFields(s))
  2301  	return c
  2302  }
  2303  
  2304  // IfNoneMatch sets an optional parameter which makes the operation fail if the
  2305  // object's ETag matches the given value. This is useful for getting updates
  2306  // only after the object has changed since the last request.
  2307  func (c *AccountsAdclientsListCall) IfNoneMatch(entityTag string) *AccountsAdclientsListCall {
  2308  	c.ifNoneMatch_ = entityTag
  2309  	return c
  2310  }
  2311  
  2312  // Context sets the context to be used in this call's Do method.
  2313  func (c *AccountsAdclientsListCall) Context(ctx context.Context) *AccountsAdclientsListCall {
  2314  	c.ctx_ = ctx
  2315  	return c
  2316  }
  2317  
  2318  // Header returns a http.Header that can be modified by the caller to add
  2319  // headers to the request.
  2320  func (c *AccountsAdclientsListCall) Header() http.Header {
  2321  	if c.header_ == nil {
  2322  		c.header_ = make(http.Header)
  2323  	}
  2324  	return c.header_
  2325  }
  2326  
  2327  func (c *AccountsAdclientsListCall) doRequest(alt string) (*http.Response, error) {
  2328  	reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_)
  2329  	if c.ifNoneMatch_ != "" {
  2330  		reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  2331  	}
  2332  	var body io.Reader = nil
  2333  	c.urlParams_.Set("alt", alt)
  2334  	c.urlParams_.Set("prettyPrint", "false")
  2335  	urls := googleapi.ResolveRelative(c.s.BasePath, "v2/{+parent}/adclients")
  2336  	urls += "?" + c.urlParams_.Encode()
  2337  	req, err := http.NewRequest("GET", urls, body)
  2338  	if err != nil {
  2339  		return nil, err
  2340  	}
  2341  	req.Header = reqHeaders
  2342  	googleapi.Expand(req.URL, map[string]string{
  2343  		"parent": c.parent,
  2344  	})
  2345  	return gensupport.SendRequest(c.ctx_, c.s.client, req)
  2346  }
  2347  
  2348  // Do executes the "adsense.accounts.adclients.list" call.
  2349  // Any non-2xx status code is an error. Response headers are in either
  2350  // *ListAdClientsResponse.ServerResponse.Header or (if a response was returned
  2351  // at all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to
  2352  // check whether the returned error was because http.StatusNotModified was
  2353  // returned.
  2354  func (c *AccountsAdclientsListCall) Do(opts ...googleapi.CallOption) (*ListAdClientsResponse, error) {
  2355  	gensupport.SetOptions(c.urlParams_, opts...)
  2356  	res, err := c.doRequest("json")
  2357  	if res != nil && res.StatusCode == http.StatusNotModified {
  2358  		if res.Body != nil {
  2359  			res.Body.Close()
  2360  		}
  2361  		return nil, gensupport.WrapError(&googleapi.Error{
  2362  			Code:   res.StatusCode,
  2363  			Header: res.Header,
  2364  		})
  2365  	}
  2366  	if err != nil {
  2367  		return nil, err
  2368  	}
  2369  	defer googleapi.CloseBody(res)
  2370  	if err := googleapi.CheckResponse(res); err != nil {
  2371  		return nil, gensupport.WrapError(err)
  2372  	}
  2373  	ret := &ListAdClientsResponse{
  2374  		ServerResponse: googleapi.ServerResponse{
  2375  			Header:         res.Header,
  2376  			HTTPStatusCode: res.StatusCode,
  2377  		},
  2378  	}
  2379  	target := &ret
  2380  	if err := gensupport.DecodeResponse(target, res); err != nil {
  2381  		return nil, err
  2382  	}
  2383  	return ret, nil
  2384  }
  2385  
  2386  // Pages invokes f for each page of results.
  2387  // A non-nil error returned from f will halt the iteration.
  2388  // The provided context supersedes any context provided to the Context method.
  2389  func (c *AccountsAdclientsListCall) Pages(ctx context.Context, f func(*ListAdClientsResponse) error) error {
  2390  	c.ctx_ = ctx
  2391  	defer c.PageToken(c.urlParams_.Get("pageToken"))
  2392  	for {
  2393  		x, err := c.Do()
  2394  		if err != nil {
  2395  			return err
  2396  		}
  2397  		if err := f(x); err != nil {
  2398  			return err
  2399  		}
  2400  		if x.NextPageToken == "" {
  2401  			return nil
  2402  		}
  2403  		c.PageToken(x.NextPageToken)
  2404  	}
  2405  }
  2406  
  2407  type AccountsAdclientsAdunitsCreateCall struct {
  2408  	s          *Service
  2409  	parent     string
  2410  	adunit     *AdUnit
  2411  	urlParams_ gensupport.URLParams
  2412  	ctx_       context.Context
  2413  	header_    http.Header
  2414  }
  2415  
  2416  // Create: Creates an ad unit. This method can be called only by a restricted
  2417  // set of projects, which are usually owned by AdSense for Platforms
  2418  // (https://developers.google.com/adsense/platforms/) publishers. Contact your
  2419  // account manager if you need to use this method. Note that ad units can only
  2420  // be created for ad clients with an "AFC" product code. For more info see the
  2421  // AdClient resource
  2422  // (/adsense/management/reference/rest/v2/accounts.adclients). For now, this
  2423  // method can only be used to create `DISPLAY` ad units. See:
  2424  // https://support.google.com/adsense/answer/9183566
  2425  //
  2426  //   - parent: Ad client to create an ad unit under. Format:
  2427  //     accounts/{account}/adclients/{adclient}.
  2428  func (r *AccountsAdclientsAdunitsService) Create(parent string, adunit *AdUnit) *AccountsAdclientsAdunitsCreateCall {
  2429  	c := &AccountsAdclientsAdunitsCreateCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  2430  	c.parent = parent
  2431  	c.adunit = adunit
  2432  	return c
  2433  }
  2434  
  2435  // Fields allows partial responses to be retrieved. See
  2436  // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse for more
  2437  // details.
  2438  func (c *AccountsAdclientsAdunitsCreateCall) Fields(s ...googleapi.Field) *AccountsAdclientsAdunitsCreateCall {
  2439  	c.urlParams_.Set("fields", googleapi.CombineFields(s))
  2440  	return c
  2441  }
  2442  
  2443  // Context sets the context to be used in this call's Do method.
  2444  func (c *AccountsAdclientsAdunitsCreateCall) Context(ctx context.Context) *AccountsAdclientsAdunitsCreateCall {
  2445  	c.ctx_ = ctx
  2446  	return c
  2447  }
  2448  
  2449  // Header returns a http.Header that can be modified by the caller to add
  2450  // headers to the request.
  2451  func (c *AccountsAdclientsAdunitsCreateCall) Header() http.Header {
  2452  	if c.header_ == nil {
  2453  		c.header_ = make(http.Header)
  2454  	}
  2455  	return c.header_
  2456  }
  2457  
  2458  func (c *AccountsAdclientsAdunitsCreateCall) doRequest(alt string) (*http.Response, error) {
  2459  	reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_)
  2460  	var body io.Reader = nil
  2461  	body, err := googleapi.WithoutDataWrapper.JSONReader(c.adunit)
  2462  	if err != nil {
  2463  		return nil, err
  2464  	}
  2465  	c.urlParams_.Set("alt", alt)
  2466  	c.urlParams_.Set("prettyPrint", "false")
  2467  	urls := googleapi.ResolveRelative(c.s.BasePath, "v2/{+parent}/adunits")
  2468  	urls += "?" + c.urlParams_.Encode()
  2469  	req, err := http.NewRequest("POST", urls, body)
  2470  	if err != nil {
  2471  		return nil, err
  2472  	}
  2473  	req.Header = reqHeaders
  2474  	googleapi.Expand(req.URL, map[string]string{
  2475  		"parent": c.parent,
  2476  	})
  2477  	return gensupport.SendRequest(c.ctx_, c.s.client, req)
  2478  }
  2479  
  2480  // Do executes the "adsense.accounts.adclients.adunits.create" call.
  2481  // Any non-2xx status code is an error. Response headers are in either
  2482  // *AdUnit.ServerResponse.Header or (if a response was returned at all) in
  2483  // error.(*googleapi.Error).Header. Use googleapi.IsNotModified to check
  2484  // whether the returned error was because http.StatusNotModified was returned.
  2485  func (c *AccountsAdclientsAdunitsCreateCall) Do(opts ...googleapi.CallOption) (*AdUnit, error) {
  2486  	gensupport.SetOptions(c.urlParams_, opts...)
  2487  	res, err := c.doRequest("json")
  2488  	if res != nil && res.StatusCode == http.StatusNotModified {
  2489  		if res.Body != nil {
  2490  			res.Body.Close()
  2491  		}
  2492  		return nil, gensupport.WrapError(&googleapi.Error{
  2493  			Code:   res.StatusCode,
  2494  			Header: res.Header,
  2495  		})
  2496  	}
  2497  	if err != nil {
  2498  		return nil, err
  2499  	}
  2500  	defer googleapi.CloseBody(res)
  2501  	if err := googleapi.CheckResponse(res); err != nil {
  2502  		return nil, gensupport.WrapError(err)
  2503  	}
  2504  	ret := &AdUnit{
  2505  		ServerResponse: googleapi.ServerResponse{
  2506  			Header:         res.Header,
  2507  			HTTPStatusCode: res.StatusCode,
  2508  		},
  2509  	}
  2510  	target := &ret
  2511  	if err := gensupport.DecodeResponse(target, res); err != nil {
  2512  		return nil, err
  2513  	}
  2514  	return ret, nil
  2515  }
  2516  
  2517  type AccountsAdclientsAdunitsGetCall struct {
  2518  	s            *Service
  2519  	name         string
  2520  	urlParams_   gensupport.URLParams
  2521  	ifNoneMatch_ string
  2522  	ctx_         context.Context
  2523  	header_      http.Header
  2524  }
  2525  
  2526  // Get: Gets an ad unit from a specified account and ad client.
  2527  //
  2528  //   - name: AdUnit to get information about. Format:
  2529  //     accounts/{account}/adclients/{adclient}/adunits/{adunit}.
  2530  func (r *AccountsAdclientsAdunitsService) Get(name string) *AccountsAdclientsAdunitsGetCall {
  2531  	c := &AccountsAdclientsAdunitsGetCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  2532  	c.name = name
  2533  	return c
  2534  }
  2535  
  2536  // Fields allows partial responses to be retrieved. See
  2537  // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse for more
  2538  // details.
  2539  func (c *AccountsAdclientsAdunitsGetCall) Fields(s ...googleapi.Field) *AccountsAdclientsAdunitsGetCall {
  2540  	c.urlParams_.Set("fields", googleapi.CombineFields(s))
  2541  	return c
  2542  }
  2543  
  2544  // IfNoneMatch sets an optional parameter which makes the operation fail if the
  2545  // object's ETag matches the given value. This is useful for getting updates
  2546  // only after the object has changed since the last request.
  2547  func (c *AccountsAdclientsAdunitsGetCall) IfNoneMatch(entityTag string) *AccountsAdclientsAdunitsGetCall {
  2548  	c.ifNoneMatch_ = entityTag
  2549  	return c
  2550  }
  2551  
  2552  // Context sets the context to be used in this call's Do method.
  2553  func (c *AccountsAdclientsAdunitsGetCall) Context(ctx context.Context) *AccountsAdclientsAdunitsGetCall {
  2554  	c.ctx_ = ctx
  2555  	return c
  2556  }
  2557  
  2558  // Header returns a http.Header that can be modified by the caller to add
  2559  // headers to the request.
  2560  func (c *AccountsAdclientsAdunitsGetCall) Header() http.Header {
  2561  	if c.header_ == nil {
  2562  		c.header_ = make(http.Header)
  2563  	}
  2564  	return c.header_
  2565  }
  2566  
  2567  func (c *AccountsAdclientsAdunitsGetCall) doRequest(alt string) (*http.Response, error) {
  2568  	reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_)
  2569  	if c.ifNoneMatch_ != "" {
  2570  		reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  2571  	}
  2572  	var body io.Reader = nil
  2573  	c.urlParams_.Set("alt", alt)
  2574  	c.urlParams_.Set("prettyPrint", "false")
  2575  	urls := googleapi.ResolveRelative(c.s.BasePath, "v2/{+name}")
  2576  	urls += "?" + c.urlParams_.Encode()
  2577  	req, err := http.NewRequest("GET", urls, body)
  2578  	if err != nil {
  2579  		return nil, err
  2580  	}
  2581  	req.Header = reqHeaders
  2582  	googleapi.Expand(req.URL, map[string]string{
  2583  		"name": c.name,
  2584  	})
  2585  	return gensupport.SendRequest(c.ctx_, c.s.client, req)
  2586  }
  2587  
  2588  // Do executes the "adsense.accounts.adclients.adunits.get" call.
  2589  // Any non-2xx status code is an error. Response headers are in either
  2590  // *AdUnit.ServerResponse.Header or (if a response was returned at all) in
  2591  // error.(*googleapi.Error).Header. Use googleapi.IsNotModified to check
  2592  // whether the returned error was because http.StatusNotModified was returned.
  2593  func (c *AccountsAdclientsAdunitsGetCall) Do(opts ...googleapi.CallOption) (*AdUnit, error) {
  2594  	gensupport.SetOptions(c.urlParams_, opts...)
  2595  	res, err := c.doRequest("json")
  2596  	if res != nil && res.StatusCode == http.StatusNotModified {
  2597  		if res.Body != nil {
  2598  			res.Body.Close()
  2599  		}
  2600  		return nil, gensupport.WrapError(&googleapi.Error{
  2601  			Code:   res.StatusCode,
  2602  			Header: res.Header,
  2603  		})
  2604  	}
  2605  	if err != nil {
  2606  		return nil, err
  2607  	}
  2608  	defer googleapi.CloseBody(res)
  2609  	if err := googleapi.CheckResponse(res); err != nil {
  2610  		return nil, gensupport.WrapError(err)
  2611  	}
  2612  	ret := &AdUnit{
  2613  		ServerResponse: googleapi.ServerResponse{
  2614  			Header:         res.Header,
  2615  			HTTPStatusCode: res.StatusCode,
  2616  		},
  2617  	}
  2618  	target := &ret
  2619  	if err := gensupport.DecodeResponse(target, res); err != nil {
  2620  		return nil, err
  2621  	}
  2622  	return ret, nil
  2623  }
  2624  
  2625  type AccountsAdclientsAdunitsGetAdcodeCall struct {
  2626  	s            *Service
  2627  	name         string
  2628  	urlParams_   gensupport.URLParams
  2629  	ifNoneMatch_ string
  2630  	ctx_         context.Context
  2631  	header_      http.Header
  2632  }
  2633  
  2634  // GetAdcode: Gets the ad unit code for a given ad unit. For more information,
  2635  // see About the AdSense code
  2636  // (https://support.google.com/adsense/answer/9274634) and Where to place the
  2637  // ad code in your HTML (https://support.google.com/adsense/answer/9190028).
  2638  //
  2639  //   - name: Name of the adunit for which to get the adcode. Format:
  2640  //     accounts/{account}/adclients/{adclient}/adunits/{adunit}.
  2641  func (r *AccountsAdclientsAdunitsService) GetAdcode(name string) *AccountsAdclientsAdunitsGetAdcodeCall {
  2642  	c := &AccountsAdclientsAdunitsGetAdcodeCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  2643  	c.name = name
  2644  	return c
  2645  }
  2646  
  2647  // Fields allows partial responses to be retrieved. See
  2648  // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse for more
  2649  // details.
  2650  func (c *AccountsAdclientsAdunitsGetAdcodeCall) Fields(s ...googleapi.Field) *AccountsAdclientsAdunitsGetAdcodeCall {
  2651  	c.urlParams_.Set("fields", googleapi.CombineFields(s))
  2652  	return c
  2653  }
  2654  
  2655  // IfNoneMatch sets an optional parameter which makes the operation fail if the
  2656  // object's ETag matches the given value. This is useful for getting updates
  2657  // only after the object has changed since the last request.
  2658  func (c *AccountsAdclientsAdunitsGetAdcodeCall) IfNoneMatch(entityTag string) *AccountsAdclientsAdunitsGetAdcodeCall {
  2659  	c.ifNoneMatch_ = entityTag
  2660  	return c
  2661  }
  2662  
  2663  // Context sets the context to be used in this call's Do method.
  2664  func (c *AccountsAdclientsAdunitsGetAdcodeCall) Context(ctx context.Context) *AccountsAdclientsAdunitsGetAdcodeCall {
  2665  	c.ctx_ = ctx
  2666  	return c
  2667  }
  2668  
  2669  // Header returns a http.Header that can be modified by the caller to add
  2670  // headers to the request.
  2671  func (c *AccountsAdclientsAdunitsGetAdcodeCall) Header() http.Header {
  2672  	if c.header_ == nil {
  2673  		c.header_ = make(http.Header)
  2674  	}
  2675  	return c.header_
  2676  }
  2677  
  2678  func (c *AccountsAdclientsAdunitsGetAdcodeCall) doRequest(alt string) (*http.Response, error) {
  2679  	reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_)
  2680  	if c.ifNoneMatch_ != "" {
  2681  		reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  2682  	}
  2683  	var body io.Reader = nil
  2684  	c.urlParams_.Set("alt", alt)
  2685  	c.urlParams_.Set("prettyPrint", "false")
  2686  	urls := googleapi.ResolveRelative(c.s.BasePath, "v2/{+name}/adcode")
  2687  	urls += "?" + c.urlParams_.Encode()
  2688  	req, err := http.NewRequest("GET", urls, body)
  2689  	if err != nil {
  2690  		return nil, err
  2691  	}
  2692  	req.Header = reqHeaders
  2693  	googleapi.Expand(req.URL, map[string]string{
  2694  		"name": c.name,
  2695  	})
  2696  	return gensupport.SendRequest(c.ctx_, c.s.client, req)
  2697  }
  2698  
  2699  // Do executes the "adsense.accounts.adclients.adunits.getAdcode" call.
  2700  // Any non-2xx status code is an error. Response headers are in either
  2701  // *AdUnitAdCode.ServerResponse.Header or (if a response was returned at all)
  2702  // in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to check
  2703  // whether the returned error was because http.StatusNotModified was returned.
  2704  func (c *AccountsAdclientsAdunitsGetAdcodeCall) Do(opts ...googleapi.CallOption) (*AdUnitAdCode, error) {
  2705  	gensupport.SetOptions(c.urlParams_, opts...)
  2706  	res, err := c.doRequest("json")
  2707  	if res != nil && res.StatusCode == http.StatusNotModified {
  2708  		if res.Body != nil {
  2709  			res.Body.Close()
  2710  		}
  2711  		return nil, gensupport.WrapError(&googleapi.Error{
  2712  			Code:   res.StatusCode,
  2713  			Header: res.Header,
  2714  		})
  2715  	}
  2716  	if err != nil {
  2717  		return nil, err
  2718  	}
  2719  	defer googleapi.CloseBody(res)
  2720  	if err := googleapi.CheckResponse(res); err != nil {
  2721  		return nil, gensupport.WrapError(err)
  2722  	}
  2723  	ret := &AdUnitAdCode{
  2724  		ServerResponse: googleapi.ServerResponse{
  2725  			Header:         res.Header,
  2726  			HTTPStatusCode: res.StatusCode,
  2727  		},
  2728  	}
  2729  	target := &ret
  2730  	if err := gensupport.DecodeResponse(target, res); err != nil {
  2731  		return nil, err
  2732  	}
  2733  	return ret, nil
  2734  }
  2735  
  2736  type AccountsAdclientsAdunitsListCall struct {
  2737  	s            *Service
  2738  	parent       string
  2739  	urlParams_   gensupport.URLParams
  2740  	ifNoneMatch_ string
  2741  	ctx_         context.Context
  2742  	header_      http.Header
  2743  }
  2744  
  2745  // List: Lists all ad units under a specified account and ad client.
  2746  //
  2747  //   - parent: The ad client which owns the collection of ad units. Format:
  2748  //     accounts/{account}/adclients/{adclient}.
  2749  func (r *AccountsAdclientsAdunitsService) List(parent string) *AccountsAdclientsAdunitsListCall {
  2750  	c := &AccountsAdclientsAdunitsListCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  2751  	c.parent = parent
  2752  	return c
  2753  }
  2754  
  2755  // PageSize sets the optional parameter "pageSize": The maximum number of ad
  2756  // units to include in the response, used for paging. If unspecified, at most
  2757  // 10000 ad units will be returned. The maximum value is 10000; values above
  2758  // 10000 will be coerced to 10000.
  2759  func (c *AccountsAdclientsAdunitsListCall) PageSize(pageSize int64) *AccountsAdclientsAdunitsListCall {
  2760  	c.urlParams_.Set("pageSize", fmt.Sprint(pageSize))
  2761  	return c
  2762  }
  2763  
  2764  // PageToken sets the optional parameter "pageToken": A page token, received
  2765  // from a previous `ListAdUnits` call. Provide this to retrieve the subsequent
  2766  // page. When paginating, all other parameters provided to `ListAdUnits` must
  2767  // match the call that provided the page token.
  2768  func (c *AccountsAdclientsAdunitsListCall) PageToken(pageToken string) *AccountsAdclientsAdunitsListCall {
  2769  	c.urlParams_.Set("pageToken", pageToken)
  2770  	return c
  2771  }
  2772  
  2773  // Fields allows partial responses to be retrieved. See
  2774  // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse for more
  2775  // details.
  2776  func (c *AccountsAdclientsAdunitsListCall) Fields(s ...googleapi.Field) *AccountsAdclientsAdunitsListCall {
  2777  	c.urlParams_.Set("fields", googleapi.CombineFields(s))
  2778  	return c
  2779  }
  2780  
  2781  // IfNoneMatch sets an optional parameter which makes the operation fail if the
  2782  // object's ETag matches the given value. This is useful for getting updates
  2783  // only after the object has changed since the last request.
  2784  func (c *AccountsAdclientsAdunitsListCall) IfNoneMatch(entityTag string) *AccountsAdclientsAdunitsListCall {
  2785  	c.ifNoneMatch_ = entityTag
  2786  	return c
  2787  }
  2788  
  2789  // Context sets the context to be used in this call's Do method.
  2790  func (c *AccountsAdclientsAdunitsListCall) Context(ctx context.Context) *AccountsAdclientsAdunitsListCall {
  2791  	c.ctx_ = ctx
  2792  	return c
  2793  }
  2794  
  2795  // Header returns a http.Header that can be modified by the caller to add
  2796  // headers to the request.
  2797  func (c *AccountsAdclientsAdunitsListCall) Header() http.Header {
  2798  	if c.header_ == nil {
  2799  		c.header_ = make(http.Header)
  2800  	}
  2801  	return c.header_
  2802  }
  2803  
  2804  func (c *AccountsAdclientsAdunitsListCall) doRequest(alt string) (*http.Response, error) {
  2805  	reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_)
  2806  	if c.ifNoneMatch_ != "" {
  2807  		reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  2808  	}
  2809  	var body io.Reader = nil
  2810  	c.urlParams_.Set("alt", alt)
  2811  	c.urlParams_.Set("prettyPrint", "false")
  2812  	urls := googleapi.ResolveRelative(c.s.BasePath, "v2/{+parent}/adunits")
  2813  	urls += "?" + c.urlParams_.Encode()
  2814  	req, err := http.NewRequest("GET", urls, body)
  2815  	if err != nil {
  2816  		return nil, err
  2817  	}
  2818  	req.Header = reqHeaders
  2819  	googleapi.Expand(req.URL, map[string]string{
  2820  		"parent": c.parent,
  2821  	})
  2822  	return gensupport.SendRequest(c.ctx_, c.s.client, req)
  2823  }
  2824  
  2825  // Do executes the "adsense.accounts.adclients.adunits.list" call.
  2826  // Any non-2xx status code is an error. Response headers are in either
  2827  // *ListAdUnitsResponse.ServerResponse.Header or (if a response was returned at
  2828  // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to
  2829  // check whether the returned error was because http.StatusNotModified was
  2830  // returned.
  2831  func (c *AccountsAdclientsAdunitsListCall) Do(opts ...googleapi.CallOption) (*ListAdUnitsResponse, error) {
  2832  	gensupport.SetOptions(c.urlParams_, opts...)
  2833  	res, err := c.doRequest("json")
  2834  	if res != nil && res.StatusCode == http.StatusNotModified {
  2835  		if res.Body != nil {
  2836  			res.Body.Close()
  2837  		}
  2838  		return nil, gensupport.WrapError(&googleapi.Error{
  2839  			Code:   res.StatusCode,
  2840  			Header: res.Header,
  2841  		})
  2842  	}
  2843  	if err != nil {
  2844  		return nil, err
  2845  	}
  2846  	defer googleapi.CloseBody(res)
  2847  	if err := googleapi.CheckResponse(res); err != nil {
  2848  		return nil, gensupport.WrapError(err)
  2849  	}
  2850  	ret := &ListAdUnitsResponse{
  2851  		ServerResponse: googleapi.ServerResponse{
  2852  			Header:         res.Header,
  2853  			HTTPStatusCode: res.StatusCode,
  2854  		},
  2855  	}
  2856  	target := &ret
  2857  	if err := gensupport.DecodeResponse(target, res); err != nil {
  2858  		return nil, err
  2859  	}
  2860  	return ret, nil
  2861  }
  2862  
  2863  // Pages invokes f for each page of results.
  2864  // A non-nil error returned from f will halt the iteration.
  2865  // The provided context supersedes any context provided to the Context method.
  2866  func (c *AccountsAdclientsAdunitsListCall) Pages(ctx context.Context, f func(*ListAdUnitsResponse) error) error {
  2867  	c.ctx_ = ctx
  2868  	defer c.PageToken(c.urlParams_.Get("pageToken"))
  2869  	for {
  2870  		x, err := c.Do()
  2871  		if err != nil {
  2872  			return err
  2873  		}
  2874  		if err := f(x); err != nil {
  2875  			return err
  2876  		}
  2877  		if x.NextPageToken == "" {
  2878  			return nil
  2879  		}
  2880  		c.PageToken(x.NextPageToken)
  2881  	}
  2882  }
  2883  
  2884  type AccountsAdclientsAdunitsListLinkedCustomChannelsCall struct {
  2885  	s            *Service
  2886  	parent       string
  2887  	urlParams_   gensupport.URLParams
  2888  	ifNoneMatch_ string
  2889  	ctx_         context.Context
  2890  	header_      http.Header
  2891  }
  2892  
  2893  // ListLinkedCustomChannels: Lists all the custom channels available for an ad
  2894  // unit.
  2895  //
  2896  //   - parent: The ad unit which owns the collection of custom channels. Format:
  2897  //     accounts/{account}/adclients/{adclient}/adunits/{adunit}.
  2898  func (r *AccountsAdclientsAdunitsService) ListLinkedCustomChannels(parent string) *AccountsAdclientsAdunitsListLinkedCustomChannelsCall {
  2899  	c := &AccountsAdclientsAdunitsListLinkedCustomChannelsCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  2900  	c.parent = parent
  2901  	return c
  2902  }
  2903  
  2904  // PageSize sets the optional parameter "pageSize": The maximum number of
  2905  // custom channels to include in the response, used for paging. If unspecified,
  2906  // at most 10000 custom channels will be returned. The maximum value is 10000;
  2907  // values above 10000 will be coerced to 10000.
  2908  func (c *AccountsAdclientsAdunitsListLinkedCustomChannelsCall) PageSize(pageSize int64) *AccountsAdclientsAdunitsListLinkedCustomChannelsCall {
  2909  	c.urlParams_.Set("pageSize", fmt.Sprint(pageSize))
  2910  	return c
  2911  }
  2912  
  2913  // PageToken sets the optional parameter "pageToken": A page token, received
  2914  // from a previous `ListLinkedCustomChannels` call. Provide this to retrieve
  2915  // the subsequent page. When paginating, all other parameters provided to
  2916  // `ListLinkedCustomChannels` must match the call that provided the page token.
  2917  func (c *AccountsAdclientsAdunitsListLinkedCustomChannelsCall) PageToken(pageToken string) *AccountsAdclientsAdunitsListLinkedCustomChannelsCall {
  2918  	c.urlParams_.Set("pageToken", pageToken)
  2919  	return c
  2920  }
  2921  
  2922  // Fields allows partial responses to be retrieved. See
  2923  // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse for more
  2924  // details.
  2925  func (c *AccountsAdclientsAdunitsListLinkedCustomChannelsCall) Fields(s ...googleapi.Field) *AccountsAdclientsAdunitsListLinkedCustomChannelsCall {
  2926  	c.urlParams_.Set("fields", googleapi.CombineFields(s))
  2927  	return c
  2928  }
  2929  
  2930  // IfNoneMatch sets an optional parameter which makes the operation fail if the
  2931  // object's ETag matches the given value. This is useful for getting updates
  2932  // only after the object has changed since the last request.
  2933  func (c *AccountsAdclientsAdunitsListLinkedCustomChannelsCall) IfNoneMatch(entityTag string) *AccountsAdclientsAdunitsListLinkedCustomChannelsCall {
  2934  	c.ifNoneMatch_ = entityTag
  2935  	return c
  2936  }
  2937  
  2938  // Context sets the context to be used in this call's Do method.
  2939  func (c *AccountsAdclientsAdunitsListLinkedCustomChannelsCall) Context(ctx context.Context) *AccountsAdclientsAdunitsListLinkedCustomChannelsCall {
  2940  	c.ctx_ = ctx
  2941  	return c
  2942  }
  2943  
  2944  // Header returns a http.Header that can be modified by the caller to add
  2945  // headers to the request.
  2946  func (c *AccountsAdclientsAdunitsListLinkedCustomChannelsCall) Header() http.Header {
  2947  	if c.header_ == nil {
  2948  		c.header_ = make(http.Header)
  2949  	}
  2950  	return c.header_
  2951  }
  2952  
  2953  func (c *AccountsAdclientsAdunitsListLinkedCustomChannelsCall) doRequest(alt string) (*http.Response, error) {
  2954  	reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_)
  2955  	if c.ifNoneMatch_ != "" {
  2956  		reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  2957  	}
  2958  	var body io.Reader = nil
  2959  	c.urlParams_.Set("alt", alt)
  2960  	c.urlParams_.Set("prettyPrint", "false")
  2961  	urls := googleapi.ResolveRelative(c.s.BasePath, "v2/{+parent}:listLinkedCustomChannels")
  2962  	urls += "?" + c.urlParams_.Encode()
  2963  	req, err := http.NewRequest("GET", urls, body)
  2964  	if err != nil {
  2965  		return nil, err
  2966  	}
  2967  	req.Header = reqHeaders
  2968  	googleapi.Expand(req.URL, map[string]string{
  2969  		"parent": c.parent,
  2970  	})
  2971  	return gensupport.SendRequest(c.ctx_, c.s.client, req)
  2972  }
  2973  
  2974  // Do executes the "adsense.accounts.adclients.adunits.listLinkedCustomChannels" call.
  2975  // Any non-2xx status code is an error. Response headers are in either
  2976  // *ListLinkedCustomChannelsResponse.ServerResponse.Header or (if a response
  2977  // was returned at all) in error.(*googleapi.Error).Header. Use
  2978  // googleapi.IsNotModified to check whether the returned error was because
  2979  // http.StatusNotModified was returned.
  2980  func (c *AccountsAdclientsAdunitsListLinkedCustomChannelsCall) Do(opts ...googleapi.CallOption) (*ListLinkedCustomChannelsResponse, error) {
  2981  	gensupport.SetOptions(c.urlParams_, opts...)
  2982  	res, err := c.doRequest("json")
  2983  	if res != nil && res.StatusCode == http.StatusNotModified {
  2984  		if res.Body != nil {
  2985  			res.Body.Close()
  2986  		}
  2987  		return nil, gensupport.WrapError(&googleapi.Error{
  2988  			Code:   res.StatusCode,
  2989  			Header: res.Header,
  2990  		})
  2991  	}
  2992  	if err != nil {
  2993  		return nil, err
  2994  	}
  2995  	defer googleapi.CloseBody(res)
  2996  	if err := googleapi.CheckResponse(res); err != nil {
  2997  		return nil, gensupport.WrapError(err)
  2998  	}
  2999  	ret := &ListLinkedCustomChannelsResponse{
  3000  		ServerResponse: googleapi.ServerResponse{
  3001  			Header:         res.Header,
  3002  			HTTPStatusCode: res.StatusCode,
  3003  		},
  3004  	}
  3005  	target := &ret
  3006  	if err := gensupport.DecodeResponse(target, res); err != nil {
  3007  		return nil, err
  3008  	}
  3009  	return ret, nil
  3010  }
  3011  
  3012  // Pages invokes f for each page of results.
  3013  // A non-nil error returned from f will halt the iteration.
  3014  // The provided context supersedes any context provided to the Context method.
  3015  func (c *AccountsAdclientsAdunitsListLinkedCustomChannelsCall) Pages(ctx context.Context, f func(*ListLinkedCustomChannelsResponse) error) error {
  3016  	c.ctx_ = ctx
  3017  	defer c.PageToken(c.urlParams_.Get("pageToken"))
  3018  	for {
  3019  		x, err := c.Do()
  3020  		if err != nil {
  3021  			return err
  3022  		}
  3023  		if err := f(x); err != nil {
  3024  			return err
  3025  		}
  3026  		if x.NextPageToken == "" {
  3027  			return nil
  3028  		}
  3029  		c.PageToken(x.NextPageToken)
  3030  	}
  3031  }
  3032  
  3033  type AccountsAdclientsAdunitsPatchCall struct {
  3034  	s          *Service
  3035  	name       string
  3036  	adunit     *AdUnit
  3037  	urlParams_ gensupport.URLParams
  3038  	ctx_       context.Context
  3039  	header_    http.Header
  3040  }
  3041  
  3042  // Patch: Updates an ad unit. This method can be called only by a restricted
  3043  // set of projects, which are usually owned by AdSense for Platforms
  3044  // (https://developers.google.com/adsense/platforms/) publishers. Contact your
  3045  // account manager if you need to use this method. For now, this method can
  3046  // only be used to update `DISPLAY` ad units. See:
  3047  // https://support.google.com/adsense/answer/9183566
  3048  //
  3049  //   - name: Output only. Resource name of the ad unit. Format:
  3050  //     accounts/{account}/adclients/{adclient}/adunits/{adunit}.
  3051  func (r *AccountsAdclientsAdunitsService) Patch(name string, adunit *AdUnit) *AccountsAdclientsAdunitsPatchCall {
  3052  	c := &AccountsAdclientsAdunitsPatchCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  3053  	c.name = name
  3054  	c.adunit = adunit
  3055  	return c
  3056  }
  3057  
  3058  // UpdateMask sets the optional parameter "updateMask": The list of fields to
  3059  // update. If empty, a full update is performed.
  3060  func (c *AccountsAdclientsAdunitsPatchCall) UpdateMask(updateMask string) *AccountsAdclientsAdunitsPatchCall {
  3061  	c.urlParams_.Set("updateMask", updateMask)
  3062  	return c
  3063  }
  3064  
  3065  // Fields allows partial responses to be retrieved. See
  3066  // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse for more
  3067  // details.
  3068  func (c *AccountsAdclientsAdunitsPatchCall) Fields(s ...googleapi.Field) *AccountsAdclientsAdunitsPatchCall {
  3069  	c.urlParams_.Set("fields", googleapi.CombineFields(s))
  3070  	return c
  3071  }
  3072  
  3073  // Context sets the context to be used in this call's Do method.
  3074  func (c *AccountsAdclientsAdunitsPatchCall) Context(ctx context.Context) *AccountsAdclientsAdunitsPatchCall {
  3075  	c.ctx_ = ctx
  3076  	return c
  3077  }
  3078  
  3079  // Header returns a http.Header that can be modified by the caller to add
  3080  // headers to the request.
  3081  func (c *AccountsAdclientsAdunitsPatchCall) Header() http.Header {
  3082  	if c.header_ == nil {
  3083  		c.header_ = make(http.Header)
  3084  	}
  3085  	return c.header_
  3086  }
  3087  
  3088  func (c *AccountsAdclientsAdunitsPatchCall) doRequest(alt string) (*http.Response, error) {
  3089  	reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_)
  3090  	var body io.Reader = nil
  3091  	body, err := googleapi.WithoutDataWrapper.JSONReader(c.adunit)
  3092  	if err != nil {
  3093  		return nil, err
  3094  	}
  3095  	c.urlParams_.Set("alt", alt)
  3096  	c.urlParams_.Set("prettyPrint", "false")
  3097  	urls := googleapi.ResolveRelative(c.s.BasePath, "v2/{+name}")
  3098  	urls += "?" + c.urlParams_.Encode()
  3099  	req, err := http.NewRequest("PATCH", urls, body)
  3100  	if err != nil {
  3101  		return nil, err
  3102  	}
  3103  	req.Header = reqHeaders
  3104  	googleapi.Expand(req.URL, map[string]string{
  3105  		"name": c.name,
  3106  	})
  3107  	return gensupport.SendRequest(c.ctx_, c.s.client, req)
  3108  }
  3109  
  3110  // Do executes the "adsense.accounts.adclients.adunits.patch" call.
  3111  // Any non-2xx status code is an error. Response headers are in either
  3112  // *AdUnit.ServerResponse.Header or (if a response was returned at all) in
  3113  // error.(*googleapi.Error).Header. Use googleapi.IsNotModified to check
  3114  // whether the returned error was because http.StatusNotModified was returned.
  3115  func (c *AccountsAdclientsAdunitsPatchCall) Do(opts ...googleapi.CallOption) (*AdUnit, error) {
  3116  	gensupport.SetOptions(c.urlParams_, opts...)
  3117  	res, err := c.doRequest("json")
  3118  	if res != nil && res.StatusCode == http.StatusNotModified {
  3119  		if res.Body != nil {
  3120  			res.Body.Close()
  3121  		}
  3122  		return nil, gensupport.WrapError(&googleapi.Error{
  3123  			Code:   res.StatusCode,
  3124  			Header: res.Header,
  3125  		})
  3126  	}
  3127  	if err != nil {
  3128  		return nil, err
  3129  	}
  3130  	defer googleapi.CloseBody(res)
  3131  	if err := googleapi.CheckResponse(res); err != nil {
  3132  		return nil, gensupport.WrapError(err)
  3133  	}
  3134  	ret := &AdUnit{
  3135  		ServerResponse: googleapi.ServerResponse{
  3136  			Header:         res.Header,
  3137  			HTTPStatusCode: res.StatusCode,
  3138  		},
  3139  	}
  3140  	target := &ret
  3141  	if err := gensupport.DecodeResponse(target, res); err != nil {
  3142  		return nil, err
  3143  	}
  3144  	return ret, nil
  3145  }
  3146  
  3147  type AccountsAdclientsCustomchannelsCreateCall struct {
  3148  	s             *Service
  3149  	parent        string
  3150  	customchannel *CustomChannel
  3151  	urlParams_    gensupport.URLParams
  3152  	ctx_          context.Context
  3153  	header_       http.Header
  3154  }
  3155  
  3156  // Create: Creates a custom channel. This method can be called only by a
  3157  // restricted set of projects, which are usually owned by AdSense for Platforms
  3158  // (https://developers.google.com/adsense/platforms/) publishers. Contact your
  3159  // account manager if you need to use this method.
  3160  //
  3161  //   - parent: The ad client to create a custom channel under. Format:
  3162  //     accounts/{account}/adclients/{adclient}.
  3163  func (r *AccountsAdclientsCustomchannelsService) Create(parent string, customchannel *CustomChannel) *AccountsAdclientsCustomchannelsCreateCall {
  3164  	c := &AccountsAdclientsCustomchannelsCreateCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  3165  	c.parent = parent
  3166  	c.customchannel = customchannel
  3167  	return c
  3168  }
  3169  
  3170  // Fields allows partial responses to be retrieved. See
  3171  // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse for more
  3172  // details.
  3173  func (c *AccountsAdclientsCustomchannelsCreateCall) Fields(s ...googleapi.Field) *AccountsAdclientsCustomchannelsCreateCall {
  3174  	c.urlParams_.Set("fields", googleapi.CombineFields(s))
  3175  	return c
  3176  }
  3177  
  3178  // Context sets the context to be used in this call's Do method.
  3179  func (c *AccountsAdclientsCustomchannelsCreateCall) Context(ctx context.Context) *AccountsAdclientsCustomchannelsCreateCall {
  3180  	c.ctx_ = ctx
  3181  	return c
  3182  }
  3183  
  3184  // Header returns a http.Header that can be modified by the caller to add
  3185  // headers to the request.
  3186  func (c *AccountsAdclientsCustomchannelsCreateCall) Header() http.Header {
  3187  	if c.header_ == nil {
  3188  		c.header_ = make(http.Header)
  3189  	}
  3190  	return c.header_
  3191  }
  3192  
  3193  func (c *AccountsAdclientsCustomchannelsCreateCall) doRequest(alt string) (*http.Response, error) {
  3194  	reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_)
  3195  	var body io.Reader = nil
  3196  	body, err := googleapi.WithoutDataWrapper.JSONReader(c.customchannel)
  3197  	if err != nil {
  3198  		return nil, err
  3199  	}
  3200  	c.urlParams_.Set("alt", alt)
  3201  	c.urlParams_.Set("prettyPrint", "false")
  3202  	urls := googleapi.ResolveRelative(c.s.BasePath, "v2/{+parent}/customchannels")
  3203  	urls += "?" + c.urlParams_.Encode()
  3204  	req, err := http.NewRequest("POST", urls, body)
  3205  	if err != nil {
  3206  		return nil, err
  3207  	}
  3208  	req.Header = reqHeaders
  3209  	googleapi.Expand(req.URL, map[string]string{
  3210  		"parent": c.parent,
  3211  	})
  3212  	return gensupport.SendRequest(c.ctx_, c.s.client, req)
  3213  }
  3214  
  3215  // Do executes the "adsense.accounts.adclients.customchannels.create" call.
  3216  // Any non-2xx status code is an error. Response headers are in either
  3217  // *CustomChannel.ServerResponse.Header or (if a response was returned at all)
  3218  // in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to check
  3219  // whether the returned error was because http.StatusNotModified was returned.
  3220  func (c *AccountsAdclientsCustomchannelsCreateCall) Do(opts ...googleapi.CallOption) (*CustomChannel, error) {
  3221  	gensupport.SetOptions(c.urlParams_, opts...)
  3222  	res, err := c.doRequest("json")
  3223  	if res != nil && res.StatusCode == http.StatusNotModified {
  3224  		if res.Body != nil {
  3225  			res.Body.Close()
  3226  		}
  3227  		return nil, gensupport.WrapError(&googleapi.Error{
  3228  			Code:   res.StatusCode,
  3229  			Header: res.Header,
  3230  		})
  3231  	}
  3232  	if err != nil {
  3233  		return nil, err
  3234  	}
  3235  	defer googleapi.CloseBody(res)
  3236  	if err := googleapi.CheckResponse(res); err != nil {
  3237  		return nil, gensupport.WrapError(err)
  3238  	}
  3239  	ret := &CustomChannel{
  3240  		ServerResponse: googleapi.ServerResponse{
  3241  			Header:         res.Header,
  3242  			HTTPStatusCode: res.StatusCode,
  3243  		},
  3244  	}
  3245  	target := &ret
  3246  	if err := gensupport.DecodeResponse(target, res); err != nil {
  3247  		return nil, err
  3248  	}
  3249  	return ret, nil
  3250  }
  3251  
  3252  type AccountsAdclientsCustomchannelsDeleteCall struct {
  3253  	s          *Service
  3254  	name       string
  3255  	urlParams_ gensupport.URLParams
  3256  	ctx_       context.Context
  3257  	header_    http.Header
  3258  }
  3259  
  3260  // Delete: Deletes a custom channel. This method can be called only by a
  3261  // restricted set of projects, which are usually owned by AdSense for Platforms
  3262  // (https://developers.google.com/adsense/platforms/) publishers. Contact your
  3263  // account manager if you need to use this method.
  3264  //
  3265  //   - name: Name of the custom channel to delete. Format:
  3266  //     accounts/{account}/adclients/{adclient}/customchannels/{customchannel}.
  3267  func (r *AccountsAdclientsCustomchannelsService) Delete(name string) *AccountsAdclientsCustomchannelsDeleteCall {
  3268  	c := &AccountsAdclientsCustomchannelsDeleteCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  3269  	c.name = name
  3270  	return c
  3271  }
  3272  
  3273  // Fields allows partial responses to be retrieved. See
  3274  // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse for more
  3275  // details.
  3276  func (c *AccountsAdclientsCustomchannelsDeleteCall) Fields(s ...googleapi.Field) *AccountsAdclientsCustomchannelsDeleteCall {
  3277  	c.urlParams_.Set("fields", googleapi.CombineFields(s))
  3278  	return c
  3279  }
  3280  
  3281  // Context sets the context to be used in this call's Do method.
  3282  func (c *AccountsAdclientsCustomchannelsDeleteCall) Context(ctx context.Context) *AccountsAdclientsCustomchannelsDeleteCall {
  3283  	c.ctx_ = ctx
  3284  	return c
  3285  }
  3286  
  3287  // Header returns a http.Header that can be modified by the caller to add
  3288  // headers to the request.
  3289  func (c *AccountsAdclientsCustomchannelsDeleteCall) Header() http.Header {
  3290  	if c.header_ == nil {
  3291  		c.header_ = make(http.Header)
  3292  	}
  3293  	return c.header_
  3294  }
  3295  
  3296  func (c *AccountsAdclientsCustomchannelsDeleteCall) doRequest(alt string) (*http.Response, error) {
  3297  	reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_)
  3298  	var body io.Reader = nil
  3299  	c.urlParams_.Set("alt", alt)
  3300  	c.urlParams_.Set("prettyPrint", "false")
  3301  	urls := googleapi.ResolveRelative(c.s.BasePath, "v2/{+name}")
  3302  	urls += "?" + c.urlParams_.Encode()
  3303  	req, err := http.NewRequest("DELETE", urls, body)
  3304  	if err != nil {
  3305  		return nil, err
  3306  	}
  3307  	req.Header = reqHeaders
  3308  	googleapi.Expand(req.URL, map[string]string{
  3309  		"name": c.name,
  3310  	})
  3311  	return gensupport.SendRequest(c.ctx_, c.s.client, req)
  3312  }
  3313  
  3314  // Do executes the "adsense.accounts.adclients.customchannels.delete" call.
  3315  // Any non-2xx status code is an error. Response headers are in either
  3316  // *Empty.ServerResponse.Header or (if a response was returned at all) in
  3317  // error.(*googleapi.Error).Header. Use googleapi.IsNotModified to check
  3318  // whether the returned error was because http.StatusNotModified was returned.
  3319  func (c *AccountsAdclientsCustomchannelsDeleteCall) Do(opts ...googleapi.CallOption) (*Empty, error) {
  3320  	gensupport.SetOptions(c.urlParams_, opts...)
  3321  	res, err := c.doRequest("json")
  3322  	if res != nil && res.StatusCode == http.StatusNotModified {
  3323  		if res.Body != nil {
  3324  			res.Body.Close()
  3325  		}
  3326  		return nil, gensupport.WrapError(&googleapi.Error{
  3327  			Code:   res.StatusCode,
  3328  			Header: res.Header,
  3329  		})
  3330  	}
  3331  	if err != nil {
  3332  		return nil, err
  3333  	}
  3334  	defer googleapi.CloseBody(res)
  3335  	if err := googleapi.CheckResponse(res); err != nil {
  3336  		return nil, gensupport.WrapError(err)
  3337  	}
  3338  	ret := &Empty{
  3339  		ServerResponse: googleapi.ServerResponse{
  3340  			Header:         res.Header,
  3341  			HTTPStatusCode: res.StatusCode,
  3342  		},
  3343  	}
  3344  	target := &ret
  3345  	if err := gensupport.DecodeResponse(target, res); err != nil {
  3346  		return nil, err
  3347  	}
  3348  	return ret, nil
  3349  }
  3350  
  3351  type AccountsAdclientsCustomchannelsGetCall struct {
  3352  	s            *Service
  3353  	name         string
  3354  	urlParams_   gensupport.URLParams
  3355  	ifNoneMatch_ string
  3356  	ctx_         context.Context
  3357  	header_      http.Header
  3358  }
  3359  
  3360  // Get: Gets information about the selected custom channel.
  3361  //
  3362  //   - name: Name of the custom channel. Format:
  3363  //     accounts/{account}/adclients/{adclient}/customchannels/{customchannel}.
  3364  func (r *AccountsAdclientsCustomchannelsService) Get(name string) *AccountsAdclientsCustomchannelsGetCall {
  3365  	c := &AccountsAdclientsCustomchannelsGetCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  3366  	c.name = name
  3367  	return c
  3368  }
  3369  
  3370  // Fields allows partial responses to be retrieved. See
  3371  // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse for more
  3372  // details.
  3373  func (c *AccountsAdclientsCustomchannelsGetCall) Fields(s ...googleapi.Field) *AccountsAdclientsCustomchannelsGetCall {
  3374  	c.urlParams_.Set("fields", googleapi.CombineFields(s))
  3375  	return c
  3376  }
  3377  
  3378  // IfNoneMatch sets an optional parameter which makes the operation fail if the
  3379  // object's ETag matches the given value. This is useful for getting updates
  3380  // only after the object has changed since the last request.
  3381  func (c *AccountsAdclientsCustomchannelsGetCall) IfNoneMatch(entityTag string) *AccountsAdclientsCustomchannelsGetCall {
  3382  	c.ifNoneMatch_ = entityTag
  3383  	return c
  3384  }
  3385  
  3386  // Context sets the context to be used in this call's Do method.
  3387  func (c *AccountsAdclientsCustomchannelsGetCall) Context(ctx context.Context) *AccountsAdclientsCustomchannelsGetCall {
  3388  	c.ctx_ = ctx
  3389  	return c
  3390  }
  3391  
  3392  // Header returns a http.Header that can be modified by the caller to add
  3393  // headers to the request.
  3394  func (c *AccountsAdclientsCustomchannelsGetCall) Header() http.Header {
  3395  	if c.header_ == nil {
  3396  		c.header_ = make(http.Header)
  3397  	}
  3398  	return c.header_
  3399  }
  3400  
  3401  func (c *AccountsAdclientsCustomchannelsGetCall) doRequest(alt string) (*http.Response, error) {
  3402  	reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_)
  3403  	if c.ifNoneMatch_ != "" {
  3404  		reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  3405  	}
  3406  	var body io.Reader = nil
  3407  	c.urlParams_.Set("alt", alt)
  3408  	c.urlParams_.Set("prettyPrint", "false")
  3409  	urls := googleapi.ResolveRelative(c.s.BasePath, "v2/{+name}")
  3410  	urls += "?" + c.urlParams_.Encode()
  3411  	req, err := http.NewRequest("GET", urls, body)
  3412  	if err != nil {
  3413  		return nil, err
  3414  	}
  3415  	req.Header = reqHeaders
  3416  	googleapi.Expand(req.URL, map[string]string{
  3417  		"name": c.name,
  3418  	})
  3419  	return gensupport.SendRequest(c.ctx_, c.s.client, req)
  3420  }
  3421  
  3422  // Do executes the "adsense.accounts.adclients.customchannels.get" call.
  3423  // Any non-2xx status code is an error. Response headers are in either
  3424  // *CustomChannel.ServerResponse.Header or (if a response was returned at all)
  3425  // in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to check
  3426  // whether the returned error was because http.StatusNotModified was returned.
  3427  func (c *AccountsAdclientsCustomchannelsGetCall) Do(opts ...googleapi.CallOption) (*CustomChannel, error) {
  3428  	gensupport.SetOptions(c.urlParams_, opts...)
  3429  	res, err := c.doRequest("json")
  3430  	if res != nil && res.StatusCode == http.StatusNotModified {
  3431  		if res.Body != nil {
  3432  			res.Body.Close()
  3433  		}
  3434  		return nil, gensupport.WrapError(&googleapi.Error{
  3435  			Code:   res.StatusCode,
  3436  			Header: res.Header,
  3437  		})
  3438  	}
  3439  	if err != nil {
  3440  		return nil, err
  3441  	}
  3442  	defer googleapi.CloseBody(res)
  3443  	if err := googleapi.CheckResponse(res); err != nil {
  3444  		return nil, gensupport.WrapError(err)
  3445  	}
  3446  	ret := &CustomChannel{
  3447  		ServerResponse: googleapi.ServerResponse{
  3448  			Header:         res.Header,
  3449  			HTTPStatusCode: res.StatusCode,
  3450  		},
  3451  	}
  3452  	target := &ret
  3453  	if err := gensupport.DecodeResponse(target, res); err != nil {
  3454  		return nil, err
  3455  	}
  3456  	return ret, nil
  3457  }
  3458  
  3459  type AccountsAdclientsCustomchannelsListCall struct {
  3460  	s            *Service
  3461  	parent       string
  3462  	urlParams_   gensupport.URLParams
  3463  	ifNoneMatch_ string
  3464  	ctx_         context.Context
  3465  	header_      http.Header
  3466  }
  3467  
  3468  // List: Lists all the custom channels available in an ad client.
  3469  //
  3470  //   - parent: The ad client which owns the collection of custom channels.
  3471  //     Format: accounts/{account}/adclients/{adclient}.
  3472  func (r *AccountsAdclientsCustomchannelsService) List(parent string) *AccountsAdclientsCustomchannelsListCall {
  3473  	c := &AccountsAdclientsCustomchannelsListCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  3474  	c.parent = parent
  3475  	return c
  3476  }
  3477  
  3478  // PageSize sets the optional parameter "pageSize": The maximum number of
  3479  // custom channels to include in the response, used for paging. If unspecified,
  3480  // at most 10000 custom channels will be returned. The maximum value is 10000;
  3481  // values above 10000 will be coerced to 10000.
  3482  func (c *AccountsAdclientsCustomchannelsListCall) PageSize(pageSize int64) *AccountsAdclientsCustomchannelsListCall {
  3483  	c.urlParams_.Set("pageSize", fmt.Sprint(pageSize))
  3484  	return c
  3485  }
  3486  
  3487  // PageToken sets the optional parameter "pageToken": A page token, received
  3488  // from a previous `ListCustomChannels` call. Provide this to retrieve the
  3489  // subsequent page. When paginating, all other parameters provided to
  3490  // `ListCustomChannels` must match the call that provided the page token.
  3491  func (c *AccountsAdclientsCustomchannelsListCall) PageToken(pageToken string) *AccountsAdclientsCustomchannelsListCall {
  3492  	c.urlParams_.Set("pageToken", pageToken)
  3493  	return c
  3494  }
  3495  
  3496  // Fields allows partial responses to be retrieved. See
  3497  // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse for more
  3498  // details.
  3499  func (c *AccountsAdclientsCustomchannelsListCall) Fields(s ...googleapi.Field) *AccountsAdclientsCustomchannelsListCall {
  3500  	c.urlParams_.Set("fields", googleapi.CombineFields(s))
  3501  	return c
  3502  }
  3503  
  3504  // IfNoneMatch sets an optional parameter which makes the operation fail if the
  3505  // object's ETag matches the given value. This is useful for getting updates
  3506  // only after the object has changed since the last request.
  3507  func (c *AccountsAdclientsCustomchannelsListCall) IfNoneMatch(entityTag string) *AccountsAdclientsCustomchannelsListCall {
  3508  	c.ifNoneMatch_ = entityTag
  3509  	return c
  3510  }
  3511  
  3512  // Context sets the context to be used in this call's Do method.
  3513  func (c *AccountsAdclientsCustomchannelsListCall) Context(ctx context.Context) *AccountsAdclientsCustomchannelsListCall {
  3514  	c.ctx_ = ctx
  3515  	return c
  3516  }
  3517  
  3518  // Header returns a http.Header that can be modified by the caller to add
  3519  // headers to the request.
  3520  func (c *AccountsAdclientsCustomchannelsListCall) Header() http.Header {
  3521  	if c.header_ == nil {
  3522  		c.header_ = make(http.Header)
  3523  	}
  3524  	return c.header_
  3525  }
  3526  
  3527  func (c *AccountsAdclientsCustomchannelsListCall) doRequest(alt string) (*http.Response, error) {
  3528  	reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_)
  3529  	if c.ifNoneMatch_ != "" {
  3530  		reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  3531  	}
  3532  	var body io.Reader = nil
  3533  	c.urlParams_.Set("alt", alt)
  3534  	c.urlParams_.Set("prettyPrint", "false")
  3535  	urls := googleapi.ResolveRelative(c.s.BasePath, "v2/{+parent}/customchannels")
  3536  	urls += "?" + c.urlParams_.Encode()
  3537  	req, err := http.NewRequest("GET", urls, body)
  3538  	if err != nil {
  3539  		return nil, err
  3540  	}
  3541  	req.Header = reqHeaders
  3542  	googleapi.Expand(req.URL, map[string]string{
  3543  		"parent": c.parent,
  3544  	})
  3545  	return gensupport.SendRequest(c.ctx_, c.s.client, req)
  3546  }
  3547  
  3548  // Do executes the "adsense.accounts.adclients.customchannels.list" call.
  3549  // Any non-2xx status code is an error. Response headers are in either
  3550  // *ListCustomChannelsResponse.ServerResponse.Header or (if a response was
  3551  // returned at all) in error.(*googleapi.Error).Header. Use
  3552  // googleapi.IsNotModified to check whether the returned error was because
  3553  // http.StatusNotModified was returned.
  3554  func (c *AccountsAdclientsCustomchannelsListCall) Do(opts ...googleapi.CallOption) (*ListCustomChannelsResponse, error) {
  3555  	gensupport.SetOptions(c.urlParams_, opts...)
  3556  	res, err := c.doRequest("json")
  3557  	if res != nil && res.StatusCode == http.StatusNotModified {
  3558  		if res.Body != nil {
  3559  			res.Body.Close()
  3560  		}
  3561  		return nil, gensupport.WrapError(&googleapi.Error{
  3562  			Code:   res.StatusCode,
  3563  			Header: res.Header,
  3564  		})
  3565  	}
  3566  	if err != nil {
  3567  		return nil, err
  3568  	}
  3569  	defer googleapi.CloseBody(res)
  3570  	if err := googleapi.CheckResponse(res); err != nil {
  3571  		return nil, gensupport.WrapError(err)
  3572  	}
  3573  	ret := &ListCustomChannelsResponse{
  3574  		ServerResponse: googleapi.ServerResponse{
  3575  			Header:         res.Header,
  3576  			HTTPStatusCode: res.StatusCode,
  3577  		},
  3578  	}
  3579  	target := &ret
  3580  	if err := gensupport.DecodeResponse(target, res); err != nil {
  3581  		return nil, err
  3582  	}
  3583  	return ret, nil
  3584  }
  3585  
  3586  // Pages invokes f for each page of results.
  3587  // A non-nil error returned from f will halt the iteration.
  3588  // The provided context supersedes any context provided to the Context method.
  3589  func (c *AccountsAdclientsCustomchannelsListCall) Pages(ctx context.Context, f func(*ListCustomChannelsResponse) error) error {
  3590  	c.ctx_ = ctx
  3591  	defer c.PageToken(c.urlParams_.Get("pageToken"))
  3592  	for {
  3593  		x, err := c.Do()
  3594  		if err != nil {
  3595  			return err
  3596  		}
  3597  		if err := f(x); err != nil {
  3598  			return err
  3599  		}
  3600  		if x.NextPageToken == "" {
  3601  			return nil
  3602  		}
  3603  		c.PageToken(x.NextPageToken)
  3604  	}
  3605  }
  3606  
  3607  type AccountsAdclientsCustomchannelsListLinkedAdUnitsCall struct {
  3608  	s            *Service
  3609  	parent       string
  3610  	urlParams_   gensupport.URLParams
  3611  	ifNoneMatch_ string
  3612  	ctx_         context.Context
  3613  	header_      http.Header
  3614  }
  3615  
  3616  // ListLinkedAdUnits: Lists all the ad units available for a custom channel.
  3617  //
  3618  //   - parent: The custom channel which owns the collection of ad units. Format:
  3619  //     accounts/{account}/adclients/{adclient}/customchannels/{customchannel}.
  3620  func (r *AccountsAdclientsCustomchannelsService) ListLinkedAdUnits(parent string) *AccountsAdclientsCustomchannelsListLinkedAdUnitsCall {
  3621  	c := &AccountsAdclientsCustomchannelsListLinkedAdUnitsCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  3622  	c.parent = parent
  3623  	return c
  3624  }
  3625  
  3626  // PageSize sets the optional parameter "pageSize": The maximum number of ad
  3627  // units to include in the response, used for paging. If unspecified, at most
  3628  // 10000 ad units will be returned. The maximum value is 10000; values above
  3629  // 10000 will be coerced to 10000.
  3630  func (c *AccountsAdclientsCustomchannelsListLinkedAdUnitsCall) PageSize(pageSize int64) *AccountsAdclientsCustomchannelsListLinkedAdUnitsCall {
  3631  	c.urlParams_.Set("pageSize", fmt.Sprint(pageSize))
  3632  	return c
  3633  }
  3634  
  3635  // PageToken sets the optional parameter "pageToken": A page token, received
  3636  // from a previous `ListLinkedAdUnits` call. Provide this to retrieve the
  3637  // subsequent page. When paginating, all other parameters provided to
  3638  // `ListLinkedAdUnits` must match the call that provided the page token.
  3639  func (c *AccountsAdclientsCustomchannelsListLinkedAdUnitsCall) PageToken(pageToken string) *AccountsAdclientsCustomchannelsListLinkedAdUnitsCall {
  3640  	c.urlParams_.Set("pageToken", pageToken)
  3641  	return c
  3642  }
  3643  
  3644  // Fields allows partial responses to be retrieved. See
  3645  // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse for more
  3646  // details.
  3647  func (c *AccountsAdclientsCustomchannelsListLinkedAdUnitsCall) Fields(s ...googleapi.Field) *AccountsAdclientsCustomchannelsListLinkedAdUnitsCall {
  3648  	c.urlParams_.Set("fields", googleapi.CombineFields(s))
  3649  	return c
  3650  }
  3651  
  3652  // IfNoneMatch sets an optional parameter which makes the operation fail if the
  3653  // object's ETag matches the given value. This is useful for getting updates
  3654  // only after the object has changed since the last request.
  3655  func (c *AccountsAdclientsCustomchannelsListLinkedAdUnitsCall) IfNoneMatch(entityTag string) *AccountsAdclientsCustomchannelsListLinkedAdUnitsCall {
  3656  	c.ifNoneMatch_ = entityTag
  3657  	return c
  3658  }
  3659  
  3660  // Context sets the context to be used in this call's Do method.
  3661  func (c *AccountsAdclientsCustomchannelsListLinkedAdUnitsCall) Context(ctx context.Context) *AccountsAdclientsCustomchannelsListLinkedAdUnitsCall {
  3662  	c.ctx_ = ctx
  3663  	return c
  3664  }
  3665  
  3666  // Header returns a http.Header that can be modified by the caller to add
  3667  // headers to the request.
  3668  func (c *AccountsAdclientsCustomchannelsListLinkedAdUnitsCall) Header() http.Header {
  3669  	if c.header_ == nil {
  3670  		c.header_ = make(http.Header)
  3671  	}
  3672  	return c.header_
  3673  }
  3674  
  3675  func (c *AccountsAdclientsCustomchannelsListLinkedAdUnitsCall) doRequest(alt string) (*http.Response, error) {
  3676  	reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_)
  3677  	if c.ifNoneMatch_ != "" {
  3678  		reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  3679  	}
  3680  	var body io.Reader = nil
  3681  	c.urlParams_.Set("alt", alt)
  3682  	c.urlParams_.Set("prettyPrint", "false")
  3683  	urls := googleapi.ResolveRelative(c.s.BasePath, "v2/{+parent}:listLinkedAdUnits")
  3684  	urls += "?" + c.urlParams_.Encode()
  3685  	req, err := http.NewRequest("GET", urls, body)
  3686  	if err != nil {
  3687  		return nil, err
  3688  	}
  3689  	req.Header = reqHeaders
  3690  	googleapi.Expand(req.URL, map[string]string{
  3691  		"parent": c.parent,
  3692  	})
  3693  	return gensupport.SendRequest(c.ctx_, c.s.client, req)
  3694  }
  3695  
  3696  // Do executes the "adsense.accounts.adclients.customchannels.listLinkedAdUnits" call.
  3697  // Any non-2xx status code is an error. Response headers are in either
  3698  // *ListLinkedAdUnitsResponse.ServerResponse.Header or (if a response was
  3699  // returned at all) in error.(*googleapi.Error).Header. Use
  3700  // googleapi.IsNotModified to check whether the returned error was because
  3701  // http.StatusNotModified was returned.
  3702  func (c *AccountsAdclientsCustomchannelsListLinkedAdUnitsCall) Do(opts ...googleapi.CallOption) (*ListLinkedAdUnitsResponse, error) {
  3703  	gensupport.SetOptions(c.urlParams_, opts...)
  3704  	res, err := c.doRequest("json")
  3705  	if res != nil && res.StatusCode == http.StatusNotModified {
  3706  		if res.Body != nil {
  3707  			res.Body.Close()
  3708  		}
  3709  		return nil, gensupport.WrapError(&googleapi.Error{
  3710  			Code:   res.StatusCode,
  3711  			Header: res.Header,
  3712  		})
  3713  	}
  3714  	if err != nil {
  3715  		return nil, err
  3716  	}
  3717  	defer googleapi.CloseBody(res)
  3718  	if err := googleapi.CheckResponse(res); err != nil {
  3719  		return nil, gensupport.WrapError(err)
  3720  	}
  3721  	ret := &ListLinkedAdUnitsResponse{
  3722  		ServerResponse: googleapi.ServerResponse{
  3723  			Header:         res.Header,
  3724  			HTTPStatusCode: res.StatusCode,
  3725  		},
  3726  	}
  3727  	target := &ret
  3728  	if err := gensupport.DecodeResponse(target, res); err != nil {
  3729  		return nil, err
  3730  	}
  3731  	return ret, nil
  3732  }
  3733  
  3734  // Pages invokes f for each page of results.
  3735  // A non-nil error returned from f will halt the iteration.
  3736  // The provided context supersedes any context provided to the Context method.
  3737  func (c *AccountsAdclientsCustomchannelsListLinkedAdUnitsCall) Pages(ctx context.Context, f func(*ListLinkedAdUnitsResponse) error) error {
  3738  	c.ctx_ = ctx
  3739  	defer c.PageToken(c.urlParams_.Get("pageToken"))
  3740  	for {
  3741  		x, err := c.Do()
  3742  		if err != nil {
  3743  			return err
  3744  		}
  3745  		if err := f(x); err != nil {
  3746  			return err
  3747  		}
  3748  		if x.NextPageToken == "" {
  3749  			return nil
  3750  		}
  3751  		c.PageToken(x.NextPageToken)
  3752  	}
  3753  }
  3754  
  3755  type AccountsAdclientsCustomchannelsPatchCall struct {
  3756  	s             *Service
  3757  	name          string
  3758  	customchannel *CustomChannel
  3759  	urlParams_    gensupport.URLParams
  3760  	ctx_          context.Context
  3761  	header_       http.Header
  3762  }
  3763  
  3764  // Patch: Updates a custom channel. This method can be called only by a
  3765  // restricted set of projects, which are usually owned by AdSense for Platforms
  3766  // (https://developers.google.com/adsense/platforms/) publishers. Contact your
  3767  // account manager if you need to use this method.
  3768  //
  3769  //   - name: Output only. Resource name of the custom channel. Format:
  3770  //     accounts/{account}/adclients/{adclient}/customchannels/{customchannel}.
  3771  func (r *AccountsAdclientsCustomchannelsService) Patch(name string, customchannel *CustomChannel) *AccountsAdclientsCustomchannelsPatchCall {
  3772  	c := &AccountsAdclientsCustomchannelsPatchCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  3773  	c.name = name
  3774  	c.customchannel = customchannel
  3775  	return c
  3776  }
  3777  
  3778  // UpdateMask sets the optional parameter "updateMask": The list of fields to
  3779  // update. If empty, a full update is performed.
  3780  func (c *AccountsAdclientsCustomchannelsPatchCall) UpdateMask(updateMask string) *AccountsAdclientsCustomchannelsPatchCall {
  3781  	c.urlParams_.Set("updateMask", updateMask)
  3782  	return c
  3783  }
  3784  
  3785  // Fields allows partial responses to be retrieved. See
  3786  // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse for more
  3787  // details.
  3788  func (c *AccountsAdclientsCustomchannelsPatchCall) Fields(s ...googleapi.Field) *AccountsAdclientsCustomchannelsPatchCall {
  3789  	c.urlParams_.Set("fields", googleapi.CombineFields(s))
  3790  	return c
  3791  }
  3792  
  3793  // Context sets the context to be used in this call's Do method.
  3794  func (c *AccountsAdclientsCustomchannelsPatchCall) Context(ctx context.Context) *AccountsAdclientsCustomchannelsPatchCall {
  3795  	c.ctx_ = ctx
  3796  	return c
  3797  }
  3798  
  3799  // Header returns a http.Header that can be modified by the caller to add
  3800  // headers to the request.
  3801  func (c *AccountsAdclientsCustomchannelsPatchCall) Header() http.Header {
  3802  	if c.header_ == nil {
  3803  		c.header_ = make(http.Header)
  3804  	}
  3805  	return c.header_
  3806  }
  3807  
  3808  func (c *AccountsAdclientsCustomchannelsPatchCall) doRequest(alt string) (*http.Response, error) {
  3809  	reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_)
  3810  	var body io.Reader = nil
  3811  	body, err := googleapi.WithoutDataWrapper.JSONReader(c.customchannel)
  3812  	if err != nil {
  3813  		return nil, err
  3814  	}
  3815  	c.urlParams_.Set("alt", alt)
  3816  	c.urlParams_.Set("prettyPrint", "false")
  3817  	urls := googleapi.ResolveRelative(c.s.BasePath, "v2/{+name}")
  3818  	urls += "?" + c.urlParams_.Encode()
  3819  	req, err := http.NewRequest("PATCH", urls, body)
  3820  	if err != nil {
  3821  		return nil, err
  3822  	}
  3823  	req.Header = reqHeaders
  3824  	googleapi.Expand(req.URL, map[string]string{
  3825  		"name": c.name,
  3826  	})
  3827  	return gensupport.SendRequest(c.ctx_, c.s.client, req)
  3828  }
  3829  
  3830  // Do executes the "adsense.accounts.adclients.customchannels.patch" call.
  3831  // Any non-2xx status code is an error. Response headers are in either
  3832  // *CustomChannel.ServerResponse.Header or (if a response was returned at all)
  3833  // in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to check
  3834  // whether the returned error was because http.StatusNotModified was returned.
  3835  func (c *AccountsAdclientsCustomchannelsPatchCall) Do(opts ...googleapi.CallOption) (*CustomChannel, error) {
  3836  	gensupport.SetOptions(c.urlParams_, opts...)
  3837  	res, err := c.doRequest("json")
  3838  	if res != nil && res.StatusCode == http.StatusNotModified {
  3839  		if res.Body != nil {
  3840  			res.Body.Close()
  3841  		}
  3842  		return nil, gensupport.WrapError(&googleapi.Error{
  3843  			Code:   res.StatusCode,
  3844  			Header: res.Header,
  3845  		})
  3846  	}
  3847  	if err != nil {
  3848  		return nil, err
  3849  	}
  3850  	defer googleapi.CloseBody(res)
  3851  	if err := googleapi.CheckResponse(res); err != nil {
  3852  		return nil, gensupport.WrapError(err)
  3853  	}
  3854  	ret := &CustomChannel{
  3855  		ServerResponse: googleapi.ServerResponse{
  3856  			Header:         res.Header,
  3857  			HTTPStatusCode: res.StatusCode,
  3858  		},
  3859  	}
  3860  	target := &ret
  3861  	if err := gensupport.DecodeResponse(target, res); err != nil {
  3862  		return nil, err
  3863  	}
  3864  	return ret, nil
  3865  }
  3866  
  3867  type AccountsAdclientsUrlchannelsGetCall struct {
  3868  	s            *Service
  3869  	name         string
  3870  	urlParams_   gensupport.URLParams
  3871  	ifNoneMatch_ string
  3872  	ctx_         context.Context
  3873  	header_      http.Header
  3874  }
  3875  
  3876  // Get: Gets information about the selected url channel.
  3877  //
  3878  //   - name: The name of the url channel to retrieve. Format:
  3879  //     accounts/{account}/adclients/{adclient}/urlchannels/{urlchannel}.
  3880  func (r *AccountsAdclientsUrlchannelsService) Get(name string) *AccountsAdclientsUrlchannelsGetCall {
  3881  	c := &AccountsAdclientsUrlchannelsGetCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  3882  	c.name = name
  3883  	return c
  3884  }
  3885  
  3886  // Fields allows partial responses to be retrieved. See
  3887  // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse for more
  3888  // details.
  3889  func (c *AccountsAdclientsUrlchannelsGetCall) Fields(s ...googleapi.Field) *AccountsAdclientsUrlchannelsGetCall {
  3890  	c.urlParams_.Set("fields", googleapi.CombineFields(s))
  3891  	return c
  3892  }
  3893  
  3894  // IfNoneMatch sets an optional parameter which makes the operation fail if the
  3895  // object's ETag matches the given value. This is useful for getting updates
  3896  // only after the object has changed since the last request.
  3897  func (c *AccountsAdclientsUrlchannelsGetCall) IfNoneMatch(entityTag string) *AccountsAdclientsUrlchannelsGetCall {
  3898  	c.ifNoneMatch_ = entityTag
  3899  	return c
  3900  }
  3901  
  3902  // Context sets the context to be used in this call's Do method.
  3903  func (c *AccountsAdclientsUrlchannelsGetCall) Context(ctx context.Context) *AccountsAdclientsUrlchannelsGetCall {
  3904  	c.ctx_ = ctx
  3905  	return c
  3906  }
  3907  
  3908  // Header returns a http.Header that can be modified by the caller to add
  3909  // headers to the request.
  3910  func (c *AccountsAdclientsUrlchannelsGetCall) Header() http.Header {
  3911  	if c.header_ == nil {
  3912  		c.header_ = make(http.Header)
  3913  	}
  3914  	return c.header_
  3915  }
  3916  
  3917  func (c *AccountsAdclientsUrlchannelsGetCall) doRequest(alt string) (*http.Response, error) {
  3918  	reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_)
  3919  	if c.ifNoneMatch_ != "" {
  3920  		reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  3921  	}
  3922  	var body io.Reader = nil
  3923  	c.urlParams_.Set("alt", alt)
  3924  	c.urlParams_.Set("prettyPrint", "false")
  3925  	urls := googleapi.ResolveRelative(c.s.BasePath, "v2/{+name}")
  3926  	urls += "?" + c.urlParams_.Encode()
  3927  	req, err := http.NewRequest("GET", urls, body)
  3928  	if err != nil {
  3929  		return nil, err
  3930  	}
  3931  	req.Header = reqHeaders
  3932  	googleapi.Expand(req.URL, map[string]string{
  3933  		"name": c.name,
  3934  	})
  3935  	return gensupport.SendRequest(c.ctx_, c.s.client, req)
  3936  }
  3937  
  3938  // Do executes the "adsense.accounts.adclients.urlchannels.get" call.
  3939  // Any non-2xx status code is an error. Response headers are in either
  3940  // *UrlChannel.ServerResponse.Header or (if a response was returned at all) in
  3941  // error.(*googleapi.Error).Header. Use googleapi.IsNotModified to check
  3942  // whether the returned error was because http.StatusNotModified was returned.
  3943  func (c *AccountsAdclientsUrlchannelsGetCall) Do(opts ...googleapi.CallOption) (*UrlChannel, error) {
  3944  	gensupport.SetOptions(c.urlParams_, opts...)
  3945  	res, err := c.doRequest("json")
  3946  	if res != nil && res.StatusCode == http.StatusNotModified {
  3947  		if res.Body != nil {
  3948  			res.Body.Close()
  3949  		}
  3950  		return nil, gensupport.WrapError(&googleapi.Error{
  3951  			Code:   res.StatusCode,
  3952  			Header: res.Header,
  3953  		})
  3954  	}
  3955  	if err != nil {
  3956  		return nil, err
  3957  	}
  3958  	defer googleapi.CloseBody(res)
  3959  	if err := googleapi.CheckResponse(res); err != nil {
  3960  		return nil, gensupport.WrapError(err)
  3961  	}
  3962  	ret := &UrlChannel{
  3963  		ServerResponse: googleapi.ServerResponse{
  3964  			Header:         res.Header,
  3965  			HTTPStatusCode: res.StatusCode,
  3966  		},
  3967  	}
  3968  	target := &ret
  3969  	if err := gensupport.DecodeResponse(target, res); err != nil {
  3970  		return nil, err
  3971  	}
  3972  	return ret, nil
  3973  }
  3974  
  3975  type AccountsAdclientsUrlchannelsListCall struct {
  3976  	s            *Service
  3977  	parent       string
  3978  	urlParams_   gensupport.URLParams
  3979  	ifNoneMatch_ string
  3980  	ctx_         context.Context
  3981  	header_      http.Header
  3982  }
  3983  
  3984  // List: Lists active url channels.
  3985  //
  3986  //   - parent: The ad client which owns the collection of url channels. Format:
  3987  //     accounts/{account}/adclients/{adclient}.
  3988  func (r *AccountsAdclientsUrlchannelsService) List(parent string) *AccountsAdclientsUrlchannelsListCall {
  3989  	c := &AccountsAdclientsUrlchannelsListCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  3990  	c.parent = parent
  3991  	return c
  3992  }
  3993  
  3994  // PageSize sets the optional parameter "pageSize": The maximum number of url
  3995  // channels to include in the response, used for paging. If unspecified, at
  3996  // most 10000 url channels will be returned. The maximum value is 10000; values
  3997  // above 10000 will be coerced to 10000.
  3998  func (c *AccountsAdclientsUrlchannelsListCall) PageSize(pageSize int64) *AccountsAdclientsUrlchannelsListCall {
  3999  	c.urlParams_.Set("pageSize", fmt.Sprint(pageSize))
  4000  	return c
  4001  }
  4002  
  4003  // PageToken sets the optional parameter "pageToken": A page token, received
  4004  // from a previous `ListUrlChannels` call. Provide this to retrieve the
  4005  // subsequent page. When paginating, all other parameters provided to
  4006  // `ListUrlChannels` must match the call that provided the page token.
  4007  func (c *AccountsAdclientsUrlchannelsListCall) PageToken(pageToken string) *AccountsAdclientsUrlchannelsListCall {
  4008  	c.urlParams_.Set("pageToken", pageToken)
  4009  	return c
  4010  }
  4011  
  4012  // Fields allows partial responses to be retrieved. See
  4013  // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse for more
  4014  // details.
  4015  func (c *AccountsAdclientsUrlchannelsListCall) Fields(s ...googleapi.Field) *AccountsAdclientsUrlchannelsListCall {
  4016  	c.urlParams_.Set("fields", googleapi.CombineFields(s))
  4017  	return c
  4018  }
  4019  
  4020  // IfNoneMatch sets an optional parameter which makes the operation fail if the
  4021  // object's ETag matches the given value. This is useful for getting updates
  4022  // only after the object has changed since the last request.
  4023  func (c *AccountsAdclientsUrlchannelsListCall) IfNoneMatch(entityTag string) *AccountsAdclientsUrlchannelsListCall {
  4024  	c.ifNoneMatch_ = entityTag
  4025  	return c
  4026  }
  4027  
  4028  // Context sets the context to be used in this call's Do method.
  4029  func (c *AccountsAdclientsUrlchannelsListCall) Context(ctx context.Context) *AccountsAdclientsUrlchannelsListCall {
  4030  	c.ctx_ = ctx
  4031  	return c
  4032  }
  4033  
  4034  // Header returns a http.Header that can be modified by the caller to add
  4035  // headers to the request.
  4036  func (c *AccountsAdclientsUrlchannelsListCall) Header() http.Header {
  4037  	if c.header_ == nil {
  4038  		c.header_ = make(http.Header)
  4039  	}
  4040  	return c.header_
  4041  }
  4042  
  4043  func (c *AccountsAdclientsUrlchannelsListCall) doRequest(alt string) (*http.Response, error) {
  4044  	reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_)
  4045  	if c.ifNoneMatch_ != "" {
  4046  		reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  4047  	}
  4048  	var body io.Reader = nil
  4049  	c.urlParams_.Set("alt", alt)
  4050  	c.urlParams_.Set("prettyPrint", "false")
  4051  	urls := googleapi.ResolveRelative(c.s.BasePath, "v2/{+parent}/urlchannels")
  4052  	urls += "?" + c.urlParams_.Encode()
  4053  	req, err := http.NewRequest("GET", urls, body)
  4054  	if err != nil {
  4055  		return nil, err
  4056  	}
  4057  	req.Header = reqHeaders
  4058  	googleapi.Expand(req.URL, map[string]string{
  4059  		"parent": c.parent,
  4060  	})
  4061  	return gensupport.SendRequest(c.ctx_, c.s.client, req)
  4062  }
  4063  
  4064  // Do executes the "adsense.accounts.adclients.urlchannels.list" call.
  4065  // Any non-2xx status code is an error. Response headers are in either
  4066  // *ListUrlChannelsResponse.ServerResponse.Header or (if a response was
  4067  // returned at all) in error.(*googleapi.Error).Header. Use
  4068  // googleapi.IsNotModified to check whether the returned error was because
  4069  // http.StatusNotModified was returned.
  4070  func (c *AccountsAdclientsUrlchannelsListCall) Do(opts ...googleapi.CallOption) (*ListUrlChannelsResponse, error) {
  4071  	gensupport.SetOptions(c.urlParams_, opts...)
  4072  	res, err := c.doRequest("json")
  4073  	if res != nil && res.StatusCode == http.StatusNotModified {
  4074  		if res.Body != nil {
  4075  			res.Body.Close()
  4076  		}
  4077  		return nil, gensupport.WrapError(&googleapi.Error{
  4078  			Code:   res.StatusCode,
  4079  			Header: res.Header,
  4080  		})
  4081  	}
  4082  	if err != nil {
  4083  		return nil, err
  4084  	}
  4085  	defer googleapi.CloseBody(res)
  4086  	if err := googleapi.CheckResponse(res); err != nil {
  4087  		return nil, gensupport.WrapError(err)
  4088  	}
  4089  	ret := &ListUrlChannelsResponse{
  4090  		ServerResponse: googleapi.ServerResponse{
  4091  			Header:         res.Header,
  4092  			HTTPStatusCode: res.StatusCode,
  4093  		},
  4094  	}
  4095  	target := &ret
  4096  	if err := gensupport.DecodeResponse(target, res); err != nil {
  4097  		return nil, err
  4098  	}
  4099  	return ret, nil
  4100  }
  4101  
  4102  // Pages invokes f for each page of results.
  4103  // A non-nil error returned from f will halt the iteration.
  4104  // The provided context supersedes any context provided to the Context method.
  4105  func (c *AccountsAdclientsUrlchannelsListCall) Pages(ctx context.Context, f func(*ListUrlChannelsResponse) error) error {
  4106  	c.ctx_ = ctx
  4107  	defer c.PageToken(c.urlParams_.Get("pageToken"))
  4108  	for {
  4109  		x, err := c.Do()
  4110  		if err != nil {
  4111  			return err
  4112  		}
  4113  		if err := f(x); err != nil {
  4114  			return err
  4115  		}
  4116  		if x.NextPageToken == "" {
  4117  			return nil
  4118  		}
  4119  		c.PageToken(x.NextPageToken)
  4120  	}
  4121  }
  4122  
  4123  type AccountsAlertsListCall struct {
  4124  	s            *Service
  4125  	parent       string
  4126  	urlParams_   gensupport.URLParams
  4127  	ifNoneMatch_ string
  4128  	ctx_         context.Context
  4129  	header_      http.Header
  4130  }
  4131  
  4132  // List: Lists all the alerts available in an account.
  4133  //
  4134  //   - parent: The account which owns the collection of alerts. Format:
  4135  //     accounts/{account}.
  4136  func (r *AccountsAlertsService) List(parent string) *AccountsAlertsListCall {
  4137  	c := &AccountsAlertsListCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  4138  	c.parent = parent
  4139  	return c
  4140  }
  4141  
  4142  // LanguageCode sets the optional parameter "languageCode": The language to use
  4143  // for translating alert messages. If unspecified, this defaults to the user's
  4144  // display language. If the given language is not supported, alerts will be
  4145  // returned in English. The language is specified as an IETF BCP-47 language
  4146  // code (https://en.wikipedia.org/wiki/IETF_language_tag).
  4147  func (c *AccountsAlertsListCall) LanguageCode(languageCode string) *AccountsAlertsListCall {
  4148  	c.urlParams_.Set("languageCode", languageCode)
  4149  	return c
  4150  }
  4151  
  4152  // Fields allows partial responses to be retrieved. See
  4153  // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse for more
  4154  // details.
  4155  func (c *AccountsAlertsListCall) Fields(s ...googleapi.Field) *AccountsAlertsListCall {
  4156  	c.urlParams_.Set("fields", googleapi.CombineFields(s))
  4157  	return c
  4158  }
  4159  
  4160  // IfNoneMatch sets an optional parameter which makes the operation fail if the
  4161  // object's ETag matches the given value. This is useful for getting updates
  4162  // only after the object has changed since the last request.
  4163  func (c *AccountsAlertsListCall) IfNoneMatch(entityTag string) *AccountsAlertsListCall {
  4164  	c.ifNoneMatch_ = entityTag
  4165  	return c
  4166  }
  4167  
  4168  // Context sets the context to be used in this call's Do method.
  4169  func (c *AccountsAlertsListCall) Context(ctx context.Context) *AccountsAlertsListCall {
  4170  	c.ctx_ = ctx
  4171  	return c
  4172  }
  4173  
  4174  // Header returns a http.Header that can be modified by the caller to add
  4175  // headers to the request.
  4176  func (c *AccountsAlertsListCall) Header() http.Header {
  4177  	if c.header_ == nil {
  4178  		c.header_ = make(http.Header)
  4179  	}
  4180  	return c.header_
  4181  }
  4182  
  4183  func (c *AccountsAlertsListCall) doRequest(alt string) (*http.Response, error) {
  4184  	reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_)
  4185  	if c.ifNoneMatch_ != "" {
  4186  		reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  4187  	}
  4188  	var body io.Reader = nil
  4189  	c.urlParams_.Set("alt", alt)
  4190  	c.urlParams_.Set("prettyPrint", "false")
  4191  	urls := googleapi.ResolveRelative(c.s.BasePath, "v2/{+parent}/alerts")
  4192  	urls += "?" + c.urlParams_.Encode()
  4193  	req, err := http.NewRequest("GET", urls, body)
  4194  	if err != nil {
  4195  		return nil, err
  4196  	}
  4197  	req.Header = reqHeaders
  4198  	googleapi.Expand(req.URL, map[string]string{
  4199  		"parent": c.parent,
  4200  	})
  4201  	return gensupport.SendRequest(c.ctx_, c.s.client, req)
  4202  }
  4203  
  4204  // Do executes the "adsense.accounts.alerts.list" call.
  4205  // Any non-2xx status code is an error. Response headers are in either
  4206  // *ListAlertsResponse.ServerResponse.Header or (if a response was returned at
  4207  // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to
  4208  // check whether the returned error was because http.StatusNotModified was
  4209  // returned.
  4210  func (c *AccountsAlertsListCall) Do(opts ...googleapi.CallOption) (*ListAlertsResponse, error) {
  4211  	gensupport.SetOptions(c.urlParams_, opts...)
  4212  	res, err := c.doRequest("json")
  4213  	if res != nil && res.StatusCode == http.StatusNotModified {
  4214  		if res.Body != nil {
  4215  			res.Body.Close()
  4216  		}
  4217  		return nil, gensupport.WrapError(&googleapi.Error{
  4218  			Code:   res.StatusCode,
  4219  			Header: res.Header,
  4220  		})
  4221  	}
  4222  	if err != nil {
  4223  		return nil, err
  4224  	}
  4225  	defer googleapi.CloseBody(res)
  4226  	if err := googleapi.CheckResponse(res); err != nil {
  4227  		return nil, gensupport.WrapError(err)
  4228  	}
  4229  	ret := &ListAlertsResponse{
  4230  		ServerResponse: googleapi.ServerResponse{
  4231  			Header:         res.Header,
  4232  			HTTPStatusCode: res.StatusCode,
  4233  		},
  4234  	}
  4235  	target := &ret
  4236  	if err := gensupport.DecodeResponse(target, res); err != nil {
  4237  		return nil, err
  4238  	}
  4239  	return ret, nil
  4240  }
  4241  
  4242  type AccountsPaymentsListCall struct {
  4243  	s            *Service
  4244  	parent       string
  4245  	urlParams_   gensupport.URLParams
  4246  	ifNoneMatch_ string
  4247  	ctx_         context.Context
  4248  	header_      http.Header
  4249  }
  4250  
  4251  // List: Lists all the payments available for an account.
  4252  //
  4253  //   - parent: The account which owns the collection of payments. Format:
  4254  //     accounts/{account}.
  4255  func (r *AccountsPaymentsService) List(parent string) *AccountsPaymentsListCall {
  4256  	c := &AccountsPaymentsListCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  4257  	c.parent = parent
  4258  	return c
  4259  }
  4260  
  4261  // Fields allows partial responses to be retrieved. See
  4262  // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse for more
  4263  // details.
  4264  func (c *AccountsPaymentsListCall) Fields(s ...googleapi.Field) *AccountsPaymentsListCall {
  4265  	c.urlParams_.Set("fields", googleapi.CombineFields(s))
  4266  	return c
  4267  }
  4268  
  4269  // IfNoneMatch sets an optional parameter which makes the operation fail if the
  4270  // object's ETag matches the given value. This is useful for getting updates
  4271  // only after the object has changed since the last request.
  4272  func (c *AccountsPaymentsListCall) IfNoneMatch(entityTag string) *AccountsPaymentsListCall {
  4273  	c.ifNoneMatch_ = entityTag
  4274  	return c
  4275  }
  4276  
  4277  // Context sets the context to be used in this call's Do method.
  4278  func (c *AccountsPaymentsListCall) Context(ctx context.Context) *AccountsPaymentsListCall {
  4279  	c.ctx_ = ctx
  4280  	return c
  4281  }
  4282  
  4283  // Header returns a http.Header that can be modified by the caller to add
  4284  // headers to the request.
  4285  func (c *AccountsPaymentsListCall) Header() http.Header {
  4286  	if c.header_ == nil {
  4287  		c.header_ = make(http.Header)
  4288  	}
  4289  	return c.header_
  4290  }
  4291  
  4292  func (c *AccountsPaymentsListCall) doRequest(alt string) (*http.Response, error) {
  4293  	reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_)
  4294  	if c.ifNoneMatch_ != "" {
  4295  		reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  4296  	}
  4297  	var body io.Reader = nil
  4298  	c.urlParams_.Set("alt", alt)
  4299  	c.urlParams_.Set("prettyPrint", "false")
  4300  	urls := googleapi.ResolveRelative(c.s.BasePath, "v2/{+parent}/payments")
  4301  	urls += "?" + c.urlParams_.Encode()
  4302  	req, err := http.NewRequest("GET", urls, body)
  4303  	if err != nil {
  4304  		return nil, err
  4305  	}
  4306  	req.Header = reqHeaders
  4307  	googleapi.Expand(req.URL, map[string]string{
  4308  		"parent": c.parent,
  4309  	})
  4310  	return gensupport.SendRequest(c.ctx_, c.s.client, req)
  4311  }
  4312  
  4313  // Do executes the "adsense.accounts.payments.list" call.
  4314  // Any non-2xx status code is an error. Response headers are in either
  4315  // *ListPaymentsResponse.ServerResponse.Header or (if a response was returned
  4316  // at all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to
  4317  // check whether the returned error was because http.StatusNotModified was
  4318  // returned.
  4319  func (c *AccountsPaymentsListCall) Do(opts ...googleapi.CallOption) (*ListPaymentsResponse, error) {
  4320  	gensupport.SetOptions(c.urlParams_, opts...)
  4321  	res, err := c.doRequest("json")
  4322  	if res != nil && res.StatusCode == http.StatusNotModified {
  4323  		if res.Body != nil {
  4324  			res.Body.Close()
  4325  		}
  4326  		return nil, gensupport.WrapError(&googleapi.Error{
  4327  			Code:   res.StatusCode,
  4328  			Header: res.Header,
  4329  		})
  4330  	}
  4331  	if err != nil {
  4332  		return nil, err
  4333  	}
  4334  	defer googleapi.CloseBody(res)
  4335  	if err := googleapi.CheckResponse(res); err != nil {
  4336  		return nil, gensupport.WrapError(err)
  4337  	}
  4338  	ret := &ListPaymentsResponse{
  4339  		ServerResponse: googleapi.ServerResponse{
  4340  			Header:         res.Header,
  4341  			HTTPStatusCode: res.StatusCode,
  4342  		},
  4343  	}
  4344  	target := &ret
  4345  	if err := gensupport.DecodeResponse(target, res); err != nil {
  4346  		return nil, err
  4347  	}
  4348  	return ret, nil
  4349  }
  4350  
  4351  type AccountsPolicyIssuesGetCall struct {
  4352  	s            *Service
  4353  	name         string
  4354  	urlParams_   gensupport.URLParams
  4355  	ifNoneMatch_ string
  4356  	ctx_         context.Context
  4357  	header_      http.Header
  4358  }
  4359  
  4360  // Get: Gets information about the selected policy issue.
  4361  //
  4362  //   - name: Name of the policy issue. Format:
  4363  //     accounts/{account}/policyIssues/{policy_issue}.
  4364  func (r *AccountsPolicyIssuesService) Get(name string) *AccountsPolicyIssuesGetCall {
  4365  	c := &AccountsPolicyIssuesGetCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  4366  	c.name = name
  4367  	return c
  4368  }
  4369  
  4370  // Fields allows partial responses to be retrieved. See
  4371  // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse for more
  4372  // details.
  4373  func (c *AccountsPolicyIssuesGetCall) Fields(s ...googleapi.Field) *AccountsPolicyIssuesGetCall {
  4374  	c.urlParams_.Set("fields", googleapi.CombineFields(s))
  4375  	return c
  4376  }
  4377  
  4378  // IfNoneMatch sets an optional parameter which makes the operation fail if the
  4379  // object's ETag matches the given value. This is useful for getting updates
  4380  // only after the object has changed since the last request.
  4381  func (c *AccountsPolicyIssuesGetCall) IfNoneMatch(entityTag string) *AccountsPolicyIssuesGetCall {
  4382  	c.ifNoneMatch_ = entityTag
  4383  	return c
  4384  }
  4385  
  4386  // Context sets the context to be used in this call's Do method.
  4387  func (c *AccountsPolicyIssuesGetCall) Context(ctx context.Context) *AccountsPolicyIssuesGetCall {
  4388  	c.ctx_ = ctx
  4389  	return c
  4390  }
  4391  
  4392  // Header returns a http.Header that can be modified by the caller to add
  4393  // headers to the request.
  4394  func (c *AccountsPolicyIssuesGetCall) Header() http.Header {
  4395  	if c.header_ == nil {
  4396  		c.header_ = make(http.Header)
  4397  	}
  4398  	return c.header_
  4399  }
  4400  
  4401  func (c *AccountsPolicyIssuesGetCall) doRequest(alt string) (*http.Response, error) {
  4402  	reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_)
  4403  	if c.ifNoneMatch_ != "" {
  4404  		reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  4405  	}
  4406  	var body io.Reader = nil
  4407  	c.urlParams_.Set("alt", alt)
  4408  	c.urlParams_.Set("prettyPrint", "false")
  4409  	urls := googleapi.ResolveRelative(c.s.BasePath, "v2/{+name}")
  4410  	urls += "?" + c.urlParams_.Encode()
  4411  	req, err := http.NewRequest("GET", urls, body)
  4412  	if err != nil {
  4413  		return nil, err
  4414  	}
  4415  	req.Header = reqHeaders
  4416  	googleapi.Expand(req.URL, map[string]string{
  4417  		"name": c.name,
  4418  	})
  4419  	return gensupport.SendRequest(c.ctx_, c.s.client, req)
  4420  }
  4421  
  4422  // Do executes the "adsense.accounts.policyIssues.get" call.
  4423  // Any non-2xx status code is an error. Response headers are in either
  4424  // *PolicyIssue.ServerResponse.Header or (if a response was returned at all) in
  4425  // error.(*googleapi.Error).Header. Use googleapi.IsNotModified to check
  4426  // whether the returned error was because http.StatusNotModified was returned.
  4427  func (c *AccountsPolicyIssuesGetCall) Do(opts ...googleapi.CallOption) (*PolicyIssue, error) {
  4428  	gensupport.SetOptions(c.urlParams_, opts...)
  4429  	res, err := c.doRequest("json")
  4430  	if res != nil && res.StatusCode == http.StatusNotModified {
  4431  		if res.Body != nil {
  4432  			res.Body.Close()
  4433  		}
  4434  		return nil, gensupport.WrapError(&googleapi.Error{
  4435  			Code:   res.StatusCode,
  4436  			Header: res.Header,
  4437  		})
  4438  	}
  4439  	if err != nil {
  4440  		return nil, err
  4441  	}
  4442  	defer googleapi.CloseBody(res)
  4443  	if err := googleapi.CheckResponse(res); err != nil {
  4444  		return nil, gensupport.WrapError(err)
  4445  	}
  4446  	ret := &PolicyIssue{
  4447  		ServerResponse: googleapi.ServerResponse{
  4448  			Header:         res.Header,
  4449  			HTTPStatusCode: res.StatusCode,
  4450  		},
  4451  	}
  4452  	target := &ret
  4453  	if err := gensupport.DecodeResponse(target, res); err != nil {
  4454  		return nil, err
  4455  	}
  4456  	return ret, nil
  4457  }
  4458  
  4459  type AccountsPolicyIssuesListCall struct {
  4460  	s            *Service
  4461  	parent       string
  4462  	urlParams_   gensupport.URLParams
  4463  	ifNoneMatch_ string
  4464  	ctx_         context.Context
  4465  	header_      http.Header
  4466  }
  4467  
  4468  // List: Lists all the policy issues where the specified account is involved,
  4469  // both directly and through any AFP child accounts.
  4470  //
  4471  //   - parent: The account for which policy issues are being retrieved. Format:
  4472  //     accounts/{account}.
  4473  func (r *AccountsPolicyIssuesService) List(parent string) *AccountsPolicyIssuesListCall {
  4474  	c := &AccountsPolicyIssuesListCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  4475  	c.parent = parent
  4476  	return c
  4477  }
  4478  
  4479  // PageSize sets the optional parameter "pageSize": The maximum number of
  4480  // policy issues to include in the response, used for paging. If unspecified,
  4481  // at most 10000 policy issues will be returned. The maximum value is 10000;
  4482  // values above 10000 will be coerced to 10000.
  4483  func (c *AccountsPolicyIssuesListCall) PageSize(pageSize int64) *AccountsPolicyIssuesListCall {
  4484  	c.urlParams_.Set("pageSize", fmt.Sprint(pageSize))
  4485  	return c
  4486  }
  4487  
  4488  // PageToken sets the optional parameter "pageToken": A page token, received
  4489  // from a previous `ListPolicyIssues` call. Provide this to retrieve the
  4490  // subsequent page. When paginating, all other parameters provided to
  4491  // `ListPolicyIssues` must match the call that provided the page token.
  4492  func (c *AccountsPolicyIssuesListCall) PageToken(pageToken string) *AccountsPolicyIssuesListCall {
  4493  	c.urlParams_.Set("pageToken", pageToken)
  4494  	return c
  4495  }
  4496  
  4497  // Fields allows partial responses to be retrieved. See
  4498  // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse for more
  4499  // details.
  4500  func (c *AccountsPolicyIssuesListCall) Fields(s ...googleapi.Field) *AccountsPolicyIssuesListCall {
  4501  	c.urlParams_.Set("fields", googleapi.CombineFields(s))
  4502  	return c
  4503  }
  4504  
  4505  // IfNoneMatch sets an optional parameter which makes the operation fail if the
  4506  // object's ETag matches the given value. This is useful for getting updates
  4507  // only after the object has changed since the last request.
  4508  func (c *AccountsPolicyIssuesListCall) IfNoneMatch(entityTag string) *AccountsPolicyIssuesListCall {
  4509  	c.ifNoneMatch_ = entityTag
  4510  	return c
  4511  }
  4512  
  4513  // Context sets the context to be used in this call's Do method.
  4514  func (c *AccountsPolicyIssuesListCall) Context(ctx context.Context) *AccountsPolicyIssuesListCall {
  4515  	c.ctx_ = ctx
  4516  	return c
  4517  }
  4518  
  4519  // Header returns a http.Header that can be modified by the caller to add
  4520  // headers to the request.
  4521  func (c *AccountsPolicyIssuesListCall) Header() http.Header {
  4522  	if c.header_ == nil {
  4523  		c.header_ = make(http.Header)
  4524  	}
  4525  	return c.header_
  4526  }
  4527  
  4528  func (c *AccountsPolicyIssuesListCall) doRequest(alt string) (*http.Response, error) {
  4529  	reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_)
  4530  	if c.ifNoneMatch_ != "" {
  4531  		reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  4532  	}
  4533  	var body io.Reader = nil
  4534  	c.urlParams_.Set("alt", alt)
  4535  	c.urlParams_.Set("prettyPrint", "false")
  4536  	urls := googleapi.ResolveRelative(c.s.BasePath, "v2/{+parent}/policyIssues")
  4537  	urls += "?" + c.urlParams_.Encode()
  4538  	req, err := http.NewRequest("GET", urls, body)
  4539  	if err != nil {
  4540  		return nil, err
  4541  	}
  4542  	req.Header = reqHeaders
  4543  	googleapi.Expand(req.URL, map[string]string{
  4544  		"parent": c.parent,
  4545  	})
  4546  	return gensupport.SendRequest(c.ctx_, c.s.client, req)
  4547  }
  4548  
  4549  // Do executes the "adsense.accounts.policyIssues.list" call.
  4550  // Any non-2xx status code is an error. Response headers are in either
  4551  // *ListPolicyIssuesResponse.ServerResponse.Header or (if a response was
  4552  // returned at all) in error.(*googleapi.Error).Header. Use
  4553  // googleapi.IsNotModified to check whether the returned error was because
  4554  // http.StatusNotModified was returned.
  4555  func (c *AccountsPolicyIssuesListCall) Do(opts ...googleapi.CallOption) (*ListPolicyIssuesResponse, error) {
  4556  	gensupport.SetOptions(c.urlParams_, opts...)
  4557  	res, err := c.doRequest("json")
  4558  	if res != nil && res.StatusCode == http.StatusNotModified {
  4559  		if res.Body != nil {
  4560  			res.Body.Close()
  4561  		}
  4562  		return nil, gensupport.WrapError(&googleapi.Error{
  4563  			Code:   res.StatusCode,
  4564  			Header: res.Header,
  4565  		})
  4566  	}
  4567  	if err != nil {
  4568  		return nil, err
  4569  	}
  4570  	defer googleapi.CloseBody(res)
  4571  	if err := googleapi.CheckResponse(res); err != nil {
  4572  		return nil, gensupport.WrapError(err)
  4573  	}
  4574  	ret := &ListPolicyIssuesResponse{
  4575  		ServerResponse: googleapi.ServerResponse{
  4576  			Header:         res.Header,
  4577  			HTTPStatusCode: res.StatusCode,
  4578  		},
  4579  	}
  4580  	target := &ret
  4581  	if err := gensupport.DecodeResponse(target, res); err != nil {
  4582  		return nil, err
  4583  	}
  4584  	return ret, nil
  4585  }
  4586  
  4587  // Pages invokes f for each page of results.
  4588  // A non-nil error returned from f will halt the iteration.
  4589  // The provided context supersedes any context provided to the Context method.
  4590  func (c *AccountsPolicyIssuesListCall) Pages(ctx context.Context, f func(*ListPolicyIssuesResponse) error) error {
  4591  	c.ctx_ = ctx
  4592  	defer c.PageToken(c.urlParams_.Get("pageToken"))
  4593  	for {
  4594  		x, err := c.Do()
  4595  		if err != nil {
  4596  			return err
  4597  		}
  4598  		if err := f(x); err != nil {
  4599  			return err
  4600  		}
  4601  		if x.NextPageToken == "" {
  4602  			return nil
  4603  		}
  4604  		c.PageToken(x.NextPageToken)
  4605  	}
  4606  }
  4607  
  4608  type AccountsReportsGenerateCall struct {
  4609  	s            *Service
  4610  	account      string
  4611  	urlParams_   gensupport.URLParams
  4612  	ifNoneMatch_ string
  4613  	ctx_         context.Context
  4614  	header_      http.Header
  4615  }
  4616  
  4617  // Generate: Generates an ad hoc report.
  4618  //
  4619  //   - account: The account which owns the collection of reports. Format:
  4620  //     accounts/{account}.
  4621  func (r *AccountsReportsService) Generate(account string) *AccountsReportsGenerateCall {
  4622  	c := &AccountsReportsGenerateCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  4623  	c.account = account
  4624  	return c
  4625  }
  4626  
  4627  // CurrencyCode sets the optional parameter "currencyCode": The ISO-4217
  4628  // currency code (https://en.wikipedia.org/wiki/ISO_4217) to use when reporting
  4629  // on monetary metrics. Defaults to the account's currency if not set.
  4630  func (c *AccountsReportsGenerateCall) CurrencyCode(currencyCode string) *AccountsReportsGenerateCall {
  4631  	c.urlParams_.Set("currencyCode", currencyCode)
  4632  	return c
  4633  }
  4634  
  4635  // DateRange sets the optional parameter "dateRange": Date range of the report,
  4636  // if unset the range will be considered CUSTOM.
  4637  //
  4638  // Possible values:
  4639  //
  4640  //	"REPORTING_DATE_RANGE_UNSPECIFIED" - Unspecified date range.
  4641  //	"CUSTOM" - A custom date range specified using the `start_date` and
  4642  //
  4643  // `end_date` fields. This is the default if no ReportingDateRange is provided.
  4644  //
  4645  //	"TODAY" - Current day.
  4646  //	"YESTERDAY" - Yesterday.
  4647  //	"MONTH_TO_DATE" - From the start of the current month to the current day.
  4648  //
  4649  // e.g. if the current date is 2020-03-12 then the range will be [2020-03-01,
  4650  // 2020-03-12].
  4651  //
  4652  //	"YEAR_TO_DATE" - From the start of the current year to the current day.
  4653  //
  4654  // e.g. if the current date is 2020-03-12 then the range will be [2020-01-01,
  4655  // 2020-03-12].
  4656  //
  4657  //	"LAST_7_DAYS" - Last 7 days, excluding current day.
  4658  //	"LAST_30_DAYS" - Last 30 days, excluding current day.
  4659  func (c *AccountsReportsGenerateCall) DateRange(dateRange string) *AccountsReportsGenerateCall {
  4660  	c.urlParams_.Set("dateRange", dateRange)
  4661  	return c
  4662  }
  4663  
  4664  // Dimensions sets the optional parameter "dimensions": Dimensions to base the
  4665  // report on.
  4666  //
  4667  // Possible values:
  4668  //
  4669  //	"DIMENSION_UNSPECIFIED" - Unspecified dimension.
  4670  //	"DATE" - Date dimension in YYYY-MM-DD format (e.g. "2010-02-10").
  4671  //	"WEEK" - Week dimension in YYYY-MM-DD format, representing the first day
  4672  //
  4673  // of each week (e.g. "2010-02-08"). The first day of the week is determined by
  4674  // the language_code specified in a report generation request (so e.g. this
  4675  // would be a Monday for "en-GB" or "es", but a Sunday for "en" or "fr-CA").
  4676  //
  4677  //	"MONTH" - Month dimension in YYYY-MM format (e.g. "2010-02").
  4678  //	"ACCOUNT_NAME" - Account name. The members of this dimension match the
  4679  //
  4680  // values from Account.display_name.
  4681  //
  4682  //	"AD_CLIENT_ID" - Unique ID of an ad client. The members of this dimension
  4683  //
  4684  // match the values from AdClient.reporting_dimension_id.
  4685  //
  4686  //	"HOSTED_AD_CLIENT_ID" - Unique ID of a sub-account's ad client. The
  4687  //
  4688  // members of this dimension match the values from
  4689  // AdClient.reporting_dimension_id (for the sub-account).
  4690  //
  4691  //	"PRODUCT_NAME" - Localized product name (e.g. "AdSense for Content",
  4692  //
  4693  // "AdSense for Search").
  4694  //
  4695  //	"PRODUCT_CODE" - Product code (e.g. "AFC", "AFS"). The members of this
  4696  //
  4697  // dimension match the values from AdClient.product_code.
  4698  //
  4699  //	"AD_UNIT_NAME" - Ad unit name (within which an ad was served). The members
  4700  //
  4701  // of this dimension match the values from AdUnit.display_name.
  4702  //
  4703  //	"AD_UNIT_ID" - Unique ID of an ad unit (within which an ad was served).
  4704  //
  4705  // The members of this dimension match the values from
  4706  // AdUnit.reporting_dimension_id.
  4707  //
  4708  //	"AD_UNIT_SIZE_NAME" - Localized size of an ad unit (e.g. "728x90",
  4709  //
  4710  // "Responsive").
  4711  //
  4712  //	"AD_UNIT_SIZE_CODE" - The size code of an ad unit (e.g. "728x90",
  4713  //
  4714  // "responsive").
  4715  //
  4716  //	"CUSTOM_CHANNEL_NAME" - Custom channel name. The members of this dimension
  4717  //
  4718  // match the values from CustomChannel.display_name.
  4719  //
  4720  //	"CUSTOM_CHANNEL_ID" - Unique ID of a custom channel. The members of this
  4721  //
  4722  // dimension match the values from CustomChannel.reporting_dimension_id.
  4723  //
  4724  //	"OWNED_SITE_DOMAIN_NAME" - Domain name of a verified site (e.g.
  4725  //
  4726  // "example.com"). The members of this dimension match the values from
  4727  // Site.domain.
  4728  //
  4729  //	"OWNED_SITE_ID" - Unique ID of a verified site. The members of this
  4730  //
  4731  // dimension match the values from Site.reporting_dimension_id.
  4732  //
  4733  //	"PAGE_URL" - URL of the page upon which the ad was served. This is a
  4734  //
  4735  // complete URL including scheme and query parameters. Note that the URL that
  4736  // appears in this dimension may be a canonicalized version of the one that was
  4737  // used in the original request, and so may not exactly match the URL that a
  4738  // user might have seen. Note that there are also some caveats to be aware of
  4739  // when using this dimension. For more information, see [Page URL
  4740  // breakdown](https://support.google.com/adsense/answer/11988478).
  4741  //
  4742  //	"URL_CHANNEL_NAME" - Name of a URL channel. The members of this dimension
  4743  //
  4744  // match the values from UrlChannel.uri_pattern.
  4745  //
  4746  //	"URL_CHANNEL_ID" - Unique ID of a URL channel. The members of this
  4747  //
  4748  // dimension match the values from UrlChannel.reporting_dimension_id.
  4749  //
  4750  //	"BUYER_NETWORK_NAME" - Name of an ad network that returned the winning ads
  4751  //
  4752  // for an ad request (e.g. "Google AdWords"). Note that unlike other "NAME"
  4753  // dimensions, the members of this dimensions are not localized.
  4754  //
  4755  //	"BUYER_NETWORK_ID" - Unique (opaque) ID of an ad network that returned the
  4756  //
  4757  // winning ads for an ad request.
  4758  //
  4759  //	"BID_TYPE_NAME" - Localized bid type name (e.g. "CPC bids", "CPM bids")
  4760  //
  4761  // for a served ad.
  4762  //
  4763  //	"BID_TYPE_CODE" - Type of a bid (e.g. "cpc", "cpm") for a served ad.
  4764  //	"CREATIVE_SIZE_NAME" - Localized creative size name (e.g. "728x90",
  4765  //
  4766  // "Dynamic") of a served ad.
  4767  //
  4768  //	"CREATIVE_SIZE_CODE" - Creative size code (e.g. "728x90", "dynamic") of a
  4769  //
  4770  // served ad.
  4771  //
  4772  //	"DOMAIN_NAME" - Localized name of a host on which an ad was served, after
  4773  //
  4774  // IDNA decoding (e.g. "www.google.com", "Web caches and other",
  4775  // "bücher.example").
  4776  //
  4777  //	"DOMAIN_CODE" - Name of a host on which an ad was served (e.g.
  4778  //
  4779  // "www.google.com", "webcaches", "xn--bcher-kva.example").
  4780  //
  4781  //	"COUNTRY_NAME" - Localized region name of a user viewing an ad (e.g.
  4782  //
  4783  // "United States", "France").
  4784  //
  4785  //	"COUNTRY_CODE" - CLDR region code of a user viewing an ad (e.g. "US",
  4786  //
  4787  // "FR").
  4788  //
  4789  //	"PLATFORM_TYPE_NAME" - Localized platform type name (e.g. "High-end mobile
  4790  //
  4791  // devices", "Desktop").
  4792  //
  4793  //	"PLATFORM_TYPE_CODE" - Platform type code (e.g. "HighEndMobile",
  4794  //
  4795  // "Desktop").
  4796  //
  4797  //	"TARGETING_TYPE_NAME" - Localized targeting type name (e.g. "Contextual",
  4798  //
  4799  // "Personalized", "Run of Network").
  4800  //
  4801  //	"TARGETING_TYPE_CODE" - Targeting type code (e.g. "Keyword",
  4802  //
  4803  // "UserInterest", "RunOfNetwork").
  4804  //
  4805  //	"CONTENT_PLATFORM_NAME" - Localized content platform name an ad request
  4806  //
  4807  // was made from (e.g. "AMP", "Web").
  4808  //
  4809  //	"CONTENT_PLATFORM_CODE" - Content platform code an ad request was made
  4810  //
  4811  // from (e.g. "AMP", "HTML").
  4812  //
  4813  //	"AD_PLACEMENT_NAME" - Localized ad placement name (e.g. "Ad unit", "Global
  4814  //
  4815  // settings", "Manual").
  4816  //
  4817  //	"AD_PLACEMENT_CODE" - Ad placement code (e.g. "AD_UNIT",
  4818  //
  4819  // "ca-pub-123456:78910", "OTHER").
  4820  //
  4821  //	"REQUESTED_AD_TYPE_NAME" - Localized requested ad type name (e.g.
  4822  //
  4823  // "Display", "Link unit", "Other").
  4824  //
  4825  //	"REQUESTED_AD_TYPE_CODE" - Requested ad type code (e.g. "IMAGE",
  4826  //
  4827  // "RADLINK", "OTHER").
  4828  //
  4829  //	"SERVED_AD_TYPE_NAME" - Localized served ad type name (e.g. "Display",
  4830  //
  4831  // "Link unit", "Other").
  4832  //
  4833  //	"SERVED_AD_TYPE_CODE" - Served ad type code (e.g. "IMAGE", "RADLINK",
  4834  //
  4835  // "OTHER").
  4836  //
  4837  //	"AD_FORMAT_NAME" - Localized ad format name indicating the way an ad is
  4838  //
  4839  // shown to the users on your site (e.g. "In-page", "Anchor", "Vignette").
  4840  //
  4841  //	"AD_FORMAT_CODE" - Ad format code indicating the way an ad is shown to the
  4842  //
  4843  // users on your site (e.g. "ON_PAGE", "ANCHOR", "INTERSTITIAL").
  4844  //
  4845  //	"CUSTOM_SEARCH_STYLE_NAME" - Custom search style name.
  4846  //	"CUSTOM_SEARCH_STYLE_ID" - Custom search style id.
  4847  //	"DOMAIN_REGISTRANT" - Domain registrants.
  4848  //	"WEBSEARCH_QUERY_STRING" - Query strings for web searches.
  4849  func (c *AccountsReportsGenerateCall) Dimensions(dimensions ...string) *AccountsReportsGenerateCall {
  4850  	c.urlParams_.SetMulti("dimensions", append([]string{}, dimensions...))
  4851  	return c
  4852  }
  4853  
  4854  // EndDateDay sets the optional parameter "endDate.day": Day of a month. Must
  4855  // be from 1 to 31 and valid for the year and month, or 0 to specify a year by
  4856  // itself or a year and month where the day isn't significant.
  4857  func (c *AccountsReportsGenerateCall) EndDateDay(endDateDay int64) *AccountsReportsGenerateCall {
  4858  	c.urlParams_.Set("endDate.day", fmt.Sprint(endDateDay))
  4859  	return c
  4860  }
  4861  
  4862  // EndDateMonth sets the optional parameter "endDate.month": Month of a year.
  4863  // Must be from 1 to 12, or 0 to specify a year without a month and day.
  4864  func (c *AccountsReportsGenerateCall) EndDateMonth(endDateMonth int64) *AccountsReportsGenerateCall {
  4865  	c.urlParams_.Set("endDate.month", fmt.Sprint(endDateMonth))
  4866  	return c
  4867  }
  4868  
  4869  // EndDateYear sets the optional parameter "endDate.year": Year of the date.
  4870  // Must be from 1 to 9999, or 0 to specify a date without a year.
  4871  func (c *AccountsReportsGenerateCall) EndDateYear(endDateYear int64) *AccountsReportsGenerateCall {
  4872  	c.urlParams_.Set("endDate.year", fmt.Sprint(endDateYear))
  4873  	return c
  4874  }
  4875  
  4876  // Filters sets the optional parameter "filters": A list of filters
  4877  // (/adsense/management/reporting/filtering) to apply to the report. All
  4878  // provided filters must match in order for the data to be included in the
  4879  // report.
  4880  func (c *AccountsReportsGenerateCall) Filters(filters ...string) *AccountsReportsGenerateCall {
  4881  	c.urlParams_.SetMulti("filters", append([]string{}, filters...))
  4882  	return c
  4883  }
  4884  
  4885  // LanguageCode sets the optional parameter "languageCode": The language to use
  4886  // for translating report output. If unspecified, this defaults to English
  4887  // ("en"). If the given language is not supported, report output will be
  4888  // returned in English. The language is specified as an IETF BCP-47 language
  4889  // code (https://en.wikipedia.org/wiki/IETF_language_tag).
  4890  func (c *AccountsReportsGenerateCall) LanguageCode(languageCode string) *AccountsReportsGenerateCall {
  4891  	c.urlParams_.Set("languageCode", languageCode)
  4892  	return c
  4893  }
  4894  
  4895  // Limit sets the optional parameter "limit": The maximum number of rows of
  4896  // report data to return. Reports producing more rows than the requested limit
  4897  // will be truncated. If unset, this defaults to 100,000 rows for
  4898  // `Reports.GenerateReport` and 1,000,000 rows for `Reports.GenerateCsvReport`,
  4899  // which are also the maximum values permitted here. Report truncation can be
  4900  // identified (for `Reports.GenerateReport` only) by comparing the number of
  4901  // rows returned to the value returned in `total_matched_rows`.
  4902  func (c *AccountsReportsGenerateCall) Limit(limit int64) *AccountsReportsGenerateCall {
  4903  	c.urlParams_.Set("limit", fmt.Sprint(limit))
  4904  	return c
  4905  }
  4906  
  4907  // Metrics sets the optional parameter "metrics": Required. Reporting metrics.
  4908  //
  4909  // Possible values:
  4910  //
  4911  //	"METRIC_UNSPECIFIED" - Unspecified metric.
  4912  //	"PAGE_VIEWS" - Number of page views.
  4913  //	"AD_REQUESTS" - Number of ad units that requested ads (for content ads) or
  4914  //
  4915  // search queries (for search ads). An ad request may result in zero, one, or
  4916  // multiple individual ad impressions depending on the size of the ad unit and
  4917  // whether any ads were available.
  4918  //
  4919  //	"MATCHED_AD_REQUESTS" - Requests that returned at least one ad.
  4920  //	"TOTAL_IMPRESSIONS" - Impressions. An impression is counted for each ad
  4921  //
  4922  // request where at least one ad has been downloaded to the user’s device and
  4923  // has begun to load. It is the number of ad units (for content ads) or search
  4924  // queries (for search ads) that showed ads.
  4925  //
  4926  //	"IMPRESSIONS" - Impressions. An impression is counted for each ad request
  4927  //
  4928  // where at least one ad has been downloaded to the user’s device and has
  4929  // begun to load. It is the number of ad units (for content ads) or search
  4930  // queries (for search ads) that showed ads.
  4931  //
  4932  //	"INDIVIDUAL_AD_IMPRESSIONS" - Ads shown. Different ad formats will display
  4933  //
  4934  // varying numbers of ads. For example, a vertical banner may consist of 2 or
  4935  // more ads. Also, the number of ads in an ad unit may vary depending on
  4936  // whether the ad unit is displaying standard text ads, expanded text ads or
  4937  // image ads.
  4938  //
  4939  //	"CLICKS" - Number of times a user clicked on a standard content ad.
  4940  //	"PAGE_VIEWS_SPAM_RATIO" - Fraction of page views considered to be spam.
  4941  //
  4942  // Only available to premium accounts.
  4943  //
  4944  //	"AD_REQUESTS_SPAM_RATIO" - Fraction of ad requests considered to be spam.
  4945  //
  4946  // Only available to premium accounts.
  4947  //
  4948  //	"MATCHED_AD_REQUESTS_SPAM_RATIO" - Fraction of ad requests that returned
  4949  //
  4950  // ads considered to be spam. Only available to premium accounts.
  4951  //
  4952  //	"IMPRESSIONS_SPAM_RATIO" - Fraction of impressions considered to be spam.
  4953  //
  4954  // Only available to premium accounts.
  4955  //
  4956  //	"INDIVIDUAL_AD_IMPRESSIONS_SPAM_RATIO" - Fraction of ad impressions
  4957  //
  4958  // considered to be spam. Only available to premium accounts.
  4959  //
  4960  //	"CLICKS_SPAM_RATIO" - Fraction of clicks considered to be spam. Only
  4961  //
  4962  // available to premium accounts.
  4963  //
  4964  //	"AD_REQUESTS_COVERAGE" - Ratio of requested ad units or queries to the
  4965  //
  4966  // number returned to the site.
  4967  //
  4968  //	"PAGE_VIEWS_CTR" - Ratio of individual page views that resulted in a
  4969  //
  4970  // click.
  4971  //
  4972  //	"AD_REQUESTS_CTR" - Ratio of ad requests that resulted in a click.
  4973  //	"MATCHED_AD_REQUESTS_CTR" - Ratio of clicks to matched requests.
  4974  //	"IMPRESSIONS_CTR" - Ratio of IMPRESSIONS that resulted in a click.
  4975  //	"INDIVIDUAL_AD_IMPRESSIONS_CTR" - Ratio of individual ad impressions that
  4976  //
  4977  // resulted in a click.
  4978  //
  4979  //	"ACTIVE_VIEW_MEASURABILITY" - Ratio of requests that were measurable for
  4980  //
  4981  // viewability.
  4982  //
  4983  //	"ACTIVE_VIEW_VIEWABILITY" - Ratio of requests that were viewable.
  4984  //	"ACTIVE_VIEW_TIME" - Mean time an ad was displayed on screen.
  4985  //	"ESTIMATED_EARNINGS" - Estimated earnings of the publisher. Note that
  4986  //
  4987  // earnings up to yesterday are accurate, more recent earnings are estimated
  4988  // due to the possibility of spam, or exchange rate fluctuations.
  4989  //
  4990  //	"PAGE_VIEWS_RPM" - Revenue per thousand page views. This is calculated by
  4991  //
  4992  // dividing the estimated revenue by the number of page views multiplied by
  4993  // 1000.
  4994  //
  4995  //	"AD_REQUESTS_RPM" - Revenue per thousand ad requests. This is calculated
  4996  //
  4997  // by dividing estimated revenue by the number of ad requests multiplied by
  4998  // 1000.
  4999  //
  5000  //	"MATCHED_AD_REQUESTS_RPM" - Revenue per thousand matched ad requests. This
  5001  //
  5002  // is calculated by dividing estimated revenue by the number of matched ad
  5003  // requests multiplied by 1000.
  5004  //
  5005  //	"IMPRESSIONS_RPM" - Revenue per thousand ad impressions. This is
  5006  //
  5007  // calculated by dividing estimated revenue by the number of ad impressions
  5008  // multiplied by 1000.
  5009  //
  5010  //	"INDIVIDUAL_AD_IMPRESSIONS_RPM" - Revenue per thousand individual ad
  5011  //
  5012  // impressions. This is calculated by dividing estimated revenue by the number
  5013  // of individual ad impressions multiplied by 1000.
  5014  //
  5015  //	"COST_PER_CLICK" - Amount the publisher earns each time a user clicks on
  5016  //
  5017  // an ad. CPC is calculated by dividing the estimated revenue by the number of
  5018  // clicks received.
  5019  //
  5020  //	"ADS_PER_IMPRESSION" - Number of ad views per impression.
  5021  //	"TOTAL_EARNINGS" - Total earnings are the gross estimated earnings from
  5022  //
  5023  // revenue shared traffic before any parent and child account revenue share is
  5024  // applied.
  5025  //
  5026  //	"WEBSEARCH_RESULT_PAGES" - Number of results pages.
  5027  //	"FUNNEL_REQUESTS" - Number of requests for non-ad units (for example a
  5028  //
  5029  // related search unit). For more information, see [Funnel
  5030  // requests](https://support.google.com/adsense/answer/11586959).
  5031  //
  5032  //	"FUNNEL_IMPRESSIONS" - Number of requests for non-ad units ads that
  5033  //
  5034  // returned content that was shown to the user. For more information, see
  5035  // [Funnel impressions](https://support.google.com/adsense/answer/11585767).
  5036  //
  5037  //	"FUNNEL_CLICKS" - Number of times a user clicked on a non-ad unit,
  5038  //
  5039  // triggering further ad requests. For more information, see [Funnel
  5040  // clicks](https://support.google.com/adsense/answer/11586382).
  5041  //
  5042  //	"FUNNEL_RPM" - Revenue per thousand funnel impressions. This is calculated
  5043  //
  5044  // by dividing estimated revenue by the number of funnel impressions multiplied
  5045  // by 1000. For more information, see [Funnel
  5046  // RPM](https://support.google.com/adsense/answer/11585979).
  5047  func (c *AccountsReportsGenerateCall) Metrics(metrics ...string) *AccountsReportsGenerateCall {
  5048  	c.urlParams_.SetMulti("metrics", append([]string{}, metrics...))
  5049  	return c
  5050  }
  5051  
  5052  // OrderBy sets the optional parameter "orderBy": The name of a dimension or
  5053  // metric to sort the resulting report on, can be prefixed with "+" to sort
  5054  // ascending or "-" to sort descending. If no prefix is specified, the column
  5055  // is sorted ascending.
  5056  func (c *AccountsReportsGenerateCall) OrderBy(orderBy ...string) *AccountsReportsGenerateCall {
  5057  	c.urlParams_.SetMulti("orderBy", append([]string{}, orderBy...))
  5058  	return c
  5059  }
  5060  
  5061  // ReportingTimeZone sets the optional parameter "reportingTimeZone": Timezone
  5062  // in which to generate the report. If unspecified, this defaults to the
  5063  // account timezone. For more information, see changing the time zone of your
  5064  // reports (https://support.google.com/adsense/answer/9830725).
  5065  //
  5066  // Possible values:
  5067  //
  5068  //	"REPORTING_TIME_ZONE_UNSPECIFIED" - Unspecified timezone.
  5069  //	"ACCOUNT_TIME_ZONE" - Use the account timezone in the report.
  5070  //	"GOOGLE_TIME_ZONE" - Use the Google timezone in the report
  5071  //
  5072  // (America/Los_Angeles).
  5073  func (c *AccountsReportsGenerateCall) ReportingTimeZone(reportingTimeZone string) *AccountsReportsGenerateCall {
  5074  	c.urlParams_.Set("reportingTimeZone", reportingTimeZone)
  5075  	return c
  5076  }
  5077  
  5078  // StartDateDay sets the optional parameter "startDate.day": Day of a month.
  5079  // Must be from 1 to 31 and valid for the year and month, or 0 to specify a
  5080  // year by itself or a year and month where the day isn't significant.
  5081  func (c *AccountsReportsGenerateCall) StartDateDay(startDateDay int64) *AccountsReportsGenerateCall {
  5082  	c.urlParams_.Set("startDate.day", fmt.Sprint(startDateDay))
  5083  	return c
  5084  }
  5085  
  5086  // StartDateMonth sets the optional parameter "startDate.month": Month of a
  5087  // year. Must be from 1 to 12, or 0 to specify a year without a month and day.
  5088  func (c *AccountsReportsGenerateCall) StartDateMonth(startDateMonth int64) *AccountsReportsGenerateCall {
  5089  	c.urlParams_.Set("startDate.month", fmt.Sprint(startDateMonth))
  5090  	return c
  5091  }
  5092  
  5093  // StartDateYear sets the optional parameter "startDate.year": Year of the
  5094  // date. Must be from 1 to 9999, or 0 to specify a date without a year.
  5095  func (c *AccountsReportsGenerateCall) StartDateYear(startDateYear int64) *AccountsReportsGenerateCall {
  5096  	c.urlParams_.Set("startDate.year", fmt.Sprint(startDateYear))
  5097  	return c
  5098  }
  5099  
  5100  // Fields allows partial responses to be retrieved. See
  5101  // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse for more
  5102  // details.
  5103  func (c *AccountsReportsGenerateCall) Fields(s ...googleapi.Field) *AccountsReportsGenerateCall {
  5104  	c.urlParams_.Set("fields", googleapi.CombineFields(s))
  5105  	return c
  5106  }
  5107  
  5108  // IfNoneMatch sets an optional parameter which makes the operation fail if the
  5109  // object's ETag matches the given value. This is useful for getting updates
  5110  // only after the object has changed since the last request.
  5111  func (c *AccountsReportsGenerateCall) IfNoneMatch(entityTag string) *AccountsReportsGenerateCall {
  5112  	c.ifNoneMatch_ = entityTag
  5113  	return c
  5114  }
  5115  
  5116  // Context sets the context to be used in this call's Do method.
  5117  func (c *AccountsReportsGenerateCall) Context(ctx context.Context) *AccountsReportsGenerateCall {
  5118  	c.ctx_ = ctx
  5119  	return c
  5120  }
  5121  
  5122  // Header returns a http.Header that can be modified by the caller to add
  5123  // headers to the request.
  5124  func (c *AccountsReportsGenerateCall) Header() http.Header {
  5125  	if c.header_ == nil {
  5126  		c.header_ = make(http.Header)
  5127  	}
  5128  	return c.header_
  5129  }
  5130  
  5131  func (c *AccountsReportsGenerateCall) doRequest(alt string) (*http.Response, error) {
  5132  	reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_)
  5133  	if c.ifNoneMatch_ != "" {
  5134  		reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  5135  	}
  5136  	var body io.Reader = nil
  5137  	c.urlParams_.Set("alt", alt)
  5138  	c.urlParams_.Set("prettyPrint", "false")
  5139  	urls := googleapi.ResolveRelative(c.s.BasePath, "v2/{+account}/reports:generate")
  5140  	urls += "?" + c.urlParams_.Encode()
  5141  	req, err := http.NewRequest("GET", urls, body)
  5142  	if err != nil {
  5143  		return nil, err
  5144  	}
  5145  	req.Header = reqHeaders
  5146  	googleapi.Expand(req.URL, map[string]string{
  5147  		"account": c.account,
  5148  	})
  5149  	return gensupport.SendRequest(c.ctx_, c.s.client, req)
  5150  }
  5151  
  5152  // Do executes the "adsense.accounts.reports.generate" call.
  5153  // Any non-2xx status code is an error. Response headers are in either
  5154  // *ReportResult.ServerResponse.Header or (if a response was returned at all)
  5155  // in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to check
  5156  // whether the returned error was because http.StatusNotModified was returned.
  5157  func (c *AccountsReportsGenerateCall) Do(opts ...googleapi.CallOption) (*ReportResult, error) {
  5158  	gensupport.SetOptions(c.urlParams_, opts...)
  5159  	res, err := c.doRequest("json")
  5160  	if res != nil && res.StatusCode == http.StatusNotModified {
  5161  		if res.Body != nil {
  5162  			res.Body.Close()
  5163  		}
  5164  		return nil, gensupport.WrapError(&googleapi.Error{
  5165  			Code:   res.StatusCode,
  5166  			Header: res.Header,
  5167  		})
  5168  	}
  5169  	if err != nil {
  5170  		return nil, err
  5171  	}
  5172  	defer googleapi.CloseBody(res)
  5173  	if err := googleapi.CheckResponse(res); err != nil {
  5174  		return nil, gensupport.WrapError(err)
  5175  	}
  5176  	ret := &ReportResult{
  5177  		ServerResponse: googleapi.ServerResponse{
  5178  			Header:         res.Header,
  5179  			HTTPStatusCode: res.StatusCode,
  5180  		},
  5181  	}
  5182  	target := &ret
  5183  	if err := gensupport.DecodeResponse(target, res); err != nil {
  5184  		return nil, err
  5185  	}
  5186  	return ret, nil
  5187  }
  5188  
  5189  type AccountsReportsGenerateCsvCall struct {
  5190  	s            *Service
  5191  	account      string
  5192  	urlParams_   gensupport.URLParams
  5193  	ifNoneMatch_ string
  5194  	ctx_         context.Context
  5195  	header_      http.Header
  5196  }
  5197  
  5198  // GenerateCsv: Generates a csv formatted ad hoc report.
  5199  //
  5200  //   - account: The account which owns the collection of reports. Format:
  5201  //     accounts/{account}.
  5202  func (r *AccountsReportsService) GenerateCsv(account string) *AccountsReportsGenerateCsvCall {
  5203  	c := &AccountsReportsGenerateCsvCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  5204  	c.account = account
  5205  	return c
  5206  }
  5207  
  5208  // CurrencyCode sets the optional parameter "currencyCode": The ISO-4217
  5209  // currency code (https://en.wikipedia.org/wiki/ISO_4217) to use when reporting
  5210  // on monetary metrics. Defaults to the account's currency if not set.
  5211  func (c *AccountsReportsGenerateCsvCall) CurrencyCode(currencyCode string) *AccountsReportsGenerateCsvCall {
  5212  	c.urlParams_.Set("currencyCode", currencyCode)
  5213  	return c
  5214  }
  5215  
  5216  // DateRange sets the optional parameter "dateRange": Date range of the report,
  5217  // if unset the range will be considered CUSTOM.
  5218  //
  5219  // Possible values:
  5220  //
  5221  //	"REPORTING_DATE_RANGE_UNSPECIFIED" - Unspecified date range.
  5222  //	"CUSTOM" - A custom date range specified using the `start_date` and
  5223  //
  5224  // `end_date` fields. This is the default if no ReportingDateRange is provided.
  5225  //
  5226  //	"TODAY" - Current day.
  5227  //	"YESTERDAY" - Yesterday.
  5228  //	"MONTH_TO_DATE" - From the start of the current month to the current day.
  5229  //
  5230  // e.g. if the current date is 2020-03-12 then the range will be [2020-03-01,
  5231  // 2020-03-12].
  5232  //
  5233  //	"YEAR_TO_DATE" - From the start of the current year to the current day.
  5234  //
  5235  // e.g. if the current date is 2020-03-12 then the range will be [2020-01-01,
  5236  // 2020-03-12].
  5237  //
  5238  //	"LAST_7_DAYS" - Last 7 days, excluding current day.
  5239  //	"LAST_30_DAYS" - Last 30 days, excluding current day.
  5240  func (c *AccountsReportsGenerateCsvCall) DateRange(dateRange string) *AccountsReportsGenerateCsvCall {
  5241  	c.urlParams_.Set("dateRange", dateRange)
  5242  	return c
  5243  }
  5244  
  5245  // Dimensions sets the optional parameter "dimensions": Dimensions to base the
  5246  // report on.
  5247  //
  5248  // Possible values:
  5249  //
  5250  //	"DIMENSION_UNSPECIFIED" - Unspecified dimension.
  5251  //	"DATE" - Date dimension in YYYY-MM-DD format (e.g. "2010-02-10").
  5252  //	"WEEK" - Week dimension in YYYY-MM-DD format, representing the first day
  5253  //
  5254  // of each week (e.g. "2010-02-08"). The first day of the week is determined by
  5255  // the language_code specified in a report generation request (so e.g. this
  5256  // would be a Monday for "en-GB" or "es", but a Sunday for "en" or "fr-CA").
  5257  //
  5258  //	"MONTH" - Month dimension in YYYY-MM format (e.g. "2010-02").
  5259  //	"ACCOUNT_NAME" - Account name. The members of this dimension match the
  5260  //
  5261  // values from Account.display_name.
  5262  //
  5263  //	"AD_CLIENT_ID" - Unique ID of an ad client. The members of this dimension
  5264  //
  5265  // match the values from AdClient.reporting_dimension_id.
  5266  //
  5267  //	"HOSTED_AD_CLIENT_ID" - Unique ID of a sub-account's ad client. The
  5268  //
  5269  // members of this dimension match the values from
  5270  // AdClient.reporting_dimension_id (for the sub-account).
  5271  //
  5272  //	"PRODUCT_NAME" - Localized product name (e.g. "AdSense for Content",
  5273  //
  5274  // "AdSense for Search").
  5275  //
  5276  //	"PRODUCT_CODE" - Product code (e.g. "AFC", "AFS"). The members of this
  5277  //
  5278  // dimension match the values from AdClient.product_code.
  5279  //
  5280  //	"AD_UNIT_NAME" - Ad unit name (within which an ad was served). The members
  5281  //
  5282  // of this dimension match the values from AdUnit.display_name.
  5283  //
  5284  //	"AD_UNIT_ID" - Unique ID of an ad unit (within which an ad was served).
  5285  //
  5286  // The members of this dimension match the values from
  5287  // AdUnit.reporting_dimension_id.
  5288  //
  5289  //	"AD_UNIT_SIZE_NAME" - Localized size of an ad unit (e.g. "728x90",
  5290  //
  5291  // "Responsive").
  5292  //
  5293  //	"AD_UNIT_SIZE_CODE" - The size code of an ad unit (e.g. "728x90",
  5294  //
  5295  // "responsive").
  5296  //
  5297  //	"CUSTOM_CHANNEL_NAME" - Custom channel name. The members of this dimension
  5298  //
  5299  // match the values from CustomChannel.display_name.
  5300  //
  5301  //	"CUSTOM_CHANNEL_ID" - Unique ID of a custom channel. The members of this
  5302  //
  5303  // dimension match the values from CustomChannel.reporting_dimension_id.
  5304  //
  5305  //	"OWNED_SITE_DOMAIN_NAME" - Domain name of a verified site (e.g.
  5306  //
  5307  // "example.com"). The members of this dimension match the values from
  5308  // Site.domain.
  5309  //
  5310  //	"OWNED_SITE_ID" - Unique ID of a verified site. The members of this
  5311  //
  5312  // dimension match the values from Site.reporting_dimension_id.
  5313  //
  5314  //	"PAGE_URL" - URL of the page upon which the ad was served. This is a
  5315  //
  5316  // complete URL including scheme and query parameters. Note that the URL that
  5317  // appears in this dimension may be a canonicalized version of the one that was
  5318  // used in the original request, and so may not exactly match the URL that a
  5319  // user might have seen. Note that there are also some caveats to be aware of
  5320  // when using this dimension. For more information, see [Page URL
  5321  // breakdown](https://support.google.com/adsense/answer/11988478).
  5322  //
  5323  //	"URL_CHANNEL_NAME" - Name of a URL channel. The members of this dimension
  5324  //
  5325  // match the values from UrlChannel.uri_pattern.
  5326  //
  5327  //	"URL_CHANNEL_ID" - Unique ID of a URL channel. The members of this
  5328  //
  5329  // dimension match the values from UrlChannel.reporting_dimension_id.
  5330  //
  5331  //	"BUYER_NETWORK_NAME" - Name of an ad network that returned the winning ads
  5332  //
  5333  // for an ad request (e.g. "Google AdWords"). Note that unlike other "NAME"
  5334  // dimensions, the members of this dimensions are not localized.
  5335  //
  5336  //	"BUYER_NETWORK_ID" - Unique (opaque) ID of an ad network that returned the
  5337  //
  5338  // winning ads for an ad request.
  5339  //
  5340  //	"BID_TYPE_NAME" - Localized bid type name (e.g. "CPC bids", "CPM bids")
  5341  //
  5342  // for a served ad.
  5343  //
  5344  //	"BID_TYPE_CODE" - Type of a bid (e.g. "cpc", "cpm") for a served ad.
  5345  //	"CREATIVE_SIZE_NAME" - Localized creative size name (e.g. "728x90",
  5346  //
  5347  // "Dynamic") of a served ad.
  5348  //
  5349  //	"CREATIVE_SIZE_CODE" - Creative size code (e.g. "728x90", "dynamic") of a
  5350  //
  5351  // served ad.
  5352  //
  5353  //	"DOMAIN_NAME" - Localized name of a host on which an ad was served, after
  5354  //
  5355  // IDNA decoding (e.g. "www.google.com", "Web caches and other",
  5356  // "bücher.example").
  5357  //
  5358  //	"DOMAIN_CODE" - Name of a host on which an ad was served (e.g.
  5359  //
  5360  // "www.google.com", "webcaches", "xn--bcher-kva.example").
  5361  //
  5362  //	"COUNTRY_NAME" - Localized region name of a user viewing an ad (e.g.
  5363  //
  5364  // "United States", "France").
  5365  //
  5366  //	"COUNTRY_CODE" - CLDR region code of a user viewing an ad (e.g. "US",
  5367  //
  5368  // "FR").
  5369  //
  5370  //	"PLATFORM_TYPE_NAME" - Localized platform type name (e.g. "High-end mobile
  5371  //
  5372  // devices", "Desktop").
  5373  //
  5374  //	"PLATFORM_TYPE_CODE" - Platform type code (e.g. "HighEndMobile",
  5375  //
  5376  // "Desktop").
  5377  //
  5378  //	"TARGETING_TYPE_NAME" - Localized targeting type name (e.g. "Contextual",
  5379  //
  5380  // "Personalized", "Run of Network").
  5381  //
  5382  //	"TARGETING_TYPE_CODE" - Targeting type code (e.g. "Keyword",
  5383  //
  5384  // "UserInterest", "RunOfNetwork").
  5385  //
  5386  //	"CONTENT_PLATFORM_NAME" - Localized content platform name an ad request
  5387  //
  5388  // was made from (e.g. "AMP", "Web").
  5389  //
  5390  //	"CONTENT_PLATFORM_CODE" - Content platform code an ad request was made
  5391  //
  5392  // from (e.g. "AMP", "HTML").
  5393  //
  5394  //	"AD_PLACEMENT_NAME" - Localized ad placement name (e.g. "Ad unit", "Global
  5395  //
  5396  // settings", "Manual").
  5397  //
  5398  //	"AD_PLACEMENT_CODE" - Ad placement code (e.g. "AD_UNIT",
  5399  //
  5400  // "ca-pub-123456:78910", "OTHER").
  5401  //
  5402  //	"REQUESTED_AD_TYPE_NAME" - Localized requested ad type name (e.g.
  5403  //
  5404  // "Display", "Link unit", "Other").
  5405  //
  5406  //	"REQUESTED_AD_TYPE_CODE" - Requested ad type code (e.g. "IMAGE",
  5407  //
  5408  // "RADLINK", "OTHER").
  5409  //
  5410  //	"SERVED_AD_TYPE_NAME" - Localized served ad type name (e.g. "Display",
  5411  //
  5412  // "Link unit", "Other").
  5413  //
  5414  //	"SERVED_AD_TYPE_CODE" - Served ad type code (e.g. "IMAGE", "RADLINK",
  5415  //
  5416  // "OTHER").
  5417  //
  5418  //	"AD_FORMAT_NAME" - Localized ad format name indicating the way an ad is
  5419  //
  5420  // shown to the users on your site (e.g. "In-page", "Anchor", "Vignette").
  5421  //
  5422  //	"AD_FORMAT_CODE" - Ad format code indicating the way an ad is shown to the
  5423  //
  5424  // users on your site (e.g. "ON_PAGE", "ANCHOR", "INTERSTITIAL").
  5425  //
  5426  //	"CUSTOM_SEARCH_STYLE_NAME" - Custom search style name.
  5427  //	"CUSTOM_SEARCH_STYLE_ID" - Custom search style id.
  5428  //	"DOMAIN_REGISTRANT" - Domain registrants.
  5429  //	"WEBSEARCH_QUERY_STRING" - Query strings for web searches.
  5430  func (c *AccountsReportsGenerateCsvCall) Dimensions(dimensions ...string) *AccountsReportsGenerateCsvCall {
  5431  	c.urlParams_.SetMulti("dimensions", append([]string{}, dimensions...))
  5432  	return c
  5433  }
  5434  
  5435  // EndDateDay sets the optional parameter "endDate.day": Day of a month. Must
  5436  // be from 1 to 31 and valid for the year and month, or 0 to specify a year by
  5437  // itself or a year and month where the day isn't significant.
  5438  func (c *AccountsReportsGenerateCsvCall) EndDateDay(endDateDay int64) *AccountsReportsGenerateCsvCall {
  5439  	c.urlParams_.Set("endDate.day", fmt.Sprint(endDateDay))
  5440  	return c
  5441  }
  5442  
  5443  // EndDateMonth sets the optional parameter "endDate.month": Month of a year.
  5444  // Must be from 1 to 12, or 0 to specify a year without a month and day.
  5445  func (c *AccountsReportsGenerateCsvCall) EndDateMonth(endDateMonth int64) *AccountsReportsGenerateCsvCall {
  5446  	c.urlParams_.Set("endDate.month", fmt.Sprint(endDateMonth))
  5447  	return c
  5448  }
  5449  
  5450  // EndDateYear sets the optional parameter "endDate.year": Year of the date.
  5451  // Must be from 1 to 9999, or 0 to specify a date without a year.
  5452  func (c *AccountsReportsGenerateCsvCall) EndDateYear(endDateYear int64) *AccountsReportsGenerateCsvCall {
  5453  	c.urlParams_.Set("endDate.year", fmt.Sprint(endDateYear))
  5454  	return c
  5455  }
  5456  
  5457  // Filters sets the optional parameter "filters": A list of filters
  5458  // (/adsense/management/reporting/filtering) to apply to the report. All
  5459  // provided filters must match in order for the data to be included in the
  5460  // report.
  5461  func (c *AccountsReportsGenerateCsvCall) Filters(filters ...string) *AccountsReportsGenerateCsvCall {
  5462  	c.urlParams_.SetMulti("filters", append([]string{}, filters...))
  5463  	return c
  5464  }
  5465  
  5466  // LanguageCode sets the optional parameter "languageCode": The language to use
  5467  // for translating report output. If unspecified, this defaults to English
  5468  // ("en"). If the given language is not supported, report output will be
  5469  // returned in English. The language is specified as an IETF BCP-47 language
  5470  // code (https://en.wikipedia.org/wiki/IETF_language_tag).
  5471  func (c *AccountsReportsGenerateCsvCall) LanguageCode(languageCode string) *AccountsReportsGenerateCsvCall {
  5472  	c.urlParams_.Set("languageCode", languageCode)
  5473  	return c
  5474  }
  5475  
  5476  // Limit sets the optional parameter "limit": The maximum number of rows of
  5477  // report data to return. Reports producing more rows than the requested limit
  5478  // will be truncated. If unset, this defaults to 100,000 rows for
  5479  // `Reports.GenerateReport` and 1,000,000 rows for `Reports.GenerateCsvReport`,
  5480  // which are also the maximum values permitted here. Report truncation can be
  5481  // identified (for `Reports.GenerateReport` only) by comparing the number of
  5482  // rows returned to the value returned in `total_matched_rows`.
  5483  func (c *AccountsReportsGenerateCsvCall) Limit(limit int64) *AccountsReportsGenerateCsvCall {
  5484  	c.urlParams_.Set("limit", fmt.Sprint(limit))
  5485  	return c
  5486  }
  5487  
  5488  // Metrics sets the optional parameter "metrics": Required. Reporting metrics.
  5489  //
  5490  // Possible values:
  5491  //
  5492  //	"METRIC_UNSPECIFIED" - Unspecified metric.
  5493  //	"PAGE_VIEWS" - Number of page views.
  5494  //	"AD_REQUESTS" - Number of ad units that requested ads (for content ads) or
  5495  //
  5496  // search queries (for search ads). An ad request may result in zero, one, or
  5497  // multiple individual ad impressions depending on the size of the ad unit and
  5498  // whether any ads were available.
  5499  //
  5500  //	"MATCHED_AD_REQUESTS" - Requests that returned at least one ad.
  5501  //	"TOTAL_IMPRESSIONS" - Impressions. An impression is counted for each ad
  5502  //
  5503  // request where at least one ad has been downloaded to the user’s device and
  5504  // has begun to load. It is the number of ad units (for content ads) or search
  5505  // queries (for search ads) that showed ads.
  5506  //
  5507  //	"IMPRESSIONS" - Impressions. An impression is counted for each ad request
  5508  //
  5509  // where at least one ad has been downloaded to the user’s device and has
  5510  // begun to load. It is the number of ad units (for content ads) or search
  5511  // queries (for search ads) that showed ads.
  5512  //
  5513  //	"INDIVIDUAL_AD_IMPRESSIONS" - Ads shown. Different ad formats will display
  5514  //
  5515  // varying numbers of ads. For example, a vertical banner may consist of 2 or
  5516  // more ads. Also, the number of ads in an ad unit may vary depending on
  5517  // whether the ad unit is displaying standard text ads, expanded text ads or
  5518  // image ads.
  5519  //
  5520  //	"CLICKS" - Number of times a user clicked on a standard content ad.
  5521  //	"PAGE_VIEWS_SPAM_RATIO" - Fraction of page views considered to be spam.
  5522  //
  5523  // Only available to premium accounts.
  5524  //
  5525  //	"AD_REQUESTS_SPAM_RATIO" - Fraction of ad requests considered to be spam.
  5526  //
  5527  // Only available to premium accounts.
  5528  //
  5529  //	"MATCHED_AD_REQUESTS_SPAM_RATIO" - Fraction of ad requests that returned
  5530  //
  5531  // ads considered to be spam. Only available to premium accounts.
  5532  //
  5533  //	"IMPRESSIONS_SPAM_RATIO" - Fraction of impressions considered to be spam.
  5534  //
  5535  // Only available to premium accounts.
  5536  //
  5537  //	"INDIVIDUAL_AD_IMPRESSIONS_SPAM_RATIO" - Fraction of ad impressions
  5538  //
  5539  // considered to be spam. Only available to premium accounts.
  5540  //
  5541  //	"CLICKS_SPAM_RATIO" - Fraction of clicks considered to be spam. Only
  5542  //
  5543  // available to premium accounts.
  5544  //
  5545  //	"AD_REQUESTS_COVERAGE" - Ratio of requested ad units or queries to the
  5546  //
  5547  // number returned to the site.
  5548  //
  5549  //	"PAGE_VIEWS_CTR" - Ratio of individual page views that resulted in a
  5550  //
  5551  // click.
  5552  //
  5553  //	"AD_REQUESTS_CTR" - Ratio of ad requests that resulted in a click.
  5554  //	"MATCHED_AD_REQUESTS_CTR" - Ratio of clicks to matched requests.
  5555  //	"IMPRESSIONS_CTR" - Ratio of IMPRESSIONS that resulted in a click.
  5556  //	"INDIVIDUAL_AD_IMPRESSIONS_CTR" - Ratio of individual ad impressions that
  5557  //
  5558  // resulted in a click.
  5559  //
  5560  //	"ACTIVE_VIEW_MEASURABILITY" - Ratio of requests that were measurable for
  5561  //
  5562  // viewability.
  5563  //
  5564  //	"ACTIVE_VIEW_VIEWABILITY" - Ratio of requests that were viewable.
  5565  //	"ACTIVE_VIEW_TIME" - Mean time an ad was displayed on screen.
  5566  //	"ESTIMATED_EARNINGS" - Estimated earnings of the publisher. Note that
  5567  //
  5568  // earnings up to yesterday are accurate, more recent earnings are estimated
  5569  // due to the possibility of spam, or exchange rate fluctuations.
  5570  //
  5571  //	"PAGE_VIEWS_RPM" - Revenue per thousand page views. This is calculated by
  5572  //
  5573  // dividing the estimated revenue by the number of page views multiplied by
  5574  // 1000.
  5575  //
  5576  //	"AD_REQUESTS_RPM" - Revenue per thousand ad requests. This is calculated
  5577  //
  5578  // by dividing estimated revenue by the number of ad requests multiplied by
  5579  // 1000.
  5580  //
  5581  //	"MATCHED_AD_REQUESTS_RPM" - Revenue per thousand matched ad requests. This
  5582  //
  5583  // is calculated by dividing estimated revenue by the number of matched ad
  5584  // requests multiplied by 1000.
  5585  //
  5586  //	"IMPRESSIONS_RPM" - Revenue per thousand ad impressions. This is
  5587  //
  5588  // calculated by dividing estimated revenue by the number of ad impressions
  5589  // multiplied by 1000.
  5590  //
  5591  //	"INDIVIDUAL_AD_IMPRESSIONS_RPM" - Revenue per thousand individual ad
  5592  //
  5593  // impressions. This is calculated by dividing estimated revenue by the number
  5594  // of individual ad impressions multiplied by 1000.
  5595  //
  5596  //	"COST_PER_CLICK" - Amount the publisher earns each time a user clicks on
  5597  //
  5598  // an ad. CPC is calculated by dividing the estimated revenue by the number of
  5599  // clicks received.
  5600  //
  5601  //	"ADS_PER_IMPRESSION" - Number of ad views per impression.
  5602  //	"TOTAL_EARNINGS" - Total earnings are the gross estimated earnings from
  5603  //
  5604  // revenue shared traffic before any parent and child account revenue share is
  5605  // applied.
  5606  //
  5607  //	"WEBSEARCH_RESULT_PAGES" - Number of results pages.
  5608  //	"FUNNEL_REQUESTS" - Number of requests for non-ad units (for example a
  5609  //
  5610  // related search unit). For more information, see [Funnel
  5611  // requests](https://support.google.com/adsense/answer/11586959).
  5612  //
  5613  //	"FUNNEL_IMPRESSIONS" - Number of requests for non-ad units ads that
  5614  //
  5615  // returned content that was shown to the user. For more information, see
  5616  // [Funnel impressions](https://support.google.com/adsense/answer/11585767).
  5617  //
  5618  //	"FUNNEL_CLICKS" - Number of times a user clicked on a non-ad unit,
  5619  //
  5620  // triggering further ad requests. For more information, see [Funnel
  5621  // clicks](https://support.google.com/adsense/answer/11586382).
  5622  //
  5623  //	"FUNNEL_RPM" - Revenue per thousand funnel impressions. This is calculated
  5624  //
  5625  // by dividing estimated revenue by the number of funnel impressions multiplied
  5626  // by 1000. For more information, see [Funnel
  5627  // RPM](https://support.google.com/adsense/answer/11585979).
  5628  func (c *AccountsReportsGenerateCsvCall) Metrics(metrics ...string) *AccountsReportsGenerateCsvCall {
  5629  	c.urlParams_.SetMulti("metrics", append([]string{}, metrics...))
  5630  	return c
  5631  }
  5632  
  5633  // OrderBy sets the optional parameter "orderBy": The name of a dimension or
  5634  // metric to sort the resulting report on, can be prefixed with "+" to sort
  5635  // ascending or "-" to sort descending. If no prefix is specified, the column
  5636  // is sorted ascending.
  5637  func (c *AccountsReportsGenerateCsvCall) OrderBy(orderBy ...string) *AccountsReportsGenerateCsvCall {
  5638  	c.urlParams_.SetMulti("orderBy", append([]string{}, orderBy...))
  5639  	return c
  5640  }
  5641  
  5642  // ReportingTimeZone sets the optional parameter "reportingTimeZone": Timezone
  5643  // in which to generate the report. If unspecified, this defaults to the
  5644  // account timezone. For more information, see changing the time zone of your
  5645  // reports (https://support.google.com/adsense/answer/9830725).
  5646  //
  5647  // Possible values:
  5648  //
  5649  //	"REPORTING_TIME_ZONE_UNSPECIFIED" - Unspecified timezone.
  5650  //	"ACCOUNT_TIME_ZONE" - Use the account timezone in the report.
  5651  //	"GOOGLE_TIME_ZONE" - Use the Google timezone in the report
  5652  //
  5653  // (America/Los_Angeles).
  5654  func (c *AccountsReportsGenerateCsvCall) ReportingTimeZone(reportingTimeZone string) *AccountsReportsGenerateCsvCall {
  5655  	c.urlParams_.Set("reportingTimeZone", reportingTimeZone)
  5656  	return c
  5657  }
  5658  
  5659  // StartDateDay sets the optional parameter "startDate.day": Day of a month.
  5660  // Must be from 1 to 31 and valid for the year and month, or 0 to specify a
  5661  // year by itself or a year and month where the day isn't significant.
  5662  func (c *AccountsReportsGenerateCsvCall) StartDateDay(startDateDay int64) *AccountsReportsGenerateCsvCall {
  5663  	c.urlParams_.Set("startDate.day", fmt.Sprint(startDateDay))
  5664  	return c
  5665  }
  5666  
  5667  // StartDateMonth sets the optional parameter "startDate.month": Month of a
  5668  // year. Must be from 1 to 12, or 0 to specify a year without a month and day.
  5669  func (c *AccountsReportsGenerateCsvCall) StartDateMonth(startDateMonth int64) *AccountsReportsGenerateCsvCall {
  5670  	c.urlParams_.Set("startDate.month", fmt.Sprint(startDateMonth))
  5671  	return c
  5672  }
  5673  
  5674  // StartDateYear sets the optional parameter "startDate.year": Year of the
  5675  // date. Must be from 1 to 9999, or 0 to specify a date without a year.
  5676  func (c *AccountsReportsGenerateCsvCall) StartDateYear(startDateYear int64) *AccountsReportsGenerateCsvCall {
  5677  	c.urlParams_.Set("startDate.year", fmt.Sprint(startDateYear))
  5678  	return c
  5679  }
  5680  
  5681  // Fields allows partial responses to be retrieved. See
  5682  // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse for more
  5683  // details.
  5684  func (c *AccountsReportsGenerateCsvCall) Fields(s ...googleapi.Field) *AccountsReportsGenerateCsvCall {
  5685  	c.urlParams_.Set("fields", googleapi.CombineFields(s))
  5686  	return c
  5687  }
  5688  
  5689  // IfNoneMatch sets an optional parameter which makes the operation fail if the
  5690  // object's ETag matches the given value. This is useful for getting updates
  5691  // only after the object has changed since the last request.
  5692  func (c *AccountsReportsGenerateCsvCall) IfNoneMatch(entityTag string) *AccountsReportsGenerateCsvCall {
  5693  	c.ifNoneMatch_ = entityTag
  5694  	return c
  5695  }
  5696  
  5697  // Context sets the context to be used in this call's Do method.
  5698  func (c *AccountsReportsGenerateCsvCall) Context(ctx context.Context) *AccountsReportsGenerateCsvCall {
  5699  	c.ctx_ = ctx
  5700  	return c
  5701  }
  5702  
  5703  // Header returns a http.Header that can be modified by the caller to add
  5704  // headers to the request.
  5705  func (c *AccountsReportsGenerateCsvCall) Header() http.Header {
  5706  	if c.header_ == nil {
  5707  		c.header_ = make(http.Header)
  5708  	}
  5709  	return c.header_
  5710  }
  5711  
  5712  func (c *AccountsReportsGenerateCsvCall) doRequest(alt string) (*http.Response, error) {
  5713  	reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_)
  5714  	if c.ifNoneMatch_ != "" {
  5715  		reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  5716  	}
  5717  	var body io.Reader = nil
  5718  	c.urlParams_.Set("alt", alt)
  5719  	c.urlParams_.Set("prettyPrint", "false")
  5720  	urls := googleapi.ResolveRelative(c.s.BasePath, "v2/{+account}/reports:generateCsv")
  5721  	urls += "?" + c.urlParams_.Encode()
  5722  	req, err := http.NewRequest("GET", urls, body)
  5723  	if err != nil {
  5724  		return nil, err
  5725  	}
  5726  	req.Header = reqHeaders
  5727  	googleapi.Expand(req.URL, map[string]string{
  5728  		"account": c.account,
  5729  	})
  5730  	return gensupport.SendRequest(c.ctx_, c.s.client, req)
  5731  }
  5732  
  5733  // Do executes the "adsense.accounts.reports.generateCsv" call.
  5734  // Any non-2xx status code is an error. Response headers are in either
  5735  // *HttpBody.ServerResponse.Header or (if a response was returned at all) in
  5736  // error.(*googleapi.Error).Header. Use googleapi.IsNotModified to check
  5737  // whether the returned error was because http.StatusNotModified was returned.
  5738  func (c *AccountsReportsGenerateCsvCall) Do(opts ...googleapi.CallOption) (*HttpBody, error) {
  5739  	gensupport.SetOptions(c.urlParams_, opts...)
  5740  	res, err := c.doRequest("json")
  5741  	if res != nil && res.StatusCode == http.StatusNotModified {
  5742  		if res.Body != nil {
  5743  			res.Body.Close()
  5744  		}
  5745  		return nil, gensupport.WrapError(&googleapi.Error{
  5746  			Code:   res.StatusCode,
  5747  			Header: res.Header,
  5748  		})
  5749  	}
  5750  	if err != nil {
  5751  		return nil, err
  5752  	}
  5753  	defer googleapi.CloseBody(res)
  5754  	if err := googleapi.CheckResponse(res); err != nil {
  5755  		return nil, gensupport.WrapError(err)
  5756  	}
  5757  	ret := &HttpBody{
  5758  		ServerResponse: googleapi.ServerResponse{
  5759  			Header:         res.Header,
  5760  			HTTPStatusCode: res.StatusCode,
  5761  		},
  5762  	}
  5763  	target := &ret
  5764  	if err := gensupport.DecodeResponse(target, res); err != nil {
  5765  		return nil, err
  5766  	}
  5767  	return ret, nil
  5768  }
  5769  
  5770  type AccountsReportsGetSavedCall struct {
  5771  	s            *Service
  5772  	name         string
  5773  	urlParams_   gensupport.URLParams
  5774  	ifNoneMatch_ string
  5775  	ctx_         context.Context
  5776  	header_      http.Header
  5777  }
  5778  
  5779  // GetSaved: Gets the saved report from the given resource name.
  5780  //
  5781  //   - name: The name of the saved report to retrieve. Format:
  5782  //     accounts/{account}/reports/{report}.
  5783  func (r *AccountsReportsService) GetSaved(name string) *AccountsReportsGetSavedCall {
  5784  	c := &AccountsReportsGetSavedCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  5785  	c.name = name
  5786  	return c
  5787  }
  5788  
  5789  // Fields allows partial responses to be retrieved. See
  5790  // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse for more
  5791  // details.
  5792  func (c *AccountsReportsGetSavedCall) Fields(s ...googleapi.Field) *AccountsReportsGetSavedCall {
  5793  	c.urlParams_.Set("fields", googleapi.CombineFields(s))
  5794  	return c
  5795  }
  5796  
  5797  // IfNoneMatch sets an optional parameter which makes the operation fail if the
  5798  // object's ETag matches the given value. This is useful for getting updates
  5799  // only after the object has changed since the last request.
  5800  func (c *AccountsReportsGetSavedCall) IfNoneMatch(entityTag string) *AccountsReportsGetSavedCall {
  5801  	c.ifNoneMatch_ = entityTag
  5802  	return c
  5803  }
  5804  
  5805  // Context sets the context to be used in this call's Do method.
  5806  func (c *AccountsReportsGetSavedCall) Context(ctx context.Context) *AccountsReportsGetSavedCall {
  5807  	c.ctx_ = ctx
  5808  	return c
  5809  }
  5810  
  5811  // Header returns a http.Header that can be modified by the caller to add
  5812  // headers to the request.
  5813  func (c *AccountsReportsGetSavedCall) Header() http.Header {
  5814  	if c.header_ == nil {
  5815  		c.header_ = make(http.Header)
  5816  	}
  5817  	return c.header_
  5818  }
  5819  
  5820  func (c *AccountsReportsGetSavedCall) doRequest(alt string) (*http.Response, error) {
  5821  	reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_)
  5822  	if c.ifNoneMatch_ != "" {
  5823  		reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  5824  	}
  5825  	var body io.Reader = nil
  5826  	c.urlParams_.Set("alt", alt)
  5827  	c.urlParams_.Set("prettyPrint", "false")
  5828  	urls := googleapi.ResolveRelative(c.s.BasePath, "v2/{+name}/saved")
  5829  	urls += "?" + c.urlParams_.Encode()
  5830  	req, err := http.NewRequest("GET", urls, body)
  5831  	if err != nil {
  5832  		return nil, err
  5833  	}
  5834  	req.Header = reqHeaders
  5835  	googleapi.Expand(req.URL, map[string]string{
  5836  		"name": c.name,
  5837  	})
  5838  	return gensupport.SendRequest(c.ctx_, c.s.client, req)
  5839  }
  5840  
  5841  // Do executes the "adsense.accounts.reports.getSaved" call.
  5842  // Any non-2xx status code is an error. Response headers are in either
  5843  // *SavedReport.ServerResponse.Header or (if a response was returned at all) in
  5844  // error.(*googleapi.Error).Header. Use googleapi.IsNotModified to check
  5845  // whether the returned error was because http.StatusNotModified was returned.
  5846  func (c *AccountsReportsGetSavedCall) Do(opts ...googleapi.CallOption) (*SavedReport, error) {
  5847  	gensupport.SetOptions(c.urlParams_, opts...)
  5848  	res, err := c.doRequest("json")
  5849  	if res != nil && res.StatusCode == http.StatusNotModified {
  5850  		if res.Body != nil {
  5851  			res.Body.Close()
  5852  		}
  5853  		return nil, gensupport.WrapError(&googleapi.Error{
  5854  			Code:   res.StatusCode,
  5855  			Header: res.Header,
  5856  		})
  5857  	}
  5858  	if err != nil {
  5859  		return nil, err
  5860  	}
  5861  	defer googleapi.CloseBody(res)
  5862  	if err := googleapi.CheckResponse(res); err != nil {
  5863  		return nil, gensupport.WrapError(err)
  5864  	}
  5865  	ret := &SavedReport{
  5866  		ServerResponse: googleapi.ServerResponse{
  5867  			Header:         res.Header,
  5868  			HTTPStatusCode: res.StatusCode,
  5869  		},
  5870  	}
  5871  	target := &ret
  5872  	if err := gensupport.DecodeResponse(target, res); err != nil {
  5873  		return nil, err
  5874  	}
  5875  	return ret, nil
  5876  }
  5877  
  5878  type AccountsReportsSavedGenerateCall struct {
  5879  	s            *Service
  5880  	name         string
  5881  	urlParams_   gensupport.URLParams
  5882  	ifNoneMatch_ string
  5883  	ctx_         context.Context
  5884  	header_      http.Header
  5885  }
  5886  
  5887  // Generate: Generates a saved report.
  5888  //
  5889  //   - name: Name of the saved report. Format:
  5890  //     accounts/{account}/reports/{report}.
  5891  func (r *AccountsReportsSavedService) Generate(name string) *AccountsReportsSavedGenerateCall {
  5892  	c := &AccountsReportsSavedGenerateCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  5893  	c.name = name
  5894  	return c
  5895  }
  5896  
  5897  // CurrencyCode sets the optional parameter "currencyCode": The ISO-4217
  5898  // currency code (https://en.wikipedia.org/wiki/ISO_4217) to use when reporting
  5899  // on monetary metrics. Defaults to the account's currency if not set.
  5900  func (c *AccountsReportsSavedGenerateCall) CurrencyCode(currencyCode string) *AccountsReportsSavedGenerateCall {
  5901  	c.urlParams_.Set("currencyCode", currencyCode)
  5902  	return c
  5903  }
  5904  
  5905  // DateRange sets the optional parameter "dateRange": Date range of the report,
  5906  // if unset the range will be considered CUSTOM.
  5907  //
  5908  // Possible values:
  5909  //
  5910  //	"REPORTING_DATE_RANGE_UNSPECIFIED" - Unspecified date range.
  5911  //	"CUSTOM" - A custom date range specified using the `start_date` and
  5912  //
  5913  // `end_date` fields. This is the default if no ReportingDateRange is provided.
  5914  //
  5915  //	"TODAY" - Current day.
  5916  //	"YESTERDAY" - Yesterday.
  5917  //	"MONTH_TO_DATE" - From the start of the current month to the current day.
  5918  //
  5919  // e.g. if the current date is 2020-03-12 then the range will be [2020-03-01,
  5920  // 2020-03-12].
  5921  //
  5922  //	"YEAR_TO_DATE" - From the start of the current year to the current day.
  5923  //
  5924  // e.g. if the current date is 2020-03-12 then the range will be [2020-01-01,
  5925  // 2020-03-12].
  5926  //
  5927  //	"LAST_7_DAYS" - Last 7 days, excluding current day.
  5928  //	"LAST_30_DAYS" - Last 30 days, excluding current day.
  5929  func (c *AccountsReportsSavedGenerateCall) DateRange(dateRange string) *AccountsReportsSavedGenerateCall {
  5930  	c.urlParams_.Set("dateRange", dateRange)
  5931  	return c
  5932  }
  5933  
  5934  // EndDateDay sets the optional parameter "endDate.day": Day of a month. Must
  5935  // be from 1 to 31 and valid for the year and month, or 0 to specify a year by
  5936  // itself or a year and month where the day isn't significant.
  5937  func (c *AccountsReportsSavedGenerateCall) EndDateDay(endDateDay int64) *AccountsReportsSavedGenerateCall {
  5938  	c.urlParams_.Set("endDate.day", fmt.Sprint(endDateDay))
  5939  	return c
  5940  }
  5941  
  5942  // EndDateMonth sets the optional parameter "endDate.month": Month of a year.
  5943  // Must be from 1 to 12, or 0 to specify a year without a month and day.
  5944  func (c *AccountsReportsSavedGenerateCall) EndDateMonth(endDateMonth int64) *AccountsReportsSavedGenerateCall {
  5945  	c.urlParams_.Set("endDate.month", fmt.Sprint(endDateMonth))
  5946  	return c
  5947  }
  5948  
  5949  // EndDateYear sets the optional parameter "endDate.year": Year of the date.
  5950  // Must be from 1 to 9999, or 0 to specify a date without a year.
  5951  func (c *AccountsReportsSavedGenerateCall) EndDateYear(endDateYear int64) *AccountsReportsSavedGenerateCall {
  5952  	c.urlParams_.Set("endDate.year", fmt.Sprint(endDateYear))
  5953  	return c
  5954  }
  5955  
  5956  // LanguageCode sets the optional parameter "languageCode": The language to use
  5957  // for translating report output. If unspecified, this defaults to English
  5958  // ("en"). If the given language is not supported, report output will be
  5959  // returned in English. The language is specified as an IETF BCP-47 language
  5960  // code (https://en.wikipedia.org/wiki/IETF_language_tag).
  5961  func (c *AccountsReportsSavedGenerateCall) LanguageCode(languageCode string) *AccountsReportsSavedGenerateCall {
  5962  	c.urlParams_.Set("languageCode", languageCode)
  5963  	return c
  5964  }
  5965  
  5966  // ReportingTimeZone sets the optional parameter "reportingTimeZone": Timezone
  5967  // in which to generate the report. If unspecified, this defaults to the
  5968  // account timezone. For more information, see changing the time zone of your
  5969  // reports (https://support.google.com/adsense/answer/9830725).
  5970  //
  5971  // Possible values:
  5972  //
  5973  //	"REPORTING_TIME_ZONE_UNSPECIFIED" - Unspecified timezone.
  5974  //	"ACCOUNT_TIME_ZONE" - Use the account timezone in the report.
  5975  //	"GOOGLE_TIME_ZONE" - Use the Google timezone in the report
  5976  //
  5977  // (America/Los_Angeles).
  5978  func (c *AccountsReportsSavedGenerateCall) ReportingTimeZone(reportingTimeZone string) *AccountsReportsSavedGenerateCall {
  5979  	c.urlParams_.Set("reportingTimeZone", reportingTimeZone)
  5980  	return c
  5981  }
  5982  
  5983  // StartDateDay sets the optional parameter "startDate.day": Day of a month.
  5984  // Must be from 1 to 31 and valid for the year and month, or 0 to specify a
  5985  // year by itself or a year and month where the day isn't significant.
  5986  func (c *AccountsReportsSavedGenerateCall) StartDateDay(startDateDay int64) *AccountsReportsSavedGenerateCall {
  5987  	c.urlParams_.Set("startDate.day", fmt.Sprint(startDateDay))
  5988  	return c
  5989  }
  5990  
  5991  // StartDateMonth sets the optional parameter "startDate.month": Month of a
  5992  // year. Must be from 1 to 12, or 0 to specify a year without a month and day.
  5993  func (c *AccountsReportsSavedGenerateCall) StartDateMonth(startDateMonth int64) *AccountsReportsSavedGenerateCall {
  5994  	c.urlParams_.Set("startDate.month", fmt.Sprint(startDateMonth))
  5995  	return c
  5996  }
  5997  
  5998  // StartDateYear sets the optional parameter "startDate.year": Year of the
  5999  // date. Must be from 1 to 9999, or 0 to specify a date without a year.
  6000  func (c *AccountsReportsSavedGenerateCall) StartDateYear(startDateYear int64) *AccountsReportsSavedGenerateCall {
  6001  	c.urlParams_.Set("startDate.year", fmt.Sprint(startDateYear))
  6002  	return c
  6003  }
  6004  
  6005  // Fields allows partial responses to be retrieved. See
  6006  // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse for more
  6007  // details.
  6008  func (c *AccountsReportsSavedGenerateCall) Fields(s ...googleapi.Field) *AccountsReportsSavedGenerateCall {
  6009  	c.urlParams_.Set("fields", googleapi.CombineFields(s))
  6010  	return c
  6011  }
  6012  
  6013  // IfNoneMatch sets an optional parameter which makes the operation fail if the
  6014  // object's ETag matches the given value. This is useful for getting updates
  6015  // only after the object has changed since the last request.
  6016  func (c *AccountsReportsSavedGenerateCall) IfNoneMatch(entityTag string) *AccountsReportsSavedGenerateCall {
  6017  	c.ifNoneMatch_ = entityTag
  6018  	return c
  6019  }
  6020  
  6021  // Context sets the context to be used in this call's Do method.
  6022  func (c *AccountsReportsSavedGenerateCall) Context(ctx context.Context) *AccountsReportsSavedGenerateCall {
  6023  	c.ctx_ = ctx
  6024  	return c
  6025  }
  6026  
  6027  // Header returns a http.Header that can be modified by the caller to add
  6028  // headers to the request.
  6029  func (c *AccountsReportsSavedGenerateCall) Header() http.Header {
  6030  	if c.header_ == nil {
  6031  		c.header_ = make(http.Header)
  6032  	}
  6033  	return c.header_
  6034  }
  6035  
  6036  func (c *AccountsReportsSavedGenerateCall) doRequest(alt string) (*http.Response, error) {
  6037  	reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_)
  6038  	if c.ifNoneMatch_ != "" {
  6039  		reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  6040  	}
  6041  	var body io.Reader = nil
  6042  	c.urlParams_.Set("alt", alt)
  6043  	c.urlParams_.Set("prettyPrint", "false")
  6044  	urls := googleapi.ResolveRelative(c.s.BasePath, "v2/{+name}/saved:generate")
  6045  	urls += "?" + c.urlParams_.Encode()
  6046  	req, err := http.NewRequest("GET", urls, body)
  6047  	if err != nil {
  6048  		return nil, err
  6049  	}
  6050  	req.Header = reqHeaders
  6051  	googleapi.Expand(req.URL, map[string]string{
  6052  		"name": c.name,
  6053  	})
  6054  	return gensupport.SendRequest(c.ctx_, c.s.client, req)
  6055  }
  6056  
  6057  // Do executes the "adsense.accounts.reports.saved.generate" call.
  6058  // Any non-2xx status code is an error. Response headers are in either
  6059  // *ReportResult.ServerResponse.Header or (if a response was returned at all)
  6060  // in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to check
  6061  // whether the returned error was because http.StatusNotModified was returned.
  6062  func (c *AccountsReportsSavedGenerateCall) Do(opts ...googleapi.CallOption) (*ReportResult, error) {
  6063  	gensupport.SetOptions(c.urlParams_, opts...)
  6064  	res, err := c.doRequest("json")
  6065  	if res != nil && res.StatusCode == http.StatusNotModified {
  6066  		if res.Body != nil {
  6067  			res.Body.Close()
  6068  		}
  6069  		return nil, gensupport.WrapError(&googleapi.Error{
  6070  			Code:   res.StatusCode,
  6071  			Header: res.Header,
  6072  		})
  6073  	}
  6074  	if err != nil {
  6075  		return nil, err
  6076  	}
  6077  	defer googleapi.CloseBody(res)
  6078  	if err := googleapi.CheckResponse(res); err != nil {
  6079  		return nil, gensupport.WrapError(err)
  6080  	}
  6081  	ret := &ReportResult{
  6082  		ServerResponse: googleapi.ServerResponse{
  6083  			Header:         res.Header,
  6084  			HTTPStatusCode: res.StatusCode,
  6085  		},
  6086  	}
  6087  	target := &ret
  6088  	if err := gensupport.DecodeResponse(target, res); err != nil {
  6089  		return nil, err
  6090  	}
  6091  	return ret, nil
  6092  }
  6093  
  6094  type AccountsReportsSavedGenerateCsvCall struct {
  6095  	s            *Service
  6096  	name         string
  6097  	urlParams_   gensupport.URLParams
  6098  	ifNoneMatch_ string
  6099  	ctx_         context.Context
  6100  	header_      http.Header
  6101  }
  6102  
  6103  // GenerateCsv: Generates a csv formatted saved report.
  6104  //
  6105  //   - name: Name of the saved report. Format:
  6106  //     accounts/{account}/reports/{report}.
  6107  func (r *AccountsReportsSavedService) GenerateCsv(name string) *AccountsReportsSavedGenerateCsvCall {
  6108  	c := &AccountsReportsSavedGenerateCsvCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  6109  	c.name = name
  6110  	return c
  6111  }
  6112  
  6113  // CurrencyCode sets the optional parameter "currencyCode": The ISO-4217
  6114  // currency code (https://en.wikipedia.org/wiki/ISO_4217) to use when reporting
  6115  // on monetary metrics. Defaults to the account's currency if not set.
  6116  func (c *AccountsReportsSavedGenerateCsvCall) CurrencyCode(currencyCode string) *AccountsReportsSavedGenerateCsvCall {
  6117  	c.urlParams_.Set("currencyCode", currencyCode)
  6118  	return c
  6119  }
  6120  
  6121  // DateRange sets the optional parameter "dateRange": Date range of the report,
  6122  // if unset the range will be considered CUSTOM.
  6123  //
  6124  // Possible values:
  6125  //
  6126  //	"REPORTING_DATE_RANGE_UNSPECIFIED" - Unspecified date range.
  6127  //	"CUSTOM" - A custom date range specified using the `start_date` and
  6128  //
  6129  // `end_date` fields. This is the default if no ReportingDateRange is provided.
  6130  //
  6131  //	"TODAY" - Current day.
  6132  //	"YESTERDAY" - Yesterday.
  6133  //	"MONTH_TO_DATE" - From the start of the current month to the current day.
  6134  //
  6135  // e.g. if the current date is 2020-03-12 then the range will be [2020-03-01,
  6136  // 2020-03-12].
  6137  //
  6138  //	"YEAR_TO_DATE" - From the start of the current year to the current day.
  6139  //
  6140  // e.g. if the current date is 2020-03-12 then the range will be [2020-01-01,
  6141  // 2020-03-12].
  6142  //
  6143  //	"LAST_7_DAYS" - Last 7 days, excluding current day.
  6144  //	"LAST_30_DAYS" - Last 30 days, excluding current day.
  6145  func (c *AccountsReportsSavedGenerateCsvCall) DateRange(dateRange string) *AccountsReportsSavedGenerateCsvCall {
  6146  	c.urlParams_.Set("dateRange", dateRange)
  6147  	return c
  6148  }
  6149  
  6150  // EndDateDay sets the optional parameter "endDate.day": Day of a month. Must
  6151  // be from 1 to 31 and valid for the year and month, or 0 to specify a year by
  6152  // itself or a year and month where the day isn't significant.
  6153  func (c *AccountsReportsSavedGenerateCsvCall) EndDateDay(endDateDay int64) *AccountsReportsSavedGenerateCsvCall {
  6154  	c.urlParams_.Set("endDate.day", fmt.Sprint(endDateDay))
  6155  	return c
  6156  }
  6157  
  6158  // EndDateMonth sets the optional parameter "endDate.month": Month of a year.
  6159  // Must be from 1 to 12, or 0 to specify a year without a month and day.
  6160  func (c *AccountsReportsSavedGenerateCsvCall) EndDateMonth(endDateMonth int64) *AccountsReportsSavedGenerateCsvCall {
  6161  	c.urlParams_.Set("endDate.month", fmt.Sprint(endDateMonth))
  6162  	return c
  6163  }
  6164  
  6165  // EndDateYear sets the optional parameter "endDate.year": Year of the date.
  6166  // Must be from 1 to 9999, or 0 to specify a date without a year.
  6167  func (c *AccountsReportsSavedGenerateCsvCall) EndDateYear(endDateYear int64) *AccountsReportsSavedGenerateCsvCall {
  6168  	c.urlParams_.Set("endDate.year", fmt.Sprint(endDateYear))
  6169  	return c
  6170  }
  6171  
  6172  // LanguageCode sets the optional parameter "languageCode": The language to use
  6173  // for translating report output. If unspecified, this defaults to English
  6174  // ("en"). If the given language is not supported, report output will be
  6175  // returned in English. The language is specified as an IETF BCP-47 language
  6176  // code (https://en.wikipedia.org/wiki/IETF_language_tag).
  6177  func (c *AccountsReportsSavedGenerateCsvCall) LanguageCode(languageCode string) *AccountsReportsSavedGenerateCsvCall {
  6178  	c.urlParams_.Set("languageCode", languageCode)
  6179  	return c
  6180  }
  6181  
  6182  // ReportingTimeZone sets the optional parameter "reportingTimeZone": Timezone
  6183  // in which to generate the report. If unspecified, this defaults to the
  6184  // account timezone. For more information, see changing the time zone of your
  6185  // reports (https://support.google.com/adsense/answer/9830725).
  6186  //
  6187  // Possible values:
  6188  //
  6189  //	"REPORTING_TIME_ZONE_UNSPECIFIED" - Unspecified timezone.
  6190  //	"ACCOUNT_TIME_ZONE" - Use the account timezone in the report.
  6191  //	"GOOGLE_TIME_ZONE" - Use the Google timezone in the report
  6192  //
  6193  // (America/Los_Angeles).
  6194  func (c *AccountsReportsSavedGenerateCsvCall) ReportingTimeZone(reportingTimeZone string) *AccountsReportsSavedGenerateCsvCall {
  6195  	c.urlParams_.Set("reportingTimeZone", reportingTimeZone)
  6196  	return c
  6197  }
  6198  
  6199  // StartDateDay sets the optional parameter "startDate.day": Day of a month.
  6200  // Must be from 1 to 31 and valid for the year and month, or 0 to specify a
  6201  // year by itself or a year and month where the day isn't significant.
  6202  func (c *AccountsReportsSavedGenerateCsvCall) StartDateDay(startDateDay int64) *AccountsReportsSavedGenerateCsvCall {
  6203  	c.urlParams_.Set("startDate.day", fmt.Sprint(startDateDay))
  6204  	return c
  6205  }
  6206  
  6207  // StartDateMonth sets the optional parameter "startDate.month": Month of a
  6208  // year. Must be from 1 to 12, or 0 to specify a year without a month and day.
  6209  func (c *AccountsReportsSavedGenerateCsvCall) StartDateMonth(startDateMonth int64) *AccountsReportsSavedGenerateCsvCall {
  6210  	c.urlParams_.Set("startDate.month", fmt.Sprint(startDateMonth))
  6211  	return c
  6212  }
  6213  
  6214  // StartDateYear sets the optional parameter "startDate.year": Year of the
  6215  // date. Must be from 1 to 9999, or 0 to specify a date without a year.
  6216  func (c *AccountsReportsSavedGenerateCsvCall) StartDateYear(startDateYear int64) *AccountsReportsSavedGenerateCsvCall {
  6217  	c.urlParams_.Set("startDate.year", fmt.Sprint(startDateYear))
  6218  	return c
  6219  }
  6220  
  6221  // Fields allows partial responses to be retrieved. See
  6222  // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse for more
  6223  // details.
  6224  func (c *AccountsReportsSavedGenerateCsvCall) Fields(s ...googleapi.Field) *AccountsReportsSavedGenerateCsvCall {
  6225  	c.urlParams_.Set("fields", googleapi.CombineFields(s))
  6226  	return c
  6227  }
  6228  
  6229  // IfNoneMatch sets an optional parameter which makes the operation fail if the
  6230  // object's ETag matches the given value. This is useful for getting updates
  6231  // only after the object has changed since the last request.
  6232  func (c *AccountsReportsSavedGenerateCsvCall) IfNoneMatch(entityTag string) *AccountsReportsSavedGenerateCsvCall {
  6233  	c.ifNoneMatch_ = entityTag
  6234  	return c
  6235  }
  6236  
  6237  // Context sets the context to be used in this call's Do method.
  6238  func (c *AccountsReportsSavedGenerateCsvCall) Context(ctx context.Context) *AccountsReportsSavedGenerateCsvCall {
  6239  	c.ctx_ = ctx
  6240  	return c
  6241  }
  6242  
  6243  // Header returns a http.Header that can be modified by the caller to add
  6244  // headers to the request.
  6245  func (c *AccountsReportsSavedGenerateCsvCall) Header() http.Header {
  6246  	if c.header_ == nil {
  6247  		c.header_ = make(http.Header)
  6248  	}
  6249  	return c.header_
  6250  }
  6251  
  6252  func (c *AccountsReportsSavedGenerateCsvCall) doRequest(alt string) (*http.Response, error) {
  6253  	reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_)
  6254  	if c.ifNoneMatch_ != "" {
  6255  		reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  6256  	}
  6257  	var body io.Reader = nil
  6258  	c.urlParams_.Set("alt", alt)
  6259  	c.urlParams_.Set("prettyPrint", "false")
  6260  	urls := googleapi.ResolveRelative(c.s.BasePath, "v2/{+name}/saved:generateCsv")
  6261  	urls += "?" + c.urlParams_.Encode()
  6262  	req, err := http.NewRequest("GET", urls, body)
  6263  	if err != nil {
  6264  		return nil, err
  6265  	}
  6266  	req.Header = reqHeaders
  6267  	googleapi.Expand(req.URL, map[string]string{
  6268  		"name": c.name,
  6269  	})
  6270  	return gensupport.SendRequest(c.ctx_, c.s.client, req)
  6271  }
  6272  
  6273  // Do executes the "adsense.accounts.reports.saved.generateCsv" call.
  6274  // Any non-2xx status code is an error. Response headers are in either
  6275  // *HttpBody.ServerResponse.Header or (if a response was returned at all) in
  6276  // error.(*googleapi.Error).Header. Use googleapi.IsNotModified to check
  6277  // whether the returned error was because http.StatusNotModified was returned.
  6278  func (c *AccountsReportsSavedGenerateCsvCall) Do(opts ...googleapi.CallOption) (*HttpBody, error) {
  6279  	gensupport.SetOptions(c.urlParams_, opts...)
  6280  	res, err := c.doRequest("json")
  6281  	if res != nil && res.StatusCode == http.StatusNotModified {
  6282  		if res.Body != nil {
  6283  			res.Body.Close()
  6284  		}
  6285  		return nil, gensupport.WrapError(&googleapi.Error{
  6286  			Code:   res.StatusCode,
  6287  			Header: res.Header,
  6288  		})
  6289  	}
  6290  	if err != nil {
  6291  		return nil, err
  6292  	}
  6293  	defer googleapi.CloseBody(res)
  6294  	if err := googleapi.CheckResponse(res); err != nil {
  6295  		return nil, gensupport.WrapError(err)
  6296  	}
  6297  	ret := &HttpBody{
  6298  		ServerResponse: googleapi.ServerResponse{
  6299  			Header:         res.Header,
  6300  			HTTPStatusCode: res.StatusCode,
  6301  		},
  6302  	}
  6303  	target := &ret
  6304  	if err := gensupport.DecodeResponse(target, res); err != nil {
  6305  		return nil, err
  6306  	}
  6307  	return ret, nil
  6308  }
  6309  
  6310  type AccountsReportsSavedListCall struct {
  6311  	s            *Service
  6312  	parent       string
  6313  	urlParams_   gensupport.URLParams
  6314  	ifNoneMatch_ string
  6315  	ctx_         context.Context
  6316  	header_      http.Header
  6317  }
  6318  
  6319  // List: Lists saved reports.
  6320  //
  6321  //   - parent: The account which owns the collection of reports. Format:
  6322  //     accounts/{account}.
  6323  func (r *AccountsReportsSavedService) List(parent string) *AccountsReportsSavedListCall {
  6324  	c := &AccountsReportsSavedListCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  6325  	c.parent = parent
  6326  	return c
  6327  }
  6328  
  6329  // PageSize sets the optional parameter "pageSize": The maximum number of
  6330  // reports to include in the response, used for paging. If unspecified, at most
  6331  // 10000 reports will be returned. The maximum value is 10000; values above
  6332  // 10000 will be coerced to 10000.
  6333  func (c *AccountsReportsSavedListCall) PageSize(pageSize int64) *AccountsReportsSavedListCall {
  6334  	c.urlParams_.Set("pageSize", fmt.Sprint(pageSize))
  6335  	return c
  6336  }
  6337  
  6338  // PageToken sets the optional parameter "pageToken": A page token, received
  6339  // from a previous `ListSavedReports` call. Provide this to retrieve the
  6340  // subsequent page. When paginating, all other parameters provided to
  6341  // `ListSavedReports` must match the call that provided the page token.
  6342  func (c *AccountsReportsSavedListCall) PageToken(pageToken string) *AccountsReportsSavedListCall {
  6343  	c.urlParams_.Set("pageToken", pageToken)
  6344  	return c
  6345  }
  6346  
  6347  // Fields allows partial responses to be retrieved. See
  6348  // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse for more
  6349  // details.
  6350  func (c *AccountsReportsSavedListCall) Fields(s ...googleapi.Field) *AccountsReportsSavedListCall {
  6351  	c.urlParams_.Set("fields", googleapi.CombineFields(s))
  6352  	return c
  6353  }
  6354  
  6355  // IfNoneMatch sets an optional parameter which makes the operation fail if the
  6356  // object's ETag matches the given value. This is useful for getting updates
  6357  // only after the object has changed since the last request.
  6358  func (c *AccountsReportsSavedListCall) IfNoneMatch(entityTag string) *AccountsReportsSavedListCall {
  6359  	c.ifNoneMatch_ = entityTag
  6360  	return c
  6361  }
  6362  
  6363  // Context sets the context to be used in this call's Do method.
  6364  func (c *AccountsReportsSavedListCall) Context(ctx context.Context) *AccountsReportsSavedListCall {
  6365  	c.ctx_ = ctx
  6366  	return c
  6367  }
  6368  
  6369  // Header returns a http.Header that can be modified by the caller to add
  6370  // headers to the request.
  6371  func (c *AccountsReportsSavedListCall) Header() http.Header {
  6372  	if c.header_ == nil {
  6373  		c.header_ = make(http.Header)
  6374  	}
  6375  	return c.header_
  6376  }
  6377  
  6378  func (c *AccountsReportsSavedListCall) doRequest(alt string) (*http.Response, error) {
  6379  	reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_)
  6380  	if c.ifNoneMatch_ != "" {
  6381  		reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  6382  	}
  6383  	var body io.Reader = nil
  6384  	c.urlParams_.Set("alt", alt)
  6385  	c.urlParams_.Set("prettyPrint", "false")
  6386  	urls := googleapi.ResolveRelative(c.s.BasePath, "v2/{+parent}/reports/saved")
  6387  	urls += "?" + c.urlParams_.Encode()
  6388  	req, err := http.NewRequest("GET", urls, body)
  6389  	if err != nil {
  6390  		return nil, err
  6391  	}
  6392  	req.Header = reqHeaders
  6393  	googleapi.Expand(req.URL, map[string]string{
  6394  		"parent": c.parent,
  6395  	})
  6396  	return gensupport.SendRequest(c.ctx_, c.s.client, req)
  6397  }
  6398  
  6399  // Do executes the "adsense.accounts.reports.saved.list" call.
  6400  // Any non-2xx status code is an error. Response headers are in either
  6401  // *ListSavedReportsResponse.ServerResponse.Header or (if a response was
  6402  // returned at all) in error.(*googleapi.Error).Header. Use
  6403  // googleapi.IsNotModified to check whether the returned error was because
  6404  // http.StatusNotModified was returned.
  6405  func (c *AccountsReportsSavedListCall) Do(opts ...googleapi.CallOption) (*ListSavedReportsResponse, error) {
  6406  	gensupport.SetOptions(c.urlParams_, opts...)
  6407  	res, err := c.doRequest("json")
  6408  	if res != nil && res.StatusCode == http.StatusNotModified {
  6409  		if res.Body != nil {
  6410  			res.Body.Close()
  6411  		}
  6412  		return nil, gensupport.WrapError(&googleapi.Error{
  6413  			Code:   res.StatusCode,
  6414  			Header: res.Header,
  6415  		})
  6416  	}
  6417  	if err != nil {
  6418  		return nil, err
  6419  	}
  6420  	defer googleapi.CloseBody(res)
  6421  	if err := googleapi.CheckResponse(res); err != nil {
  6422  		return nil, gensupport.WrapError(err)
  6423  	}
  6424  	ret := &ListSavedReportsResponse{
  6425  		ServerResponse: googleapi.ServerResponse{
  6426  			Header:         res.Header,
  6427  			HTTPStatusCode: res.StatusCode,
  6428  		},
  6429  	}
  6430  	target := &ret
  6431  	if err := gensupport.DecodeResponse(target, res); err != nil {
  6432  		return nil, err
  6433  	}
  6434  	return ret, nil
  6435  }
  6436  
  6437  // Pages invokes f for each page of results.
  6438  // A non-nil error returned from f will halt the iteration.
  6439  // The provided context supersedes any context provided to the Context method.
  6440  func (c *AccountsReportsSavedListCall) Pages(ctx context.Context, f func(*ListSavedReportsResponse) error) error {
  6441  	c.ctx_ = ctx
  6442  	defer c.PageToken(c.urlParams_.Get("pageToken"))
  6443  	for {
  6444  		x, err := c.Do()
  6445  		if err != nil {
  6446  			return err
  6447  		}
  6448  		if err := f(x); err != nil {
  6449  			return err
  6450  		}
  6451  		if x.NextPageToken == "" {
  6452  			return nil
  6453  		}
  6454  		c.PageToken(x.NextPageToken)
  6455  	}
  6456  }
  6457  
  6458  type AccountsSitesGetCall struct {
  6459  	s            *Service
  6460  	name         string
  6461  	urlParams_   gensupport.URLParams
  6462  	ifNoneMatch_ string
  6463  	ctx_         context.Context
  6464  	header_      http.Header
  6465  }
  6466  
  6467  // Get: Gets information about the selected site.
  6468  //
  6469  // - name: Name of the site. Format: accounts/{account}/sites/{site}.
  6470  func (r *AccountsSitesService) Get(name string) *AccountsSitesGetCall {
  6471  	c := &AccountsSitesGetCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  6472  	c.name = name
  6473  	return c
  6474  }
  6475  
  6476  // Fields allows partial responses to be retrieved. See
  6477  // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse for more
  6478  // details.
  6479  func (c *AccountsSitesGetCall) Fields(s ...googleapi.Field) *AccountsSitesGetCall {
  6480  	c.urlParams_.Set("fields", googleapi.CombineFields(s))
  6481  	return c
  6482  }
  6483  
  6484  // IfNoneMatch sets an optional parameter which makes the operation fail if the
  6485  // object's ETag matches the given value. This is useful for getting updates
  6486  // only after the object has changed since the last request.
  6487  func (c *AccountsSitesGetCall) IfNoneMatch(entityTag string) *AccountsSitesGetCall {
  6488  	c.ifNoneMatch_ = entityTag
  6489  	return c
  6490  }
  6491  
  6492  // Context sets the context to be used in this call's Do method.
  6493  func (c *AccountsSitesGetCall) Context(ctx context.Context) *AccountsSitesGetCall {
  6494  	c.ctx_ = ctx
  6495  	return c
  6496  }
  6497  
  6498  // Header returns a http.Header that can be modified by the caller to add
  6499  // headers to the request.
  6500  func (c *AccountsSitesGetCall) Header() http.Header {
  6501  	if c.header_ == nil {
  6502  		c.header_ = make(http.Header)
  6503  	}
  6504  	return c.header_
  6505  }
  6506  
  6507  func (c *AccountsSitesGetCall) doRequest(alt string) (*http.Response, error) {
  6508  	reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_)
  6509  	if c.ifNoneMatch_ != "" {
  6510  		reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  6511  	}
  6512  	var body io.Reader = nil
  6513  	c.urlParams_.Set("alt", alt)
  6514  	c.urlParams_.Set("prettyPrint", "false")
  6515  	urls := googleapi.ResolveRelative(c.s.BasePath, "v2/{+name}")
  6516  	urls += "?" + c.urlParams_.Encode()
  6517  	req, err := http.NewRequest("GET", urls, body)
  6518  	if err != nil {
  6519  		return nil, err
  6520  	}
  6521  	req.Header = reqHeaders
  6522  	googleapi.Expand(req.URL, map[string]string{
  6523  		"name": c.name,
  6524  	})
  6525  	return gensupport.SendRequest(c.ctx_, c.s.client, req)
  6526  }
  6527  
  6528  // Do executes the "adsense.accounts.sites.get" call.
  6529  // Any non-2xx status code is an error. Response headers are in either
  6530  // *Site.ServerResponse.Header or (if a response was returned at all) in
  6531  // error.(*googleapi.Error).Header. Use googleapi.IsNotModified to check
  6532  // whether the returned error was because http.StatusNotModified was returned.
  6533  func (c *AccountsSitesGetCall) Do(opts ...googleapi.CallOption) (*Site, error) {
  6534  	gensupport.SetOptions(c.urlParams_, opts...)
  6535  	res, err := c.doRequest("json")
  6536  	if res != nil && res.StatusCode == http.StatusNotModified {
  6537  		if res.Body != nil {
  6538  			res.Body.Close()
  6539  		}
  6540  		return nil, gensupport.WrapError(&googleapi.Error{
  6541  			Code:   res.StatusCode,
  6542  			Header: res.Header,
  6543  		})
  6544  	}
  6545  	if err != nil {
  6546  		return nil, err
  6547  	}
  6548  	defer googleapi.CloseBody(res)
  6549  	if err := googleapi.CheckResponse(res); err != nil {
  6550  		return nil, gensupport.WrapError(err)
  6551  	}
  6552  	ret := &Site{
  6553  		ServerResponse: googleapi.ServerResponse{
  6554  			Header:         res.Header,
  6555  			HTTPStatusCode: res.StatusCode,
  6556  		},
  6557  	}
  6558  	target := &ret
  6559  	if err := gensupport.DecodeResponse(target, res); err != nil {
  6560  		return nil, err
  6561  	}
  6562  	return ret, nil
  6563  }
  6564  
  6565  type AccountsSitesListCall struct {
  6566  	s            *Service
  6567  	parent       string
  6568  	urlParams_   gensupport.URLParams
  6569  	ifNoneMatch_ string
  6570  	ctx_         context.Context
  6571  	header_      http.Header
  6572  }
  6573  
  6574  // List: Lists all the sites available in an account.
  6575  //
  6576  //   - parent: The account which owns the collection of sites. Format:
  6577  //     accounts/{account}.
  6578  func (r *AccountsSitesService) List(parent string) *AccountsSitesListCall {
  6579  	c := &AccountsSitesListCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  6580  	c.parent = parent
  6581  	return c
  6582  }
  6583  
  6584  // PageSize sets the optional parameter "pageSize": The maximum number of sites
  6585  // to include in the response, used for paging. If unspecified, at most 10000
  6586  // sites will be returned. The maximum value is 10000; values above 10000 will
  6587  // be coerced to 10000.
  6588  func (c *AccountsSitesListCall) PageSize(pageSize int64) *AccountsSitesListCall {
  6589  	c.urlParams_.Set("pageSize", fmt.Sprint(pageSize))
  6590  	return c
  6591  }
  6592  
  6593  // PageToken sets the optional parameter "pageToken": A page token, received
  6594  // from a previous `ListSites` call. Provide this to retrieve the subsequent
  6595  // page. When paginating, all other parameters provided to `ListSites` must
  6596  // match the call that provided the page token.
  6597  func (c *AccountsSitesListCall) PageToken(pageToken string) *AccountsSitesListCall {
  6598  	c.urlParams_.Set("pageToken", pageToken)
  6599  	return c
  6600  }
  6601  
  6602  // Fields allows partial responses to be retrieved. See
  6603  // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse for more
  6604  // details.
  6605  func (c *AccountsSitesListCall) Fields(s ...googleapi.Field) *AccountsSitesListCall {
  6606  	c.urlParams_.Set("fields", googleapi.CombineFields(s))
  6607  	return c
  6608  }
  6609  
  6610  // IfNoneMatch sets an optional parameter which makes the operation fail if the
  6611  // object's ETag matches the given value. This is useful for getting updates
  6612  // only after the object has changed since the last request.
  6613  func (c *AccountsSitesListCall) IfNoneMatch(entityTag string) *AccountsSitesListCall {
  6614  	c.ifNoneMatch_ = entityTag
  6615  	return c
  6616  }
  6617  
  6618  // Context sets the context to be used in this call's Do method.
  6619  func (c *AccountsSitesListCall) Context(ctx context.Context) *AccountsSitesListCall {
  6620  	c.ctx_ = ctx
  6621  	return c
  6622  }
  6623  
  6624  // Header returns a http.Header that can be modified by the caller to add
  6625  // headers to the request.
  6626  func (c *AccountsSitesListCall) Header() http.Header {
  6627  	if c.header_ == nil {
  6628  		c.header_ = make(http.Header)
  6629  	}
  6630  	return c.header_
  6631  }
  6632  
  6633  func (c *AccountsSitesListCall) doRequest(alt string) (*http.Response, error) {
  6634  	reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_)
  6635  	if c.ifNoneMatch_ != "" {
  6636  		reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  6637  	}
  6638  	var body io.Reader = nil
  6639  	c.urlParams_.Set("alt", alt)
  6640  	c.urlParams_.Set("prettyPrint", "false")
  6641  	urls := googleapi.ResolveRelative(c.s.BasePath, "v2/{+parent}/sites")
  6642  	urls += "?" + c.urlParams_.Encode()
  6643  	req, err := http.NewRequest("GET", urls, body)
  6644  	if err != nil {
  6645  		return nil, err
  6646  	}
  6647  	req.Header = reqHeaders
  6648  	googleapi.Expand(req.URL, map[string]string{
  6649  		"parent": c.parent,
  6650  	})
  6651  	return gensupport.SendRequest(c.ctx_, c.s.client, req)
  6652  }
  6653  
  6654  // Do executes the "adsense.accounts.sites.list" call.
  6655  // Any non-2xx status code is an error. Response headers are in either
  6656  // *ListSitesResponse.ServerResponse.Header or (if a response was returned at
  6657  // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to
  6658  // check whether the returned error was because http.StatusNotModified was
  6659  // returned.
  6660  func (c *AccountsSitesListCall) Do(opts ...googleapi.CallOption) (*ListSitesResponse, error) {
  6661  	gensupport.SetOptions(c.urlParams_, opts...)
  6662  	res, err := c.doRequest("json")
  6663  	if res != nil && res.StatusCode == http.StatusNotModified {
  6664  		if res.Body != nil {
  6665  			res.Body.Close()
  6666  		}
  6667  		return nil, gensupport.WrapError(&googleapi.Error{
  6668  			Code:   res.StatusCode,
  6669  			Header: res.Header,
  6670  		})
  6671  	}
  6672  	if err != nil {
  6673  		return nil, err
  6674  	}
  6675  	defer googleapi.CloseBody(res)
  6676  	if err := googleapi.CheckResponse(res); err != nil {
  6677  		return nil, gensupport.WrapError(err)
  6678  	}
  6679  	ret := &ListSitesResponse{
  6680  		ServerResponse: googleapi.ServerResponse{
  6681  			Header:         res.Header,
  6682  			HTTPStatusCode: res.StatusCode,
  6683  		},
  6684  	}
  6685  	target := &ret
  6686  	if err := gensupport.DecodeResponse(target, res); err != nil {
  6687  		return nil, err
  6688  	}
  6689  	return ret, nil
  6690  }
  6691  
  6692  // Pages invokes f for each page of results.
  6693  // A non-nil error returned from f will halt the iteration.
  6694  // The provided context supersedes any context provided to the Context method.
  6695  func (c *AccountsSitesListCall) Pages(ctx context.Context, f func(*ListSitesResponse) error) error {
  6696  	c.ctx_ = ctx
  6697  	defer c.PageToken(c.urlParams_.Get("pageToken"))
  6698  	for {
  6699  		x, err := c.Do()
  6700  		if err != nil {
  6701  			return err
  6702  		}
  6703  		if err := f(x); err != nil {
  6704  			return err
  6705  		}
  6706  		if x.NextPageToken == "" {
  6707  			return nil
  6708  		}
  6709  		c.PageToken(x.NextPageToken)
  6710  	}
  6711  }
  6712  

View as plain text