...

Source file src/google.golang.org/api/adexchangeseller/v1.1/adexchangeseller-gen.go

Documentation: google.golang.org/api/adexchangeseller/v1.1

     1  // Copyright 2020 Google LLC.
     2  // Use of this source code is governed by a BSD-style
     3  // license that can be found in the LICENSE file.
     4  
     5  // Code generated file. DO NOT EDIT.
     6  
     7  // Package adexchangeseller provides access to the Ad Exchange Seller API.
     8  //
     9  // For product documentation, see: https://developers.google.com/ad-exchange/seller-rest/
    10  //
    11  // # Creating a client
    12  //
    13  // Usage example:
    14  //
    15  //	import "google.golang.org/api/adexchangeseller/v1.1"
    16  //	...
    17  //	ctx := context.Background()
    18  //	adexchangesellerService, err := adexchangeseller.NewService(ctx)
    19  //
    20  // In this example, Google Application Default Credentials are used for authentication.
    21  //
    22  // For information on how to create and obtain Application Default Credentials, see https://developers.google.com/identity/protocols/application-default-credentials.
    23  //
    24  // # Other authentication options
    25  //
    26  // By default, all available scopes (see "Constants") are used to authenticate. To restrict scopes, use option.WithScopes:
    27  //
    28  //	adexchangesellerService, err := adexchangeseller.NewService(ctx, option.WithScopes(adexchangeseller.AdexchangeSellerReadonlyScope))
    29  //
    30  // To use an API key for authentication (note: some APIs do not support API keys), use option.WithAPIKey:
    31  //
    32  //	adexchangesellerService, err := adexchangeseller.NewService(ctx, option.WithAPIKey("AIza..."))
    33  //
    34  // To use an OAuth token (e.g., a user token obtained via a three-legged OAuth flow), use option.WithTokenSource:
    35  //
    36  //	config := &oauth2.Config{...}
    37  //	// ...
    38  //	token, err := config.Exchange(ctx, ...)
    39  //	adexchangesellerService, err := adexchangeseller.NewService(ctx, option.WithTokenSource(config.TokenSource(ctx, token)))
    40  //
    41  // See https://godoc.org/google.golang.org/api/option/ for details on options.
    42  package adexchangeseller // import "google.golang.org/api/adexchangeseller/v1.1"
    43  
    44  import (
    45  	"bytes"
    46  	"context"
    47  	"encoding/json"
    48  	"errors"
    49  	"fmt"
    50  	"io"
    51  	"net/http"
    52  	"net/url"
    53  	"strconv"
    54  	"strings"
    55  
    56  	googleapi "google.golang.org/api/googleapi"
    57  	gensupport "google.golang.org/api/internal/gensupport"
    58  	option "google.golang.org/api/option"
    59  	htransport "google.golang.org/api/transport/http"
    60  )
    61  
    62  // Always reference these packages, just in case the auto-generated code
    63  // below doesn't.
    64  var _ = bytes.NewBuffer
    65  var _ = strconv.Itoa
    66  var _ = fmt.Sprintf
    67  var _ = json.NewDecoder
    68  var _ = io.Copy
    69  var _ = url.Parse
    70  var _ = gensupport.MarshalJSON
    71  var _ = googleapi.Version
    72  var _ = errors.New
    73  var _ = strings.Replace
    74  var _ = context.Canceled
    75  
    76  const apiId = "adexchangeseller:v1.1"
    77  const apiName = "adexchangeseller"
    78  const apiVersion = "v1.1"
    79  const basePath = "https://www.googleapis.com/adexchangeseller/v1.1/"
    80  
    81  // OAuth2 scopes used by this API.
    82  const (
    83  	// View and manage your Ad Exchange data
    84  	AdexchangeSellerScope = "https://www.googleapis.com/auth/adexchange.seller"
    85  
    86  	// View your Ad Exchange data
    87  	AdexchangeSellerReadonlyScope = "https://www.googleapis.com/auth/adexchange.seller.readonly"
    88  )
    89  
    90  // NewService creates a new Service.
    91  func NewService(ctx context.Context, opts ...option.ClientOption) (*Service, error) {
    92  	scopesOption := option.WithScopes(
    93  		"https://www.googleapis.com/auth/adexchange.seller",
    94  		"https://www.googleapis.com/auth/adexchange.seller.readonly",
    95  	)
    96  	// NOTE: prepend, so we don't override user-specified scopes.
    97  	opts = append([]option.ClientOption{scopesOption}, opts...)
    98  	client, endpoint, err := htransport.NewClient(ctx, opts...)
    99  	if err != nil {
   100  		return nil, err
   101  	}
   102  	s, err := New(client)
   103  	if err != nil {
   104  		return nil, err
   105  	}
   106  	if endpoint != "" {
   107  		s.BasePath = endpoint
   108  	}
   109  	return s, nil
   110  }
   111  
   112  // New creates a new Service. It uses the provided http.Client for requests.
   113  //
   114  // Deprecated: please use NewService instead.
   115  // To provide a custom HTTP client, use option.WithHTTPClient.
   116  // If you are using google.golang.org/api/googleapis/transport.APIKey, use option.WithAPIKey with NewService instead.
   117  func New(client *http.Client) (*Service, error) {
   118  	if client == nil {
   119  		return nil, errors.New("client is nil")
   120  	}
   121  	s := &Service{client: client, BasePath: basePath}
   122  	s.Accounts = NewAccountsService(s)
   123  	s.Adclients = NewAdclientsService(s)
   124  	s.Adunits = NewAdunitsService(s)
   125  	s.Alerts = NewAlertsService(s)
   126  	s.Customchannels = NewCustomchannelsService(s)
   127  	s.Metadata = NewMetadataService(s)
   128  	s.Preferreddeals = NewPreferreddealsService(s)
   129  	s.Reports = NewReportsService(s)
   130  	s.Urlchannels = NewUrlchannelsService(s)
   131  	return s, nil
   132  }
   133  
   134  type Service struct {
   135  	client    *http.Client
   136  	BasePath  string // API endpoint base URL
   137  	UserAgent string // optional additional User-Agent fragment
   138  
   139  	Accounts *AccountsService
   140  
   141  	Adclients *AdclientsService
   142  
   143  	Adunits *AdunitsService
   144  
   145  	Alerts *AlertsService
   146  
   147  	Customchannels *CustomchannelsService
   148  
   149  	Metadata *MetadataService
   150  
   151  	Preferreddeals *PreferreddealsService
   152  
   153  	Reports *ReportsService
   154  
   155  	Urlchannels *UrlchannelsService
   156  }
   157  
   158  func (s *Service) userAgent() string {
   159  	if s.UserAgent == "" {
   160  		return googleapi.UserAgent
   161  	}
   162  	return googleapi.UserAgent + " " + s.UserAgent
   163  }
   164  
   165  func NewAccountsService(s *Service) *AccountsService {
   166  	rs := &AccountsService{s: s}
   167  	return rs
   168  }
   169  
   170  type AccountsService struct {
   171  	s *Service
   172  }
   173  
   174  func NewAdclientsService(s *Service) *AdclientsService {
   175  	rs := &AdclientsService{s: s}
   176  	return rs
   177  }
   178  
   179  type AdclientsService struct {
   180  	s *Service
   181  }
   182  
   183  func NewAdunitsService(s *Service) *AdunitsService {
   184  	rs := &AdunitsService{s: s}
   185  	rs.Customchannels = NewAdunitsCustomchannelsService(s)
   186  	return rs
   187  }
   188  
   189  type AdunitsService struct {
   190  	s *Service
   191  
   192  	Customchannels *AdunitsCustomchannelsService
   193  }
   194  
   195  func NewAdunitsCustomchannelsService(s *Service) *AdunitsCustomchannelsService {
   196  	rs := &AdunitsCustomchannelsService{s: s}
   197  	return rs
   198  }
   199  
   200  type AdunitsCustomchannelsService struct {
   201  	s *Service
   202  }
   203  
   204  func NewAlertsService(s *Service) *AlertsService {
   205  	rs := &AlertsService{s: s}
   206  	return rs
   207  }
   208  
   209  type AlertsService struct {
   210  	s *Service
   211  }
   212  
   213  func NewCustomchannelsService(s *Service) *CustomchannelsService {
   214  	rs := &CustomchannelsService{s: s}
   215  	rs.Adunits = NewCustomchannelsAdunitsService(s)
   216  	return rs
   217  }
   218  
   219  type CustomchannelsService struct {
   220  	s *Service
   221  
   222  	Adunits *CustomchannelsAdunitsService
   223  }
   224  
   225  func NewCustomchannelsAdunitsService(s *Service) *CustomchannelsAdunitsService {
   226  	rs := &CustomchannelsAdunitsService{s: s}
   227  	return rs
   228  }
   229  
   230  type CustomchannelsAdunitsService struct {
   231  	s *Service
   232  }
   233  
   234  func NewMetadataService(s *Service) *MetadataService {
   235  	rs := &MetadataService{s: s}
   236  	rs.Dimensions = NewMetadataDimensionsService(s)
   237  	rs.Metrics = NewMetadataMetricsService(s)
   238  	return rs
   239  }
   240  
   241  type MetadataService struct {
   242  	s *Service
   243  
   244  	Dimensions *MetadataDimensionsService
   245  
   246  	Metrics *MetadataMetricsService
   247  }
   248  
   249  func NewMetadataDimensionsService(s *Service) *MetadataDimensionsService {
   250  	rs := &MetadataDimensionsService{s: s}
   251  	return rs
   252  }
   253  
   254  type MetadataDimensionsService struct {
   255  	s *Service
   256  }
   257  
   258  func NewMetadataMetricsService(s *Service) *MetadataMetricsService {
   259  	rs := &MetadataMetricsService{s: s}
   260  	return rs
   261  }
   262  
   263  type MetadataMetricsService struct {
   264  	s *Service
   265  }
   266  
   267  func NewPreferreddealsService(s *Service) *PreferreddealsService {
   268  	rs := &PreferreddealsService{s: s}
   269  	return rs
   270  }
   271  
   272  type PreferreddealsService struct {
   273  	s *Service
   274  }
   275  
   276  func NewReportsService(s *Service) *ReportsService {
   277  	rs := &ReportsService{s: s}
   278  	rs.Saved = NewReportsSavedService(s)
   279  	return rs
   280  }
   281  
   282  type ReportsService struct {
   283  	s *Service
   284  
   285  	Saved *ReportsSavedService
   286  }
   287  
   288  func NewReportsSavedService(s *Service) *ReportsSavedService {
   289  	rs := &ReportsSavedService{s: s}
   290  	return rs
   291  }
   292  
   293  type ReportsSavedService struct {
   294  	s *Service
   295  }
   296  
   297  func NewUrlchannelsService(s *Service) *UrlchannelsService {
   298  	rs := &UrlchannelsService{s: s}
   299  	return rs
   300  }
   301  
   302  type UrlchannelsService struct {
   303  	s *Service
   304  }
   305  
   306  type Account struct {
   307  	// Id: Unique identifier of this account.
   308  	Id string `json:"id,omitempty"`
   309  
   310  	// Kind: Kind of resource this is, in this case
   311  	// adexchangeseller#account.
   312  	Kind string `json:"kind,omitempty"`
   313  
   314  	// Name: Name of this account.
   315  	Name string `json:"name,omitempty"`
   316  
   317  	// ServerResponse contains the HTTP response code and headers from the
   318  	// server.
   319  	googleapi.ServerResponse `json:"-"`
   320  
   321  	// ForceSendFields is a list of field names (e.g. "Id") to
   322  	// unconditionally include in API requests. By default, fields with
   323  	// empty values are omitted from API requests. However, any non-pointer,
   324  	// non-interface field appearing in ForceSendFields will be sent to the
   325  	// server regardless of whether the field is empty or not. This may be
   326  	// used to include empty fields in Patch requests.
   327  	ForceSendFields []string `json:"-"`
   328  
   329  	// NullFields is a list of field names (e.g. "Id") to include in API
   330  	// requests with the JSON null value. By default, fields with empty
   331  	// values are omitted from API requests. However, any field with an
   332  	// empty value appearing in NullFields will be sent to the server as
   333  	// null. It is an error if a field in this list has a non-empty value.
   334  	// This may be used to include null fields in Patch requests.
   335  	NullFields []string `json:"-"`
   336  }
   337  
   338  func (s *Account) MarshalJSON() ([]byte, error) {
   339  	type NoMethod Account
   340  	raw := NoMethod(*s)
   341  	return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
   342  }
   343  
   344  type AdClient struct {
   345  	// ArcOptIn: Whether this ad client is opted in to ARC.
   346  	ArcOptIn bool `json:"arcOptIn,omitempty"`
   347  
   348  	// Id: Unique identifier of this ad client.
   349  	Id string `json:"id,omitempty"`
   350  
   351  	// Kind: Kind of resource this is, in this case
   352  	// adexchangeseller#adClient.
   353  	Kind string `json:"kind,omitempty"`
   354  
   355  	// ProductCode: This ad client's product code, which corresponds to the
   356  	// PRODUCT_CODE report dimension.
   357  	ProductCode string `json:"productCode,omitempty"`
   358  
   359  	// SupportsReporting: Whether this ad client supports being reported on.
   360  	SupportsReporting bool `json:"supportsReporting,omitempty"`
   361  
   362  	// ForceSendFields is a list of field names (e.g. "ArcOptIn") to
   363  	// unconditionally include in API requests. By default, fields with
   364  	// empty values are omitted from API requests. However, any non-pointer,
   365  	// non-interface field appearing in ForceSendFields will be sent to the
   366  	// server regardless of whether the field is empty or not. This may be
   367  	// used to include empty fields in Patch requests.
   368  	ForceSendFields []string `json:"-"`
   369  
   370  	// NullFields is a list of field names (e.g. "ArcOptIn") to include in
   371  	// API requests with the JSON null value. By default, fields with empty
   372  	// values are omitted from API requests. However, any field with an
   373  	// empty value appearing in NullFields will be sent to the server as
   374  	// null. It is an error if a field in this list has a non-empty value.
   375  	// This may be used to include null fields in Patch requests.
   376  	NullFields []string `json:"-"`
   377  }
   378  
   379  func (s *AdClient) MarshalJSON() ([]byte, error) {
   380  	type NoMethod AdClient
   381  	raw := NoMethod(*s)
   382  	return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
   383  }
   384  
   385  type AdClients struct {
   386  	// Etag: ETag of this response for caching purposes.
   387  	Etag string `json:"etag,omitempty"`
   388  
   389  	// Items: The ad clients returned in this list response.
   390  	Items []*AdClient `json:"items,omitempty"`
   391  
   392  	// Kind: Kind of list this is, in this case adexchangeseller#adClients.
   393  	Kind string `json:"kind,omitempty"`
   394  
   395  	// NextPageToken: Continuation token used to page through ad clients. To
   396  	// retrieve the next page of results, set the next request's "pageToken"
   397  	// value to this.
   398  	NextPageToken string `json:"nextPageToken,omitempty"`
   399  
   400  	// ServerResponse contains the HTTP response code and headers from the
   401  	// server.
   402  	googleapi.ServerResponse `json:"-"`
   403  
   404  	// ForceSendFields is a list of field names (e.g. "Etag") to
   405  	// unconditionally include in API requests. By default, fields with
   406  	// empty values are omitted from API requests. However, any non-pointer,
   407  	// non-interface field appearing in ForceSendFields will be sent to the
   408  	// server regardless of whether the field is empty or not. This may be
   409  	// used to include empty fields in Patch requests.
   410  	ForceSendFields []string `json:"-"`
   411  
   412  	// NullFields is a list of field names (e.g. "Etag") to include in API
   413  	// requests with the JSON null value. By default, fields with empty
   414  	// values are omitted from API requests. However, any field with an
   415  	// empty value appearing in NullFields will be sent to the server as
   416  	// null. It is an error if a field in this list has a non-empty value.
   417  	// This may be used to include null fields in Patch requests.
   418  	NullFields []string `json:"-"`
   419  }
   420  
   421  func (s *AdClients) MarshalJSON() ([]byte, error) {
   422  	type NoMethod AdClients
   423  	raw := NoMethod(*s)
   424  	return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
   425  }
   426  
   427  type AdUnit struct {
   428  	// Code: Identity code of this ad unit, not necessarily unique across ad
   429  	// clients.
   430  	Code string `json:"code,omitempty"`
   431  
   432  	// Id: Unique identifier of this ad unit. This should be considered an
   433  	// opaque identifier; it is not safe to rely on it being in any
   434  	// particular format.
   435  	Id string `json:"id,omitempty"`
   436  
   437  	// Kind: Kind of resource this is, in this case adexchangeseller#adUnit.
   438  	Kind string `json:"kind,omitempty"`
   439  
   440  	// Name: Name of this ad unit.
   441  	Name string `json:"name,omitempty"`
   442  
   443  	// Status: Status of this ad unit. Possible values are:
   444  	// NEW: Indicates that the ad unit was created within the last seven
   445  	// days and does not yet have any activity associated with it.
   446  	//
   447  	// ACTIVE: Indicates that there has been activity on this ad unit in the
   448  	// last seven days.
   449  	//
   450  	// INACTIVE: Indicates that there has been no activity on this ad unit
   451  	// in the last seven days.
   452  	Status string `json:"status,omitempty"`
   453  
   454  	// ServerResponse contains the HTTP response code and headers from the
   455  	// server.
   456  	googleapi.ServerResponse `json:"-"`
   457  
   458  	// ForceSendFields is a list of field names (e.g. "Code") to
   459  	// unconditionally include in API requests. By default, fields with
   460  	// empty values are omitted from API requests. However, any non-pointer,
   461  	// non-interface field appearing in ForceSendFields will be sent to the
   462  	// server regardless of whether the field is empty or not. This may be
   463  	// used to include empty fields in Patch requests.
   464  	ForceSendFields []string `json:"-"`
   465  
   466  	// NullFields is a list of field names (e.g. "Code") to include in API
   467  	// requests with the JSON null value. By default, fields with empty
   468  	// values are omitted from API requests. However, any field with an
   469  	// empty value appearing in NullFields will be sent to the server as
   470  	// null. It is an error if a field in this list has a non-empty value.
   471  	// This may be used to include null fields in Patch requests.
   472  	NullFields []string `json:"-"`
   473  }
   474  
   475  func (s *AdUnit) MarshalJSON() ([]byte, error) {
   476  	type NoMethod AdUnit
   477  	raw := NoMethod(*s)
   478  	return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
   479  }
   480  
   481  type AdUnits struct {
   482  	// Etag: ETag of this response for caching purposes.
   483  	Etag string `json:"etag,omitempty"`
   484  
   485  	// Items: The ad units returned in this list response.
   486  	Items []*AdUnit `json:"items,omitempty"`
   487  
   488  	// Kind: Kind of list this is, in this case adexchangeseller#adUnits.
   489  	Kind string `json:"kind,omitempty"`
   490  
   491  	// NextPageToken: Continuation token used to page through ad units. To
   492  	// retrieve the next page of results, set the next request's "pageToken"
   493  	// value to this.
   494  	NextPageToken string `json:"nextPageToken,omitempty"`
   495  
   496  	// ServerResponse contains the HTTP response code and headers from the
   497  	// server.
   498  	googleapi.ServerResponse `json:"-"`
   499  
   500  	// ForceSendFields is a list of field names (e.g. "Etag") to
   501  	// unconditionally include in API requests. By default, fields with
   502  	// empty values are omitted from API requests. However, any non-pointer,
   503  	// non-interface field appearing in ForceSendFields will be sent to the
   504  	// server regardless of whether the field is empty or not. This may be
   505  	// used to include empty fields in Patch requests.
   506  	ForceSendFields []string `json:"-"`
   507  
   508  	// NullFields is a list of field names (e.g. "Etag") to include in API
   509  	// requests with the JSON null value. By default, fields with empty
   510  	// values are omitted from API requests. However, any field with an
   511  	// empty value appearing in NullFields will be sent to the server as
   512  	// null. It is an error if a field in this list has a non-empty value.
   513  	// This may be used to include null fields in Patch requests.
   514  	NullFields []string `json:"-"`
   515  }
   516  
   517  func (s *AdUnits) MarshalJSON() ([]byte, error) {
   518  	type NoMethod AdUnits
   519  	raw := NoMethod(*s)
   520  	return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
   521  }
   522  
   523  type Alert struct {
   524  	// Id: Unique identifier of this alert. This should be considered an
   525  	// opaque identifier; it is not safe to rely on it being in any
   526  	// particular format.
   527  	Id string `json:"id,omitempty"`
   528  
   529  	// Kind: Kind of resource this is, in this case adexchangeseller#alert.
   530  	Kind string `json:"kind,omitempty"`
   531  
   532  	// Message: The localized alert message.
   533  	Message string `json:"message,omitempty"`
   534  
   535  	// Severity: Severity of this alert. Possible values: INFO, WARNING,
   536  	// SEVERE.
   537  	Severity string `json:"severity,omitempty"`
   538  
   539  	// Type: Type of this alert. Possible values: SELF_HOLD,
   540  	// MIGRATED_TO_BILLING3, ADDRESS_PIN_VERIFICATION,
   541  	// PHONE_PIN_VERIFICATION, CORPORATE_ENTITY, GRAYLISTED_PUBLISHER,
   542  	// API_HOLD.
   543  	Type string `json:"type,omitempty"`
   544  
   545  	// ForceSendFields is a list of field names (e.g. "Id") to
   546  	// unconditionally include in API requests. By default, fields with
   547  	// empty values are omitted from API requests. However, any non-pointer,
   548  	// non-interface field appearing in ForceSendFields will be sent to the
   549  	// server regardless of whether the field is empty or not. This may be
   550  	// used to include empty fields in Patch requests.
   551  	ForceSendFields []string `json:"-"`
   552  
   553  	// NullFields is a list of field names (e.g. "Id") to include in API
   554  	// requests with the JSON null value. By default, fields with empty
   555  	// values are omitted from API requests. However, any field with an
   556  	// empty value appearing in NullFields will be sent to the server as
   557  	// null. It is an error if a field in this list has a non-empty value.
   558  	// This may be used to include null fields in Patch requests.
   559  	NullFields []string `json:"-"`
   560  }
   561  
   562  func (s *Alert) MarshalJSON() ([]byte, error) {
   563  	type NoMethod Alert
   564  	raw := NoMethod(*s)
   565  	return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
   566  }
   567  
   568  type Alerts struct {
   569  	// Items: The alerts returned in this list response.
   570  	Items []*Alert `json:"items,omitempty"`
   571  
   572  	// Kind: Kind of list this is, in this case adexchangeseller#alerts.
   573  	Kind string `json:"kind,omitempty"`
   574  
   575  	// ServerResponse contains the HTTP response code and headers from the
   576  	// server.
   577  	googleapi.ServerResponse `json:"-"`
   578  
   579  	// ForceSendFields is a list of field names (e.g. "Items") to
   580  	// unconditionally include in API requests. By default, fields with
   581  	// empty values are omitted from API requests. However, any non-pointer,
   582  	// non-interface field appearing in ForceSendFields will be sent to the
   583  	// server regardless of whether the field is empty or not. This may be
   584  	// used to include empty fields in Patch requests.
   585  	ForceSendFields []string `json:"-"`
   586  
   587  	// NullFields is a list of field names (e.g. "Items") to include in API
   588  	// requests with the JSON null value. By default, fields with empty
   589  	// values are omitted from API requests. However, any field with an
   590  	// empty value appearing in NullFields will be sent to the server as
   591  	// null. It is an error if a field in this list has a non-empty value.
   592  	// This may be used to include null fields in Patch requests.
   593  	NullFields []string `json:"-"`
   594  }
   595  
   596  func (s *Alerts) MarshalJSON() ([]byte, error) {
   597  	type NoMethod Alerts
   598  	raw := NoMethod(*s)
   599  	return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
   600  }
   601  
   602  type CustomChannel struct {
   603  	// Code: Code of this custom channel, not necessarily unique across ad
   604  	// clients.
   605  	Code string `json:"code,omitempty"`
   606  
   607  	// Id: Unique identifier of this custom channel. This should be
   608  	// considered an opaque identifier; it is not safe to rely on it being
   609  	// in any particular format.
   610  	Id string `json:"id,omitempty"`
   611  
   612  	// Kind: Kind of resource this is, in this case
   613  	// adexchangeseller#customChannel.
   614  	Kind string `json:"kind,omitempty"`
   615  
   616  	// Name: Name of this custom channel.
   617  	Name string `json:"name,omitempty"`
   618  
   619  	// TargetingInfo: The targeting information of this custom channel, if
   620  	// activated.
   621  	TargetingInfo *CustomChannelTargetingInfo `json:"targetingInfo,omitempty"`
   622  
   623  	// ServerResponse contains the HTTP response code and headers from the
   624  	// server.
   625  	googleapi.ServerResponse `json:"-"`
   626  
   627  	// ForceSendFields is a list of field names (e.g. "Code") to
   628  	// unconditionally include in API requests. By default, fields with
   629  	// empty values are omitted from API requests. However, any non-pointer,
   630  	// non-interface field appearing in ForceSendFields will be sent to the
   631  	// server regardless of whether the field is empty or not. This may be
   632  	// used to include empty fields in Patch requests.
   633  	ForceSendFields []string `json:"-"`
   634  
   635  	// NullFields is a list of field names (e.g. "Code") to include in API
   636  	// requests with the JSON null value. By default, fields with empty
   637  	// values are omitted from API requests. However, any field with an
   638  	// empty value appearing in NullFields will be sent to the server as
   639  	// null. It is an error if a field in this list has a non-empty value.
   640  	// This may be used to include null fields in Patch requests.
   641  	NullFields []string `json:"-"`
   642  }
   643  
   644  func (s *CustomChannel) MarshalJSON() ([]byte, error) {
   645  	type NoMethod CustomChannel
   646  	raw := NoMethod(*s)
   647  	return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
   648  }
   649  
   650  // CustomChannelTargetingInfo: The targeting information of this custom
   651  // channel, if activated.
   652  type CustomChannelTargetingInfo struct {
   653  	// AdsAppearOn: The name used to describe this channel externally.
   654  	AdsAppearOn string `json:"adsAppearOn,omitempty"`
   655  
   656  	// Description: The external description of the channel.
   657  	Description string `json:"description,omitempty"`
   658  
   659  	// Location: The locations in which ads appear. (Only valid for content
   660  	// and mobile content ads). Acceptable values for content ads are:
   661  	// TOP_LEFT, TOP_CENTER, TOP_RIGHT, MIDDLE_LEFT, MIDDLE_CENTER,
   662  	// MIDDLE_RIGHT, BOTTOM_LEFT, BOTTOM_CENTER, BOTTOM_RIGHT,
   663  	// MULTIPLE_LOCATIONS. Acceptable values for mobile content ads are:
   664  	// TOP, MIDDLE, BOTTOM, MULTIPLE_LOCATIONS.
   665  	Location string `json:"location,omitempty"`
   666  
   667  	// SiteLanguage: The language of the sites ads will be displayed on.
   668  	SiteLanguage string `json:"siteLanguage,omitempty"`
   669  
   670  	// ForceSendFields is a list of field names (e.g. "AdsAppearOn") to
   671  	// unconditionally include in API requests. By default, fields with
   672  	// empty values are omitted from API requests. However, any non-pointer,
   673  	// non-interface field appearing in ForceSendFields will be sent to the
   674  	// server regardless of whether the field is empty or not. This may be
   675  	// used to include empty fields in Patch requests.
   676  	ForceSendFields []string `json:"-"`
   677  
   678  	// NullFields is a list of field names (e.g. "AdsAppearOn") to include
   679  	// in API requests with the JSON null value. By default, fields with
   680  	// empty values are omitted from API requests. However, any field with
   681  	// an empty value appearing in NullFields will be sent to the server as
   682  	// null. It is an error if a field in this list has a non-empty value.
   683  	// This may be used to include null fields in Patch requests.
   684  	NullFields []string `json:"-"`
   685  }
   686  
   687  func (s *CustomChannelTargetingInfo) MarshalJSON() ([]byte, error) {
   688  	type NoMethod CustomChannelTargetingInfo
   689  	raw := NoMethod(*s)
   690  	return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
   691  }
   692  
   693  type CustomChannels struct {
   694  	// Etag: ETag of this response for caching purposes.
   695  	Etag string `json:"etag,omitempty"`
   696  
   697  	// Items: The custom channels returned in this list response.
   698  	Items []*CustomChannel `json:"items,omitempty"`
   699  
   700  	// Kind: Kind of list this is, in this case
   701  	// adexchangeseller#customChannels.
   702  	Kind string `json:"kind,omitempty"`
   703  
   704  	// NextPageToken: Continuation token used to page through custom
   705  	// channels. To retrieve the next page of results, set the next
   706  	// request's "pageToken" value to this.
   707  	NextPageToken string `json:"nextPageToken,omitempty"`
   708  
   709  	// ServerResponse contains the HTTP response code and headers from the
   710  	// server.
   711  	googleapi.ServerResponse `json:"-"`
   712  
   713  	// ForceSendFields is a list of field names (e.g. "Etag") to
   714  	// unconditionally include in API requests. By default, fields with
   715  	// empty values are omitted from API requests. However, any non-pointer,
   716  	// non-interface field appearing in ForceSendFields will be sent to the
   717  	// server regardless of whether the field is empty or not. This may be
   718  	// used to include empty fields in Patch requests.
   719  	ForceSendFields []string `json:"-"`
   720  
   721  	// NullFields is a list of field names (e.g. "Etag") to include in API
   722  	// requests with the JSON null value. By default, fields with empty
   723  	// values are omitted from API requests. However, any field with an
   724  	// empty value appearing in NullFields will be sent to the server as
   725  	// null. It is an error if a field in this list has a non-empty value.
   726  	// This may be used to include null fields in Patch requests.
   727  	NullFields []string `json:"-"`
   728  }
   729  
   730  func (s *CustomChannels) MarshalJSON() ([]byte, error) {
   731  	type NoMethod CustomChannels
   732  	raw := NoMethod(*s)
   733  	return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
   734  }
   735  
   736  type Metadata struct {
   737  	Items []*ReportingMetadataEntry `json:"items,omitempty"`
   738  
   739  	// Kind: Kind of list this is, in this case adexchangeseller#metadata.
   740  	Kind string `json:"kind,omitempty"`
   741  
   742  	// ServerResponse contains the HTTP response code and headers from the
   743  	// server.
   744  	googleapi.ServerResponse `json:"-"`
   745  
   746  	// ForceSendFields is a list of field names (e.g. "Items") to
   747  	// unconditionally include in API requests. By default, fields with
   748  	// empty values are omitted from API requests. However, any non-pointer,
   749  	// non-interface field appearing in ForceSendFields will be sent to the
   750  	// server regardless of whether the field is empty or not. This may be
   751  	// used to include empty fields in Patch requests.
   752  	ForceSendFields []string `json:"-"`
   753  
   754  	// NullFields is a list of field names (e.g. "Items") to include in API
   755  	// requests with the JSON null value. By default, fields with empty
   756  	// values are omitted from API requests. However, any field with an
   757  	// empty value appearing in NullFields will be sent to the server as
   758  	// null. It is an error if a field in this list has a non-empty value.
   759  	// This may be used to include null fields in Patch requests.
   760  	NullFields []string `json:"-"`
   761  }
   762  
   763  func (s *Metadata) MarshalJSON() ([]byte, error) {
   764  	type NoMethod Metadata
   765  	raw := NoMethod(*s)
   766  	return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
   767  }
   768  
   769  type PreferredDeal struct {
   770  	// AdvertiserName: The name of the advertiser this deal is for.
   771  	AdvertiserName string `json:"advertiserName,omitempty"`
   772  
   773  	// BuyerNetworkName: The name of the buyer network this deal is for.
   774  	BuyerNetworkName string `json:"buyerNetworkName,omitempty"`
   775  
   776  	// CurrencyCode: The currency code that applies to the fixed_cpm value.
   777  	// If not set then assumed to be USD.
   778  	CurrencyCode string `json:"currencyCode,omitempty"`
   779  
   780  	// EndTime: Time when this deal stops being active in seconds since the
   781  	// epoch (GMT). If not set then this deal is valid until manually
   782  	// disabled by the publisher.
   783  	EndTime uint64 `json:"endTime,omitempty,string"`
   784  
   785  	// FixedCpm: The fixed price for this preferred deal. In cpm micros of
   786  	// currency according to currencyCode. If set, then this preferred deal
   787  	// is eligible for the fixed price tier of buying (highest priority, pay
   788  	// exactly the configured fixed price).
   789  	FixedCpm int64 `json:"fixedCpm,omitempty,string"`
   790  
   791  	// Id: Unique identifier of this preferred deal.
   792  	Id int64 `json:"id,omitempty,string"`
   793  
   794  	// Kind: Kind of resource this is, in this case
   795  	// adexchangeseller#preferredDeal.
   796  	Kind string `json:"kind,omitempty"`
   797  
   798  	// StartTime: Time when this deal becomes active in seconds since the
   799  	// epoch (GMT). If not set then this deal is active immediately upon
   800  	// creation.
   801  	StartTime uint64 `json:"startTime,omitempty,string"`
   802  
   803  	// ServerResponse contains the HTTP response code and headers from the
   804  	// server.
   805  	googleapi.ServerResponse `json:"-"`
   806  
   807  	// ForceSendFields is a list of field names (e.g. "AdvertiserName") to
   808  	// unconditionally include in API requests. By default, fields with
   809  	// empty values are omitted from API requests. However, any non-pointer,
   810  	// non-interface field appearing in ForceSendFields will be sent to the
   811  	// server regardless of whether the field is empty or not. This may be
   812  	// used to include empty fields in Patch requests.
   813  	ForceSendFields []string `json:"-"`
   814  
   815  	// NullFields is a list of field names (e.g. "AdvertiserName") to
   816  	// include in API requests with the JSON null value. By default, fields
   817  	// with empty values are omitted from API requests. However, any field
   818  	// with an empty value appearing in NullFields will be sent to the
   819  	// server as null. It is an error if a field in this list has a
   820  	// non-empty value. This may be used to include null fields in Patch
   821  	// requests.
   822  	NullFields []string `json:"-"`
   823  }
   824  
   825  func (s *PreferredDeal) MarshalJSON() ([]byte, error) {
   826  	type NoMethod PreferredDeal
   827  	raw := NoMethod(*s)
   828  	return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
   829  }
   830  
   831  type PreferredDeals struct {
   832  	// Items: The preferred deals returned in this list response.
   833  	Items []*PreferredDeal `json:"items,omitempty"`
   834  
   835  	// Kind: Kind of list this is, in this case
   836  	// adexchangeseller#preferredDeals.
   837  	Kind string `json:"kind,omitempty"`
   838  
   839  	// ServerResponse contains the HTTP response code and headers from the
   840  	// server.
   841  	googleapi.ServerResponse `json:"-"`
   842  
   843  	// ForceSendFields is a list of field names (e.g. "Items") to
   844  	// unconditionally include in API requests. By default, fields with
   845  	// empty values are omitted from API requests. However, any non-pointer,
   846  	// non-interface field appearing in ForceSendFields will be sent to the
   847  	// server regardless of whether the field is empty or not. This may be
   848  	// used to include empty fields in Patch requests.
   849  	ForceSendFields []string `json:"-"`
   850  
   851  	// NullFields is a list of field names (e.g. "Items") to include in API
   852  	// requests with the JSON null value. By default, fields with empty
   853  	// values are omitted from API requests. However, any field with an
   854  	// empty value appearing in NullFields will be sent to the server as
   855  	// null. It is an error if a field in this list has a non-empty value.
   856  	// This may be used to include null fields in Patch requests.
   857  	NullFields []string `json:"-"`
   858  }
   859  
   860  func (s *PreferredDeals) MarshalJSON() ([]byte, error) {
   861  	type NoMethod PreferredDeals
   862  	raw := NoMethod(*s)
   863  	return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
   864  }
   865  
   866  type Report struct {
   867  	// Averages: The averages of the report. This is the same length as any
   868  	// other row in the report; cells corresponding to dimension columns are
   869  	// empty.
   870  	Averages []string `json:"averages,omitempty"`
   871  
   872  	// Headers: The header information of the columns requested in the
   873  	// report. This is a list of headers; one for each dimension in the
   874  	// request, followed by one for each metric in the request.
   875  	Headers []*ReportHeaders `json:"headers,omitempty"`
   876  
   877  	// Kind: Kind this is, in this case adexchangeseller#report.
   878  	Kind string `json:"kind,omitempty"`
   879  
   880  	// Rows: The output rows of the report. Each row is a list of cells; one
   881  	// for each dimension in the request, followed by one for each metric in
   882  	// the request. The dimension cells contain strings, and the metric
   883  	// cells contain numbers.
   884  	Rows [][]string `json:"rows,omitempty"`
   885  
   886  	// TotalMatchedRows: The total number of rows matched by the report
   887  	// request. Fewer rows may be returned in the response due to being
   888  	// limited by the row count requested or the report row limit.
   889  	TotalMatchedRows int64 `json:"totalMatchedRows,omitempty,string"`
   890  
   891  	// Totals: The totals of the report. This is the same length as any
   892  	// other row in the report; cells corresponding to dimension columns are
   893  	// empty.
   894  	Totals []string `json:"totals,omitempty"`
   895  
   896  	// Warnings: Any warnings associated with generation of the report.
   897  	Warnings []string `json:"warnings,omitempty"`
   898  
   899  	// ServerResponse contains the HTTP response code and headers from the
   900  	// server.
   901  	googleapi.ServerResponse `json:"-"`
   902  
   903  	// ForceSendFields is a list of field names (e.g. "Averages") to
   904  	// unconditionally include in API requests. By default, fields with
   905  	// empty values are omitted from API requests. However, any non-pointer,
   906  	// non-interface field appearing in ForceSendFields will be sent to the
   907  	// server regardless of whether the field is empty or not. This may be
   908  	// used to include empty fields in Patch requests.
   909  	ForceSendFields []string `json:"-"`
   910  
   911  	// NullFields is a list of field names (e.g. "Averages") to include in
   912  	// API requests with the JSON null value. By default, fields with empty
   913  	// values are omitted from API requests. However, any field with an
   914  	// empty value appearing in NullFields will be sent to the server as
   915  	// null. It is an error if a field in this list has a non-empty value.
   916  	// This may be used to include null fields in Patch requests.
   917  	NullFields []string `json:"-"`
   918  }
   919  
   920  func (s *Report) MarshalJSON() ([]byte, error) {
   921  	type NoMethod Report
   922  	raw := NoMethod(*s)
   923  	return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
   924  }
   925  
   926  type ReportHeaders struct {
   927  	// Currency: The currency of this column. Only present if the header
   928  	// type is METRIC_CURRENCY.
   929  	Currency string `json:"currency,omitempty"`
   930  
   931  	// Name: The name of the header.
   932  	Name string `json:"name,omitempty"`
   933  
   934  	// Type: The type of the header; one of DIMENSION, METRIC_TALLY,
   935  	// METRIC_RATIO, or METRIC_CURRENCY.
   936  	Type string `json:"type,omitempty"`
   937  
   938  	// ForceSendFields is a list of field names (e.g. "Currency") to
   939  	// unconditionally include in API requests. By default, fields with
   940  	// empty values are omitted from API requests. However, any non-pointer,
   941  	// non-interface field appearing in ForceSendFields will be sent to the
   942  	// server regardless of whether the field is empty or not. This may be
   943  	// used to include empty fields in Patch requests.
   944  	ForceSendFields []string `json:"-"`
   945  
   946  	// NullFields is a list of field names (e.g. "Currency") to include in
   947  	// API requests with the JSON null value. By default, fields with empty
   948  	// values are omitted from API requests. However, any field with an
   949  	// empty value appearing in NullFields will be sent to the server as
   950  	// null. It is an error if a field in this list has a non-empty value.
   951  	// This may be used to include null fields in Patch requests.
   952  	NullFields []string `json:"-"`
   953  }
   954  
   955  func (s *ReportHeaders) MarshalJSON() ([]byte, error) {
   956  	type NoMethod ReportHeaders
   957  	raw := NoMethod(*s)
   958  	return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
   959  }
   960  
   961  type ReportingMetadataEntry struct {
   962  	// CompatibleDimensions: For metrics this is a list of dimension IDs
   963  	// which the metric is compatible with, for dimensions it is a list of
   964  	// compatibility groups the dimension belongs to.
   965  	CompatibleDimensions []string `json:"compatibleDimensions,omitempty"`
   966  
   967  	// CompatibleMetrics: The names of the metrics the dimension or metric
   968  	// this reporting metadata entry describes is compatible with.
   969  	CompatibleMetrics []string `json:"compatibleMetrics,omitempty"`
   970  
   971  	// Id: Unique identifier of this reporting metadata entry, corresponding
   972  	// to the name of the appropriate dimension or metric.
   973  	Id string `json:"id,omitempty"`
   974  
   975  	// Kind: Kind of resource this is, in this case
   976  	// adexchangeseller#reportingMetadataEntry.
   977  	Kind string `json:"kind,omitempty"`
   978  
   979  	// RequiredDimensions: The names of the dimensions which the dimension
   980  	// or metric this reporting metadata entry describes requires to also be
   981  	// present in order for the report to be valid. Omitting these will not
   982  	// cause an error or warning, but may result in data which cannot be
   983  	// correctly interpreted.
   984  	RequiredDimensions []string `json:"requiredDimensions,omitempty"`
   985  
   986  	// RequiredMetrics: The names of the metrics which the dimension or
   987  	// metric this reporting metadata entry describes requires to also be
   988  	// present in order for the report to be valid. Omitting these will not
   989  	// cause an error or warning, but may result in data which cannot be
   990  	// correctly interpreted.
   991  	RequiredMetrics []string `json:"requiredMetrics,omitempty"`
   992  
   993  	// SupportedProducts: The codes of the projects supported by the
   994  	// dimension or metric this reporting metadata entry describes.
   995  	SupportedProducts []string `json:"supportedProducts,omitempty"`
   996  
   997  	// ForceSendFields is a list of field names (e.g.
   998  	// "CompatibleDimensions") to unconditionally include in API requests.
   999  	// By default, fields with empty values are omitted from API requests.
  1000  	// However, any non-pointer, non-interface field appearing in
  1001  	// ForceSendFields will be sent to the server regardless of whether the
  1002  	// field is empty or not. This may be used to include empty fields in
  1003  	// Patch requests.
  1004  	ForceSendFields []string `json:"-"`
  1005  
  1006  	// NullFields is a list of field names (e.g. "CompatibleDimensions") to
  1007  	// include in API requests with the JSON null value. By default, fields
  1008  	// with empty values are omitted from API requests. However, any field
  1009  	// with an empty value appearing in NullFields will be sent to the
  1010  	// server as null. It is an error if a field in this list has a
  1011  	// non-empty value. This may be used to include null fields in Patch
  1012  	// requests.
  1013  	NullFields []string `json:"-"`
  1014  }
  1015  
  1016  func (s *ReportingMetadataEntry) MarshalJSON() ([]byte, error) {
  1017  	type NoMethod ReportingMetadataEntry
  1018  	raw := NoMethod(*s)
  1019  	return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  1020  }
  1021  
  1022  type SavedReport struct {
  1023  	// Id: Unique identifier of this saved report.
  1024  	Id string `json:"id,omitempty"`
  1025  
  1026  	// Kind: Kind of resource this is, in this case
  1027  	// adexchangeseller#savedReport.
  1028  	Kind string `json:"kind,omitempty"`
  1029  
  1030  	// Name: This saved report's name.
  1031  	Name string `json:"name,omitempty"`
  1032  
  1033  	// ForceSendFields is a list of field names (e.g. "Id") to
  1034  	// unconditionally include in API requests. By default, fields with
  1035  	// empty values are omitted from API requests. However, any non-pointer,
  1036  	// non-interface field appearing in ForceSendFields will be sent to the
  1037  	// server regardless of whether the field is empty or not. This may be
  1038  	// used to include empty fields in Patch requests.
  1039  	ForceSendFields []string `json:"-"`
  1040  
  1041  	// NullFields is a list of field names (e.g. "Id") to include in API
  1042  	// requests with the JSON null value. By default, fields with empty
  1043  	// values are omitted from API requests. However, any field with an
  1044  	// empty value appearing in NullFields will be sent to the server as
  1045  	// null. It is an error if a field in this list has a non-empty value.
  1046  	// This may be used to include null fields in Patch requests.
  1047  	NullFields []string `json:"-"`
  1048  }
  1049  
  1050  func (s *SavedReport) MarshalJSON() ([]byte, error) {
  1051  	type NoMethod SavedReport
  1052  	raw := NoMethod(*s)
  1053  	return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  1054  }
  1055  
  1056  type SavedReports struct {
  1057  	// Etag: ETag of this response for caching purposes.
  1058  	Etag string `json:"etag,omitempty"`
  1059  
  1060  	// Items: The saved reports returned in this list response.
  1061  	Items []*SavedReport `json:"items,omitempty"`
  1062  
  1063  	// Kind: Kind of list this is, in this case
  1064  	// adexchangeseller#savedReports.
  1065  	Kind string `json:"kind,omitempty"`
  1066  
  1067  	// NextPageToken: Continuation token used to page through saved reports.
  1068  	// To retrieve the next page of results, set the next request's
  1069  	// "pageToken" value to this.
  1070  	NextPageToken string `json:"nextPageToken,omitempty"`
  1071  
  1072  	// ServerResponse contains the HTTP response code and headers from the
  1073  	// server.
  1074  	googleapi.ServerResponse `json:"-"`
  1075  
  1076  	// ForceSendFields is a list of field names (e.g. "Etag") to
  1077  	// unconditionally include in API requests. By default, fields with
  1078  	// empty values are omitted from API requests. However, any non-pointer,
  1079  	// non-interface field appearing in ForceSendFields will be sent to the
  1080  	// server regardless of whether the field is empty or not. This may be
  1081  	// used to include empty fields in Patch requests.
  1082  	ForceSendFields []string `json:"-"`
  1083  
  1084  	// NullFields is a list of field names (e.g. "Etag") to include in API
  1085  	// requests with the JSON null value. By default, fields with empty
  1086  	// values are omitted from API requests. However, any field with an
  1087  	// empty value appearing in NullFields will be sent to the server as
  1088  	// null. It is an error if a field in this list has a non-empty value.
  1089  	// This may be used to include null fields in Patch requests.
  1090  	NullFields []string `json:"-"`
  1091  }
  1092  
  1093  func (s *SavedReports) MarshalJSON() ([]byte, error) {
  1094  	type NoMethod SavedReports
  1095  	raw := NoMethod(*s)
  1096  	return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  1097  }
  1098  
  1099  type UrlChannel struct {
  1100  	// Id: Unique identifier of this URL channel. This should be considered
  1101  	// an opaque identifier; it is not safe to rely on it being in any
  1102  	// particular format.
  1103  	Id string `json:"id,omitempty"`
  1104  
  1105  	// Kind: Kind of resource this is, in this case
  1106  	// adexchangeseller#urlChannel.
  1107  	Kind string `json:"kind,omitempty"`
  1108  
  1109  	// UrlPattern: URL Pattern of this URL channel. Does not include
  1110  	// "http://" or "https://". Example: www.example.com/home
  1111  	UrlPattern string `json:"urlPattern,omitempty"`
  1112  
  1113  	// ForceSendFields is a list of field names (e.g. "Id") to
  1114  	// unconditionally include in API requests. By default, fields with
  1115  	// empty values are omitted from API requests. However, any non-pointer,
  1116  	// non-interface field appearing in ForceSendFields will be sent to the
  1117  	// server regardless of whether the field is empty or not. This may be
  1118  	// used to include empty fields in Patch requests.
  1119  	ForceSendFields []string `json:"-"`
  1120  
  1121  	// NullFields is a list of field names (e.g. "Id") to include in API
  1122  	// requests with the JSON null value. By default, fields with empty
  1123  	// values are omitted from API requests. However, any field with an
  1124  	// empty value appearing in NullFields will be sent to the server as
  1125  	// null. It is an error if a field in this list has a non-empty value.
  1126  	// This may be used to include null fields in Patch requests.
  1127  	NullFields []string `json:"-"`
  1128  }
  1129  
  1130  func (s *UrlChannel) MarshalJSON() ([]byte, error) {
  1131  	type NoMethod UrlChannel
  1132  	raw := NoMethod(*s)
  1133  	return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  1134  }
  1135  
  1136  type UrlChannels struct {
  1137  	// Etag: ETag of this response for caching purposes.
  1138  	Etag string `json:"etag,omitempty"`
  1139  
  1140  	// Items: The URL channels returned in this list response.
  1141  	Items []*UrlChannel `json:"items,omitempty"`
  1142  
  1143  	// Kind: Kind of list this is, in this case
  1144  	// adexchangeseller#urlChannels.
  1145  	Kind string `json:"kind,omitempty"`
  1146  
  1147  	// NextPageToken: Continuation token used to page through URL channels.
  1148  	// To retrieve the next page of results, set the next request's
  1149  	// "pageToken" value to this.
  1150  	NextPageToken string `json:"nextPageToken,omitempty"`
  1151  
  1152  	// ServerResponse contains the HTTP response code and headers from the
  1153  	// server.
  1154  	googleapi.ServerResponse `json:"-"`
  1155  
  1156  	// ForceSendFields is a list of field names (e.g. "Etag") to
  1157  	// unconditionally include in API requests. By default, fields with
  1158  	// empty values are omitted from API requests. However, any non-pointer,
  1159  	// non-interface field appearing in ForceSendFields will be sent to the
  1160  	// server regardless of whether the field is empty or not. This may be
  1161  	// used to include empty fields in Patch requests.
  1162  	ForceSendFields []string `json:"-"`
  1163  
  1164  	// NullFields is a list of field names (e.g. "Etag") to include in API
  1165  	// requests with the JSON null value. By default, fields with empty
  1166  	// values are omitted from API requests. However, any field with an
  1167  	// empty value appearing in NullFields will be sent to the server as
  1168  	// null. It is an error if a field in this list has a non-empty value.
  1169  	// This may be used to include null fields in Patch requests.
  1170  	NullFields []string `json:"-"`
  1171  }
  1172  
  1173  func (s *UrlChannels) MarshalJSON() ([]byte, error) {
  1174  	type NoMethod UrlChannels
  1175  	raw := NoMethod(*s)
  1176  	return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  1177  }
  1178  
  1179  // method id "adexchangeseller.accounts.get":
  1180  
  1181  type AccountsGetCall struct {
  1182  	s            *Service
  1183  	accountId    string
  1184  	urlParams_   gensupport.URLParams
  1185  	ifNoneMatch_ string
  1186  	ctx_         context.Context
  1187  	header_      http.Header
  1188  }
  1189  
  1190  // Get: Get information about the selected Ad Exchange account.
  1191  func (r *AccountsService) Get(accountId string) *AccountsGetCall {
  1192  	c := &AccountsGetCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  1193  	c.accountId = accountId
  1194  	return c
  1195  }
  1196  
  1197  // Fields allows partial responses to be retrieved. See
  1198  // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  1199  // for more information.
  1200  func (c *AccountsGetCall) Fields(s ...googleapi.Field) *AccountsGetCall {
  1201  	c.urlParams_.Set("fields", googleapi.CombineFields(s))
  1202  	return c
  1203  }
  1204  
  1205  // IfNoneMatch sets the optional parameter which makes the operation
  1206  // fail if the object's ETag matches the given value. This is useful for
  1207  // getting updates only after the object has changed since the last
  1208  // request. Use googleapi.IsNotModified to check whether the response
  1209  // error from Do is the result of In-None-Match.
  1210  func (c *AccountsGetCall) IfNoneMatch(entityTag string) *AccountsGetCall {
  1211  	c.ifNoneMatch_ = entityTag
  1212  	return c
  1213  }
  1214  
  1215  // Context sets the context to be used in this call's Do method. Any
  1216  // pending HTTP request will be aborted if the provided context is
  1217  // canceled.
  1218  func (c *AccountsGetCall) Context(ctx context.Context) *AccountsGetCall {
  1219  	c.ctx_ = ctx
  1220  	return c
  1221  }
  1222  
  1223  // Header returns an http.Header that can be modified by the caller to
  1224  // add HTTP headers to the request.
  1225  func (c *AccountsGetCall) Header() http.Header {
  1226  	if c.header_ == nil {
  1227  		c.header_ = make(http.Header)
  1228  	}
  1229  	return c.header_
  1230  }
  1231  
  1232  func (c *AccountsGetCall) doRequest(alt string) (*http.Response, error) {
  1233  	reqHeaders := make(http.Header)
  1234  	reqHeaders.Set("x-goog-api-client", "gl-go/1.13.7 gdcl/20200203")
  1235  	for k, v := range c.header_ {
  1236  		reqHeaders[k] = v
  1237  	}
  1238  	reqHeaders.Set("User-Agent", c.s.userAgent())
  1239  	if c.ifNoneMatch_ != "" {
  1240  		reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  1241  	}
  1242  	var body io.Reader = nil
  1243  	c.urlParams_.Set("alt", alt)
  1244  	c.urlParams_.Set("prettyPrint", "false")
  1245  	urls := googleapi.ResolveRelative(c.s.BasePath, "accounts/{accountId}")
  1246  	urls += "?" + c.urlParams_.Encode()
  1247  	req, err := http.NewRequest("GET", urls, body)
  1248  	if err != nil {
  1249  		return nil, err
  1250  	}
  1251  	req.Header = reqHeaders
  1252  	googleapi.Expand(req.URL, map[string]string{
  1253  		"accountId": c.accountId,
  1254  	})
  1255  	return gensupport.SendRequest(c.ctx_, c.s.client, req)
  1256  }
  1257  
  1258  // Do executes the "adexchangeseller.accounts.get" call.
  1259  // Exactly one of *Account or error will be non-nil. Any non-2xx status
  1260  // code is an error. Response headers are in either
  1261  // *Account.ServerResponse.Header or (if a response was returned at all)
  1262  // in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to
  1263  // check whether the returned error was because http.StatusNotModified
  1264  // was returned.
  1265  func (c *AccountsGetCall) Do(opts ...googleapi.CallOption) (*Account, error) {
  1266  	gensupport.SetOptions(c.urlParams_, opts...)
  1267  	res, err := c.doRequest("json")
  1268  	if res != nil && res.StatusCode == http.StatusNotModified {
  1269  		if res.Body != nil {
  1270  			res.Body.Close()
  1271  		}
  1272  		return nil, &googleapi.Error{
  1273  			Code:   res.StatusCode,
  1274  			Header: res.Header,
  1275  		}
  1276  	}
  1277  	if err != nil {
  1278  		return nil, err
  1279  	}
  1280  	defer googleapi.CloseBody(res)
  1281  	if err := googleapi.CheckResponse(res); err != nil {
  1282  		return nil, err
  1283  	}
  1284  	ret := &Account{
  1285  		ServerResponse: googleapi.ServerResponse{
  1286  			Header:         res.Header,
  1287  			HTTPStatusCode: res.StatusCode,
  1288  		},
  1289  	}
  1290  	target := &ret
  1291  	if err := gensupport.DecodeResponse(target, res); err != nil {
  1292  		return nil, err
  1293  	}
  1294  	return ret, nil
  1295  	// {
  1296  	//   "description": "Get information about the selected Ad Exchange account.",
  1297  	//   "httpMethod": "GET",
  1298  	//   "id": "adexchangeseller.accounts.get",
  1299  	//   "parameterOrder": [
  1300  	//     "accountId"
  1301  	//   ],
  1302  	//   "parameters": {
  1303  	//     "accountId": {
  1304  	//       "description": "Account to get information about. Tip: 'myaccount' is a valid ID.",
  1305  	//       "location": "path",
  1306  	//       "required": true,
  1307  	//       "type": "string"
  1308  	//     }
  1309  	//   },
  1310  	//   "path": "accounts/{accountId}",
  1311  	//   "response": {
  1312  	//     "$ref": "Account"
  1313  	//   },
  1314  	//   "scopes": [
  1315  	//     "https://www.googleapis.com/auth/adexchange.seller",
  1316  	//     "https://www.googleapis.com/auth/adexchange.seller.readonly"
  1317  	//   ]
  1318  	// }
  1319  
  1320  }
  1321  
  1322  // method id "adexchangeseller.adclients.list":
  1323  
  1324  type AdclientsListCall struct {
  1325  	s            *Service
  1326  	urlParams_   gensupport.URLParams
  1327  	ifNoneMatch_ string
  1328  	ctx_         context.Context
  1329  	header_      http.Header
  1330  }
  1331  
  1332  // List: List all ad clients in this Ad Exchange account.
  1333  func (r *AdclientsService) List() *AdclientsListCall {
  1334  	c := &AdclientsListCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  1335  	return c
  1336  }
  1337  
  1338  // MaxResults sets the optional parameter "maxResults": The maximum
  1339  // number of ad clients to include in the response, used for paging.
  1340  func (c *AdclientsListCall) MaxResults(maxResults int64) *AdclientsListCall {
  1341  	c.urlParams_.Set("maxResults", fmt.Sprint(maxResults))
  1342  	return c
  1343  }
  1344  
  1345  // PageToken sets the optional parameter "pageToken": A continuation
  1346  // token, used to page through ad clients. To retrieve the next page,
  1347  // set this parameter to the value of "nextPageToken" from the previous
  1348  // response.
  1349  func (c *AdclientsListCall) PageToken(pageToken string) *AdclientsListCall {
  1350  	c.urlParams_.Set("pageToken", pageToken)
  1351  	return c
  1352  }
  1353  
  1354  // Fields allows partial responses to be retrieved. See
  1355  // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  1356  // for more information.
  1357  func (c *AdclientsListCall) Fields(s ...googleapi.Field) *AdclientsListCall {
  1358  	c.urlParams_.Set("fields", googleapi.CombineFields(s))
  1359  	return c
  1360  }
  1361  
  1362  // IfNoneMatch sets the optional parameter which makes the operation
  1363  // fail if the object's ETag matches the given value. This is useful for
  1364  // getting updates only after the object has changed since the last
  1365  // request. Use googleapi.IsNotModified to check whether the response
  1366  // error from Do is the result of In-None-Match.
  1367  func (c *AdclientsListCall) IfNoneMatch(entityTag string) *AdclientsListCall {
  1368  	c.ifNoneMatch_ = entityTag
  1369  	return c
  1370  }
  1371  
  1372  // Context sets the context to be used in this call's Do method. Any
  1373  // pending HTTP request will be aborted if the provided context is
  1374  // canceled.
  1375  func (c *AdclientsListCall) Context(ctx context.Context) *AdclientsListCall {
  1376  	c.ctx_ = ctx
  1377  	return c
  1378  }
  1379  
  1380  // Header returns an http.Header that can be modified by the caller to
  1381  // add HTTP headers to the request.
  1382  func (c *AdclientsListCall) Header() http.Header {
  1383  	if c.header_ == nil {
  1384  		c.header_ = make(http.Header)
  1385  	}
  1386  	return c.header_
  1387  }
  1388  
  1389  func (c *AdclientsListCall) doRequest(alt string) (*http.Response, error) {
  1390  	reqHeaders := make(http.Header)
  1391  	reqHeaders.Set("x-goog-api-client", "gl-go/1.13.7 gdcl/20200203")
  1392  	for k, v := range c.header_ {
  1393  		reqHeaders[k] = v
  1394  	}
  1395  	reqHeaders.Set("User-Agent", c.s.userAgent())
  1396  	if c.ifNoneMatch_ != "" {
  1397  		reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  1398  	}
  1399  	var body io.Reader = nil
  1400  	c.urlParams_.Set("alt", alt)
  1401  	c.urlParams_.Set("prettyPrint", "false")
  1402  	urls := googleapi.ResolveRelative(c.s.BasePath, "adclients")
  1403  	urls += "?" + c.urlParams_.Encode()
  1404  	req, err := http.NewRequest("GET", urls, body)
  1405  	if err != nil {
  1406  		return nil, err
  1407  	}
  1408  	req.Header = reqHeaders
  1409  	return gensupport.SendRequest(c.ctx_, c.s.client, req)
  1410  }
  1411  
  1412  // Do executes the "adexchangeseller.adclients.list" call.
  1413  // Exactly one of *AdClients or error will be non-nil. Any non-2xx
  1414  // status code is an error. Response headers are in either
  1415  // *AdClients.ServerResponse.Header or (if a response was returned at
  1416  // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  1417  // to check whether the returned error was because
  1418  // http.StatusNotModified was returned.
  1419  func (c *AdclientsListCall) Do(opts ...googleapi.CallOption) (*AdClients, error) {
  1420  	gensupport.SetOptions(c.urlParams_, opts...)
  1421  	res, err := c.doRequest("json")
  1422  	if res != nil && res.StatusCode == http.StatusNotModified {
  1423  		if res.Body != nil {
  1424  			res.Body.Close()
  1425  		}
  1426  		return nil, &googleapi.Error{
  1427  			Code:   res.StatusCode,
  1428  			Header: res.Header,
  1429  		}
  1430  	}
  1431  	if err != nil {
  1432  		return nil, err
  1433  	}
  1434  	defer googleapi.CloseBody(res)
  1435  	if err := googleapi.CheckResponse(res); err != nil {
  1436  		return nil, err
  1437  	}
  1438  	ret := &AdClients{
  1439  		ServerResponse: googleapi.ServerResponse{
  1440  			Header:         res.Header,
  1441  			HTTPStatusCode: res.StatusCode,
  1442  		},
  1443  	}
  1444  	target := &ret
  1445  	if err := gensupport.DecodeResponse(target, res); err != nil {
  1446  		return nil, err
  1447  	}
  1448  	return ret, nil
  1449  	// {
  1450  	//   "description": "List all ad clients in this Ad Exchange account.",
  1451  	//   "httpMethod": "GET",
  1452  	//   "id": "adexchangeseller.adclients.list",
  1453  	//   "parameters": {
  1454  	//     "maxResults": {
  1455  	//       "description": "The maximum number of ad clients to include in the response, used for paging.",
  1456  	//       "format": "uint32",
  1457  	//       "location": "query",
  1458  	//       "maximum": "10000",
  1459  	//       "minimum": "0",
  1460  	//       "type": "integer"
  1461  	//     },
  1462  	//     "pageToken": {
  1463  	//       "description": "A continuation token, used to page through ad clients. To retrieve the next page, set this parameter to the value of \"nextPageToken\" from the previous response.",
  1464  	//       "location": "query",
  1465  	//       "type": "string"
  1466  	//     }
  1467  	//   },
  1468  	//   "path": "adclients",
  1469  	//   "response": {
  1470  	//     "$ref": "AdClients"
  1471  	//   },
  1472  	//   "scopes": [
  1473  	//     "https://www.googleapis.com/auth/adexchange.seller",
  1474  	//     "https://www.googleapis.com/auth/adexchange.seller.readonly"
  1475  	//   ]
  1476  	// }
  1477  
  1478  }
  1479  
  1480  // Pages invokes f for each page of results.
  1481  // A non-nil error returned from f will halt the iteration.
  1482  // The provided context supersedes any context provided to the Context method.
  1483  func (c *AdclientsListCall) Pages(ctx context.Context, f func(*AdClients) error) error {
  1484  	c.ctx_ = ctx
  1485  	defer c.PageToken(c.urlParams_.Get("pageToken")) // reset paging to original point
  1486  	for {
  1487  		x, err := c.Do()
  1488  		if err != nil {
  1489  			return err
  1490  		}
  1491  		if err := f(x); err != nil {
  1492  			return err
  1493  		}
  1494  		if x.NextPageToken == "" {
  1495  			return nil
  1496  		}
  1497  		c.PageToken(x.NextPageToken)
  1498  	}
  1499  }
  1500  
  1501  // method id "adexchangeseller.adunits.get":
  1502  
  1503  type AdunitsGetCall struct {
  1504  	s            *Service
  1505  	adClientId   string
  1506  	adUnitId     string
  1507  	urlParams_   gensupport.URLParams
  1508  	ifNoneMatch_ string
  1509  	ctx_         context.Context
  1510  	header_      http.Header
  1511  }
  1512  
  1513  // Get: Gets the specified ad unit in the specified ad client.
  1514  func (r *AdunitsService) Get(adClientId string, adUnitId string) *AdunitsGetCall {
  1515  	c := &AdunitsGetCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  1516  	c.adClientId = adClientId
  1517  	c.adUnitId = adUnitId
  1518  	return c
  1519  }
  1520  
  1521  // Fields allows partial responses to be retrieved. See
  1522  // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  1523  // for more information.
  1524  func (c *AdunitsGetCall) Fields(s ...googleapi.Field) *AdunitsGetCall {
  1525  	c.urlParams_.Set("fields", googleapi.CombineFields(s))
  1526  	return c
  1527  }
  1528  
  1529  // IfNoneMatch sets the optional parameter which makes the operation
  1530  // fail if the object's ETag matches the given value. This is useful for
  1531  // getting updates only after the object has changed since the last
  1532  // request. Use googleapi.IsNotModified to check whether the response
  1533  // error from Do is the result of In-None-Match.
  1534  func (c *AdunitsGetCall) IfNoneMatch(entityTag string) *AdunitsGetCall {
  1535  	c.ifNoneMatch_ = entityTag
  1536  	return c
  1537  }
  1538  
  1539  // Context sets the context to be used in this call's Do method. Any
  1540  // pending HTTP request will be aborted if the provided context is
  1541  // canceled.
  1542  func (c *AdunitsGetCall) Context(ctx context.Context) *AdunitsGetCall {
  1543  	c.ctx_ = ctx
  1544  	return c
  1545  }
  1546  
  1547  // Header returns an http.Header that can be modified by the caller to
  1548  // add HTTP headers to the request.
  1549  func (c *AdunitsGetCall) Header() http.Header {
  1550  	if c.header_ == nil {
  1551  		c.header_ = make(http.Header)
  1552  	}
  1553  	return c.header_
  1554  }
  1555  
  1556  func (c *AdunitsGetCall) doRequest(alt string) (*http.Response, error) {
  1557  	reqHeaders := make(http.Header)
  1558  	reqHeaders.Set("x-goog-api-client", "gl-go/1.13.7 gdcl/20200203")
  1559  	for k, v := range c.header_ {
  1560  		reqHeaders[k] = v
  1561  	}
  1562  	reqHeaders.Set("User-Agent", c.s.userAgent())
  1563  	if c.ifNoneMatch_ != "" {
  1564  		reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  1565  	}
  1566  	var body io.Reader = nil
  1567  	c.urlParams_.Set("alt", alt)
  1568  	c.urlParams_.Set("prettyPrint", "false")
  1569  	urls := googleapi.ResolveRelative(c.s.BasePath, "adclients/{adClientId}/adunits/{adUnitId}")
  1570  	urls += "?" + c.urlParams_.Encode()
  1571  	req, err := http.NewRequest("GET", urls, body)
  1572  	if err != nil {
  1573  		return nil, err
  1574  	}
  1575  	req.Header = reqHeaders
  1576  	googleapi.Expand(req.URL, map[string]string{
  1577  		"adClientId": c.adClientId,
  1578  		"adUnitId":   c.adUnitId,
  1579  	})
  1580  	return gensupport.SendRequest(c.ctx_, c.s.client, req)
  1581  }
  1582  
  1583  // Do executes the "adexchangeseller.adunits.get" call.
  1584  // Exactly one of *AdUnit or error will be non-nil. Any non-2xx status
  1585  // code is an error. Response headers are in either
  1586  // *AdUnit.ServerResponse.Header or (if a response was returned at all)
  1587  // in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to
  1588  // check whether the returned error was because http.StatusNotModified
  1589  // was returned.
  1590  func (c *AdunitsGetCall) Do(opts ...googleapi.CallOption) (*AdUnit, error) {
  1591  	gensupport.SetOptions(c.urlParams_, opts...)
  1592  	res, err := c.doRequest("json")
  1593  	if res != nil && res.StatusCode == http.StatusNotModified {
  1594  		if res.Body != nil {
  1595  			res.Body.Close()
  1596  		}
  1597  		return nil, &googleapi.Error{
  1598  			Code:   res.StatusCode,
  1599  			Header: res.Header,
  1600  		}
  1601  	}
  1602  	if err != nil {
  1603  		return nil, err
  1604  	}
  1605  	defer googleapi.CloseBody(res)
  1606  	if err := googleapi.CheckResponse(res); err != nil {
  1607  		return nil, err
  1608  	}
  1609  	ret := &AdUnit{
  1610  		ServerResponse: googleapi.ServerResponse{
  1611  			Header:         res.Header,
  1612  			HTTPStatusCode: res.StatusCode,
  1613  		},
  1614  	}
  1615  	target := &ret
  1616  	if err := gensupport.DecodeResponse(target, res); err != nil {
  1617  		return nil, err
  1618  	}
  1619  	return ret, nil
  1620  	// {
  1621  	//   "description": "Gets the specified ad unit in the specified ad client.",
  1622  	//   "httpMethod": "GET",
  1623  	//   "id": "adexchangeseller.adunits.get",
  1624  	//   "parameterOrder": [
  1625  	//     "adClientId",
  1626  	//     "adUnitId"
  1627  	//   ],
  1628  	//   "parameters": {
  1629  	//     "adClientId": {
  1630  	//       "description": "Ad client for which to get the ad unit.",
  1631  	//       "location": "path",
  1632  	//       "required": true,
  1633  	//       "type": "string"
  1634  	//     },
  1635  	//     "adUnitId": {
  1636  	//       "description": "Ad unit to retrieve.",
  1637  	//       "location": "path",
  1638  	//       "required": true,
  1639  	//       "type": "string"
  1640  	//     }
  1641  	//   },
  1642  	//   "path": "adclients/{adClientId}/adunits/{adUnitId}",
  1643  	//   "response": {
  1644  	//     "$ref": "AdUnit"
  1645  	//   },
  1646  	//   "scopes": [
  1647  	//     "https://www.googleapis.com/auth/adexchange.seller",
  1648  	//     "https://www.googleapis.com/auth/adexchange.seller.readonly"
  1649  	//   ]
  1650  	// }
  1651  
  1652  }
  1653  
  1654  // method id "adexchangeseller.adunits.list":
  1655  
  1656  type AdunitsListCall struct {
  1657  	s            *Service
  1658  	adClientId   string
  1659  	urlParams_   gensupport.URLParams
  1660  	ifNoneMatch_ string
  1661  	ctx_         context.Context
  1662  	header_      http.Header
  1663  }
  1664  
  1665  // List: List all ad units in the specified ad client for this Ad
  1666  // Exchange account.
  1667  func (r *AdunitsService) List(adClientId string) *AdunitsListCall {
  1668  	c := &AdunitsListCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  1669  	c.adClientId = adClientId
  1670  	return c
  1671  }
  1672  
  1673  // IncludeInactive sets the optional parameter "includeInactive":
  1674  // Whether to include inactive ad units. Default: true.
  1675  func (c *AdunitsListCall) IncludeInactive(includeInactive bool) *AdunitsListCall {
  1676  	c.urlParams_.Set("includeInactive", fmt.Sprint(includeInactive))
  1677  	return c
  1678  }
  1679  
  1680  // MaxResults sets the optional parameter "maxResults": The maximum
  1681  // number of ad units to include in the response, used for paging.
  1682  func (c *AdunitsListCall) MaxResults(maxResults int64) *AdunitsListCall {
  1683  	c.urlParams_.Set("maxResults", fmt.Sprint(maxResults))
  1684  	return c
  1685  }
  1686  
  1687  // PageToken sets the optional parameter "pageToken": A continuation
  1688  // token, used to page through ad units. To retrieve the next page, set
  1689  // this parameter to the value of "nextPageToken" from the previous
  1690  // response.
  1691  func (c *AdunitsListCall) PageToken(pageToken string) *AdunitsListCall {
  1692  	c.urlParams_.Set("pageToken", pageToken)
  1693  	return c
  1694  }
  1695  
  1696  // Fields allows partial responses to be retrieved. See
  1697  // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  1698  // for more information.
  1699  func (c *AdunitsListCall) Fields(s ...googleapi.Field) *AdunitsListCall {
  1700  	c.urlParams_.Set("fields", googleapi.CombineFields(s))
  1701  	return c
  1702  }
  1703  
  1704  // IfNoneMatch sets the optional parameter which makes the operation
  1705  // fail if the object's ETag matches the given value. This is useful for
  1706  // getting updates only after the object has changed since the last
  1707  // request. Use googleapi.IsNotModified to check whether the response
  1708  // error from Do is the result of In-None-Match.
  1709  func (c *AdunitsListCall) IfNoneMatch(entityTag string) *AdunitsListCall {
  1710  	c.ifNoneMatch_ = entityTag
  1711  	return c
  1712  }
  1713  
  1714  // Context sets the context to be used in this call's Do method. Any
  1715  // pending HTTP request will be aborted if the provided context is
  1716  // canceled.
  1717  func (c *AdunitsListCall) Context(ctx context.Context) *AdunitsListCall {
  1718  	c.ctx_ = ctx
  1719  	return c
  1720  }
  1721  
  1722  // Header returns an http.Header that can be modified by the caller to
  1723  // add HTTP headers to the request.
  1724  func (c *AdunitsListCall) Header() http.Header {
  1725  	if c.header_ == nil {
  1726  		c.header_ = make(http.Header)
  1727  	}
  1728  	return c.header_
  1729  }
  1730  
  1731  func (c *AdunitsListCall) doRequest(alt string) (*http.Response, error) {
  1732  	reqHeaders := make(http.Header)
  1733  	reqHeaders.Set("x-goog-api-client", "gl-go/1.13.7 gdcl/20200203")
  1734  	for k, v := range c.header_ {
  1735  		reqHeaders[k] = v
  1736  	}
  1737  	reqHeaders.Set("User-Agent", c.s.userAgent())
  1738  	if c.ifNoneMatch_ != "" {
  1739  		reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  1740  	}
  1741  	var body io.Reader = nil
  1742  	c.urlParams_.Set("alt", alt)
  1743  	c.urlParams_.Set("prettyPrint", "false")
  1744  	urls := googleapi.ResolveRelative(c.s.BasePath, "adclients/{adClientId}/adunits")
  1745  	urls += "?" + c.urlParams_.Encode()
  1746  	req, err := http.NewRequest("GET", urls, body)
  1747  	if err != nil {
  1748  		return nil, err
  1749  	}
  1750  	req.Header = reqHeaders
  1751  	googleapi.Expand(req.URL, map[string]string{
  1752  		"adClientId": c.adClientId,
  1753  	})
  1754  	return gensupport.SendRequest(c.ctx_, c.s.client, req)
  1755  }
  1756  
  1757  // Do executes the "adexchangeseller.adunits.list" call.
  1758  // Exactly one of *AdUnits or error will be non-nil. Any non-2xx status
  1759  // code is an error. Response headers are in either
  1760  // *AdUnits.ServerResponse.Header or (if a response was returned at all)
  1761  // in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to
  1762  // check whether the returned error was because http.StatusNotModified
  1763  // was returned.
  1764  func (c *AdunitsListCall) Do(opts ...googleapi.CallOption) (*AdUnits, error) {
  1765  	gensupport.SetOptions(c.urlParams_, opts...)
  1766  	res, err := c.doRequest("json")
  1767  	if res != nil && res.StatusCode == http.StatusNotModified {
  1768  		if res.Body != nil {
  1769  			res.Body.Close()
  1770  		}
  1771  		return nil, &googleapi.Error{
  1772  			Code:   res.StatusCode,
  1773  			Header: res.Header,
  1774  		}
  1775  	}
  1776  	if err != nil {
  1777  		return nil, err
  1778  	}
  1779  	defer googleapi.CloseBody(res)
  1780  	if err := googleapi.CheckResponse(res); err != nil {
  1781  		return nil, err
  1782  	}
  1783  	ret := &AdUnits{
  1784  		ServerResponse: googleapi.ServerResponse{
  1785  			Header:         res.Header,
  1786  			HTTPStatusCode: res.StatusCode,
  1787  		},
  1788  	}
  1789  	target := &ret
  1790  	if err := gensupport.DecodeResponse(target, res); err != nil {
  1791  		return nil, err
  1792  	}
  1793  	return ret, nil
  1794  	// {
  1795  	//   "description": "List all ad units in the specified ad client for this Ad Exchange account.",
  1796  	//   "httpMethod": "GET",
  1797  	//   "id": "adexchangeseller.adunits.list",
  1798  	//   "parameterOrder": [
  1799  	//     "adClientId"
  1800  	//   ],
  1801  	//   "parameters": {
  1802  	//     "adClientId": {
  1803  	//       "description": "Ad client for which to list ad units.",
  1804  	//       "location": "path",
  1805  	//       "required": true,
  1806  	//       "type": "string"
  1807  	//     },
  1808  	//     "includeInactive": {
  1809  	//       "description": "Whether to include inactive ad units. Default: true.",
  1810  	//       "location": "query",
  1811  	//       "type": "boolean"
  1812  	//     },
  1813  	//     "maxResults": {
  1814  	//       "description": "The maximum number of ad units to include in the response, used for paging.",
  1815  	//       "format": "uint32",
  1816  	//       "location": "query",
  1817  	//       "maximum": "10000",
  1818  	//       "minimum": "0",
  1819  	//       "type": "integer"
  1820  	//     },
  1821  	//     "pageToken": {
  1822  	//       "description": "A continuation token, used to page through ad units. To retrieve the next page, set this parameter to the value of \"nextPageToken\" from the previous response.",
  1823  	//       "location": "query",
  1824  	//       "type": "string"
  1825  	//     }
  1826  	//   },
  1827  	//   "path": "adclients/{adClientId}/adunits",
  1828  	//   "response": {
  1829  	//     "$ref": "AdUnits"
  1830  	//   },
  1831  	//   "scopes": [
  1832  	//     "https://www.googleapis.com/auth/adexchange.seller",
  1833  	//     "https://www.googleapis.com/auth/adexchange.seller.readonly"
  1834  	//   ]
  1835  	// }
  1836  
  1837  }
  1838  
  1839  // Pages invokes f for each page of results.
  1840  // A non-nil error returned from f will halt the iteration.
  1841  // The provided context supersedes any context provided to the Context method.
  1842  func (c *AdunitsListCall) Pages(ctx context.Context, f func(*AdUnits) error) error {
  1843  	c.ctx_ = ctx
  1844  	defer c.PageToken(c.urlParams_.Get("pageToken")) // reset paging to original point
  1845  	for {
  1846  		x, err := c.Do()
  1847  		if err != nil {
  1848  			return err
  1849  		}
  1850  		if err := f(x); err != nil {
  1851  			return err
  1852  		}
  1853  		if x.NextPageToken == "" {
  1854  			return nil
  1855  		}
  1856  		c.PageToken(x.NextPageToken)
  1857  	}
  1858  }
  1859  
  1860  // method id "adexchangeseller.adunits.customchannels.list":
  1861  
  1862  type AdunitsCustomchannelsListCall struct {
  1863  	s            *Service
  1864  	adClientId   string
  1865  	adUnitId     string
  1866  	urlParams_   gensupport.URLParams
  1867  	ifNoneMatch_ string
  1868  	ctx_         context.Context
  1869  	header_      http.Header
  1870  }
  1871  
  1872  // List: List all custom channels which the specified ad unit belongs
  1873  // to.
  1874  func (r *AdunitsCustomchannelsService) List(adClientId string, adUnitId string) *AdunitsCustomchannelsListCall {
  1875  	c := &AdunitsCustomchannelsListCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  1876  	c.adClientId = adClientId
  1877  	c.adUnitId = adUnitId
  1878  	return c
  1879  }
  1880  
  1881  // MaxResults sets the optional parameter "maxResults": The maximum
  1882  // number of custom channels to include in the response, used for
  1883  // paging.
  1884  func (c *AdunitsCustomchannelsListCall) MaxResults(maxResults int64) *AdunitsCustomchannelsListCall {
  1885  	c.urlParams_.Set("maxResults", fmt.Sprint(maxResults))
  1886  	return c
  1887  }
  1888  
  1889  // PageToken sets the optional parameter "pageToken": A continuation
  1890  // token, used to page through custom channels. To retrieve the next
  1891  // page, set this parameter to the value of "nextPageToken" from the
  1892  // previous response.
  1893  func (c *AdunitsCustomchannelsListCall) PageToken(pageToken string) *AdunitsCustomchannelsListCall {
  1894  	c.urlParams_.Set("pageToken", pageToken)
  1895  	return c
  1896  }
  1897  
  1898  // Fields allows partial responses to be retrieved. See
  1899  // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  1900  // for more information.
  1901  func (c *AdunitsCustomchannelsListCall) Fields(s ...googleapi.Field) *AdunitsCustomchannelsListCall {
  1902  	c.urlParams_.Set("fields", googleapi.CombineFields(s))
  1903  	return c
  1904  }
  1905  
  1906  // IfNoneMatch sets the optional parameter which makes the operation
  1907  // fail if the object's ETag matches the given value. This is useful for
  1908  // getting updates only after the object has changed since the last
  1909  // request. Use googleapi.IsNotModified to check whether the response
  1910  // error from Do is the result of In-None-Match.
  1911  func (c *AdunitsCustomchannelsListCall) IfNoneMatch(entityTag string) *AdunitsCustomchannelsListCall {
  1912  	c.ifNoneMatch_ = entityTag
  1913  	return c
  1914  }
  1915  
  1916  // Context sets the context to be used in this call's Do method. Any
  1917  // pending HTTP request will be aborted if the provided context is
  1918  // canceled.
  1919  func (c *AdunitsCustomchannelsListCall) Context(ctx context.Context) *AdunitsCustomchannelsListCall {
  1920  	c.ctx_ = ctx
  1921  	return c
  1922  }
  1923  
  1924  // Header returns an http.Header that can be modified by the caller to
  1925  // add HTTP headers to the request.
  1926  func (c *AdunitsCustomchannelsListCall) Header() http.Header {
  1927  	if c.header_ == nil {
  1928  		c.header_ = make(http.Header)
  1929  	}
  1930  	return c.header_
  1931  }
  1932  
  1933  func (c *AdunitsCustomchannelsListCall) doRequest(alt string) (*http.Response, error) {
  1934  	reqHeaders := make(http.Header)
  1935  	reqHeaders.Set("x-goog-api-client", "gl-go/1.13.7 gdcl/20200203")
  1936  	for k, v := range c.header_ {
  1937  		reqHeaders[k] = v
  1938  	}
  1939  	reqHeaders.Set("User-Agent", c.s.userAgent())
  1940  	if c.ifNoneMatch_ != "" {
  1941  		reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  1942  	}
  1943  	var body io.Reader = nil
  1944  	c.urlParams_.Set("alt", alt)
  1945  	c.urlParams_.Set("prettyPrint", "false")
  1946  	urls := googleapi.ResolveRelative(c.s.BasePath, "adclients/{adClientId}/adunits/{adUnitId}/customchannels")
  1947  	urls += "?" + c.urlParams_.Encode()
  1948  	req, err := http.NewRequest("GET", urls, body)
  1949  	if err != nil {
  1950  		return nil, err
  1951  	}
  1952  	req.Header = reqHeaders
  1953  	googleapi.Expand(req.URL, map[string]string{
  1954  		"adClientId": c.adClientId,
  1955  		"adUnitId":   c.adUnitId,
  1956  	})
  1957  	return gensupport.SendRequest(c.ctx_, c.s.client, req)
  1958  }
  1959  
  1960  // Do executes the "adexchangeseller.adunits.customchannels.list" call.
  1961  // Exactly one of *CustomChannels or error will be non-nil. Any non-2xx
  1962  // status code is an error. Response headers are in either
  1963  // *CustomChannels.ServerResponse.Header or (if a response was returned
  1964  // at all) in error.(*googleapi.Error).Header. Use
  1965  // googleapi.IsNotModified to check whether the returned error was
  1966  // because http.StatusNotModified was returned.
  1967  func (c *AdunitsCustomchannelsListCall) Do(opts ...googleapi.CallOption) (*CustomChannels, error) {
  1968  	gensupport.SetOptions(c.urlParams_, opts...)
  1969  	res, err := c.doRequest("json")
  1970  	if res != nil && res.StatusCode == http.StatusNotModified {
  1971  		if res.Body != nil {
  1972  			res.Body.Close()
  1973  		}
  1974  		return nil, &googleapi.Error{
  1975  			Code:   res.StatusCode,
  1976  			Header: res.Header,
  1977  		}
  1978  	}
  1979  	if err != nil {
  1980  		return nil, err
  1981  	}
  1982  	defer googleapi.CloseBody(res)
  1983  	if err := googleapi.CheckResponse(res); err != nil {
  1984  		return nil, err
  1985  	}
  1986  	ret := &CustomChannels{
  1987  		ServerResponse: googleapi.ServerResponse{
  1988  			Header:         res.Header,
  1989  			HTTPStatusCode: res.StatusCode,
  1990  		},
  1991  	}
  1992  	target := &ret
  1993  	if err := gensupport.DecodeResponse(target, res); err != nil {
  1994  		return nil, err
  1995  	}
  1996  	return ret, nil
  1997  	// {
  1998  	//   "description": "List all custom channels which the specified ad unit belongs to.",
  1999  	//   "httpMethod": "GET",
  2000  	//   "id": "adexchangeseller.adunits.customchannels.list",
  2001  	//   "parameterOrder": [
  2002  	//     "adClientId",
  2003  	//     "adUnitId"
  2004  	//   ],
  2005  	//   "parameters": {
  2006  	//     "adClientId": {
  2007  	//       "description": "Ad client which contains the ad unit.",
  2008  	//       "location": "path",
  2009  	//       "required": true,
  2010  	//       "type": "string"
  2011  	//     },
  2012  	//     "adUnitId": {
  2013  	//       "description": "Ad unit for which to list custom channels.",
  2014  	//       "location": "path",
  2015  	//       "required": true,
  2016  	//       "type": "string"
  2017  	//     },
  2018  	//     "maxResults": {
  2019  	//       "description": "The maximum number of custom channels to include in the response, used for paging.",
  2020  	//       "format": "uint32",
  2021  	//       "location": "query",
  2022  	//       "maximum": "10000",
  2023  	//       "minimum": "0",
  2024  	//       "type": "integer"
  2025  	//     },
  2026  	//     "pageToken": {
  2027  	//       "description": "A continuation token, used to page through custom channels. To retrieve the next page, set this parameter to the value of \"nextPageToken\" from the previous response.",
  2028  	//       "location": "query",
  2029  	//       "type": "string"
  2030  	//     }
  2031  	//   },
  2032  	//   "path": "adclients/{adClientId}/adunits/{adUnitId}/customchannels",
  2033  	//   "response": {
  2034  	//     "$ref": "CustomChannels"
  2035  	//   },
  2036  	//   "scopes": [
  2037  	//     "https://www.googleapis.com/auth/adexchange.seller",
  2038  	//     "https://www.googleapis.com/auth/adexchange.seller.readonly"
  2039  	//   ]
  2040  	// }
  2041  
  2042  }
  2043  
  2044  // Pages invokes f for each page of results.
  2045  // A non-nil error returned from f will halt the iteration.
  2046  // The provided context supersedes any context provided to the Context method.
  2047  func (c *AdunitsCustomchannelsListCall) Pages(ctx context.Context, f func(*CustomChannels) error) error {
  2048  	c.ctx_ = ctx
  2049  	defer c.PageToken(c.urlParams_.Get("pageToken")) // reset paging to original point
  2050  	for {
  2051  		x, err := c.Do()
  2052  		if err != nil {
  2053  			return err
  2054  		}
  2055  		if err := f(x); err != nil {
  2056  			return err
  2057  		}
  2058  		if x.NextPageToken == "" {
  2059  			return nil
  2060  		}
  2061  		c.PageToken(x.NextPageToken)
  2062  	}
  2063  }
  2064  
  2065  // method id "adexchangeseller.alerts.list":
  2066  
  2067  type AlertsListCall struct {
  2068  	s            *Service
  2069  	urlParams_   gensupport.URLParams
  2070  	ifNoneMatch_ string
  2071  	ctx_         context.Context
  2072  	header_      http.Header
  2073  }
  2074  
  2075  // List: List the alerts for this Ad Exchange account.
  2076  func (r *AlertsService) List() *AlertsListCall {
  2077  	c := &AlertsListCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  2078  	return c
  2079  }
  2080  
  2081  // Locale sets the optional parameter "locale": The locale to use for
  2082  // translating alert messages. The account locale will be used if this
  2083  // is not supplied. The AdSense default (English) will be used if the
  2084  // supplied locale is invalid or unsupported.
  2085  func (c *AlertsListCall) Locale(locale string) *AlertsListCall {
  2086  	c.urlParams_.Set("locale", locale)
  2087  	return c
  2088  }
  2089  
  2090  // Fields allows partial responses to be retrieved. See
  2091  // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  2092  // for more information.
  2093  func (c *AlertsListCall) Fields(s ...googleapi.Field) *AlertsListCall {
  2094  	c.urlParams_.Set("fields", googleapi.CombineFields(s))
  2095  	return c
  2096  }
  2097  
  2098  // IfNoneMatch sets the optional parameter which makes the operation
  2099  // fail if the object's ETag matches the given value. This is useful for
  2100  // getting updates only after the object has changed since the last
  2101  // request. Use googleapi.IsNotModified to check whether the response
  2102  // error from Do is the result of In-None-Match.
  2103  func (c *AlertsListCall) IfNoneMatch(entityTag string) *AlertsListCall {
  2104  	c.ifNoneMatch_ = entityTag
  2105  	return c
  2106  }
  2107  
  2108  // Context sets the context to be used in this call's Do method. Any
  2109  // pending HTTP request will be aborted if the provided context is
  2110  // canceled.
  2111  func (c *AlertsListCall) Context(ctx context.Context) *AlertsListCall {
  2112  	c.ctx_ = ctx
  2113  	return c
  2114  }
  2115  
  2116  // Header returns an http.Header that can be modified by the caller to
  2117  // add HTTP headers to the request.
  2118  func (c *AlertsListCall) Header() http.Header {
  2119  	if c.header_ == nil {
  2120  		c.header_ = make(http.Header)
  2121  	}
  2122  	return c.header_
  2123  }
  2124  
  2125  func (c *AlertsListCall) doRequest(alt string) (*http.Response, error) {
  2126  	reqHeaders := make(http.Header)
  2127  	reqHeaders.Set("x-goog-api-client", "gl-go/1.13.7 gdcl/20200203")
  2128  	for k, v := range c.header_ {
  2129  		reqHeaders[k] = v
  2130  	}
  2131  	reqHeaders.Set("User-Agent", c.s.userAgent())
  2132  	if c.ifNoneMatch_ != "" {
  2133  		reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  2134  	}
  2135  	var body io.Reader = nil
  2136  	c.urlParams_.Set("alt", alt)
  2137  	c.urlParams_.Set("prettyPrint", "false")
  2138  	urls := googleapi.ResolveRelative(c.s.BasePath, "alerts")
  2139  	urls += "?" + c.urlParams_.Encode()
  2140  	req, err := http.NewRequest("GET", urls, body)
  2141  	if err != nil {
  2142  		return nil, err
  2143  	}
  2144  	req.Header = reqHeaders
  2145  	return gensupport.SendRequest(c.ctx_, c.s.client, req)
  2146  }
  2147  
  2148  // Do executes the "adexchangeseller.alerts.list" call.
  2149  // Exactly one of *Alerts or error will be non-nil. Any non-2xx status
  2150  // code is an error. Response headers are in either
  2151  // *Alerts.ServerResponse.Header or (if a response was returned at all)
  2152  // in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to
  2153  // check whether the returned error was because http.StatusNotModified
  2154  // was returned.
  2155  func (c *AlertsListCall) Do(opts ...googleapi.CallOption) (*Alerts, error) {
  2156  	gensupport.SetOptions(c.urlParams_, opts...)
  2157  	res, err := c.doRequest("json")
  2158  	if res != nil && res.StatusCode == http.StatusNotModified {
  2159  		if res.Body != nil {
  2160  			res.Body.Close()
  2161  		}
  2162  		return nil, &googleapi.Error{
  2163  			Code:   res.StatusCode,
  2164  			Header: res.Header,
  2165  		}
  2166  	}
  2167  	if err != nil {
  2168  		return nil, err
  2169  	}
  2170  	defer googleapi.CloseBody(res)
  2171  	if err := googleapi.CheckResponse(res); err != nil {
  2172  		return nil, err
  2173  	}
  2174  	ret := &Alerts{
  2175  		ServerResponse: googleapi.ServerResponse{
  2176  			Header:         res.Header,
  2177  			HTTPStatusCode: res.StatusCode,
  2178  		},
  2179  	}
  2180  	target := &ret
  2181  	if err := gensupport.DecodeResponse(target, res); err != nil {
  2182  		return nil, err
  2183  	}
  2184  	return ret, nil
  2185  	// {
  2186  	//   "description": "List the alerts for this Ad Exchange account.",
  2187  	//   "httpMethod": "GET",
  2188  	//   "id": "adexchangeseller.alerts.list",
  2189  	//   "parameters": {
  2190  	//     "locale": {
  2191  	//       "description": "The locale to use for translating alert messages. The account locale will be used if this is not supplied. The AdSense default (English) will be used if the supplied locale is invalid or unsupported.",
  2192  	//       "location": "query",
  2193  	//       "type": "string"
  2194  	//     }
  2195  	//   },
  2196  	//   "path": "alerts",
  2197  	//   "response": {
  2198  	//     "$ref": "Alerts"
  2199  	//   },
  2200  	//   "scopes": [
  2201  	//     "https://www.googleapis.com/auth/adexchange.seller",
  2202  	//     "https://www.googleapis.com/auth/adexchange.seller.readonly"
  2203  	//   ]
  2204  	// }
  2205  
  2206  }
  2207  
  2208  // method id "adexchangeseller.customchannels.get":
  2209  
  2210  type CustomchannelsGetCall struct {
  2211  	s               *Service
  2212  	adClientId      string
  2213  	customChannelId string
  2214  	urlParams_      gensupport.URLParams
  2215  	ifNoneMatch_    string
  2216  	ctx_            context.Context
  2217  	header_         http.Header
  2218  }
  2219  
  2220  // Get: Get the specified custom channel from the specified ad client.
  2221  func (r *CustomchannelsService) Get(adClientId string, customChannelId string) *CustomchannelsGetCall {
  2222  	c := &CustomchannelsGetCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  2223  	c.adClientId = adClientId
  2224  	c.customChannelId = customChannelId
  2225  	return c
  2226  }
  2227  
  2228  // Fields allows partial responses to be retrieved. See
  2229  // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  2230  // for more information.
  2231  func (c *CustomchannelsGetCall) Fields(s ...googleapi.Field) *CustomchannelsGetCall {
  2232  	c.urlParams_.Set("fields", googleapi.CombineFields(s))
  2233  	return c
  2234  }
  2235  
  2236  // IfNoneMatch sets the optional parameter which makes the operation
  2237  // fail if the object's ETag matches the given value. This is useful for
  2238  // getting updates only after the object has changed since the last
  2239  // request. Use googleapi.IsNotModified to check whether the response
  2240  // error from Do is the result of In-None-Match.
  2241  func (c *CustomchannelsGetCall) IfNoneMatch(entityTag string) *CustomchannelsGetCall {
  2242  	c.ifNoneMatch_ = entityTag
  2243  	return c
  2244  }
  2245  
  2246  // Context sets the context to be used in this call's Do method. Any
  2247  // pending HTTP request will be aborted if the provided context is
  2248  // canceled.
  2249  func (c *CustomchannelsGetCall) Context(ctx context.Context) *CustomchannelsGetCall {
  2250  	c.ctx_ = ctx
  2251  	return c
  2252  }
  2253  
  2254  // Header returns an http.Header that can be modified by the caller to
  2255  // add HTTP headers to the request.
  2256  func (c *CustomchannelsGetCall) Header() http.Header {
  2257  	if c.header_ == nil {
  2258  		c.header_ = make(http.Header)
  2259  	}
  2260  	return c.header_
  2261  }
  2262  
  2263  func (c *CustomchannelsGetCall) doRequest(alt string) (*http.Response, error) {
  2264  	reqHeaders := make(http.Header)
  2265  	reqHeaders.Set("x-goog-api-client", "gl-go/1.13.7 gdcl/20200203")
  2266  	for k, v := range c.header_ {
  2267  		reqHeaders[k] = v
  2268  	}
  2269  	reqHeaders.Set("User-Agent", c.s.userAgent())
  2270  	if c.ifNoneMatch_ != "" {
  2271  		reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  2272  	}
  2273  	var body io.Reader = nil
  2274  	c.urlParams_.Set("alt", alt)
  2275  	c.urlParams_.Set("prettyPrint", "false")
  2276  	urls := googleapi.ResolveRelative(c.s.BasePath, "adclients/{adClientId}/customchannels/{customChannelId}")
  2277  	urls += "?" + c.urlParams_.Encode()
  2278  	req, err := http.NewRequest("GET", urls, body)
  2279  	if err != nil {
  2280  		return nil, err
  2281  	}
  2282  	req.Header = reqHeaders
  2283  	googleapi.Expand(req.URL, map[string]string{
  2284  		"adClientId":      c.adClientId,
  2285  		"customChannelId": c.customChannelId,
  2286  	})
  2287  	return gensupport.SendRequest(c.ctx_, c.s.client, req)
  2288  }
  2289  
  2290  // Do executes the "adexchangeseller.customchannels.get" call.
  2291  // Exactly one of *CustomChannel or error will be non-nil. Any non-2xx
  2292  // status code is an error. Response headers are in either
  2293  // *CustomChannel.ServerResponse.Header or (if a response was returned
  2294  // at all) in error.(*googleapi.Error).Header. Use
  2295  // googleapi.IsNotModified to check whether the returned error was
  2296  // because http.StatusNotModified was returned.
  2297  func (c *CustomchannelsGetCall) Do(opts ...googleapi.CallOption) (*CustomChannel, error) {
  2298  	gensupport.SetOptions(c.urlParams_, opts...)
  2299  	res, err := c.doRequest("json")
  2300  	if res != nil && res.StatusCode == http.StatusNotModified {
  2301  		if res.Body != nil {
  2302  			res.Body.Close()
  2303  		}
  2304  		return nil, &googleapi.Error{
  2305  			Code:   res.StatusCode,
  2306  			Header: res.Header,
  2307  		}
  2308  	}
  2309  	if err != nil {
  2310  		return nil, err
  2311  	}
  2312  	defer googleapi.CloseBody(res)
  2313  	if err := googleapi.CheckResponse(res); err != nil {
  2314  		return nil, err
  2315  	}
  2316  	ret := &CustomChannel{
  2317  		ServerResponse: googleapi.ServerResponse{
  2318  			Header:         res.Header,
  2319  			HTTPStatusCode: res.StatusCode,
  2320  		},
  2321  	}
  2322  	target := &ret
  2323  	if err := gensupport.DecodeResponse(target, res); err != nil {
  2324  		return nil, err
  2325  	}
  2326  	return ret, nil
  2327  	// {
  2328  	//   "description": "Get the specified custom channel from the specified ad client.",
  2329  	//   "httpMethod": "GET",
  2330  	//   "id": "adexchangeseller.customchannels.get",
  2331  	//   "parameterOrder": [
  2332  	//     "adClientId",
  2333  	//     "customChannelId"
  2334  	//   ],
  2335  	//   "parameters": {
  2336  	//     "adClientId": {
  2337  	//       "description": "Ad client which contains the custom channel.",
  2338  	//       "location": "path",
  2339  	//       "required": true,
  2340  	//       "type": "string"
  2341  	//     },
  2342  	//     "customChannelId": {
  2343  	//       "description": "Custom channel to retrieve.",
  2344  	//       "location": "path",
  2345  	//       "required": true,
  2346  	//       "type": "string"
  2347  	//     }
  2348  	//   },
  2349  	//   "path": "adclients/{adClientId}/customchannels/{customChannelId}",
  2350  	//   "response": {
  2351  	//     "$ref": "CustomChannel"
  2352  	//   },
  2353  	//   "scopes": [
  2354  	//     "https://www.googleapis.com/auth/adexchange.seller",
  2355  	//     "https://www.googleapis.com/auth/adexchange.seller.readonly"
  2356  	//   ]
  2357  	// }
  2358  
  2359  }
  2360  
  2361  // method id "adexchangeseller.customchannels.list":
  2362  
  2363  type CustomchannelsListCall struct {
  2364  	s            *Service
  2365  	adClientId   string
  2366  	urlParams_   gensupport.URLParams
  2367  	ifNoneMatch_ string
  2368  	ctx_         context.Context
  2369  	header_      http.Header
  2370  }
  2371  
  2372  // List: List all custom channels in the specified ad client for this Ad
  2373  // Exchange account.
  2374  func (r *CustomchannelsService) List(adClientId string) *CustomchannelsListCall {
  2375  	c := &CustomchannelsListCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  2376  	c.adClientId = adClientId
  2377  	return c
  2378  }
  2379  
  2380  // MaxResults sets the optional parameter "maxResults": The maximum
  2381  // number of custom channels to include in the response, used for
  2382  // paging.
  2383  func (c *CustomchannelsListCall) MaxResults(maxResults int64) *CustomchannelsListCall {
  2384  	c.urlParams_.Set("maxResults", fmt.Sprint(maxResults))
  2385  	return c
  2386  }
  2387  
  2388  // PageToken sets the optional parameter "pageToken": A continuation
  2389  // token, used to page through custom channels. To retrieve the next
  2390  // page, set this parameter to the value of "nextPageToken" from the
  2391  // previous response.
  2392  func (c *CustomchannelsListCall) PageToken(pageToken string) *CustomchannelsListCall {
  2393  	c.urlParams_.Set("pageToken", pageToken)
  2394  	return c
  2395  }
  2396  
  2397  // Fields allows partial responses to be retrieved. See
  2398  // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  2399  // for more information.
  2400  func (c *CustomchannelsListCall) Fields(s ...googleapi.Field) *CustomchannelsListCall {
  2401  	c.urlParams_.Set("fields", googleapi.CombineFields(s))
  2402  	return c
  2403  }
  2404  
  2405  // IfNoneMatch sets the optional parameter which makes the operation
  2406  // fail if the object's ETag matches the given value. This is useful for
  2407  // getting updates only after the object has changed since the last
  2408  // request. Use googleapi.IsNotModified to check whether the response
  2409  // error from Do is the result of In-None-Match.
  2410  func (c *CustomchannelsListCall) IfNoneMatch(entityTag string) *CustomchannelsListCall {
  2411  	c.ifNoneMatch_ = entityTag
  2412  	return c
  2413  }
  2414  
  2415  // Context sets the context to be used in this call's Do method. Any
  2416  // pending HTTP request will be aborted if the provided context is
  2417  // canceled.
  2418  func (c *CustomchannelsListCall) Context(ctx context.Context) *CustomchannelsListCall {
  2419  	c.ctx_ = ctx
  2420  	return c
  2421  }
  2422  
  2423  // Header returns an http.Header that can be modified by the caller to
  2424  // add HTTP headers to the request.
  2425  func (c *CustomchannelsListCall) Header() http.Header {
  2426  	if c.header_ == nil {
  2427  		c.header_ = make(http.Header)
  2428  	}
  2429  	return c.header_
  2430  }
  2431  
  2432  func (c *CustomchannelsListCall) doRequest(alt string) (*http.Response, error) {
  2433  	reqHeaders := make(http.Header)
  2434  	reqHeaders.Set("x-goog-api-client", "gl-go/1.13.7 gdcl/20200203")
  2435  	for k, v := range c.header_ {
  2436  		reqHeaders[k] = v
  2437  	}
  2438  	reqHeaders.Set("User-Agent", c.s.userAgent())
  2439  	if c.ifNoneMatch_ != "" {
  2440  		reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  2441  	}
  2442  	var body io.Reader = nil
  2443  	c.urlParams_.Set("alt", alt)
  2444  	c.urlParams_.Set("prettyPrint", "false")
  2445  	urls := googleapi.ResolveRelative(c.s.BasePath, "adclients/{adClientId}/customchannels")
  2446  	urls += "?" + c.urlParams_.Encode()
  2447  	req, err := http.NewRequest("GET", urls, body)
  2448  	if err != nil {
  2449  		return nil, err
  2450  	}
  2451  	req.Header = reqHeaders
  2452  	googleapi.Expand(req.URL, map[string]string{
  2453  		"adClientId": c.adClientId,
  2454  	})
  2455  	return gensupport.SendRequest(c.ctx_, c.s.client, req)
  2456  }
  2457  
  2458  // Do executes the "adexchangeseller.customchannels.list" call.
  2459  // Exactly one of *CustomChannels or error will be non-nil. Any non-2xx
  2460  // status code is an error. Response headers are in either
  2461  // *CustomChannels.ServerResponse.Header or (if a response was returned
  2462  // at all) in error.(*googleapi.Error).Header. Use
  2463  // googleapi.IsNotModified to check whether the returned error was
  2464  // because http.StatusNotModified was returned.
  2465  func (c *CustomchannelsListCall) Do(opts ...googleapi.CallOption) (*CustomChannels, error) {
  2466  	gensupport.SetOptions(c.urlParams_, opts...)
  2467  	res, err := c.doRequest("json")
  2468  	if res != nil && res.StatusCode == http.StatusNotModified {
  2469  		if res.Body != nil {
  2470  			res.Body.Close()
  2471  		}
  2472  		return nil, &googleapi.Error{
  2473  			Code:   res.StatusCode,
  2474  			Header: res.Header,
  2475  		}
  2476  	}
  2477  	if err != nil {
  2478  		return nil, err
  2479  	}
  2480  	defer googleapi.CloseBody(res)
  2481  	if err := googleapi.CheckResponse(res); err != nil {
  2482  		return nil, err
  2483  	}
  2484  	ret := &CustomChannels{
  2485  		ServerResponse: googleapi.ServerResponse{
  2486  			Header:         res.Header,
  2487  			HTTPStatusCode: res.StatusCode,
  2488  		},
  2489  	}
  2490  	target := &ret
  2491  	if err := gensupport.DecodeResponse(target, res); err != nil {
  2492  		return nil, err
  2493  	}
  2494  	return ret, nil
  2495  	// {
  2496  	//   "description": "List all custom channels in the specified ad client for this Ad Exchange account.",
  2497  	//   "httpMethod": "GET",
  2498  	//   "id": "adexchangeseller.customchannels.list",
  2499  	//   "parameterOrder": [
  2500  	//     "adClientId"
  2501  	//   ],
  2502  	//   "parameters": {
  2503  	//     "adClientId": {
  2504  	//       "description": "Ad client for which to list custom channels.",
  2505  	//       "location": "path",
  2506  	//       "required": true,
  2507  	//       "type": "string"
  2508  	//     },
  2509  	//     "maxResults": {
  2510  	//       "description": "The maximum number of custom channels to include in the response, used for paging.",
  2511  	//       "format": "uint32",
  2512  	//       "location": "query",
  2513  	//       "maximum": "10000",
  2514  	//       "minimum": "0",
  2515  	//       "type": "integer"
  2516  	//     },
  2517  	//     "pageToken": {
  2518  	//       "description": "A continuation token, used to page through custom channels. To retrieve the next page, set this parameter to the value of \"nextPageToken\" from the previous response.",
  2519  	//       "location": "query",
  2520  	//       "type": "string"
  2521  	//     }
  2522  	//   },
  2523  	//   "path": "adclients/{adClientId}/customchannels",
  2524  	//   "response": {
  2525  	//     "$ref": "CustomChannels"
  2526  	//   },
  2527  	//   "scopes": [
  2528  	//     "https://www.googleapis.com/auth/adexchange.seller",
  2529  	//     "https://www.googleapis.com/auth/adexchange.seller.readonly"
  2530  	//   ]
  2531  	// }
  2532  
  2533  }
  2534  
  2535  // Pages invokes f for each page of results.
  2536  // A non-nil error returned from f will halt the iteration.
  2537  // The provided context supersedes any context provided to the Context method.
  2538  func (c *CustomchannelsListCall) Pages(ctx context.Context, f func(*CustomChannels) error) error {
  2539  	c.ctx_ = ctx
  2540  	defer c.PageToken(c.urlParams_.Get("pageToken")) // reset paging to original point
  2541  	for {
  2542  		x, err := c.Do()
  2543  		if err != nil {
  2544  			return err
  2545  		}
  2546  		if err := f(x); err != nil {
  2547  			return err
  2548  		}
  2549  		if x.NextPageToken == "" {
  2550  			return nil
  2551  		}
  2552  		c.PageToken(x.NextPageToken)
  2553  	}
  2554  }
  2555  
  2556  // method id "adexchangeseller.customchannels.adunits.list":
  2557  
  2558  type CustomchannelsAdunitsListCall struct {
  2559  	s               *Service
  2560  	adClientId      string
  2561  	customChannelId string
  2562  	urlParams_      gensupport.URLParams
  2563  	ifNoneMatch_    string
  2564  	ctx_            context.Context
  2565  	header_         http.Header
  2566  }
  2567  
  2568  // List: List all ad units in the specified custom channel.
  2569  func (r *CustomchannelsAdunitsService) List(adClientId string, customChannelId string) *CustomchannelsAdunitsListCall {
  2570  	c := &CustomchannelsAdunitsListCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  2571  	c.adClientId = adClientId
  2572  	c.customChannelId = customChannelId
  2573  	return c
  2574  }
  2575  
  2576  // IncludeInactive sets the optional parameter "includeInactive":
  2577  // Whether to include inactive ad units. Default: true.
  2578  func (c *CustomchannelsAdunitsListCall) IncludeInactive(includeInactive bool) *CustomchannelsAdunitsListCall {
  2579  	c.urlParams_.Set("includeInactive", fmt.Sprint(includeInactive))
  2580  	return c
  2581  }
  2582  
  2583  // MaxResults sets the optional parameter "maxResults": The maximum
  2584  // number of ad units to include in the response, used for paging.
  2585  func (c *CustomchannelsAdunitsListCall) MaxResults(maxResults int64) *CustomchannelsAdunitsListCall {
  2586  	c.urlParams_.Set("maxResults", fmt.Sprint(maxResults))
  2587  	return c
  2588  }
  2589  
  2590  // PageToken sets the optional parameter "pageToken": A continuation
  2591  // token, used to page through ad units. To retrieve the next page, set
  2592  // this parameter to the value of "nextPageToken" from the previous
  2593  // response.
  2594  func (c *CustomchannelsAdunitsListCall) PageToken(pageToken string) *CustomchannelsAdunitsListCall {
  2595  	c.urlParams_.Set("pageToken", pageToken)
  2596  	return c
  2597  }
  2598  
  2599  // Fields allows partial responses to be retrieved. See
  2600  // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  2601  // for more information.
  2602  func (c *CustomchannelsAdunitsListCall) Fields(s ...googleapi.Field) *CustomchannelsAdunitsListCall {
  2603  	c.urlParams_.Set("fields", googleapi.CombineFields(s))
  2604  	return c
  2605  }
  2606  
  2607  // IfNoneMatch sets the optional parameter which makes the operation
  2608  // fail if the object's ETag matches the given value. This is useful for
  2609  // getting updates only after the object has changed since the last
  2610  // request. Use googleapi.IsNotModified to check whether the response
  2611  // error from Do is the result of In-None-Match.
  2612  func (c *CustomchannelsAdunitsListCall) IfNoneMatch(entityTag string) *CustomchannelsAdunitsListCall {
  2613  	c.ifNoneMatch_ = entityTag
  2614  	return c
  2615  }
  2616  
  2617  // Context sets the context to be used in this call's Do method. Any
  2618  // pending HTTP request will be aborted if the provided context is
  2619  // canceled.
  2620  func (c *CustomchannelsAdunitsListCall) Context(ctx context.Context) *CustomchannelsAdunitsListCall {
  2621  	c.ctx_ = ctx
  2622  	return c
  2623  }
  2624  
  2625  // Header returns an http.Header that can be modified by the caller to
  2626  // add HTTP headers to the request.
  2627  func (c *CustomchannelsAdunitsListCall) Header() http.Header {
  2628  	if c.header_ == nil {
  2629  		c.header_ = make(http.Header)
  2630  	}
  2631  	return c.header_
  2632  }
  2633  
  2634  func (c *CustomchannelsAdunitsListCall) doRequest(alt string) (*http.Response, error) {
  2635  	reqHeaders := make(http.Header)
  2636  	reqHeaders.Set("x-goog-api-client", "gl-go/1.13.7 gdcl/20200203")
  2637  	for k, v := range c.header_ {
  2638  		reqHeaders[k] = v
  2639  	}
  2640  	reqHeaders.Set("User-Agent", c.s.userAgent())
  2641  	if c.ifNoneMatch_ != "" {
  2642  		reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  2643  	}
  2644  	var body io.Reader = nil
  2645  	c.urlParams_.Set("alt", alt)
  2646  	c.urlParams_.Set("prettyPrint", "false")
  2647  	urls := googleapi.ResolveRelative(c.s.BasePath, "adclients/{adClientId}/customchannels/{customChannelId}/adunits")
  2648  	urls += "?" + c.urlParams_.Encode()
  2649  	req, err := http.NewRequest("GET", urls, body)
  2650  	if err != nil {
  2651  		return nil, err
  2652  	}
  2653  	req.Header = reqHeaders
  2654  	googleapi.Expand(req.URL, map[string]string{
  2655  		"adClientId":      c.adClientId,
  2656  		"customChannelId": c.customChannelId,
  2657  	})
  2658  	return gensupport.SendRequest(c.ctx_, c.s.client, req)
  2659  }
  2660  
  2661  // Do executes the "adexchangeseller.customchannels.adunits.list" call.
  2662  // Exactly one of *AdUnits or error will be non-nil. Any non-2xx status
  2663  // code is an error. Response headers are in either
  2664  // *AdUnits.ServerResponse.Header or (if a response was returned at all)
  2665  // in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to
  2666  // check whether the returned error was because http.StatusNotModified
  2667  // was returned.
  2668  func (c *CustomchannelsAdunitsListCall) Do(opts ...googleapi.CallOption) (*AdUnits, error) {
  2669  	gensupport.SetOptions(c.urlParams_, opts...)
  2670  	res, err := c.doRequest("json")
  2671  	if res != nil && res.StatusCode == http.StatusNotModified {
  2672  		if res.Body != nil {
  2673  			res.Body.Close()
  2674  		}
  2675  		return nil, &googleapi.Error{
  2676  			Code:   res.StatusCode,
  2677  			Header: res.Header,
  2678  		}
  2679  	}
  2680  	if err != nil {
  2681  		return nil, err
  2682  	}
  2683  	defer googleapi.CloseBody(res)
  2684  	if err := googleapi.CheckResponse(res); err != nil {
  2685  		return nil, err
  2686  	}
  2687  	ret := &AdUnits{
  2688  		ServerResponse: googleapi.ServerResponse{
  2689  			Header:         res.Header,
  2690  			HTTPStatusCode: res.StatusCode,
  2691  		},
  2692  	}
  2693  	target := &ret
  2694  	if err := gensupport.DecodeResponse(target, res); err != nil {
  2695  		return nil, err
  2696  	}
  2697  	return ret, nil
  2698  	// {
  2699  	//   "description": "List all ad units in the specified custom channel.",
  2700  	//   "httpMethod": "GET",
  2701  	//   "id": "adexchangeseller.customchannels.adunits.list",
  2702  	//   "parameterOrder": [
  2703  	//     "adClientId",
  2704  	//     "customChannelId"
  2705  	//   ],
  2706  	//   "parameters": {
  2707  	//     "adClientId": {
  2708  	//       "description": "Ad client which contains the custom channel.",
  2709  	//       "location": "path",
  2710  	//       "required": true,
  2711  	//       "type": "string"
  2712  	//     },
  2713  	//     "customChannelId": {
  2714  	//       "description": "Custom channel for which to list ad units.",
  2715  	//       "location": "path",
  2716  	//       "required": true,
  2717  	//       "type": "string"
  2718  	//     },
  2719  	//     "includeInactive": {
  2720  	//       "description": "Whether to include inactive ad units. Default: true.",
  2721  	//       "location": "query",
  2722  	//       "type": "boolean"
  2723  	//     },
  2724  	//     "maxResults": {
  2725  	//       "description": "The maximum number of ad units to include in the response, used for paging.",
  2726  	//       "format": "uint32",
  2727  	//       "location": "query",
  2728  	//       "maximum": "10000",
  2729  	//       "minimum": "0",
  2730  	//       "type": "integer"
  2731  	//     },
  2732  	//     "pageToken": {
  2733  	//       "description": "A continuation token, used to page through ad units. To retrieve the next page, set this parameter to the value of \"nextPageToken\" from the previous response.",
  2734  	//       "location": "query",
  2735  	//       "type": "string"
  2736  	//     }
  2737  	//   },
  2738  	//   "path": "adclients/{adClientId}/customchannels/{customChannelId}/adunits",
  2739  	//   "response": {
  2740  	//     "$ref": "AdUnits"
  2741  	//   },
  2742  	//   "scopes": [
  2743  	//     "https://www.googleapis.com/auth/adexchange.seller",
  2744  	//     "https://www.googleapis.com/auth/adexchange.seller.readonly"
  2745  	//   ]
  2746  	// }
  2747  
  2748  }
  2749  
  2750  // Pages invokes f for each page of results.
  2751  // A non-nil error returned from f will halt the iteration.
  2752  // The provided context supersedes any context provided to the Context method.
  2753  func (c *CustomchannelsAdunitsListCall) Pages(ctx context.Context, f func(*AdUnits) error) error {
  2754  	c.ctx_ = ctx
  2755  	defer c.PageToken(c.urlParams_.Get("pageToken")) // reset paging to original point
  2756  	for {
  2757  		x, err := c.Do()
  2758  		if err != nil {
  2759  			return err
  2760  		}
  2761  		if err := f(x); err != nil {
  2762  			return err
  2763  		}
  2764  		if x.NextPageToken == "" {
  2765  			return nil
  2766  		}
  2767  		c.PageToken(x.NextPageToken)
  2768  	}
  2769  }
  2770  
  2771  // method id "adexchangeseller.metadata.dimensions.list":
  2772  
  2773  type MetadataDimensionsListCall struct {
  2774  	s            *Service
  2775  	urlParams_   gensupport.URLParams
  2776  	ifNoneMatch_ string
  2777  	ctx_         context.Context
  2778  	header_      http.Header
  2779  }
  2780  
  2781  // List: List the metadata for the dimensions available to this
  2782  // AdExchange account.
  2783  func (r *MetadataDimensionsService) List() *MetadataDimensionsListCall {
  2784  	c := &MetadataDimensionsListCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  2785  	return c
  2786  }
  2787  
  2788  // Fields allows partial responses to be retrieved. See
  2789  // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  2790  // for more information.
  2791  func (c *MetadataDimensionsListCall) Fields(s ...googleapi.Field) *MetadataDimensionsListCall {
  2792  	c.urlParams_.Set("fields", googleapi.CombineFields(s))
  2793  	return c
  2794  }
  2795  
  2796  // IfNoneMatch sets the optional parameter which makes the operation
  2797  // fail if the object's ETag matches the given value. This is useful for
  2798  // getting updates only after the object has changed since the last
  2799  // request. Use googleapi.IsNotModified to check whether the response
  2800  // error from Do is the result of In-None-Match.
  2801  func (c *MetadataDimensionsListCall) IfNoneMatch(entityTag string) *MetadataDimensionsListCall {
  2802  	c.ifNoneMatch_ = entityTag
  2803  	return c
  2804  }
  2805  
  2806  // Context sets the context to be used in this call's Do method. Any
  2807  // pending HTTP request will be aborted if the provided context is
  2808  // canceled.
  2809  func (c *MetadataDimensionsListCall) Context(ctx context.Context) *MetadataDimensionsListCall {
  2810  	c.ctx_ = ctx
  2811  	return c
  2812  }
  2813  
  2814  // Header returns an http.Header that can be modified by the caller to
  2815  // add HTTP headers to the request.
  2816  func (c *MetadataDimensionsListCall) Header() http.Header {
  2817  	if c.header_ == nil {
  2818  		c.header_ = make(http.Header)
  2819  	}
  2820  	return c.header_
  2821  }
  2822  
  2823  func (c *MetadataDimensionsListCall) doRequest(alt string) (*http.Response, error) {
  2824  	reqHeaders := make(http.Header)
  2825  	reqHeaders.Set("x-goog-api-client", "gl-go/1.13.7 gdcl/20200203")
  2826  	for k, v := range c.header_ {
  2827  		reqHeaders[k] = v
  2828  	}
  2829  	reqHeaders.Set("User-Agent", c.s.userAgent())
  2830  	if c.ifNoneMatch_ != "" {
  2831  		reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  2832  	}
  2833  	var body io.Reader = nil
  2834  	c.urlParams_.Set("alt", alt)
  2835  	c.urlParams_.Set("prettyPrint", "false")
  2836  	urls := googleapi.ResolveRelative(c.s.BasePath, "metadata/dimensions")
  2837  	urls += "?" + c.urlParams_.Encode()
  2838  	req, err := http.NewRequest("GET", urls, body)
  2839  	if err != nil {
  2840  		return nil, err
  2841  	}
  2842  	req.Header = reqHeaders
  2843  	return gensupport.SendRequest(c.ctx_, c.s.client, req)
  2844  }
  2845  
  2846  // Do executes the "adexchangeseller.metadata.dimensions.list" call.
  2847  // Exactly one of *Metadata or error will be non-nil. Any non-2xx status
  2848  // code is an error. Response headers are in either
  2849  // *Metadata.ServerResponse.Header or (if a response was returned at
  2850  // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  2851  // to check whether the returned error was because
  2852  // http.StatusNotModified was returned.
  2853  func (c *MetadataDimensionsListCall) Do(opts ...googleapi.CallOption) (*Metadata, error) {
  2854  	gensupport.SetOptions(c.urlParams_, opts...)
  2855  	res, err := c.doRequest("json")
  2856  	if res != nil && res.StatusCode == http.StatusNotModified {
  2857  		if res.Body != nil {
  2858  			res.Body.Close()
  2859  		}
  2860  		return nil, &googleapi.Error{
  2861  			Code:   res.StatusCode,
  2862  			Header: res.Header,
  2863  		}
  2864  	}
  2865  	if err != nil {
  2866  		return nil, err
  2867  	}
  2868  	defer googleapi.CloseBody(res)
  2869  	if err := googleapi.CheckResponse(res); err != nil {
  2870  		return nil, err
  2871  	}
  2872  	ret := &Metadata{
  2873  		ServerResponse: googleapi.ServerResponse{
  2874  			Header:         res.Header,
  2875  			HTTPStatusCode: res.StatusCode,
  2876  		},
  2877  	}
  2878  	target := &ret
  2879  	if err := gensupport.DecodeResponse(target, res); err != nil {
  2880  		return nil, err
  2881  	}
  2882  	return ret, nil
  2883  	// {
  2884  	//   "description": "List the metadata for the dimensions available to this AdExchange account.",
  2885  	//   "httpMethod": "GET",
  2886  	//   "id": "adexchangeseller.metadata.dimensions.list",
  2887  	//   "path": "metadata/dimensions",
  2888  	//   "response": {
  2889  	//     "$ref": "Metadata"
  2890  	//   },
  2891  	//   "scopes": [
  2892  	//     "https://www.googleapis.com/auth/adexchange.seller",
  2893  	//     "https://www.googleapis.com/auth/adexchange.seller.readonly"
  2894  	//   ]
  2895  	// }
  2896  
  2897  }
  2898  
  2899  // method id "adexchangeseller.metadata.metrics.list":
  2900  
  2901  type MetadataMetricsListCall struct {
  2902  	s            *Service
  2903  	urlParams_   gensupport.URLParams
  2904  	ifNoneMatch_ string
  2905  	ctx_         context.Context
  2906  	header_      http.Header
  2907  }
  2908  
  2909  // List: List the metadata for the metrics available to this AdExchange
  2910  // account.
  2911  func (r *MetadataMetricsService) List() *MetadataMetricsListCall {
  2912  	c := &MetadataMetricsListCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  2913  	return c
  2914  }
  2915  
  2916  // Fields allows partial responses to be retrieved. See
  2917  // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  2918  // for more information.
  2919  func (c *MetadataMetricsListCall) Fields(s ...googleapi.Field) *MetadataMetricsListCall {
  2920  	c.urlParams_.Set("fields", googleapi.CombineFields(s))
  2921  	return c
  2922  }
  2923  
  2924  // IfNoneMatch sets the optional parameter which makes the operation
  2925  // fail if the object's ETag matches the given value. This is useful for
  2926  // getting updates only after the object has changed since the last
  2927  // request. Use googleapi.IsNotModified to check whether the response
  2928  // error from Do is the result of In-None-Match.
  2929  func (c *MetadataMetricsListCall) IfNoneMatch(entityTag string) *MetadataMetricsListCall {
  2930  	c.ifNoneMatch_ = entityTag
  2931  	return c
  2932  }
  2933  
  2934  // Context sets the context to be used in this call's Do method. Any
  2935  // pending HTTP request will be aborted if the provided context is
  2936  // canceled.
  2937  func (c *MetadataMetricsListCall) Context(ctx context.Context) *MetadataMetricsListCall {
  2938  	c.ctx_ = ctx
  2939  	return c
  2940  }
  2941  
  2942  // Header returns an http.Header that can be modified by the caller to
  2943  // add HTTP headers to the request.
  2944  func (c *MetadataMetricsListCall) Header() http.Header {
  2945  	if c.header_ == nil {
  2946  		c.header_ = make(http.Header)
  2947  	}
  2948  	return c.header_
  2949  }
  2950  
  2951  func (c *MetadataMetricsListCall) doRequest(alt string) (*http.Response, error) {
  2952  	reqHeaders := make(http.Header)
  2953  	reqHeaders.Set("x-goog-api-client", "gl-go/1.13.7 gdcl/20200203")
  2954  	for k, v := range c.header_ {
  2955  		reqHeaders[k] = v
  2956  	}
  2957  	reqHeaders.Set("User-Agent", c.s.userAgent())
  2958  	if c.ifNoneMatch_ != "" {
  2959  		reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  2960  	}
  2961  	var body io.Reader = nil
  2962  	c.urlParams_.Set("alt", alt)
  2963  	c.urlParams_.Set("prettyPrint", "false")
  2964  	urls := googleapi.ResolveRelative(c.s.BasePath, "metadata/metrics")
  2965  	urls += "?" + c.urlParams_.Encode()
  2966  	req, err := http.NewRequest("GET", urls, body)
  2967  	if err != nil {
  2968  		return nil, err
  2969  	}
  2970  	req.Header = reqHeaders
  2971  	return gensupport.SendRequest(c.ctx_, c.s.client, req)
  2972  }
  2973  
  2974  // Do executes the "adexchangeseller.metadata.metrics.list" call.
  2975  // Exactly one of *Metadata or error will be non-nil. Any non-2xx status
  2976  // code is an error. Response headers are in either
  2977  // *Metadata.ServerResponse.Header or (if a response was returned at
  2978  // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  2979  // to check whether the returned error was because
  2980  // http.StatusNotModified was returned.
  2981  func (c *MetadataMetricsListCall) Do(opts ...googleapi.CallOption) (*Metadata, error) {
  2982  	gensupport.SetOptions(c.urlParams_, opts...)
  2983  	res, err := c.doRequest("json")
  2984  	if res != nil && res.StatusCode == http.StatusNotModified {
  2985  		if res.Body != nil {
  2986  			res.Body.Close()
  2987  		}
  2988  		return nil, &googleapi.Error{
  2989  			Code:   res.StatusCode,
  2990  			Header: res.Header,
  2991  		}
  2992  	}
  2993  	if err != nil {
  2994  		return nil, err
  2995  	}
  2996  	defer googleapi.CloseBody(res)
  2997  	if err := googleapi.CheckResponse(res); err != nil {
  2998  		return nil, err
  2999  	}
  3000  	ret := &Metadata{
  3001  		ServerResponse: googleapi.ServerResponse{
  3002  			Header:         res.Header,
  3003  			HTTPStatusCode: res.StatusCode,
  3004  		},
  3005  	}
  3006  	target := &ret
  3007  	if err := gensupport.DecodeResponse(target, res); err != nil {
  3008  		return nil, err
  3009  	}
  3010  	return ret, nil
  3011  	// {
  3012  	//   "description": "List the metadata for the metrics available to this AdExchange account.",
  3013  	//   "httpMethod": "GET",
  3014  	//   "id": "adexchangeseller.metadata.metrics.list",
  3015  	//   "path": "metadata/metrics",
  3016  	//   "response": {
  3017  	//     "$ref": "Metadata"
  3018  	//   },
  3019  	//   "scopes": [
  3020  	//     "https://www.googleapis.com/auth/adexchange.seller",
  3021  	//     "https://www.googleapis.com/auth/adexchange.seller.readonly"
  3022  	//   ]
  3023  	// }
  3024  
  3025  }
  3026  
  3027  // method id "adexchangeseller.preferreddeals.get":
  3028  
  3029  type PreferreddealsGetCall struct {
  3030  	s            *Service
  3031  	dealId       string
  3032  	urlParams_   gensupport.URLParams
  3033  	ifNoneMatch_ string
  3034  	ctx_         context.Context
  3035  	header_      http.Header
  3036  }
  3037  
  3038  // Get: Get information about the selected Ad Exchange Preferred Deal.
  3039  func (r *PreferreddealsService) Get(dealId string) *PreferreddealsGetCall {
  3040  	c := &PreferreddealsGetCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  3041  	c.dealId = dealId
  3042  	return c
  3043  }
  3044  
  3045  // Fields allows partial responses to be retrieved. See
  3046  // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  3047  // for more information.
  3048  func (c *PreferreddealsGetCall) Fields(s ...googleapi.Field) *PreferreddealsGetCall {
  3049  	c.urlParams_.Set("fields", googleapi.CombineFields(s))
  3050  	return c
  3051  }
  3052  
  3053  // IfNoneMatch sets the optional parameter which makes the operation
  3054  // fail if the object's ETag matches the given value. This is useful for
  3055  // getting updates only after the object has changed since the last
  3056  // request. Use googleapi.IsNotModified to check whether the response
  3057  // error from Do is the result of In-None-Match.
  3058  func (c *PreferreddealsGetCall) IfNoneMatch(entityTag string) *PreferreddealsGetCall {
  3059  	c.ifNoneMatch_ = entityTag
  3060  	return c
  3061  }
  3062  
  3063  // Context sets the context to be used in this call's Do method. Any
  3064  // pending HTTP request will be aborted if the provided context is
  3065  // canceled.
  3066  func (c *PreferreddealsGetCall) Context(ctx context.Context) *PreferreddealsGetCall {
  3067  	c.ctx_ = ctx
  3068  	return c
  3069  }
  3070  
  3071  // Header returns an http.Header that can be modified by the caller to
  3072  // add HTTP headers to the request.
  3073  func (c *PreferreddealsGetCall) Header() http.Header {
  3074  	if c.header_ == nil {
  3075  		c.header_ = make(http.Header)
  3076  	}
  3077  	return c.header_
  3078  }
  3079  
  3080  func (c *PreferreddealsGetCall) doRequest(alt string) (*http.Response, error) {
  3081  	reqHeaders := make(http.Header)
  3082  	reqHeaders.Set("x-goog-api-client", "gl-go/1.13.7 gdcl/20200203")
  3083  	for k, v := range c.header_ {
  3084  		reqHeaders[k] = v
  3085  	}
  3086  	reqHeaders.Set("User-Agent", c.s.userAgent())
  3087  	if c.ifNoneMatch_ != "" {
  3088  		reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  3089  	}
  3090  	var body io.Reader = nil
  3091  	c.urlParams_.Set("alt", alt)
  3092  	c.urlParams_.Set("prettyPrint", "false")
  3093  	urls := googleapi.ResolveRelative(c.s.BasePath, "preferreddeals/{dealId}")
  3094  	urls += "?" + c.urlParams_.Encode()
  3095  	req, err := http.NewRequest("GET", urls, body)
  3096  	if err != nil {
  3097  		return nil, err
  3098  	}
  3099  	req.Header = reqHeaders
  3100  	googleapi.Expand(req.URL, map[string]string{
  3101  		"dealId": c.dealId,
  3102  	})
  3103  	return gensupport.SendRequest(c.ctx_, c.s.client, req)
  3104  }
  3105  
  3106  // Do executes the "adexchangeseller.preferreddeals.get" call.
  3107  // Exactly one of *PreferredDeal or error will be non-nil. Any non-2xx
  3108  // status code is an error. Response headers are in either
  3109  // *PreferredDeal.ServerResponse.Header or (if a response was returned
  3110  // at all) in error.(*googleapi.Error).Header. Use
  3111  // googleapi.IsNotModified to check whether the returned error was
  3112  // because http.StatusNotModified was returned.
  3113  func (c *PreferreddealsGetCall) Do(opts ...googleapi.CallOption) (*PreferredDeal, error) {
  3114  	gensupport.SetOptions(c.urlParams_, opts...)
  3115  	res, err := c.doRequest("json")
  3116  	if res != nil && res.StatusCode == http.StatusNotModified {
  3117  		if res.Body != nil {
  3118  			res.Body.Close()
  3119  		}
  3120  		return nil, &googleapi.Error{
  3121  			Code:   res.StatusCode,
  3122  			Header: res.Header,
  3123  		}
  3124  	}
  3125  	if err != nil {
  3126  		return nil, err
  3127  	}
  3128  	defer googleapi.CloseBody(res)
  3129  	if err := googleapi.CheckResponse(res); err != nil {
  3130  		return nil, err
  3131  	}
  3132  	ret := &PreferredDeal{
  3133  		ServerResponse: googleapi.ServerResponse{
  3134  			Header:         res.Header,
  3135  			HTTPStatusCode: res.StatusCode,
  3136  		},
  3137  	}
  3138  	target := &ret
  3139  	if err := gensupport.DecodeResponse(target, res); err != nil {
  3140  		return nil, err
  3141  	}
  3142  	return ret, nil
  3143  	// {
  3144  	//   "description": "Get information about the selected Ad Exchange Preferred Deal.",
  3145  	//   "httpMethod": "GET",
  3146  	//   "id": "adexchangeseller.preferreddeals.get",
  3147  	//   "parameterOrder": [
  3148  	//     "dealId"
  3149  	//   ],
  3150  	//   "parameters": {
  3151  	//     "dealId": {
  3152  	//       "description": "Preferred deal to get information about.",
  3153  	//       "location": "path",
  3154  	//       "required": true,
  3155  	//       "type": "string"
  3156  	//     }
  3157  	//   },
  3158  	//   "path": "preferreddeals/{dealId}",
  3159  	//   "response": {
  3160  	//     "$ref": "PreferredDeal"
  3161  	//   },
  3162  	//   "scopes": [
  3163  	//     "https://www.googleapis.com/auth/adexchange.seller",
  3164  	//     "https://www.googleapis.com/auth/adexchange.seller.readonly"
  3165  	//   ]
  3166  	// }
  3167  
  3168  }
  3169  
  3170  // method id "adexchangeseller.preferreddeals.list":
  3171  
  3172  type PreferreddealsListCall struct {
  3173  	s            *Service
  3174  	urlParams_   gensupport.URLParams
  3175  	ifNoneMatch_ string
  3176  	ctx_         context.Context
  3177  	header_      http.Header
  3178  }
  3179  
  3180  // List: List the preferred deals for this Ad Exchange account.
  3181  func (r *PreferreddealsService) List() *PreferreddealsListCall {
  3182  	c := &PreferreddealsListCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  3183  	return c
  3184  }
  3185  
  3186  // Fields allows partial responses to be retrieved. See
  3187  // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  3188  // for more information.
  3189  func (c *PreferreddealsListCall) Fields(s ...googleapi.Field) *PreferreddealsListCall {
  3190  	c.urlParams_.Set("fields", googleapi.CombineFields(s))
  3191  	return c
  3192  }
  3193  
  3194  // IfNoneMatch sets the optional parameter which makes the operation
  3195  // fail if the object's ETag matches the given value. This is useful for
  3196  // getting updates only after the object has changed since the last
  3197  // request. Use googleapi.IsNotModified to check whether the response
  3198  // error from Do is the result of In-None-Match.
  3199  func (c *PreferreddealsListCall) IfNoneMatch(entityTag string) *PreferreddealsListCall {
  3200  	c.ifNoneMatch_ = entityTag
  3201  	return c
  3202  }
  3203  
  3204  // Context sets the context to be used in this call's Do method. Any
  3205  // pending HTTP request will be aborted if the provided context is
  3206  // canceled.
  3207  func (c *PreferreddealsListCall) Context(ctx context.Context) *PreferreddealsListCall {
  3208  	c.ctx_ = ctx
  3209  	return c
  3210  }
  3211  
  3212  // Header returns an http.Header that can be modified by the caller to
  3213  // add HTTP headers to the request.
  3214  func (c *PreferreddealsListCall) Header() http.Header {
  3215  	if c.header_ == nil {
  3216  		c.header_ = make(http.Header)
  3217  	}
  3218  	return c.header_
  3219  }
  3220  
  3221  func (c *PreferreddealsListCall) doRequest(alt string) (*http.Response, error) {
  3222  	reqHeaders := make(http.Header)
  3223  	reqHeaders.Set("x-goog-api-client", "gl-go/1.13.7 gdcl/20200203")
  3224  	for k, v := range c.header_ {
  3225  		reqHeaders[k] = v
  3226  	}
  3227  	reqHeaders.Set("User-Agent", c.s.userAgent())
  3228  	if c.ifNoneMatch_ != "" {
  3229  		reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  3230  	}
  3231  	var body io.Reader = nil
  3232  	c.urlParams_.Set("alt", alt)
  3233  	c.urlParams_.Set("prettyPrint", "false")
  3234  	urls := googleapi.ResolveRelative(c.s.BasePath, "preferreddeals")
  3235  	urls += "?" + c.urlParams_.Encode()
  3236  	req, err := http.NewRequest("GET", urls, body)
  3237  	if err != nil {
  3238  		return nil, err
  3239  	}
  3240  	req.Header = reqHeaders
  3241  	return gensupport.SendRequest(c.ctx_, c.s.client, req)
  3242  }
  3243  
  3244  // Do executes the "adexchangeseller.preferreddeals.list" call.
  3245  // Exactly one of *PreferredDeals or error will be non-nil. Any non-2xx
  3246  // status code is an error. Response headers are in either
  3247  // *PreferredDeals.ServerResponse.Header or (if a response was returned
  3248  // at all) in error.(*googleapi.Error).Header. Use
  3249  // googleapi.IsNotModified to check whether the returned error was
  3250  // because http.StatusNotModified was returned.
  3251  func (c *PreferreddealsListCall) Do(opts ...googleapi.CallOption) (*PreferredDeals, error) {
  3252  	gensupport.SetOptions(c.urlParams_, opts...)
  3253  	res, err := c.doRequest("json")
  3254  	if res != nil && res.StatusCode == http.StatusNotModified {
  3255  		if res.Body != nil {
  3256  			res.Body.Close()
  3257  		}
  3258  		return nil, &googleapi.Error{
  3259  			Code:   res.StatusCode,
  3260  			Header: res.Header,
  3261  		}
  3262  	}
  3263  	if err != nil {
  3264  		return nil, err
  3265  	}
  3266  	defer googleapi.CloseBody(res)
  3267  	if err := googleapi.CheckResponse(res); err != nil {
  3268  		return nil, err
  3269  	}
  3270  	ret := &PreferredDeals{
  3271  		ServerResponse: googleapi.ServerResponse{
  3272  			Header:         res.Header,
  3273  			HTTPStatusCode: res.StatusCode,
  3274  		},
  3275  	}
  3276  	target := &ret
  3277  	if err := gensupport.DecodeResponse(target, res); err != nil {
  3278  		return nil, err
  3279  	}
  3280  	return ret, nil
  3281  	// {
  3282  	//   "description": "List the preferred deals for this Ad Exchange account.",
  3283  	//   "httpMethod": "GET",
  3284  	//   "id": "adexchangeseller.preferreddeals.list",
  3285  	//   "path": "preferreddeals",
  3286  	//   "response": {
  3287  	//     "$ref": "PreferredDeals"
  3288  	//   },
  3289  	//   "scopes": [
  3290  	//     "https://www.googleapis.com/auth/adexchange.seller",
  3291  	//     "https://www.googleapis.com/auth/adexchange.seller.readonly"
  3292  	//   ]
  3293  	// }
  3294  
  3295  }
  3296  
  3297  // method id "adexchangeseller.reports.generate":
  3298  
  3299  type ReportsGenerateCall struct {
  3300  	s            *Service
  3301  	urlParams_   gensupport.URLParams
  3302  	ifNoneMatch_ string
  3303  	ctx_         context.Context
  3304  	header_      http.Header
  3305  }
  3306  
  3307  // Generate: Generate an Ad Exchange report based on the report request
  3308  // sent in the query parameters. Returns the result as JSON; to retrieve
  3309  // output in CSV format specify "alt=csv" as a query parameter.
  3310  func (r *ReportsService) Generate(startDate string, endDate string) *ReportsGenerateCall {
  3311  	c := &ReportsGenerateCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  3312  	c.urlParams_.Set("startDate", startDate)
  3313  	c.urlParams_.Set("endDate", endDate)
  3314  	return c
  3315  }
  3316  
  3317  // Dimension sets the optional parameter "dimension": Dimensions to base
  3318  // the report on.
  3319  func (c *ReportsGenerateCall) Dimension(dimension ...string) *ReportsGenerateCall {
  3320  	c.urlParams_.SetMulti("dimension", append([]string{}, dimension...))
  3321  	return c
  3322  }
  3323  
  3324  // Filter sets the optional parameter "filter": Filters to be run on the
  3325  // report.
  3326  func (c *ReportsGenerateCall) Filter(filter ...string) *ReportsGenerateCall {
  3327  	c.urlParams_.SetMulti("filter", append([]string{}, filter...))
  3328  	return c
  3329  }
  3330  
  3331  // Locale sets the optional parameter "locale": Optional locale to use
  3332  // for translating report output to a local language. Defaults to
  3333  // "en_US" if not specified.
  3334  func (c *ReportsGenerateCall) Locale(locale string) *ReportsGenerateCall {
  3335  	c.urlParams_.Set("locale", locale)
  3336  	return c
  3337  }
  3338  
  3339  // MaxResults sets the optional parameter "maxResults": The maximum
  3340  // number of rows of report data to return.
  3341  func (c *ReportsGenerateCall) MaxResults(maxResults int64) *ReportsGenerateCall {
  3342  	c.urlParams_.Set("maxResults", fmt.Sprint(maxResults))
  3343  	return c
  3344  }
  3345  
  3346  // Metric sets the optional parameter "metric": Numeric columns to
  3347  // include in the report.
  3348  func (c *ReportsGenerateCall) Metric(metric ...string) *ReportsGenerateCall {
  3349  	c.urlParams_.SetMulti("metric", append([]string{}, metric...))
  3350  	return c
  3351  }
  3352  
  3353  // Sort sets the optional parameter "sort": The name of a dimension or
  3354  // metric to sort the resulting report on, optionally prefixed with "+"
  3355  // to sort ascending or "-" to sort descending. If no prefix is
  3356  // specified, the column is sorted ascending.
  3357  func (c *ReportsGenerateCall) Sort(sort ...string) *ReportsGenerateCall {
  3358  	c.urlParams_.SetMulti("sort", append([]string{}, sort...))
  3359  	return c
  3360  }
  3361  
  3362  // StartIndex sets the optional parameter "startIndex": Index of the
  3363  // first row of report data to return.
  3364  func (c *ReportsGenerateCall) StartIndex(startIndex int64) *ReportsGenerateCall {
  3365  	c.urlParams_.Set("startIndex", fmt.Sprint(startIndex))
  3366  	return c
  3367  }
  3368  
  3369  // Fields allows partial responses to be retrieved. See
  3370  // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  3371  // for more information.
  3372  func (c *ReportsGenerateCall) Fields(s ...googleapi.Field) *ReportsGenerateCall {
  3373  	c.urlParams_.Set("fields", googleapi.CombineFields(s))
  3374  	return c
  3375  }
  3376  
  3377  // IfNoneMatch sets the optional parameter which makes the operation
  3378  // fail if the object's ETag matches the given value. This is useful for
  3379  // getting updates only after the object has changed since the last
  3380  // request. Use googleapi.IsNotModified to check whether the response
  3381  // error from Do is the result of In-None-Match.
  3382  func (c *ReportsGenerateCall) IfNoneMatch(entityTag string) *ReportsGenerateCall {
  3383  	c.ifNoneMatch_ = entityTag
  3384  	return c
  3385  }
  3386  
  3387  // Context sets the context to be used in this call's Do and Download
  3388  // methods. Any pending HTTP request will be aborted if the provided
  3389  // context is canceled.
  3390  func (c *ReportsGenerateCall) Context(ctx context.Context) *ReportsGenerateCall {
  3391  	c.ctx_ = ctx
  3392  	return c
  3393  }
  3394  
  3395  // Header returns an http.Header that can be modified by the caller to
  3396  // add HTTP headers to the request.
  3397  func (c *ReportsGenerateCall) Header() http.Header {
  3398  	if c.header_ == nil {
  3399  		c.header_ = make(http.Header)
  3400  	}
  3401  	return c.header_
  3402  }
  3403  
  3404  func (c *ReportsGenerateCall) doRequest(alt string) (*http.Response, error) {
  3405  	reqHeaders := make(http.Header)
  3406  	reqHeaders.Set("x-goog-api-client", "gl-go/1.13.7 gdcl/20200203")
  3407  	for k, v := range c.header_ {
  3408  		reqHeaders[k] = v
  3409  	}
  3410  	reqHeaders.Set("User-Agent", c.s.userAgent())
  3411  	if c.ifNoneMatch_ != "" {
  3412  		reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  3413  	}
  3414  	var body io.Reader = nil
  3415  	c.urlParams_.Set("alt", alt)
  3416  	c.urlParams_.Set("prettyPrint", "false")
  3417  	urls := googleapi.ResolveRelative(c.s.BasePath, "reports")
  3418  	urls += "?" + c.urlParams_.Encode()
  3419  	req, err := http.NewRequest("GET", urls, body)
  3420  	if err != nil {
  3421  		return nil, err
  3422  	}
  3423  	req.Header = reqHeaders
  3424  	return gensupport.SendRequest(c.ctx_, c.s.client, req)
  3425  }
  3426  
  3427  // Download fetches the API endpoint's "media" value, instead of the normal
  3428  // API response value. If the returned error is nil, the Response is guaranteed to
  3429  // have a 2xx status code. Callers must close the Response.Body as usual.
  3430  func (c *ReportsGenerateCall) Download(opts ...googleapi.CallOption) (*http.Response, error) {
  3431  	gensupport.SetOptions(c.urlParams_, opts...)
  3432  	res, err := c.doRequest("media")
  3433  	if err != nil {
  3434  		return nil, err
  3435  	}
  3436  	if err := googleapi.CheckMediaResponse(res); err != nil {
  3437  		res.Body.Close()
  3438  		return nil, err
  3439  	}
  3440  	return res, nil
  3441  }
  3442  
  3443  // Do executes the "adexchangeseller.reports.generate" call.
  3444  // Exactly one of *Report or error will be non-nil. Any non-2xx status
  3445  // code is an error. Response headers are in either
  3446  // *Report.ServerResponse.Header or (if a response was returned at all)
  3447  // in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to
  3448  // check whether the returned error was because http.StatusNotModified
  3449  // was returned.
  3450  func (c *ReportsGenerateCall) Do(opts ...googleapi.CallOption) (*Report, error) {
  3451  	gensupport.SetOptions(c.urlParams_, opts...)
  3452  	res, err := c.doRequest("json")
  3453  	if res != nil && res.StatusCode == http.StatusNotModified {
  3454  		if res.Body != nil {
  3455  			res.Body.Close()
  3456  		}
  3457  		return nil, &googleapi.Error{
  3458  			Code:   res.StatusCode,
  3459  			Header: res.Header,
  3460  		}
  3461  	}
  3462  	if err != nil {
  3463  		return nil, err
  3464  	}
  3465  	defer googleapi.CloseBody(res)
  3466  	if err := googleapi.CheckResponse(res); err != nil {
  3467  		return nil, err
  3468  	}
  3469  	ret := &Report{
  3470  		ServerResponse: googleapi.ServerResponse{
  3471  			Header:         res.Header,
  3472  			HTTPStatusCode: res.StatusCode,
  3473  		},
  3474  	}
  3475  	target := &ret
  3476  	if err := gensupport.DecodeResponse(target, res); err != nil {
  3477  		return nil, err
  3478  	}
  3479  	return ret, nil
  3480  	// {
  3481  	//   "description": "Generate an Ad Exchange report based on the report request sent in the query parameters. Returns the result as JSON; to retrieve output in CSV format specify \"alt=csv\" as a query parameter.",
  3482  	//   "httpMethod": "GET",
  3483  	//   "id": "adexchangeseller.reports.generate",
  3484  	//   "parameterOrder": [
  3485  	//     "startDate",
  3486  	//     "endDate"
  3487  	//   ],
  3488  	//   "parameters": {
  3489  	//     "dimension": {
  3490  	//       "description": "Dimensions to base the report on.",
  3491  	//       "location": "query",
  3492  	//       "pattern": "[a-zA-Z_]+",
  3493  	//       "repeated": true,
  3494  	//       "type": "string"
  3495  	//     },
  3496  	//     "endDate": {
  3497  	//       "description": "End of the date range to report on in \"YYYY-MM-DD\" format, inclusive.",
  3498  	//       "location": "query",
  3499  	//       "pattern": "\\d{4}-\\d{2}-\\d{2}|(today|startOfMonth|startOfYear)(([\\-\\+]\\d+[dwmy]){0,3}?)",
  3500  	//       "required": true,
  3501  	//       "type": "string"
  3502  	//     },
  3503  	//     "filter": {
  3504  	//       "description": "Filters to be run on the report.",
  3505  	//       "location": "query",
  3506  	//       "pattern": "[a-zA-Z_]+(==|=@).+",
  3507  	//       "repeated": true,
  3508  	//       "type": "string"
  3509  	//     },
  3510  	//     "locale": {
  3511  	//       "description": "Optional locale to use for translating report output to a local language. Defaults to \"en_US\" if not specified.",
  3512  	//       "location": "query",
  3513  	//       "pattern": "[a-zA-Z_]+",
  3514  	//       "type": "string"
  3515  	//     },
  3516  	//     "maxResults": {
  3517  	//       "description": "The maximum number of rows of report data to return.",
  3518  	//       "format": "uint32",
  3519  	//       "location": "query",
  3520  	//       "maximum": "50000",
  3521  	//       "minimum": "0",
  3522  	//       "type": "integer"
  3523  	//     },
  3524  	//     "metric": {
  3525  	//       "description": "Numeric columns to include in the report.",
  3526  	//       "location": "query",
  3527  	//       "pattern": "[a-zA-Z_]+",
  3528  	//       "repeated": true,
  3529  	//       "type": "string"
  3530  	//     },
  3531  	//     "sort": {
  3532  	//       "description": "The name of a dimension or metric to sort the resulting report on, optionally prefixed with \"+\" to sort ascending or \"-\" to sort descending. If no prefix is specified, the column is sorted ascending.",
  3533  	//       "location": "query",
  3534  	//       "pattern": "(\\+|-)?[a-zA-Z_]+",
  3535  	//       "repeated": true,
  3536  	//       "type": "string"
  3537  	//     },
  3538  	//     "startDate": {
  3539  	//       "description": "Start of the date range to report on in \"YYYY-MM-DD\" format, inclusive.",
  3540  	//       "location": "query",
  3541  	//       "pattern": "\\d{4}-\\d{2}-\\d{2}|(today|startOfMonth|startOfYear)(([\\-\\+]\\d+[dwmy]){0,3}?)",
  3542  	//       "required": true,
  3543  	//       "type": "string"
  3544  	//     },
  3545  	//     "startIndex": {
  3546  	//       "description": "Index of the first row of report data to return.",
  3547  	//       "format": "uint32",
  3548  	//       "location": "query",
  3549  	//       "maximum": "5000",
  3550  	//       "minimum": "0",
  3551  	//       "type": "integer"
  3552  	//     }
  3553  	//   },
  3554  	//   "path": "reports",
  3555  	//   "response": {
  3556  	//     "$ref": "Report"
  3557  	//   },
  3558  	//   "scopes": [
  3559  	//     "https://www.googleapis.com/auth/adexchange.seller",
  3560  	//     "https://www.googleapis.com/auth/adexchange.seller.readonly"
  3561  	//   ],
  3562  	//   "supportsMediaDownload": true
  3563  	// }
  3564  
  3565  }
  3566  
  3567  // method id "adexchangeseller.reports.saved.generate":
  3568  
  3569  type ReportsSavedGenerateCall struct {
  3570  	s             *Service
  3571  	savedReportId string
  3572  	urlParams_    gensupport.URLParams
  3573  	ifNoneMatch_  string
  3574  	ctx_          context.Context
  3575  	header_       http.Header
  3576  }
  3577  
  3578  // Generate: Generate an Ad Exchange report based on the saved report ID
  3579  // sent in the query parameters.
  3580  func (r *ReportsSavedService) Generate(savedReportId string) *ReportsSavedGenerateCall {
  3581  	c := &ReportsSavedGenerateCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  3582  	c.savedReportId = savedReportId
  3583  	return c
  3584  }
  3585  
  3586  // Locale sets the optional parameter "locale": Optional locale to use
  3587  // for translating report output to a local language. Defaults to
  3588  // "en_US" if not specified.
  3589  func (c *ReportsSavedGenerateCall) Locale(locale string) *ReportsSavedGenerateCall {
  3590  	c.urlParams_.Set("locale", locale)
  3591  	return c
  3592  }
  3593  
  3594  // MaxResults sets the optional parameter "maxResults": The maximum
  3595  // number of rows of report data to return.
  3596  func (c *ReportsSavedGenerateCall) MaxResults(maxResults int64) *ReportsSavedGenerateCall {
  3597  	c.urlParams_.Set("maxResults", fmt.Sprint(maxResults))
  3598  	return c
  3599  }
  3600  
  3601  // StartIndex sets the optional parameter "startIndex": Index of the
  3602  // first row of report data to return.
  3603  func (c *ReportsSavedGenerateCall) StartIndex(startIndex int64) *ReportsSavedGenerateCall {
  3604  	c.urlParams_.Set("startIndex", fmt.Sprint(startIndex))
  3605  	return c
  3606  }
  3607  
  3608  // Fields allows partial responses to be retrieved. See
  3609  // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  3610  // for more information.
  3611  func (c *ReportsSavedGenerateCall) Fields(s ...googleapi.Field) *ReportsSavedGenerateCall {
  3612  	c.urlParams_.Set("fields", googleapi.CombineFields(s))
  3613  	return c
  3614  }
  3615  
  3616  // IfNoneMatch sets the optional parameter which makes the operation
  3617  // fail if the object's ETag matches the given value. This is useful for
  3618  // getting updates only after the object has changed since the last
  3619  // request. Use googleapi.IsNotModified to check whether the response
  3620  // error from Do is the result of In-None-Match.
  3621  func (c *ReportsSavedGenerateCall) IfNoneMatch(entityTag string) *ReportsSavedGenerateCall {
  3622  	c.ifNoneMatch_ = entityTag
  3623  	return c
  3624  }
  3625  
  3626  // Context sets the context to be used in this call's Do method. Any
  3627  // pending HTTP request will be aborted if the provided context is
  3628  // canceled.
  3629  func (c *ReportsSavedGenerateCall) Context(ctx context.Context) *ReportsSavedGenerateCall {
  3630  	c.ctx_ = ctx
  3631  	return c
  3632  }
  3633  
  3634  // Header returns an http.Header that can be modified by the caller to
  3635  // add HTTP headers to the request.
  3636  func (c *ReportsSavedGenerateCall) Header() http.Header {
  3637  	if c.header_ == nil {
  3638  		c.header_ = make(http.Header)
  3639  	}
  3640  	return c.header_
  3641  }
  3642  
  3643  func (c *ReportsSavedGenerateCall) doRequest(alt string) (*http.Response, error) {
  3644  	reqHeaders := make(http.Header)
  3645  	reqHeaders.Set("x-goog-api-client", "gl-go/1.13.7 gdcl/20200203")
  3646  	for k, v := range c.header_ {
  3647  		reqHeaders[k] = v
  3648  	}
  3649  	reqHeaders.Set("User-Agent", c.s.userAgent())
  3650  	if c.ifNoneMatch_ != "" {
  3651  		reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  3652  	}
  3653  	var body io.Reader = nil
  3654  	c.urlParams_.Set("alt", alt)
  3655  	c.urlParams_.Set("prettyPrint", "false")
  3656  	urls := googleapi.ResolveRelative(c.s.BasePath, "reports/{savedReportId}")
  3657  	urls += "?" + c.urlParams_.Encode()
  3658  	req, err := http.NewRequest("GET", urls, body)
  3659  	if err != nil {
  3660  		return nil, err
  3661  	}
  3662  	req.Header = reqHeaders
  3663  	googleapi.Expand(req.URL, map[string]string{
  3664  		"savedReportId": c.savedReportId,
  3665  	})
  3666  	return gensupport.SendRequest(c.ctx_, c.s.client, req)
  3667  }
  3668  
  3669  // Do executes the "adexchangeseller.reports.saved.generate" call.
  3670  // Exactly one of *Report or error will be non-nil. Any non-2xx status
  3671  // code is an error. Response headers are in either
  3672  // *Report.ServerResponse.Header or (if a response was returned at all)
  3673  // in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to
  3674  // check whether the returned error was because http.StatusNotModified
  3675  // was returned.
  3676  func (c *ReportsSavedGenerateCall) Do(opts ...googleapi.CallOption) (*Report, error) {
  3677  	gensupport.SetOptions(c.urlParams_, opts...)
  3678  	res, err := c.doRequest("json")
  3679  	if res != nil && res.StatusCode == http.StatusNotModified {
  3680  		if res.Body != nil {
  3681  			res.Body.Close()
  3682  		}
  3683  		return nil, &googleapi.Error{
  3684  			Code:   res.StatusCode,
  3685  			Header: res.Header,
  3686  		}
  3687  	}
  3688  	if err != nil {
  3689  		return nil, err
  3690  	}
  3691  	defer googleapi.CloseBody(res)
  3692  	if err := googleapi.CheckResponse(res); err != nil {
  3693  		return nil, err
  3694  	}
  3695  	ret := &Report{
  3696  		ServerResponse: googleapi.ServerResponse{
  3697  			Header:         res.Header,
  3698  			HTTPStatusCode: res.StatusCode,
  3699  		},
  3700  	}
  3701  	target := &ret
  3702  	if err := gensupport.DecodeResponse(target, res); err != nil {
  3703  		return nil, err
  3704  	}
  3705  	return ret, nil
  3706  	// {
  3707  	//   "description": "Generate an Ad Exchange report based on the saved report ID sent in the query parameters.",
  3708  	//   "httpMethod": "GET",
  3709  	//   "id": "adexchangeseller.reports.saved.generate",
  3710  	//   "parameterOrder": [
  3711  	//     "savedReportId"
  3712  	//   ],
  3713  	//   "parameters": {
  3714  	//     "locale": {
  3715  	//       "description": "Optional locale to use for translating report output to a local language. Defaults to \"en_US\" if not specified.",
  3716  	//       "location": "query",
  3717  	//       "pattern": "[a-zA-Z_]+",
  3718  	//       "type": "string"
  3719  	//     },
  3720  	//     "maxResults": {
  3721  	//       "description": "The maximum number of rows of report data to return.",
  3722  	//       "format": "int32",
  3723  	//       "location": "query",
  3724  	//       "maximum": "50000",
  3725  	//       "minimum": "0",
  3726  	//       "type": "integer"
  3727  	//     },
  3728  	//     "savedReportId": {
  3729  	//       "description": "The saved report to retrieve.",
  3730  	//       "location": "path",
  3731  	//       "required": true,
  3732  	//       "type": "string"
  3733  	//     },
  3734  	//     "startIndex": {
  3735  	//       "description": "Index of the first row of report data to return.",
  3736  	//       "format": "int32",
  3737  	//       "location": "query",
  3738  	//       "maximum": "5000",
  3739  	//       "minimum": "0",
  3740  	//       "type": "integer"
  3741  	//     }
  3742  	//   },
  3743  	//   "path": "reports/{savedReportId}",
  3744  	//   "response": {
  3745  	//     "$ref": "Report"
  3746  	//   },
  3747  	//   "scopes": [
  3748  	//     "https://www.googleapis.com/auth/adexchange.seller",
  3749  	//     "https://www.googleapis.com/auth/adexchange.seller.readonly"
  3750  	//   ]
  3751  	// }
  3752  
  3753  }
  3754  
  3755  // method id "adexchangeseller.reports.saved.list":
  3756  
  3757  type ReportsSavedListCall struct {
  3758  	s            *Service
  3759  	urlParams_   gensupport.URLParams
  3760  	ifNoneMatch_ string
  3761  	ctx_         context.Context
  3762  	header_      http.Header
  3763  }
  3764  
  3765  // List: List all saved reports in this Ad Exchange account.
  3766  func (r *ReportsSavedService) List() *ReportsSavedListCall {
  3767  	c := &ReportsSavedListCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  3768  	return c
  3769  }
  3770  
  3771  // MaxResults sets the optional parameter "maxResults": The maximum
  3772  // number of saved reports to include in the response, used for paging.
  3773  func (c *ReportsSavedListCall) MaxResults(maxResults int64) *ReportsSavedListCall {
  3774  	c.urlParams_.Set("maxResults", fmt.Sprint(maxResults))
  3775  	return c
  3776  }
  3777  
  3778  // PageToken sets the optional parameter "pageToken": A continuation
  3779  // token, used to page through saved reports. To retrieve the next page,
  3780  // set this parameter to the value of "nextPageToken" from the previous
  3781  // response.
  3782  func (c *ReportsSavedListCall) PageToken(pageToken string) *ReportsSavedListCall {
  3783  	c.urlParams_.Set("pageToken", pageToken)
  3784  	return c
  3785  }
  3786  
  3787  // Fields allows partial responses to be retrieved. See
  3788  // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  3789  // for more information.
  3790  func (c *ReportsSavedListCall) Fields(s ...googleapi.Field) *ReportsSavedListCall {
  3791  	c.urlParams_.Set("fields", googleapi.CombineFields(s))
  3792  	return c
  3793  }
  3794  
  3795  // IfNoneMatch sets the optional parameter which makes the operation
  3796  // fail if the object's ETag matches the given value. This is useful for
  3797  // getting updates only after the object has changed since the last
  3798  // request. Use googleapi.IsNotModified to check whether the response
  3799  // error from Do is the result of In-None-Match.
  3800  func (c *ReportsSavedListCall) IfNoneMatch(entityTag string) *ReportsSavedListCall {
  3801  	c.ifNoneMatch_ = entityTag
  3802  	return c
  3803  }
  3804  
  3805  // Context sets the context to be used in this call's Do method. Any
  3806  // pending HTTP request will be aborted if the provided context is
  3807  // canceled.
  3808  func (c *ReportsSavedListCall) Context(ctx context.Context) *ReportsSavedListCall {
  3809  	c.ctx_ = ctx
  3810  	return c
  3811  }
  3812  
  3813  // Header returns an http.Header that can be modified by the caller to
  3814  // add HTTP headers to the request.
  3815  func (c *ReportsSavedListCall) Header() http.Header {
  3816  	if c.header_ == nil {
  3817  		c.header_ = make(http.Header)
  3818  	}
  3819  	return c.header_
  3820  }
  3821  
  3822  func (c *ReportsSavedListCall) doRequest(alt string) (*http.Response, error) {
  3823  	reqHeaders := make(http.Header)
  3824  	reqHeaders.Set("x-goog-api-client", "gl-go/1.13.7 gdcl/20200203")
  3825  	for k, v := range c.header_ {
  3826  		reqHeaders[k] = v
  3827  	}
  3828  	reqHeaders.Set("User-Agent", c.s.userAgent())
  3829  	if c.ifNoneMatch_ != "" {
  3830  		reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  3831  	}
  3832  	var body io.Reader = nil
  3833  	c.urlParams_.Set("alt", alt)
  3834  	c.urlParams_.Set("prettyPrint", "false")
  3835  	urls := googleapi.ResolveRelative(c.s.BasePath, "reports/saved")
  3836  	urls += "?" + c.urlParams_.Encode()
  3837  	req, err := http.NewRequest("GET", urls, body)
  3838  	if err != nil {
  3839  		return nil, err
  3840  	}
  3841  	req.Header = reqHeaders
  3842  	return gensupport.SendRequest(c.ctx_, c.s.client, req)
  3843  }
  3844  
  3845  // Do executes the "adexchangeseller.reports.saved.list" call.
  3846  // Exactly one of *SavedReports or error will be non-nil. Any non-2xx
  3847  // status code is an error. Response headers are in either
  3848  // *SavedReports.ServerResponse.Header or (if a response was returned at
  3849  // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  3850  // to check whether the returned error was because
  3851  // http.StatusNotModified was returned.
  3852  func (c *ReportsSavedListCall) Do(opts ...googleapi.CallOption) (*SavedReports, error) {
  3853  	gensupport.SetOptions(c.urlParams_, opts...)
  3854  	res, err := c.doRequest("json")
  3855  	if res != nil && res.StatusCode == http.StatusNotModified {
  3856  		if res.Body != nil {
  3857  			res.Body.Close()
  3858  		}
  3859  		return nil, &googleapi.Error{
  3860  			Code:   res.StatusCode,
  3861  			Header: res.Header,
  3862  		}
  3863  	}
  3864  	if err != nil {
  3865  		return nil, err
  3866  	}
  3867  	defer googleapi.CloseBody(res)
  3868  	if err := googleapi.CheckResponse(res); err != nil {
  3869  		return nil, err
  3870  	}
  3871  	ret := &SavedReports{
  3872  		ServerResponse: googleapi.ServerResponse{
  3873  			Header:         res.Header,
  3874  			HTTPStatusCode: res.StatusCode,
  3875  		},
  3876  	}
  3877  	target := &ret
  3878  	if err := gensupport.DecodeResponse(target, res); err != nil {
  3879  		return nil, err
  3880  	}
  3881  	return ret, nil
  3882  	// {
  3883  	//   "description": "List all saved reports in this Ad Exchange account.",
  3884  	//   "httpMethod": "GET",
  3885  	//   "id": "adexchangeseller.reports.saved.list",
  3886  	//   "parameters": {
  3887  	//     "maxResults": {
  3888  	//       "description": "The maximum number of saved reports to include in the response, used for paging.",
  3889  	//       "format": "int32",
  3890  	//       "location": "query",
  3891  	//       "maximum": "100",
  3892  	//       "minimum": "0",
  3893  	//       "type": "integer"
  3894  	//     },
  3895  	//     "pageToken": {
  3896  	//       "description": "A continuation token, used to page through saved reports. To retrieve the next page, set this parameter to the value of \"nextPageToken\" from the previous response.",
  3897  	//       "location": "query",
  3898  	//       "type": "string"
  3899  	//     }
  3900  	//   },
  3901  	//   "path": "reports/saved",
  3902  	//   "response": {
  3903  	//     "$ref": "SavedReports"
  3904  	//   },
  3905  	//   "scopes": [
  3906  	//     "https://www.googleapis.com/auth/adexchange.seller",
  3907  	//     "https://www.googleapis.com/auth/adexchange.seller.readonly"
  3908  	//   ]
  3909  	// }
  3910  
  3911  }
  3912  
  3913  // Pages invokes f for each page of results.
  3914  // A non-nil error returned from f will halt the iteration.
  3915  // The provided context supersedes any context provided to the Context method.
  3916  func (c *ReportsSavedListCall) Pages(ctx context.Context, f func(*SavedReports) error) error {
  3917  	c.ctx_ = ctx
  3918  	defer c.PageToken(c.urlParams_.Get("pageToken")) // reset paging to original point
  3919  	for {
  3920  		x, err := c.Do()
  3921  		if err != nil {
  3922  			return err
  3923  		}
  3924  		if err := f(x); err != nil {
  3925  			return err
  3926  		}
  3927  		if x.NextPageToken == "" {
  3928  			return nil
  3929  		}
  3930  		c.PageToken(x.NextPageToken)
  3931  	}
  3932  }
  3933  
  3934  // method id "adexchangeseller.urlchannels.list":
  3935  
  3936  type UrlchannelsListCall struct {
  3937  	s            *Service
  3938  	adClientId   string
  3939  	urlParams_   gensupport.URLParams
  3940  	ifNoneMatch_ string
  3941  	ctx_         context.Context
  3942  	header_      http.Header
  3943  }
  3944  
  3945  // List: List all URL channels in the specified ad client for this Ad
  3946  // Exchange account.
  3947  func (r *UrlchannelsService) List(adClientId string) *UrlchannelsListCall {
  3948  	c := &UrlchannelsListCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  3949  	c.adClientId = adClientId
  3950  	return c
  3951  }
  3952  
  3953  // MaxResults sets the optional parameter "maxResults": The maximum
  3954  // number of URL channels to include in the response, used for paging.
  3955  func (c *UrlchannelsListCall) MaxResults(maxResults int64) *UrlchannelsListCall {
  3956  	c.urlParams_.Set("maxResults", fmt.Sprint(maxResults))
  3957  	return c
  3958  }
  3959  
  3960  // PageToken sets the optional parameter "pageToken": A continuation
  3961  // token, used to page through URL channels. To retrieve the next page,
  3962  // set this parameter to the value of "nextPageToken" from the previous
  3963  // response.
  3964  func (c *UrlchannelsListCall) PageToken(pageToken string) *UrlchannelsListCall {
  3965  	c.urlParams_.Set("pageToken", pageToken)
  3966  	return c
  3967  }
  3968  
  3969  // Fields allows partial responses to be retrieved. See
  3970  // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  3971  // for more information.
  3972  func (c *UrlchannelsListCall) Fields(s ...googleapi.Field) *UrlchannelsListCall {
  3973  	c.urlParams_.Set("fields", googleapi.CombineFields(s))
  3974  	return c
  3975  }
  3976  
  3977  // IfNoneMatch sets the optional parameter which makes the operation
  3978  // fail if the object's ETag matches the given value. This is useful for
  3979  // getting updates only after the object has changed since the last
  3980  // request. Use googleapi.IsNotModified to check whether the response
  3981  // error from Do is the result of In-None-Match.
  3982  func (c *UrlchannelsListCall) IfNoneMatch(entityTag string) *UrlchannelsListCall {
  3983  	c.ifNoneMatch_ = entityTag
  3984  	return c
  3985  }
  3986  
  3987  // Context sets the context to be used in this call's Do method. Any
  3988  // pending HTTP request will be aborted if the provided context is
  3989  // canceled.
  3990  func (c *UrlchannelsListCall) Context(ctx context.Context) *UrlchannelsListCall {
  3991  	c.ctx_ = ctx
  3992  	return c
  3993  }
  3994  
  3995  // Header returns an http.Header that can be modified by the caller to
  3996  // add HTTP headers to the request.
  3997  func (c *UrlchannelsListCall) Header() http.Header {
  3998  	if c.header_ == nil {
  3999  		c.header_ = make(http.Header)
  4000  	}
  4001  	return c.header_
  4002  }
  4003  
  4004  func (c *UrlchannelsListCall) doRequest(alt string) (*http.Response, error) {
  4005  	reqHeaders := make(http.Header)
  4006  	reqHeaders.Set("x-goog-api-client", "gl-go/1.13.7 gdcl/20200203")
  4007  	for k, v := range c.header_ {
  4008  		reqHeaders[k] = v
  4009  	}
  4010  	reqHeaders.Set("User-Agent", c.s.userAgent())
  4011  	if c.ifNoneMatch_ != "" {
  4012  		reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  4013  	}
  4014  	var body io.Reader = nil
  4015  	c.urlParams_.Set("alt", alt)
  4016  	c.urlParams_.Set("prettyPrint", "false")
  4017  	urls := googleapi.ResolveRelative(c.s.BasePath, "adclients/{adClientId}/urlchannels")
  4018  	urls += "?" + c.urlParams_.Encode()
  4019  	req, err := http.NewRequest("GET", urls, body)
  4020  	if err != nil {
  4021  		return nil, err
  4022  	}
  4023  	req.Header = reqHeaders
  4024  	googleapi.Expand(req.URL, map[string]string{
  4025  		"adClientId": c.adClientId,
  4026  	})
  4027  	return gensupport.SendRequest(c.ctx_, c.s.client, req)
  4028  }
  4029  
  4030  // Do executes the "adexchangeseller.urlchannels.list" call.
  4031  // Exactly one of *UrlChannels or error will be non-nil. Any non-2xx
  4032  // status code is an error. Response headers are in either
  4033  // *UrlChannels.ServerResponse.Header or (if a response was returned at
  4034  // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  4035  // to check whether the returned error was because
  4036  // http.StatusNotModified was returned.
  4037  func (c *UrlchannelsListCall) Do(opts ...googleapi.CallOption) (*UrlChannels, error) {
  4038  	gensupport.SetOptions(c.urlParams_, opts...)
  4039  	res, err := c.doRequest("json")
  4040  	if res != nil && res.StatusCode == http.StatusNotModified {
  4041  		if res.Body != nil {
  4042  			res.Body.Close()
  4043  		}
  4044  		return nil, &googleapi.Error{
  4045  			Code:   res.StatusCode,
  4046  			Header: res.Header,
  4047  		}
  4048  	}
  4049  	if err != nil {
  4050  		return nil, err
  4051  	}
  4052  	defer googleapi.CloseBody(res)
  4053  	if err := googleapi.CheckResponse(res); err != nil {
  4054  		return nil, err
  4055  	}
  4056  	ret := &UrlChannels{
  4057  		ServerResponse: googleapi.ServerResponse{
  4058  			Header:         res.Header,
  4059  			HTTPStatusCode: res.StatusCode,
  4060  		},
  4061  	}
  4062  	target := &ret
  4063  	if err := gensupport.DecodeResponse(target, res); err != nil {
  4064  		return nil, err
  4065  	}
  4066  	return ret, nil
  4067  	// {
  4068  	//   "description": "List all URL channels in the specified ad client for this Ad Exchange account.",
  4069  	//   "httpMethod": "GET",
  4070  	//   "id": "adexchangeseller.urlchannels.list",
  4071  	//   "parameterOrder": [
  4072  	//     "adClientId"
  4073  	//   ],
  4074  	//   "parameters": {
  4075  	//     "adClientId": {
  4076  	//       "description": "Ad client for which to list URL channels.",
  4077  	//       "location": "path",
  4078  	//       "required": true,
  4079  	//       "type": "string"
  4080  	//     },
  4081  	//     "maxResults": {
  4082  	//       "description": "The maximum number of URL channels to include in the response, used for paging.",
  4083  	//       "format": "uint32",
  4084  	//       "location": "query",
  4085  	//       "maximum": "10000",
  4086  	//       "minimum": "0",
  4087  	//       "type": "integer"
  4088  	//     },
  4089  	//     "pageToken": {
  4090  	//       "description": "A continuation token, used to page through URL channels. To retrieve the next page, set this parameter to the value of \"nextPageToken\" from the previous response.",
  4091  	//       "location": "query",
  4092  	//       "type": "string"
  4093  	//     }
  4094  	//   },
  4095  	//   "path": "adclients/{adClientId}/urlchannels",
  4096  	//   "response": {
  4097  	//     "$ref": "UrlChannels"
  4098  	//   },
  4099  	//   "scopes": [
  4100  	//     "https://www.googleapis.com/auth/adexchange.seller",
  4101  	//     "https://www.googleapis.com/auth/adexchange.seller.readonly"
  4102  	//   ]
  4103  	// }
  4104  
  4105  }
  4106  
  4107  // Pages invokes f for each page of results.
  4108  // A non-nil error returned from f will halt the iteration.
  4109  // The provided context supersedes any context provided to the Context method.
  4110  func (c *UrlchannelsListCall) Pages(ctx context.Context, f func(*UrlChannels) error) error {
  4111  	c.ctx_ = ctx
  4112  	defer c.PageToken(c.urlParams_.Get("pageToken")) // reset paging to original point
  4113  	for {
  4114  		x, err := c.Do()
  4115  		if err != nil {
  4116  			return err
  4117  		}
  4118  		if err := f(x); err != nil {
  4119  			return err
  4120  		}
  4121  		if x.NextPageToken == "" {
  4122  			return nil
  4123  		}
  4124  		c.PageToken(x.NextPageToken)
  4125  	}
  4126  }
  4127  

View as plain text