...

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

Documentation: google.golang.org/api/adexchangeseller/v2.0

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

View as plain text