...

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

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

     1  // Copyright 2024 Google LLC.
     2  // Use of this source code is governed by a BSD-style
     3  // license that can be found in the LICENSE file.
     4  
     5  // Code generated file. DO NOT EDIT.
     6  
     7  // Package doubleclicksearch provides access to the Search Ads 360 API.
     8  //
     9  // For product documentation, see: https://developers.google.com/search-ads
    10  //
    11  // # Library status
    12  //
    13  // These client libraries are officially supported by Google. However, this
    14  // library is considered complete and is in maintenance mode. This means
    15  // that we will address critical bugs and security issues but will not add
    16  // any new features.
    17  //
    18  // When possible, we recommend using our newer
    19  // [Cloud Client Libraries for Go](https://pkg.go.dev/cloud.google.com/go)
    20  // that are still actively being worked and iterated on.
    21  //
    22  // # Creating a client
    23  //
    24  // Usage example:
    25  //
    26  //	import "google.golang.org/api/doubleclicksearch/v2"
    27  //	...
    28  //	ctx := context.Background()
    29  //	doubleclicksearchService, err := doubleclicksearch.NewService(ctx)
    30  //
    31  // In this example, Google Application Default Credentials are used for
    32  // authentication. For information on how to create and obtain Application
    33  // Default Credentials, see https://developers.google.com/identity/protocols/application-default-credentials.
    34  //
    35  // # Other authentication options
    36  //
    37  // To use an API key for authentication (note: some APIs do not support API
    38  // keys), use [google.golang.org/api/option.WithAPIKey]:
    39  //
    40  //	doubleclicksearchService, err := doubleclicksearch.NewService(ctx, option.WithAPIKey("AIza..."))
    41  //
    42  // To use an OAuth token (e.g., a user token obtained via a three-legged OAuth
    43  // flow, use [google.golang.org/api/option.WithTokenSource]:
    44  //
    45  //	config := &oauth2.Config{...}
    46  //	// ...
    47  //	token, err := config.Exchange(ctx, ...)
    48  //	doubleclicksearchService, err := doubleclicksearch.NewService(ctx, option.WithTokenSource(config.TokenSource(ctx, token)))
    49  //
    50  // See [google.golang.org/api/option.ClientOption] for details on options.
    51  package doubleclicksearch // import "google.golang.org/api/doubleclicksearch/v2"
    52  
    53  import (
    54  	"bytes"
    55  	"context"
    56  	"encoding/json"
    57  	"errors"
    58  	"fmt"
    59  	"io"
    60  	"net/http"
    61  	"net/url"
    62  	"strconv"
    63  	"strings"
    64  
    65  	googleapi "google.golang.org/api/googleapi"
    66  	internal "google.golang.org/api/internal"
    67  	gensupport "google.golang.org/api/internal/gensupport"
    68  	option "google.golang.org/api/option"
    69  	internaloption "google.golang.org/api/option/internaloption"
    70  	htransport "google.golang.org/api/transport/http"
    71  )
    72  
    73  // Always reference these packages, just in case the auto-generated code
    74  // below doesn't.
    75  var _ = bytes.NewBuffer
    76  var _ = strconv.Itoa
    77  var _ = fmt.Sprintf
    78  var _ = json.NewDecoder
    79  var _ = io.Copy
    80  var _ = url.Parse
    81  var _ = gensupport.MarshalJSON
    82  var _ = googleapi.Version
    83  var _ = errors.New
    84  var _ = strings.Replace
    85  var _ = context.Canceled
    86  var _ = internaloption.WithDefaultEndpoint
    87  var _ = internal.Version
    88  
    89  const apiId = "doubleclicksearch:v2"
    90  const apiName = "doubleclicksearch"
    91  const apiVersion = "v2"
    92  const basePath = "https://doubleclicksearch.googleapis.com/"
    93  const basePathTemplate = "https://doubleclicksearch.UNIVERSE_DOMAIN/"
    94  const mtlsBasePath = "https://doubleclicksearch.mtls.googleapis.com/"
    95  
    96  // OAuth2 scopes used by this API.
    97  const (
    98  	// View and manage your advertising data in DoubleClick Search
    99  	DoubleclicksearchScope = "https://www.googleapis.com/auth/doubleclicksearch"
   100  )
   101  
   102  // NewService creates a new Service.
   103  func NewService(ctx context.Context, opts ...option.ClientOption) (*Service, error) {
   104  	scopesOption := internaloption.WithDefaultScopes(
   105  		"https://www.googleapis.com/auth/doubleclicksearch",
   106  	)
   107  	// NOTE: prepend, so we don't override user-specified scopes.
   108  	opts = append([]option.ClientOption{scopesOption}, opts...)
   109  	opts = append(opts, internaloption.WithDefaultEndpoint(basePath))
   110  	opts = append(opts, internaloption.WithDefaultEndpointTemplate(basePathTemplate))
   111  	opts = append(opts, internaloption.WithDefaultMTLSEndpoint(mtlsBasePath))
   112  	opts = append(opts, internaloption.EnableNewAuthLibrary())
   113  	client, endpoint, err := htransport.NewClient(ctx, opts...)
   114  	if err != nil {
   115  		return nil, err
   116  	}
   117  	s, err := New(client)
   118  	if err != nil {
   119  		return nil, err
   120  	}
   121  	if endpoint != "" {
   122  		s.BasePath = endpoint
   123  	}
   124  	return s, nil
   125  }
   126  
   127  // New creates a new Service. It uses the provided http.Client for requests.
   128  //
   129  // Deprecated: please use NewService instead.
   130  // To provide a custom HTTP client, use option.WithHTTPClient.
   131  // If you are using google.golang.org/api/googleapis/transport.APIKey, use option.WithAPIKey with NewService instead.
   132  func New(client *http.Client) (*Service, error) {
   133  	if client == nil {
   134  		return nil, errors.New("client is nil")
   135  	}
   136  	s := &Service{client: client, BasePath: basePath}
   137  	s.Conversion = NewConversionService(s)
   138  	s.Reports = NewReportsService(s)
   139  	s.SavedColumns = NewSavedColumnsService(s)
   140  	return s, nil
   141  }
   142  
   143  type Service struct {
   144  	client    *http.Client
   145  	BasePath  string // API endpoint base URL
   146  	UserAgent string // optional additional User-Agent fragment
   147  
   148  	Conversion *ConversionService
   149  
   150  	Reports *ReportsService
   151  
   152  	SavedColumns *SavedColumnsService
   153  }
   154  
   155  func (s *Service) userAgent() string {
   156  	if s.UserAgent == "" {
   157  		return googleapi.UserAgent
   158  	}
   159  	return googleapi.UserAgent + " " + s.UserAgent
   160  }
   161  
   162  func NewConversionService(s *Service) *ConversionService {
   163  	rs := &ConversionService{s: s}
   164  	return rs
   165  }
   166  
   167  type ConversionService struct {
   168  	s *Service
   169  }
   170  
   171  func NewReportsService(s *Service) *ReportsService {
   172  	rs := &ReportsService{s: s}
   173  	return rs
   174  }
   175  
   176  type ReportsService struct {
   177  	s *Service
   178  }
   179  
   180  func NewSavedColumnsService(s *Service) *SavedColumnsService {
   181  	rs := &SavedColumnsService{s: s}
   182  	return rs
   183  }
   184  
   185  type SavedColumnsService struct {
   186  	s *Service
   187  }
   188  
   189  // Availability: A message containing availability data relevant to DoubleClick
   190  // Search.
   191  type Availability struct {
   192  	// AdvertiserId: DS advertiser ID.
   193  	AdvertiserId int64 `json:"advertiserId,omitempty,string"`
   194  	// AgencyId: DS agency ID.
   195  	AgencyId int64 `json:"agencyId,omitempty,string"`
   196  	// AvailabilityTimestamp: The time by which all conversions have been uploaded,
   197  	// in epoch millis UTC.
   198  	AvailabilityTimestamp int64 `json:"availabilityTimestamp,omitempty,string"`
   199  	// CustomerId: Customer ID of a client account in the new Search Ads 360
   200  	// experience.
   201  	CustomerId string `json:"customerId,omitempty"`
   202  	// SegmentationId: The numeric segmentation identifier (for example,
   203  	// DoubleClick Search Floodlight activity ID).
   204  	SegmentationId int64 `json:"segmentationId,omitempty,string"`
   205  	// SegmentationName: The friendly segmentation identifier (for example,
   206  	// DoubleClick Search Floodlight activity name).
   207  	SegmentationName string `json:"segmentationName,omitempty"`
   208  	// SegmentationType: The segmentation type that this availability is for (its
   209  	// default value is `FLOODLIGHT`).
   210  	SegmentationType string `json:"segmentationType,omitempty"`
   211  	// ForceSendFields is a list of field names (e.g. "AdvertiserId") to
   212  	// unconditionally include in API requests. By default, fields with empty or
   213  	// default values are omitted from API requests. See
   214  	// https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more
   215  	// details.
   216  	ForceSendFields []string `json:"-"`
   217  	// NullFields is a list of field names (e.g. "AdvertiserId") to include in API
   218  	// requests with the JSON null value. By default, fields with empty values are
   219  	// omitted from API requests. See
   220  	// https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details.
   221  	NullFields []string `json:"-"`
   222  }
   223  
   224  func (s *Availability) MarshalJSON() ([]byte, error) {
   225  	type NoMethod Availability
   226  	return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields)
   227  }
   228  
   229  // Conversion: A conversion containing data relevant to DoubleClick Search.
   230  type Conversion struct {
   231  	// AdGroupId: DS ad group ID.
   232  	AdGroupId int64 `json:"adGroupId,omitempty,string"`
   233  	// AdId: DS ad ID.
   234  	AdId int64 `json:"adId,omitempty,string"`
   235  	// AdUserDataConsent: Represents consent for core platform services (CPS)
   236  	// preferences in settings. No default value. Acceptable values are: GRANTED:
   237  	// The desired consent status is to grant. Read the CPS preferences from GTE
   238  	// settings. DENIED: The desired consent status is to deny; CPS list is empty.
   239  	//
   240  	// Possible values:
   241  	//   "UNKNOWN" - Not specified.
   242  	//   "GRANTED" - Granted.
   243  	//   "DENIED" - Denied.
   244  	AdUserDataConsent string `json:"adUserDataConsent,omitempty"`
   245  	// AdvertiserId: DS advertiser ID.
   246  	AdvertiserId int64 `json:"advertiserId,omitempty,string"`
   247  	// AgencyId: DS agency ID.
   248  	AgencyId int64 `json:"agencyId,omitempty,string"`
   249  	// AttributionModel: Available to advertisers only after contacting DoubleClick
   250  	// Search customer support.
   251  	AttributionModel string `json:"attributionModel,omitempty"`
   252  	// CampaignId: DS campaign ID.
   253  	CampaignId int64 `json:"campaignId,omitempty,string"`
   254  	// Channel: Sales channel for the product. Acceptable values are: - "local":
   255  	// a physical store - "online": an online store
   256  	Channel string `json:"channel,omitempty"`
   257  	// ClickId: DS click ID for the conversion.
   258  	ClickId string `json:"clickId,omitempty"`
   259  	// ConversionId: For offline conversions, advertisers provide this ID.
   260  	// Advertisers can specify any ID that is meaningful to them. Each conversion
   261  	// in a request must specify a unique ID, and the combination of ID and
   262  	// timestamp must be unique amongst all conversions within the advertiser. For
   263  	// online conversions, DS copies the `dsConversionId` or `floodlightOrderId`
   264  	// into this property depending on the advertiser's Floodlight instructions.
   265  	ConversionId string `json:"conversionId,omitempty"`
   266  	// ConversionModifiedTimestamp: The time at which the conversion was last
   267  	// modified, in epoch millis UTC.
   268  	ConversionModifiedTimestamp int64 `json:"conversionModifiedTimestamp,omitempty,string"`
   269  	// ConversionTimestamp: The time at which the conversion took place, in epoch
   270  	// millis UTC.
   271  	ConversionTimestamp string `json:"conversionTimestamp,omitempty"`
   272  	// CountMillis: Available to advertisers only after contacting DoubleClick
   273  	// Search customer support.
   274  	CountMillis int64 `json:"countMillis,omitempty,string"`
   275  	// CriterionId: DS criterion (keyword) ID.
   276  	CriterionId int64 `json:"criterionId,omitempty,string"`
   277  	// CurrencyCode: The currency code for the conversion's revenue. Should be in
   278  	// ISO 4217 alphabetic (3-char) format.
   279  	CurrencyCode string `json:"currencyCode,omitempty"`
   280  	// CustomDimension: Custom dimensions for the conversion, which can be used to
   281  	// filter data in a report.
   282  	CustomDimension []*CustomDimension `json:"customDimension,omitempty"`
   283  	// CustomMetric: Custom metrics for the conversion.
   284  	CustomMetric []*CustomMetric `json:"customMetric,omitempty"`
   285  	// CustomerId: Customer ID of a client account in the new Search Ads 360
   286  	// experience.
   287  	CustomerId string `json:"customerId,omitempty"`
   288  	// DeviceType: The type of device on which the conversion occurred.
   289  	DeviceType string `json:"deviceType,omitempty"`
   290  	// DsConversionId: ID that DoubleClick Search generates for each conversion.
   291  	DsConversionId int64 `json:"dsConversionId,omitempty,string"`
   292  	// EngineAccountId: DS engine account ID.
   293  	EngineAccountId int64 `json:"engineAccountId,omitempty,string"`
   294  	// FloodlightOrderId: The Floodlight order ID provided by the advertiser for
   295  	// the conversion.
   296  	FloodlightOrderId string `json:"floodlightOrderId,omitempty"`
   297  	// InventoryAccountId: ID that DS generates and uses to uniquely identify the
   298  	// inventory account that contains the product.
   299  	InventoryAccountId int64 `json:"inventoryAccountId,omitempty,string"`
   300  	// ProductCountry: The country registered for the Merchant Center feed that
   301  	// contains the product. Use an ISO 3166 code to specify a country.
   302  	ProductCountry string `json:"productCountry,omitempty"`
   303  	// ProductGroupId: DS product group ID.
   304  	ProductGroupId int64 `json:"productGroupId,omitempty,string"`
   305  	// ProductId: The product ID (SKU).
   306  	ProductId string `json:"productId,omitempty"`
   307  	// ProductLanguage: The language registered for the Merchant Center feed that
   308  	// contains the product. Use an ISO 639 code to specify a language.
   309  	ProductLanguage string `json:"productLanguage,omitempty"`
   310  	// QuantityMillis: The quantity of this conversion, in millis.
   311  	QuantityMillis int64 `json:"quantityMillis,omitempty,string"`
   312  	// RevenueMicros: The revenue amount of this `TRANSACTION` conversion, in
   313  	// micros (value multiplied by 1000000, no decimal). For example, to specify a
   314  	// revenue value of "10" enter "10000000" (10 million) in your request.
   315  	RevenueMicros string `json:"revenueMicros,omitempty"`
   316  	// SegmentationId: The numeric segmentation identifier (for example,
   317  	// DoubleClick Search Floodlight activity ID).
   318  	SegmentationId int64 `json:"segmentationId,omitempty,string"`
   319  	// SegmentationName: The friendly segmentation identifier (for example,
   320  	// DoubleClick Search Floodlight activity name).
   321  	SegmentationName string `json:"segmentationName,omitempty"`
   322  	// SegmentationType: The segmentation type of this conversion (for example,
   323  	// `FLOODLIGHT`).
   324  	SegmentationType string `json:"segmentationType,omitempty"`
   325  	// State: The state of the conversion, that is, either `ACTIVE` or `REMOVED`.
   326  	// Note: state DELETED is deprecated.
   327  	State string `json:"state,omitempty"`
   328  	// StoreId: The ID of the local store for which the product was advertised.
   329  	// Applicable only when the channel is "local".
   330  	StoreId string `json:"storeId,omitempty"`
   331  	// Type: The type of the conversion, that is, either `ACTION` or `TRANSACTION`.
   332  	// An `ACTION` conversion is an action by the user that has no monetarily
   333  	// quantifiable value, while a `TRANSACTION` conversion is an action that does
   334  	// have a monetarily quantifiable value. Examples are email list signups
   335  	// (`ACTION`) versus ecommerce purchases (`TRANSACTION`).
   336  	Type string `json:"type,omitempty"`
   337  	// ForceSendFields is a list of field names (e.g. "AdGroupId") to
   338  	// unconditionally include in API requests. By default, fields with empty or
   339  	// default values are omitted from API requests. See
   340  	// https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more
   341  	// details.
   342  	ForceSendFields []string `json:"-"`
   343  	// NullFields is a list of field names (e.g. "AdGroupId") to include in API
   344  	// requests with the JSON null value. By default, fields with empty values are
   345  	// omitted from API requests. See
   346  	// https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details.
   347  	NullFields []string `json:"-"`
   348  }
   349  
   350  func (s *Conversion) MarshalJSON() ([]byte, error) {
   351  	type NoMethod Conversion
   352  	return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields)
   353  }
   354  
   355  // ConversionList: A list of conversions.
   356  type ConversionList struct {
   357  	// Conversion: The conversions being requested.
   358  	Conversion []*Conversion `json:"conversion,omitempty"`
   359  	// Kind: Identifies this as a ConversionList resource. Value: the fixed string
   360  	// doubleclicksearch#conversionList.
   361  	Kind string `json:"kind,omitempty"`
   362  
   363  	// ServerResponse contains the HTTP response code and headers from the server.
   364  	googleapi.ServerResponse `json:"-"`
   365  	// ForceSendFields is a list of field names (e.g. "Conversion") to
   366  	// unconditionally include in API requests. By default, fields with empty or
   367  	// default values are omitted from API requests. See
   368  	// https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more
   369  	// details.
   370  	ForceSendFields []string `json:"-"`
   371  	// NullFields is a list of field names (e.g. "Conversion") to include in API
   372  	// requests with the JSON null value. By default, fields with empty values are
   373  	// omitted from API requests. See
   374  	// https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details.
   375  	NullFields []string `json:"-"`
   376  }
   377  
   378  func (s *ConversionList) MarshalJSON() ([]byte, error) {
   379  	type NoMethod ConversionList
   380  	return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields)
   381  }
   382  
   383  // CustomDimension: A message containing the custom dimension.
   384  type CustomDimension struct {
   385  	// Name: Custom dimension name.
   386  	Name string `json:"name,omitempty"`
   387  	// Value: Custom dimension value.
   388  	Value string `json:"value,omitempty"`
   389  	// ForceSendFields is a list of field names (e.g. "Name") to unconditionally
   390  	// include in API requests. By default, fields with empty or default values are
   391  	// omitted from API requests. See
   392  	// https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more
   393  	// details.
   394  	ForceSendFields []string `json:"-"`
   395  	// NullFields is a list of field names (e.g. "Name") to include in API requests
   396  	// with the JSON null value. By default, fields with empty values are omitted
   397  	// from API requests. See
   398  	// https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details.
   399  	NullFields []string `json:"-"`
   400  }
   401  
   402  func (s *CustomDimension) MarshalJSON() ([]byte, error) {
   403  	type NoMethod CustomDimension
   404  	return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields)
   405  }
   406  
   407  // CustomMetric: A message containing the custom metric.
   408  type CustomMetric struct {
   409  	// Name: Custom metric name.
   410  	Name string `json:"name,omitempty"`
   411  	// Value: Custom metric numeric value.
   412  	Value float64 `json:"value,omitempty"`
   413  	// ForceSendFields is a list of field names (e.g. "Name") to unconditionally
   414  	// include in API requests. By default, fields with empty or default values are
   415  	// omitted from API requests. See
   416  	// https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more
   417  	// details.
   418  	ForceSendFields []string `json:"-"`
   419  	// NullFields is a list of field names (e.g. "Name") to include in API requests
   420  	// with the JSON null value. By default, fields with empty values are omitted
   421  	// from API requests. See
   422  	// https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details.
   423  	NullFields []string `json:"-"`
   424  }
   425  
   426  func (s *CustomMetric) MarshalJSON() ([]byte, error) {
   427  	type NoMethod CustomMetric
   428  	return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields)
   429  }
   430  
   431  func (s *CustomMetric) UnmarshalJSON(data []byte) error {
   432  	type NoMethod CustomMetric
   433  	var s1 struct {
   434  		Value gensupport.JSONFloat64 `json:"value"`
   435  		*NoMethod
   436  	}
   437  	s1.NoMethod = (*NoMethod)(s)
   438  	if err := json.Unmarshal(data, &s1); err != nil {
   439  		return err
   440  	}
   441  	s.Value = float64(s1.Value)
   442  	return nil
   443  }
   444  
   445  // IdMappingFile: File returned to
   446  // https://developers.google.com/search-ads/v2/reference/reports/getIdMappingFile.
   447  type IdMappingFile struct {
   448  	// ServerResponse contains the HTTP response code and headers from the server.
   449  	googleapi.ServerResponse `json:"-"`
   450  }
   451  
   452  // Report: A DoubleClick Search report. This object contains the report
   453  // request, some report metadata such as currency code, and the generated
   454  // report rows or report files.
   455  type Report struct {
   456  	// Files: Asynchronous report only. Contains a list of generated report files
   457  	// once the report has successfully completed.
   458  	Files []*ReportFiles `json:"files,omitempty"`
   459  	// Id: Asynchronous report only. Id of the report.
   460  	Id string `json:"id,omitempty"`
   461  	// IsReportReady: Asynchronous report only. True if and only if the report has
   462  	// completed successfully and the report files are ready to be downloaded.
   463  	IsReportReady bool `json:"isReportReady,omitempty"`
   464  	// Kind: Identifies this as a Report resource. Value: the fixed string
   465  	// `doubleclicksearch#report`.
   466  	Kind string `json:"kind,omitempty"`
   467  	// Request: The request that created the report. Optional fields not specified
   468  	// in the original request are filled with default values.
   469  	Request *ReportRequest `json:"request,omitempty"`
   470  	// RowCount: The number of report rows generated by the report, not including
   471  	// headers.
   472  	RowCount int64 `json:"rowCount,omitempty"`
   473  	// Rows: Synchronous report only. Generated report rows.
   474  	Rows []googleapi.RawMessage `json:"rows,omitempty"`
   475  	// StatisticsCurrencyCode: The currency code of all monetary values produced in
   476  	// the report, including values that are set by users (e.g., keyword bid
   477  	// settings) and metrics (e.g., cost and revenue). The currency code of a
   478  	// report is determined by the `statisticsCurrency` field of the report
   479  	// request.
   480  	StatisticsCurrencyCode string `json:"statisticsCurrencyCode,omitempty"`
   481  	// StatisticsTimeZone: If all statistics of the report are sourced from the
   482  	// same time zone, this would be it. Otherwise the field is unset.
   483  	StatisticsTimeZone string `json:"statisticsTimeZone,omitempty"`
   484  
   485  	// ServerResponse contains the HTTP response code and headers from the server.
   486  	googleapi.ServerResponse `json:"-"`
   487  	// ForceSendFields is a list of field names (e.g. "Files") to unconditionally
   488  	// include in API requests. By default, fields with empty or default values are
   489  	// omitted from API requests. See
   490  	// https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more
   491  	// details.
   492  	ForceSendFields []string `json:"-"`
   493  	// NullFields is a list of field names (e.g. "Files") to include in API
   494  	// requests with the JSON null value. By default, fields with empty values are
   495  	// omitted from API requests. See
   496  	// https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details.
   497  	NullFields []string `json:"-"`
   498  }
   499  
   500  func (s *Report) MarshalJSON() ([]byte, error) {
   501  	type NoMethod Report
   502  	return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields)
   503  }
   504  
   505  type ReportFiles struct {
   506  	// ByteCount: The size of this report file in bytes.
   507  	ByteCount int64 `json:"byteCount,omitempty,string"`
   508  	// Url: Use this url to download the report file.
   509  	Url string `json:"url,omitempty"`
   510  	// ForceSendFields is a list of field names (e.g. "ByteCount") to
   511  	// unconditionally include in API requests. By default, fields with empty or
   512  	// default values are omitted from API requests. See
   513  	// https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more
   514  	// details.
   515  	ForceSendFields []string `json:"-"`
   516  	// NullFields is a list of field names (e.g. "ByteCount") to include in API
   517  	// requests with the JSON null value. By default, fields with empty values are
   518  	// omitted from API requests. See
   519  	// https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details.
   520  	NullFields []string `json:"-"`
   521  }
   522  
   523  func (s *ReportFiles) MarshalJSON() ([]byte, error) {
   524  	type NoMethod ReportFiles
   525  	return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields)
   526  }
   527  
   528  // ReportApiColumnSpec: A request object used to create a DoubleClick Search
   529  // report.
   530  type ReportApiColumnSpec struct {
   531  	// ColumnName: Name of a DoubleClick Search column to include in the report.
   532  	ColumnName string `json:"columnName,omitempty"`
   533  	// CustomDimensionName: Segments a report by a custom dimension. The report
   534  	// must be scoped to an advertiser or lower, and the custom dimension must
   535  	// already be set up in DoubleClick Search. The custom dimension name, which
   536  	// appears in DoubleClick Search, is case sensitive.\ If used in a conversion
   537  	// report, returns the value of the specified custom dimension for the given
   538  	// conversion, if set. This column does not segment the conversion report.
   539  	CustomDimensionName string `json:"customDimensionName,omitempty"`
   540  	// CustomMetricName: Name of a custom metric to include in the report. The
   541  	// report must be scoped to an advertiser or lower, and the custom metric must
   542  	// already be set up in DoubleClick Search. The custom metric name, which
   543  	// appears in DoubleClick Search, is case sensitive.
   544  	CustomMetricName string `json:"customMetricName,omitempty"`
   545  	// EndDate: Inclusive day in YYYY-MM-DD format. When provided, this overrides
   546  	// the overall time range of the report for this column only. Must be provided
   547  	// together with `startDate`.
   548  	EndDate string `json:"endDate,omitempty"`
   549  	// GroupByColumn: Synchronous report only. Set to `true` to group by this
   550  	// column. Defaults to `false`.
   551  	GroupByColumn bool `json:"groupByColumn,omitempty"`
   552  	// HeaderText: Text used to identify this column in the report output; defaults
   553  	// to `columnName` or `savedColumnName` when not specified. This can be used to
   554  	// prevent collisions between DoubleClick Search columns and saved columns with
   555  	// the same name.
   556  	HeaderText string `json:"headerText,omitempty"`
   557  	// PlatformSource: The platform that is used to provide data for the custom
   558  	// dimension. Acceptable values are "floodlight".
   559  	PlatformSource string `json:"platformSource,omitempty"`
   560  	// ProductReportPerspective: Returns metrics only for a specific type of
   561  	// product activity. Accepted values are: - "sold": returns metrics only for
   562  	// products that were sold - "advertised": returns metrics only for products
   563  	// that were advertised in a Shopping campaign, and that might or might not
   564  	// have been sold
   565  	ProductReportPerspective string `json:"productReportPerspective,omitempty"`
   566  	// SavedColumnName: Name of a saved column to include in the report. The report
   567  	// must be scoped at advertiser or lower, and this saved column must already be
   568  	// created in the DoubleClick Search UI.
   569  	SavedColumnName string `json:"savedColumnName,omitempty"`
   570  	// StartDate: Inclusive date in YYYY-MM-DD format. When provided, this
   571  	// overrides the overall time range of the report for this column only. Must be
   572  	// provided together with `endDate`.
   573  	StartDate string `json:"startDate,omitempty"`
   574  	// ForceSendFields is a list of field names (e.g. "ColumnName") to
   575  	// unconditionally include in API requests. By default, fields with empty or
   576  	// default values are omitted from API requests. See
   577  	// https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more
   578  	// details.
   579  	ForceSendFields []string `json:"-"`
   580  	// NullFields is a list of field names (e.g. "ColumnName") to include in API
   581  	// requests with the JSON null value. By default, fields with empty values are
   582  	// omitted from API requests. See
   583  	// https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details.
   584  	NullFields []string `json:"-"`
   585  }
   586  
   587  func (s *ReportApiColumnSpec) MarshalJSON() ([]byte, error) {
   588  	type NoMethod ReportApiColumnSpec
   589  	return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields)
   590  }
   591  
   592  // ReportRequest: A request object used to create a DoubleClick Search report.
   593  type ReportRequest struct {
   594  	// Columns: The columns to include in the report. This includes both
   595  	// DoubleClick Search columns and saved columns. For DoubleClick Search
   596  	// columns, only the `columnName` parameter is required. For saved columns only
   597  	// the `savedColumnName` parameter is required. Both `columnName` and
   598  	// `savedColumnName` cannot be set in the same stanza.\ The maximum number of
   599  	// columns per request is 300.
   600  	Columns []*ReportApiColumnSpec `json:"columns,omitempty"`
   601  	// DownloadFormat: Format that the report should be returned in. Currently
   602  	// `csv` or `tsv` is supported.
   603  	DownloadFormat string `json:"downloadFormat,omitempty"`
   604  	// Filters: A list of filters to be applied to the report.\ The maximum number
   605  	// of filters per request is 300.
   606  	Filters []*ReportRequestFilters `json:"filters,omitempty"`
   607  	// IncludeDeletedEntities: Determines if removed entities should be included in
   608  	// the report. Defaults to `false`. Deprecated, please use
   609  	// `includeRemovedEntities` instead.
   610  	IncludeDeletedEntities bool `json:"includeDeletedEntities,omitempty"`
   611  	// IncludeRemovedEntities: Determines if removed entities should be included in
   612  	// the report. Defaults to `false`.
   613  	IncludeRemovedEntities bool `json:"includeRemovedEntities,omitempty"`
   614  	// MaxRowsPerFile: Asynchronous report only. The maximum number of rows per
   615  	// report file. A large report is split into many files based on this field.
   616  	// Acceptable values are `1000000` to `100000000`, inclusive.
   617  	MaxRowsPerFile int64 `json:"maxRowsPerFile,omitempty"`
   618  	// OrderBy: Synchronous report only. A list of columns and directions defining
   619  	// sorting to be performed on the report rows.\ The maximum number of orderings
   620  	// per request is 300.
   621  	OrderBy []*ReportRequestOrderBy `json:"orderBy,omitempty"`
   622  	// ReportScope: The reportScope is a set of IDs that are used to determine
   623  	// which subset of entities will be returned in the report. The full lineage of
   624  	// IDs from the lowest scoped level desired up through agency is required.
   625  	ReportScope *ReportRequestReportScope `json:"reportScope,omitempty"`
   626  	// ReportType: Determines the type of rows that are returned in the report. For
   627  	// example, if you specify `reportType: keyword`, each row in the report will
   628  	// contain data about a keyword. See the Types of Reports
   629  	// (/search-ads/v2/report-types/) reference for the columns that are available
   630  	// for each type.
   631  	ReportType string `json:"reportType,omitempty"`
   632  	// RowCount: Synchronous report only. The maximum number of rows to return;
   633  	// additional rows are dropped. Acceptable values are `0` to `10000`,
   634  	// inclusive. Defaults to `10000`.
   635  	RowCount int64 `json:"rowCount,omitempty"`
   636  	// StartRow: Synchronous report only. Zero-based index of the first row to
   637  	// return. Acceptable values are `0` to `50000`, inclusive. Defaults to `0`.
   638  	StartRow int64 `json:"startRow,omitempty"`
   639  	// StatisticsCurrency: Specifies the currency in which monetary will be
   640  	// returned. Possible values are: `usd`, `agency` (valid if the report is
   641  	// scoped to agency or lower), `advertiser` (valid if the report is scoped to *
   642  	// advertiser or lower), or `account` (valid if the report is scoped to engine
   643  	// account or lower).
   644  	StatisticsCurrency string `json:"statisticsCurrency,omitempty"`
   645  	// TimeRange: If metrics are requested in a report, this argument will be used
   646  	// to restrict the metrics to a specific time range.
   647  	TimeRange *ReportRequestTimeRange `json:"timeRange,omitempty"`
   648  	// VerifySingleTimeZone: If `true`, the report would only be created if all the
   649  	// requested stat data are sourced from a single timezone. Defaults to `false`.
   650  	VerifySingleTimeZone bool `json:"verifySingleTimeZone,omitempty"`
   651  	// ForceSendFields is a list of field names (e.g. "Columns") to unconditionally
   652  	// include in API requests. By default, fields with empty or default values are
   653  	// omitted from API requests. See
   654  	// https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more
   655  	// details.
   656  	ForceSendFields []string `json:"-"`
   657  	// NullFields is a list of field names (e.g. "Columns") to include in API
   658  	// requests with the JSON null value. By default, fields with empty values are
   659  	// omitted from API requests. See
   660  	// https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details.
   661  	NullFields []string `json:"-"`
   662  }
   663  
   664  func (s *ReportRequest) MarshalJSON() ([]byte, error) {
   665  	type NoMethod ReportRequest
   666  	return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields)
   667  }
   668  
   669  type ReportRequestFilters struct {
   670  	// Column: Column to perform the filter on. This can be a DoubleClick Search
   671  	// column or a saved column.
   672  	Column *ReportApiColumnSpec `json:"column,omitempty"`
   673  	// Operator: Operator to use in the filter. See the filter reference for a list
   674  	// of available operators.
   675  	Operator string `json:"operator,omitempty"`
   676  	// Values: A list of values to filter the column value against.\ The maximum
   677  	// number of filter values per request is 300.
   678  	Values []interface{} `json:"values,omitempty"`
   679  	// ForceSendFields is a list of field names (e.g. "Column") to unconditionally
   680  	// include in API requests. By default, fields with empty or default values are
   681  	// omitted from API requests. See
   682  	// https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more
   683  	// details.
   684  	ForceSendFields []string `json:"-"`
   685  	// NullFields is a list of field names (e.g. "Column") to include in API
   686  	// requests with the JSON null value. By default, fields with empty values are
   687  	// omitted from API requests. See
   688  	// https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details.
   689  	NullFields []string `json:"-"`
   690  }
   691  
   692  func (s *ReportRequestFilters) MarshalJSON() ([]byte, error) {
   693  	type NoMethod ReportRequestFilters
   694  	return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields)
   695  }
   696  
   697  type ReportRequestOrderBy struct {
   698  	// Column: Column to perform the sort on. This can be a DoubleClick
   699  	// Search-defined column or a saved column.
   700  	Column *ReportApiColumnSpec `json:"column,omitempty"`
   701  	// SortOrder: The sort direction, which is either `ascending` or `descending`.
   702  	SortOrder string `json:"sortOrder,omitempty"`
   703  	// ForceSendFields is a list of field names (e.g. "Column") to unconditionally
   704  	// include in API requests. By default, fields with empty or default values are
   705  	// omitted from API requests. See
   706  	// https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more
   707  	// details.
   708  	ForceSendFields []string `json:"-"`
   709  	// NullFields is a list of field names (e.g. "Column") to include in API
   710  	// requests with the JSON null value. By default, fields with empty values are
   711  	// omitted from API requests. See
   712  	// https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details.
   713  	NullFields []string `json:"-"`
   714  }
   715  
   716  func (s *ReportRequestOrderBy) MarshalJSON() ([]byte, error) {
   717  	type NoMethod ReportRequestOrderBy
   718  	return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields)
   719  }
   720  
   721  // ReportRequestReportScope: The reportScope is a set of IDs that are used to
   722  // determine which subset of entities will be returned in the report. The full
   723  // lineage of IDs from the lowest scoped level desired up through agency is
   724  // required.
   725  type ReportRequestReportScope struct {
   726  	// AdGroupId: DS ad group ID.
   727  	AdGroupId int64 `json:"adGroupId,omitempty,string"`
   728  	// AdId: DS ad ID.
   729  	AdId int64 `json:"adId,omitempty,string"`
   730  	// AdvertiserId: DS advertiser ID.
   731  	AdvertiserId int64 `json:"advertiserId,omitempty,string"`
   732  	// AgencyId: DS agency ID.
   733  	AgencyId int64 `json:"agencyId,omitempty,string"`
   734  	// CampaignId: DS campaign ID.
   735  	CampaignId int64 `json:"campaignId,omitempty,string"`
   736  	// EngineAccountId: DS engine account ID.
   737  	EngineAccountId int64 `json:"engineAccountId,omitempty,string"`
   738  	// KeywordId: DS keyword ID.
   739  	KeywordId int64 `json:"keywordId,omitempty,string"`
   740  	// ForceSendFields is a list of field names (e.g. "AdGroupId") to
   741  	// unconditionally include in API requests. By default, fields with empty or
   742  	// default values are omitted from API requests. See
   743  	// https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more
   744  	// details.
   745  	ForceSendFields []string `json:"-"`
   746  	// NullFields is a list of field names (e.g. "AdGroupId") to include in API
   747  	// requests with the JSON null value. By default, fields with empty values are
   748  	// omitted from API requests. See
   749  	// https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details.
   750  	NullFields []string `json:"-"`
   751  }
   752  
   753  func (s *ReportRequestReportScope) MarshalJSON() ([]byte, error) {
   754  	type NoMethod ReportRequestReportScope
   755  	return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields)
   756  }
   757  
   758  // ReportRequestTimeRange: If metrics are requested in a report, this argument
   759  // will be used to restrict the metrics to a specific time range.
   760  type ReportRequestTimeRange struct {
   761  	// ChangedAttributesSinceTimestamp: Inclusive UTC timestamp in RFC format,
   762  	// e.g., `2013-07-16T10:16:23.555Z`. See additional references on how changed
   763  	// attribute reports work.
   764  	ChangedAttributesSinceTimestamp string `json:"changedAttributesSinceTimestamp,omitempty"`
   765  	// ChangedMetricsSinceTimestamp: Inclusive UTC timestamp in RFC format, e.g.,
   766  	// `2013-07-16T10:16:23.555Z`. See additional references on how changed metrics
   767  	// reports work.
   768  	ChangedMetricsSinceTimestamp string `json:"changedMetricsSinceTimestamp,omitempty"`
   769  	// EndDate: Inclusive date in YYYY-MM-DD format.
   770  	EndDate string `json:"endDate,omitempty"`
   771  	// StartDate: Inclusive date in YYYY-MM-DD format.
   772  	StartDate string `json:"startDate,omitempty"`
   773  	// ForceSendFields is a list of field names (e.g.
   774  	// "ChangedAttributesSinceTimestamp") to unconditionally include in API
   775  	// requests. By default, fields with empty or default values are omitted from
   776  	// API requests. See
   777  	// https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more
   778  	// details.
   779  	ForceSendFields []string `json:"-"`
   780  	// NullFields is a list of field names (e.g. "ChangedAttributesSinceTimestamp")
   781  	// to include in API requests with the JSON null value. By default, fields with
   782  	// empty values are omitted from API requests. See
   783  	// https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details.
   784  	NullFields []string `json:"-"`
   785  }
   786  
   787  func (s *ReportRequestTimeRange) MarshalJSON() ([]byte, error) {
   788  	type NoMethod ReportRequestTimeRange
   789  	return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields)
   790  }
   791  
   792  // SavedColumn: A saved column
   793  type SavedColumn struct {
   794  	// Kind: Identifies this as a SavedColumn resource. Value: the fixed string
   795  	// doubleclicksearch#savedColumn.
   796  	Kind string `json:"kind,omitempty"`
   797  	// SavedColumnName: The name of the saved column.
   798  	SavedColumnName string `json:"savedColumnName,omitempty"`
   799  	// Type: The type of data this saved column will produce.
   800  	Type string `json:"type,omitempty"`
   801  	// ForceSendFields is a list of field names (e.g. "Kind") to unconditionally
   802  	// include in API requests. By default, fields with empty or default values are
   803  	// omitted from API requests. See
   804  	// https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more
   805  	// details.
   806  	ForceSendFields []string `json:"-"`
   807  	// NullFields is a list of field names (e.g. "Kind") to include in API requests
   808  	// with the JSON null value. By default, fields with empty values are omitted
   809  	// from API requests. See
   810  	// https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details.
   811  	NullFields []string `json:"-"`
   812  }
   813  
   814  func (s *SavedColumn) MarshalJSON() ([]byte, error) {
   815  	type NoMethod SavedColumn
   816  	return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields)
   817  }
   818  
   819  // SavedColumnList: A list of saved columns. Advertisers create saved columns
   820  // to report on Floodlight activities, Google Analytics goals, or custom KPIs.
   821  // To request reports with saved columns, you'll need the saved column names
   822  // that are available from this list.
   823  type SavedColumnList struct {
   824  	// Items: The saved columns being requested.
   825  	Items []*SavedColumn `json:"items,omitempty"`
   826  	// Kind: Identifies this as a SavedColumnList resource. Value: the fixed string
   827  	// doubleclicksearch#savedColumnList.
   828  	Kind string `json:"kind,omitempty"`
   829  
   830  	// ServerResponse contains the HTTP response code and headers from the server.
   831  	googleapi.ServerResponse `json:"-"`
   832  	// ForceSendFields is a list of field names (e.g. "Items") to unconditionally
   833  	// include in API requests. By default, fields with empty or default values are
   834  	// omitted from API requests. See
   835  	// https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more
   836  	// details.
   837  	ForceSendFields []string `json:"-"`
   838  	// NullFields is a list of field names (e.g. "Items") to include in API
   839  	// requests with the JSON null value. By default, fields with empty values are
   840  	// omitted from API requests. See
   841  	// https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details.
   842  	NullFields []string `json:"-"`
   843  }
   844  
   845  func (s *SavedColumnList) MarshalJSON() ([]byte, error) {
   846  	type NoMethod SavedColumnList
   847  	return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields)
   848  }
   849  
   850  // UpdateAvailabilityRequest: The request to update availability.
   851  type UpdateAvailabilityRequest struct {
   852  	// Availabilities: The availabilities being requested.
   853  	Availabilities []*Availability `json:"availabilities,omitempty"`
   854  	// ForceSendFields is a list of field names (e.g. "Availabilities") to
   855  	// unconditionally include in API requests. By default, fields with empty or
   856  	// default values are omitted from API requests. See
   857  	// https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more
   858  	// details.
   859  	ForceSendFields []string `json:"-"`
   860  	// NullFields is a list of field names (e.g. "Availabilities") to include in
   861  	// API requests with the JSON null value. By default, fields with empty values
   862  	// are omitted from API requests. See
   863  	// https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details.
   864  	NullFields []string `json:"-"`
   865  }
   866  
   867  func (s *UpdateAvailabilityRequest) MarshalJSON() ([]byte, error) {
   868  	type NoMethod UpdateAvailabilityRequest
   869  	return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields)
   870  }
   871  
   872  // UpdateAvailabilityResponse: The response to a update availability request.
   873  type UpdateAvailabilityResponse struct {
   874  	// Availabilities: The availabilities being returned.
   875  	Availabilities []*Availability `json:"availabilities,omitempty"`
   876  
   877  	// ServerResponse contains the HTTP response code and headers from the server.
   878  	googleapi.ServerResponse `json:"-"`
   879  	// ForceSendFields is a list of field names (e.g. "Availabilities") to
   880  	// unconditionally include in API requests. By default, fields with empty or
   881  	// default values are omitted from API requests. See
   882  	// https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more
   883  	// details.
   884  	ForceSendFields []string `json:"-"`
   885  	// NullFields is a list of field names (e.g. "Availabilities") to include in
   886  	// API requests with the JSON null value. By default, fields with empty values
   887  	// are omitted from API requests. See
   888  	// https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details.
   889  	NullFields []string `json:"-"`
   890  }
   891  
   892  func (s *UpdateAvailabilityResponse) MarshalJSON() ([]byte, error) {
   893  	type NoMethod UpdateAvailabilityResponse
   894  	return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields)
   895  }
   896  
   897  type ConversionGetCall struct {
   898  	s               *Service
   899  	agencyId        int64
   900  	advertiserId    int64
   901  	engineAccountId int64
   902  	urlParams_      gensupport.URLParams
   903  	ifNoneMatch_    string
   904  	ctx_            context.Context
   905  	header_         http.Header
   906  }
   907  
   908  // Get: Retrieves a list of conversions from a DoubleClick Search engine
   909  // account.
   910  //
   911  //   - advertiserId: Numeric ID of the advertiser.
   912  //   - agencyId: Numeric ID of the agency.
   913  //   - endDate: Last date (inclusive) on which to retrieve conversions. Format is
   914  //     yyyymmdd.
   915  //   - engineAccountId: Numeric ID of the engine account.
   916  //   - rowCount: The number of conversions to return per call.
   917  //   - startDate: First date (inclusive) on which to retrieve conversions. Format
   918  //     is yyyymmdd.
   919  //   - startRow: The 0-based starting index for retrieving conversions results.
   920  func (r *ConversionService) Get(agencyId int64, advertiserId int64, engineAccountId int64, endDate int64, rowCount int64, startDate int64, startRow int64) *ConversionGetCall {
   921  	c := &ConversionGetCall{s: r.s, urlParams_: make(gensupport.URLParams)}
   922  	c.agencyId = agencyId
   923  	c.advertiserId = advertiserId
   924  	c.engineAccountId = engineAccountId
   925  	c.urlParams_.Set("endDate", fmt.Sprint(endDate))
   926  	c.urlParams_.Set("rowCount", fmt.Sprint(rowCount))
   927  	c.urlParams_.Set("startDate", fmt.Sprint(startDate))
   928  	c.urlParams_.Set("startRow", fmt.Sprint(startRow))
   929  	return c
   930  }
   931  
   932  // AdGroupId sets the optional parameter "adGroupId": Numeric ID of the ad
   933  // group.
   934  func (c *ConversionGetCall) AdGroupId(adGroupId int64) *ConversionGetCall {
   935  	c.urlParams_.Set("adGroupId", fmt.Sprint(adGroupId))
   936  	return c
   937  }
   938  
   939  // AdId sets the optional parameter "adId": Numeric ID of the ad.
   940  func (c *ConversionGetCall) AdId(adId int64) *ConversionGetCall {
   941  	c.urlParams_.Set("adId", fmt.Sprint(adId))
   942  	return c
   943  }
   944  
   945  // CampaignId sets the optional parameter "campaignId": Numeric ID of the
   946  // campaign.
   947  func (c *ConversionGetCall) CampaignId(campaignId int64) *ConversionGetCall {
   948  	c.urlParams_.Set("campaignId", fmt.Sprint(campaignId))
   949  	return c
   950  }
   951  
   952  // CriterionId sets the optional parameter "criterionId": Numeric ID of the
   953  // criterion.
   954  func (c *ConversionGetCall) CriterionId(criterionId int64) *ConversionGetCall {
   955  	c.urlParams_.Set("criterionId", fmt.Sprint(criterionId))
   956  	return c
   957  }
   958  
   959  // CustomerId sets the optional parameter "customerId": Customer ID of a client
   960  // account in the new Search Ads 360 experience.
   961  func (c *ConversionGetCall) CustomerId(customerId string) *ConversionGetCall {
   962  	c.urlParams_.Set("customerId", customerId)
   963  	return c
   964  }
   965  
   966  // Fields allows partial responses to be retrieved. See
   967  // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse for more
   968  // details.
   969  func (c *ConversionGetCall) Fields(s ...googleapi.Field) *ConversionGetCall {
   970  	c.urlParams_.Set("fields", googleapi.CombineFields(s))
   971  	return c
   972  }
   973  
   974  // IfNoneMatch sets an optional parameter which makes the operation fail if the
   975  // object's ETag matches the given value. This is useful for getting updates
   976  // only after the object has changed since the last request.
   977  func (c *ConversionGetCall) IfNoneMatch(entityTag string) *ConversionGetCall {
   978  	c.ifNoneMatch_ = entityTag
   979  	return c
   980  }
   981  
   982  // Context sets the context to be used in this call's Do method.
   983  func (c *ConversionGetCall) Context(ctx context.Context) *ConversionGetCall {
   984  	c.ctx_ = ctx
   985  	return c
   986  }
   987  
   988  // Header returns a http.Header that can be modified by the caller to add
   989  // headers to the request.
   990  func (c *ConversionGetCall) Header() http.Header {
   991  	if c.header_ == nil {
   992  		c.header_ = make(http.Header)
   993  	}
   994  	return c.header_
   995  }
   996  
   997  func (c *ConversionGetCall) doRequest(alt string) (*http.Response, error) {
   998  	reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_)
   999  	if c.ifNoneMatch_ != "" {
  1000  		reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  1001  	}
  1002  	var body io.Reader = nil
  1003  	c.urlParams_.Set("alt", alt)
  1004  	c.urlParams_.Set("prettyPrint", "false")
  1005  	urls := googleapi.ResolveRelative(c.s.BasePath, "doubleclicksearch/v2/agency/{agencyId}/advertiser/{advertiserId}/engine/{engineAccountId}/conversion")
  1006  	urls += "?" + c.urlParams_.Encode()
  1007  	req, err := http.NewRequest("GET", urls, body)
  1008  	if err != nil {
  1009  		return nil, err
  1010  	}
  1011  	req.Header = reqHeaders
  1012  	googleapi.Expand(req.URL, map[string]string{
  1013  		"agencyId":        strconv.FormatInt(c.agencyId, 10),
  1014  		"advertiserId":    strconv.FormatInt(c.advertiserId, 10),
  1015  		"engineAccountId": strconv.FormatInt(c.engineAccountId, 10),
  1016  	})
  1017  	return gensupport.SendRequest(c.ctx_, c.s.client, req)
  1018  }
  1019  
  1020  // Do executes the "doubleclicksearch.conversion.get" call.
  1021  // Any non-2xx status code is an error. Response headers are in either
  1022  // *ConversionList.ServerResponse.Header or (if a response was returned at all)
  1023  // in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to check
  1024  // whether the returned error was because http.StatusNotModified was returned.
  1025  func (c *ConversionGetCall) Do(opts ...googleapi.CallOption) (*ConversionList, error) {
  1026  	gensupport.SetOptions(c.urlParams_, opts...)
  1027  	res, err := c.doRequest("json")
  1028  	if res != nil && res.StatusCode == http.StatusNotModified {
  1029  		if res.Body != nil {
  1030  			res.Body.Close()
  1031  		}
  1032  		return nil, gensupport.WrapError(&googleapi.Error{
  1033  			Code:   res.StatusCode,
  1034  			Header: res.Header,
  1035  		})
  1036  	}
  1037  	if err != nil {
  1038  		return nil, err
  1039  	}
  1040  	defer googleapi.CloseBody(res)
  1041  	if err := googleapi.CheckResponse(res); err != nil {
  1042  		return nil, gensupport.WrapError(err)
  1043  	}
  1044  	ret := &ConversionList{
  1045  		ServerResponse: googleapi.ServerResponse{
  1046  			Header:         res.Header,
  1047  			HTTPStatusCode: res.StatusCode,
  1048  		},
  1049  	}
  1050  	target := &ret
  1051  	if err := gensupport.DecodeResponse(target, res); err != nil {
  1052  		return nil, err
  1053  	}
  1054  	return ret, nil
  1055  }
  1056  
  1057  type ConversionGetByCustomerIdCall struct {
  1058  	s            *Service
  1059  	customerId   string
  1060  	urlParams_   gensupport.URLParams
  1061  	ifNoneMatch_ string
  1062  	ctx_         context.Context
  1063  	header_      http.Header
  1064  }
  1065  
  1066  // GetByCustomerId: Retrieves a list of conversions from a DoubleClick Search
  1067  // engine account.
  1068  //
  1069  //   - customerId: Customer ID of a client account in the new Search Ads 360
  1070  //     experience.
  1071  //   - endDate: Last date (inclusive) on which to retrieve conversions. Format is
  1072  //     yyyymmdd.
  1073  //   - rowCount: The number of conversions to return per call.
  1074  //   - startDate: First date (inclusive) on which to retrieve conversions. Format
  1075  //     is yyyymmdd.
  1076  //   - startRow: The 0-based starting index for retrieving conversions results.
  1077  func (r *ConversionService) GetByCustomerId(customerId string, endDate int64, rowCount int64, startDate int64, startRow int64) *ConversionGetByCustomerIdCall {
  1078  	c := &ConversionGetByCustomerIdCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  1079  	c.customerId = customerId
  1080  	c.urlParams_.Set("endDate", fmt.Sprint(endDate))
  1081  	c.urlParams_.Set("rowCount", fmt.Sprint(rowCount))
  1082  	c.urlParams_.Set("startDate", fmt.Sprint(startDate))
  1083  	c.urlParams_.Set("startRow", fmt.Sprint(startRow))
  1084  	return c
  1085  }
  1086  
  1087  // AdGroupId sets the optional parameter "adGroupId": Numeric ID of the ad
  1088  // group.
  1089  func (c *ConversionGetByCustomerIdCall) AdGroupId(adGroupId int64) *ConversionGetByCustomerIdCall {
  1090  	c.urlParams_.Set("adGroupId", fmt.Sprint(adGroupId))
  1091  	return c
  1092  }
  1093  
  1094  // AdId sets the optional parameter "adId": Numeric ID of the ad.
  1095  func (c *ConversionGetByCustomerIdCall) AdId(adId int64) *ConversionGetByCustomerIdCall {
  1096  	c.urlParams_.Set("adId", fmt.Sprint(adId))
  1097  	return c
  1098  }
  1099  
  1100  // AdvertiserId sets the optional parameter "advertiserId": Numeric ID of the
  1101  // advertiser.
  1102  func (c *ConversionGetByCustomerIdCall) AdvertiserId(advertiserId int64) *ConversionGetByCustomerIdCall {
  1103  	c.urlParams_.Set("advertiserId", fmt.Sprint(advertiserId))
  1104  	return c
  1105  }
  1106  
  1107  // AgencyId sets the optional parameter "agencyId": Numeric ID of the agency.
  1108  func (c *ConversionGetByCustomerIdCall) AgencyId(agencyId int64) *ConversionGetByCustomerIdCall {
  1109  	c.urlParams_.Set("agencyId", fmt.Sprint(agencyId))
  1110  	return c
  1111  }
  1112  
  1113  // CampaignId sets the optional parameter "campaignId": Numeric ID of the
  1114  // campaign.
  1115  func (c *ConversionGetByCustomerIdCall) CampaignId(campaignId int64) *ConversionGetByCustomerIdCall {
  1116  	c.urlParams_.Set("campaignId", fmt.Sprint(campaignId))
  1117  	return c
  1118  }
  1119  
  1120  // CriterionId sets the optional parameter "criterionId": Numeric ID of the
  1121  // criterion.
  1122  func (c *ConversionGetByCustomerIdCall) CriterionId(criterionId int64) *ConversionGetByCustomerIdCall {
  1123  	c.urlParams_.Set("criterionId", fmt.Sprint(criterionId))
  1124  	return c
  1125  }
  1126  
  1127  // EngineAccountId sets the optional parameter "engineAccountId": Numeric ID of
  1128  // the engine account.
  1129  func (c *ConversionGetByCustomerIdCall) EngineAccountId(engineAccountId int64) *ConversionGetByCustomerIdCall {
  1130  	c.urlParams_.Set("engineAccountId", fmt.Sprint(engineAccountId))
  1131  	return c
  1132  }
  1133  
  1134  // Fields allows partial responses to be retrieved. See
  1135  // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse for more
  1136  // details.
  1137  func (c *ConversionGetByCustomerIdCall) Fields(s ...googleapi.Field) *ConversionGetByCustomerIdCall {
  1138  	c.urlParams_.Set("fields", googleapi.CombineFields(s))
  1139  	return c
  1140  }
  1141  
  1142  // IfNoneMatch sets an optional parameter which makes the operation fail if the
  1143  // object's ETag matches the given value. This is useful for getting updates
  1144  // only after the object has changed since the last request.
  1145  func (c *ConversionGetByCustomerIdCall) IfNoneMatch(entityTag string) *ConversionGetByCustomerIdCall {
  1146  	c.ifNoneMatch_ = entityTag
  1147  	return c
  1148  }
  1149  
  1150  // Context sets the context to be used in this call's Do method.
  1151  func (c *ConversionGetByCustomerIdCall) Context(ctx context.Context) *ConversionGetByCustomerIdCall {
  1152  	c.ctx_ = ctx
  1153  	return c
  1154  }
  1155  
  1156  // Header returns a http.Header that can be modified by the caller to add
  1157  // headers to the request.
  1158  func (c *ConversionGetByCustomerIdCall) Header() http.Header {
  1159  	if c.header_ == nil {
  1160  		c.header_ = make(http.Header)
  1161  	}
  1162  	return c.header_
  1163  }
  1164  
  1165  func (c *ConversionGetByCustomerIdCall) doRequest(alt string) (*http.Response, error) {
  1166  	reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_)
  1167  	if c.ifNoneMatch_ != "" {
  1168  		reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  1169  	}
  1170  	var body io.Reader = nil
  1171  	c.urlParams_.Set("alt", alt)
  1172  	c.urlParams_.Set("prettyPrint", "false")
  1173  	urls := googleapi.ResolveRelative(c.s.BasePath, "doubleclicksearch/v2/customer/{customerId}/conversion")
  1174  	urls += "?" + c.urlParams_.Encode()
  1175  	req, err := http.NewRequest("GET", urls, body)
  1176  	if err != nil {
  1177  		return nil, err
  1178  	}
  1179  	req.Header = reqHeaders
  1180  	googleapi.Expand(req.URL, map[string]string{
  1181  		"customerId": c.customerId,
  1182  	})
  1183  	return gensupport.SendRequest(c.ctx_, c.s.client, req)
  1184  }
  1185  
  1186  // Do executes the "doubleclicksearch.conversion.getByCustomerId" call.
  1187  // Any non-2xx status code is an error. Response headers are in either
  1188  // *ConversionList.ServerResponse.Header or (if a response was returned at all)
  1189  // in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to check
  1190  // whether the returned error was because http.StatusNotModified was returned.
  1191  func (c *ConversionGetByCustomerIdCall) Do(opts ...googleapi.CallOption) (*ConversionList, error) {
  1192  	gensupport.SetOptions(c.urlParams_, opts...)
  1193  	res, err := c.doRequest("json")
  1194  	if res != nil && res.StatusCode == http.StatusNotModified {
  1195  		if res.Body != nil {
  1196  			res.Body.Close()
  1197  		}
  1198  		return nil, gensupport.WrapError(&googleapi.Error{
  1199  			Code:   res.StatusCode,
  1200  			Header: res.Header,
  1201  		})
  1202  	}
  1203  	if err != nil {
  1204  		return nil, err
  1205  	}
  1206  	defer googleapi.CloseBody(res)
  1207  	if err := googleapi.CheckResponse(res); err != nil {
  1208  		return nil, gensupport.WrapError(err)
  1209  	}
  1210  	ret := &ConversionList{
  1211  		ServerResponse: googleapi.ServerResponse{
  1212  			Header:         res.Header,
  1213  			HTTPStatusCode: res.StatusCode,
  1214  		},
  1215  	}
  1216  	target := &ret
  1217  	if err := gensupport.DecodeResponse(target, res); err != nil {
  1218  		return nil, err
  1219  	}
  1220  	return ret, nil
  1221  }
  1222  
  1223  type ConversionInsertCall struct {
  1224  	s              *Service
  1225  	conversionlist *ConversionList
  1226  	urlParams_     gensupport.URLParams
  1227  	ctx_           context.Context
  1228  	header_        http.Header
  1229  }
  1230  
  1231  // Insert: Inserts a batch of new conversions into DoubleClick Search.
  1232  func (r *ConversionService) Insert(conversionlist *ConversionList) *ConversionInsertCall {
  1233  	c := &ConversionInsertCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  1234  	c.conversionlist = conversionlist
  1235  	return c
  1236  }
  1237  
  1238  // Fields allows partial responses to be retrieved. See
  1239  // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse for more
  1240  // details.
  1241  func (c *ConversionInsertCall) Fields(s ...googleapi.Field) *ConversionInsertCall {
  1242  	c.urlParams_.Set("fields", googleapi.CombineFields(s))
  1243  	return c
  1244  }
  1245  
  1246  // Context sets the context to be used in this call's Do method.
  1247  func (c *ConversionInsertCall) Context(ctx context.Context) *ConversionInsertCall {
  1248  	c.ctx_ = ctx
  1249  	return c
  1250  }
  1251  
  1252  // Header returns a http.Header that can be modified by the caller to add
  1253  // headers to the request.
  1254  func (c *ConversionInsertCall) Header() http.Header {
  1255  	if c.header_ == nil {
  1256  		c.header_ = make(http.Header)
  1257  	}
  1258  	return c.header_
  1259  }
  1260  
  1261  func (c *ConversionInsertCall) doRequest(alt string) (*http.Response, error) {
  1262  	reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_)
  1263  	var body io.Reader = nil
  1264  	body, err := googleapi.WithoutDataWrapper.JSONReader(c.conversionlist)
  1265  	if err != nil {
  1266  		return nil, err
  1267  	}
  1268  	c.urlParams_.Set("alt", alt)
  1269  	c.urlParams_.Set("prettyPrint", "false")
  1270  	urls := googleapi.ResolveRelative(c.s.BasePath, "doubleclicksearch/v2/conversion")
  1271  	urls += "?" + c.urlParams_.Encode()
  1272  	req, err := http.NewRequest("POST", urls, body)
  1273  	if err != nil {
  1274  		return nil, err
  1275  	}
  1276  	req.Header = reqHeaders
  1277  	return gensupport.SendRequest(c.ctx_, c.s.client, req)
  1278  }
  1279  
  1280  // Do executes the "doubleclicksearch.conversion.insert" call.
  1281  // Any non-2xx status code is an error. Response headers are in either
  1282  // *ConversionList.ServerResponse.Header or (if a response was returned at all)
  1283  // in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to check
  1284  // whether the returned error was because http.StatusNotModified was returned.
  1285  func (c *ConversionInsertCall) Do(opts ...googleapi.CallOption) (*ConversionList, error) {
  1286  	gensupport.SetOptions(c.urlParams_, opts...)
  1287  	res, err := c.doRequest("json")
  1288  	if res != nil && res.StatusCode == http.StatusNotModified {
  1289  		if res.Body != nil {
  1290  			res.Body.Close()
  1291  		}
  1292  		return nil, gensupport.WrapError(&googleapi.Error{
  1293  			Code:   res.StatusCode,
  1294  			Header: res.Header,
  1295  		})
  1296  	}
  1297  	if err != nil {
  1298  		return nil, err
  1299  	}
  1300  	defer googleapi.CloseBody(res)
  1301  	if err := googleapi.CheckResponse(res); err != nil {
  1302  		return nil, gensupport.WrapError(err)
  1303  	}
  1304  	ret := &ConversionList{
  1305  		ServerResponse: googleapi.ServerResponse{
  1306  			Header:         res.Header,
  1307  			HTTPStatusCode: res.StatusCode,
  1308  		},
  1309  	}
  1310  	target := &ret
  1311  	if err := gensupport.DecodeResponse(target, res); err != nil {
  1312  		return nil, err
  1313  	}
  1314  	return ret, nil
  1315  }
  1316  
  1317  type ConversionUpdateCall struct {
  1318  	s              *Service
  1319  	conversionlist *ConversionList
  1320  	urlParams_     gensupport.URLParams
  1321  	ctx_           context.Context
  1322  	header_        http.Header
  1323  }
  1324  
  1325  // Update: Updates a batch of conversions in DoubleClick Search.
  1326  func (r *ConversionService) Update(conversionlist *ConversionList) *ConversionUpdateCall {
  1327  	c := &ConversionUpdateCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  1328  	c.conversionlist = conversionlist
  1329  	return c
  1330  }
  1331  
  1332  // Fields allows partial responses to be retrieved. See
  1333  // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse for more
  1334  // details.
  1335  func (c *ConversionUpdateCall) Fields(s ...googleapi.Field) *ConversionUpdateCall {
  1336  	c.urlParams_.Set("fields", googleapi.CombineFields(s))
  1337  	return c
  1338  }
  1339  
  1340  // Context sets the context to be used in this call's Do method.
  1341  func (c *ConversionUpdateCall) Context(ctx context.Context) *ConversionUpdateCall {
  1342  	c.ctx_ = ctx
  1343  	return c
  1344  }
  1345  
  1346  // Header returns a http.Header that can be modified by the caller to add
  1347  // headers to the request.
  1348  func (c *ConversionUpdateCall) Header() http.Header {
  1349  	if c.header_ == nil {
  1350  		c.header_ = make(http.Header)
  1351  	}
  1352  	return c.header_
  1353  }
  1354  
  1355  func (c *ConversionUpdateCall) doRequest(alt string) (*http.Response, error) {
  1356  	reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_)
  1357  	var body io.Reader = nil
  1358  	body, err := googleapi.WithoutDataWrapper.JSONReader(c.conversionlist)
  1359  	if err != nil {
  1360  		return nil, err
  1361  	}
  1362  	c.urlParams_.Set("alt", alt)
  1363  	c.urlParams_.Set("prettyPrint", "false")
  1364  	urls := googleapi.ResolveRelative(c.s.BasePath, "doubleclicksearch/v2/conversion")
  1365  	urls += "?" + c.urlParams_.Encode()
  1366  	req, err := http.NewRequest("PUT", urls, body)
  1367  	if err != nil {
  1368  		return nil, err
  1369  	}
  1370  	req.Header = reqHeaders
  1371  	return gensupport.SendRequest(c.ctx_, c.s.client, req)
  1372  }
  1373  
  1374  // Do executes the "doubleclicksearch.conversion.update" call.
  1375  // Any non-2xx status code is an error. Response headers are in either
  1376  // *ConversionList.ServerResponse.Header or (if a response was returned at all)
  1377  // in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to check
  1378  // whether the returned error was because http.StatusNotModified was returned.
  1379  func (c *ConversionUpdateCall) Do(opts ...googleapi.CallOption) (*ConversionList, error) {
  1380  	gensupport.SetOptions(c.urlParams_, opts...)
  1381  	res, err := c.doRequest("json")
  1382  	if res != nil && res.StatusCode == http.StatusNotModified {
  1383  		if res.Body != nil {
  1384  			res.Body.Close()
  1385  		}
  1386  		return nil, gensupport.WrapError(&googleapi.Error{
  1387  			Code:   res.StatusCode,
  1388  			Header: res.Header,
  1389  		})
  1390  	}
  1391  	if err != nil {
  1392  		return nil, err
  1393  	}
  1394  	defer googleapi.CloseBody(res)
  1395  	if err := googleapi.CheckResponse(res); err != nil {
  1396  		return nil, gensupport.WrapError(err)
  1397  	}
  1398  	ret := &ConversionList{
  1399  		ServerResponse: googleapi.ServerResponse{
  1400  			Header:         res.Header,
  1401  			HTTPStatusCode: res.StatusCode,
  1402  		},
  1403  	}
  1404  	target := &ret
  1405  	if err := gensupport.DecodeResponse(target, res); err != nil {
  1406  		return nil, err
  1407  	}
  1408  	return ret, nil
  1409  }
  1410  
  1411  type ConversionUpdateAvailabilityCall struct {
  1412  	s                         *Service
  1413  	updateavailabilityrequest *UpdateAvailabilityRequest
  1414  	urlParams_                gensupport.URLParams
  1415  	ctx_                      context.Context
  1416  	header_                   http.Header
  1417  }
  1418  
  1419  // UpdateAvailability: Updates the availabilities of a batch of floodlight
  1420  // activities in DoubleClick Search.
  1421  func (r *ConversionService) UpdateAvailability(updateavailabilityrequest *UpdateAvailabilityRequest) *ConversionUpdateAvailabilityCall {
  1422  	c := &ConversionUpdateAvailabilityCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  1423  	c.updateavailabilityrequest = updateavailabilityrequest
  1424  	return c
  1425  }
  1426  
  1427  // Fields allows partial responses to be retrieved. See
  1428  // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse for more
  1429  // details.
  1430  func (c *ConversionUpdateAvailabilityCall) Fields(s ...googleapi.Field) *ConversionUpdateAvailabilityCall {
  1431  	c.urlParams_.Set("fields", googleapi.CombineFields(s))
  1432  	return c
  1433  }
  1434  
  1435  // Context sets the context to be used in this call's Do method.
  1436  func (c *ConversionUpdateAvailabilityCall) Context(ctx context.Context) *ConversionUpdateAvailabilityCall {
  1437  	c.ctx_ = ctx
  1438  	return c
  1439  }
  1440  
  1441  // Header returns a http.Header that can be modified by the caller to add
  1442  // headers to the request.
  1443  func (c *ConversionUpdateAvailabilityCall) Header() http.Header {
  1444  	if c.header_ == nil {
  1445  		c.header_ = make(http.Header)
  1446  	}
  1447  	return c.header_
  1448  }
  1449  
  1450  func (c *ConversionUpdateAvailabilityCall) doRequest(alt string) (*http.Response, error) {
  1451  	reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_)
  1452  	var body io.Reader = nil
  1453  	body, err := googleapi.WithoutDataWrapper.JSONReader(c.updateavailabilityrequest)
  1454  	if err != nil {
  1455  		return nil, err
  1456  	}
  1457  	c.urlParams_.Set("alt", alt)
  1458  	c.urlParams_.Set("prettyPrint", "false")
  1459  	urls := googleapi.ResolveRelative(c.s.BasePath, "doubleclicksearch/v2/conversion/updateAvailability")
  1460  	urls += "?" + c.urlParams_.Encode()
  1461  	req, err := http.NewRequest("POST", urls, body)
  1462  	if err != nil {
  1463  		return nil, err
  1464  	}
  1465  	req.Header = reqHeaders
  1466  	return gensupport.SendRequest(c.ctx_, c.s.client, req)
  1467  }
  1468  
  1469  // Do executes the "doubleclicksearch.conversion.updateAvailability" call.
  1470  // Any non-2xx status code is an error. Response headers are in either
  1471  // *UpdateAvailabilityResponse.ServerResponse.Header or (if a response was
  1472  // returned at all) in error.(*googleapi.Error).Header. Use
  1473  // googleapi.IsNotModified to check whether the returned error was because
  1474  // http.StatusNotModified was returned.
  1475  func (c *ConversionUpdateAvailabilityCall) Do(opts ...googleapi.CallOption) (*UpdateAvailabilityResponse, error) {
  1476  	gensupport.SetOptions(c.urlParams_, opts...)
  1477  	res, err := c.doRequest("json")
  1478  	if res != nil && res.StatusCode == http.StatusNotModified {
  1479  		if res.Body != nil {
  1480  			res.Body.Close()
  1481  		}
  1482  		return nil, gensupport.WrapError(&googleapi.Error{
  1483  			Code:   res.StatusCode,
  1484  			Header: res.Header,
  1485  		})
  1486  	}
  1487  	if err != nil {
  1488  		return nil, err
  1489  	}
  1490  	defer googleapi.CloseBody(res)
  1491  	if err := googleapi.CheckResponse(res); err != nil {
  1492  		return nil, gensupport.WrapError(err)
  1493  	}
  1494  	ret := &UpdateAvailabilityResponse{
  1495  		ServerResponse: googleapi.ServerResponse{
  1496  			Header:         res.Header,
  1497  			HTTPStatusCode: res.StatusCode,
  1498  		},
  1499  	}
  1500  	target := &ret
  1501  	if err := gensupport.DecodeResponse(target, res); err != nil {
  1502  		return nil, err
  1503  	}
  1504  	return ret, nil
  1505  }
  1506  
  1507  type ReportsGenerateCall struct {
  1508  	s             *Service
  1509  	reportrequest *ReportRequest
  1510  	urlParams_    gensupport.URLParams
  1511  	ctx_          context.Context
  1512  	header_       http.Header
  1513  }
  1514  
  1515  // Generate: Generates and returns a report immediately.
  1516  func (r *ReportsService) Generate(reportrequest *ReportRequest) *ReportsGenerateCall {
  1517  	c := &ReportsGenerateCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  1518  	c.reportrequest = reportrequest
  1519  	return c
  1520  }
  1521  
  1522  // Fields allows partial responses to be retrieved. See
  1523  // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse for more
  1524  // details.
  1525  func (c *ReportsGenerateCall) Fields(s ...googleapi.Field) *ReportsGenerateCall {
  1526  	c.urlParams_.Set("fields", googleapi.CombineFields(s))
  1527  	return c
  1528  }
  1529  
  1530  // Context sets the context to be used in this call's Do method.
  1531  func (c *ReportsGenerateCall) Context(ctx context.Context) *ReportsGenerateCall {
  1532  	c.ctx_ = ctx
  1533  	return c
  1534  }
  1535  
  1536  // Header returns a http.Header that can be modified by the caller to add
  1537  // headers to the request.
  1538  func (c *ReportsGenerateCall) Header() http.Header {
  1539  	if c.header_ == nil {
  1540  		c.header_ = make(http.Header)
  1541  	}
  1542  	return c.header_
  1543  }
  1544  
  1545  func (c *ReportsGenerateCall) doRequest(alt string) (*http.Response, error) {
  1546  	reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_)
  1547  	var body io.Reader = nil
  1548  	body, err := googleapi.WithoutDataWrapper.JSONReader(c.reportrequest)
  1549  	if err != nil {
  1550  		return nil, err
  1551  	}
  1552  	c.urlParams_.Set("alt", alt)
  1553  	c.urlParams_.Set("prettyPrint", "false")
  1554  	urls := googleapi.ResolveRelative(c.s.BasePath, "doubleclicksearch/v2/reports/generate")
  1555  	urls += "?" + c.urlParams_.Encode()
  1556  	req, err := http.NewRequest("POST", urls, body)
  1557  	if err != nil {
  1558  		return nil, err
  1559  	}
  1560  	req.Header = reqHeaders
  1561  	return gensupport.SendRequest(c.ctx_, c.s.client, req)
  1562  }
  1563  
  1564  // Do executes the "doubleclicksearch.reports.generate" call.
  1565  // Any non-2xx status code is an error. Response headers are in either
  1566  // *Report.ServerResponse.Header or (if a response was returned at all) in
  1567  // error.(*googleapi.Error).Header. Use googleapi.IsNotModified to check
  1568  // whether the returned error was because http.StatusNotModified was returned.
  1569  func (c *ReportsGenerateCall) Do(opts ...googleapi.CallOption) (*Report, error) {
  1570  	gensupport.SetOptions(c.urlParams_, opts...)
  1571  	res, err := c.doRequest("json")
  1572  	if res != nil && res.StatusCode == http.StatusNotModified {
  1573  		if res.Body != nil {
  1574  			res.Body.Close()
  1575  		}
  1576  		return nil, gensupport.WrapError(&googleapi.Error{
  1577  			Code:   res.StatusCode,
  1578  			Header: res.Header,
  1579  		})
  1580  	}
  1581  	if err != nil {
  1582  		return nil, err
  1583  	}
  1584  	defer googleapi.CloseBody(res)
  1585  	if err := googleapi.CheckResponse(res); err != nil {
  1586  		return nil, gensupport.WrapError(err)
  1587  	}
  1588  	ret := &Report{
  1589  		ServerResponse: googleapi.ServerResponse{
  1590  			Header:         res.Header,
  1591  			HTTPStatusCode: res.StatusCode,
  1592  		},
  1593  	}
  1594  	target := &ret
  1595  	if err := gensupport.DecodeResponse(target, res); err != nil {
  1596  		return nil, err
  1597  	}
  1598  	return ret, nil
  1599  }
  1600  
  1601  type ReportsGetCall struct {
  1602  	s            *Service
  1603  	reportId     string
  1604  	urlParams_   gensupport.URLParams
  1605  	ifNoneMatch_ string
  1606  	ctx_         context.Context
  1607  	header_      http.Header
  1608  }
  1609  
  1610  // Get: Polls for the status of a report request.
  1611  //
  1612  // - reportId: ID of the report request being polled.
  1613  func (r *ReportsService) Get(reportId string) *ReportsGetCall {
  1614  	c := &ReportsGetCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  1615  	c.reportId = reportId
  1616  	return c
  1617  }
  1618  
  1619  // Fields allows partial responses to be retrieved. See
  1620  // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse for more
  1621  // details.
  1622  func (c *ReportsGetCall) Fields(s ...googleapi.Field) *ReportsGetCall {
  1623  	c.urlParams_.Set("fields", googleapi.CombineFields(s))
  1624  	return c
  1625  }
  1626  
  1627  // IfNoneMatch sets an optional parameter which makes the operation fail if the
  1628  // object's ETag matches the given value. This is useful for getting updates
  1629  // only after the object has changed since the last request.
  1630  func (c *ReportsGetCall) IfNoneMatch(entityTag string) *ReportsGetCall {
  1631  	c.ifNoneMatch_ = entityTag
  1632  	return c
  1633  }
  1634  
  1635  // Context sets the context to be used in this call's Do method.
  1636  func (c *ReportsGetCall) Context(ctx context.Context) *ReportsGetCall {
  1637  	c.ctx_ = ctx
  1638  	return c
  1639  }
  1640  
  1641  // Header returns a http.Header that can be modified by the caller to add
  1642  // headers to the request.
  1643  func (c *ReportsGetCall) Header() http.Header {
  1644  	if c.header_ == nil {
  1645  		c.header_ = make(http.Header)
  1646  	}
  1647  	return c.header_
  1648  }
  1649  
  1650  func (c *ReportsGetCall) doRequest(alt string) (*http.Response, error) {
  1651  	reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_)
  1652  	if c.ifNoneMatch_ != "" {
  1653  		reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  1654  	}
  1655  	var body io.Reader = nil
  1656  	c.urlParams_.Set("alt", alt)
  1657  	c.urlParams_.Set("prettyPrint", "false")
  1658  	urls := googleapi.ResolveRelative(c.s.BasePath, "doubleclicksearch/v2/reports/{reportId}")
  1659  	urls += "?" + c.urlParams_.Encode()
  1660  	req, err := http.NewRequest("GET", urls, body)
  1661  	if err != nil {
  1662  		return nil, err
  1663  	}
  1664  	req.Header = reqHeaders
  1665  	googleapi.Expand(req.URL, map[string]string{
  1666  		"reportId": c.reportId,
  1667  	})
  1668  	return gensupport.SendRequest(c.ctx_, c.s.client, req)
  1669  }
  1670  
  1671  // Do executes the "doubleclicksearch.reports.get" call.
  1672  // Any non-2xx status code is an error. Response headers are in either
  1673  // *Report.ServerResponse.Header or (if a response was returned at all) in
  1674  // error.(*googleapi.Error).Header. Use googleapi.IsNotModified to check
  1675  // whether the returned error was because http.StatusNotModified was returned.
  1676  func (c *ReportsGetCall) Do(opts ...googleapi.CallOption) (*Report, error) {
  1677  	gensupport.SetOptions(c.urlParams_, opts...)
  1678  	res, err := c.doRequest("json")
  1679  	if res != nil && res.StatusCode == http.StatusNotModified {
  1680  		if res.Body != nil {
  1681  			res.Body.Close()
  1682  		}
  1683  		return nil, gensupport.WrapError(&googleapi.Error{
  1684  			Code:   res.StatusCode,
  1685  			Header: res.Header,
  1686  		})
  1687  	}
  1688  	if err != nil {
  1689  		return nil, err
  1690  	}
  1691  	defer googleapi.CloseBody(res)
  1692  	if err := googleapi.CheckResponse(res); err != nil {
  1693  		return nil, gensupport.WrapError(err)
  1694  	}
  1695  	ret := &Report{
  1696  		ServerResponse: googleapi.ServerResponse{
  1697  			Header:         res.Header,
  1698  			HTTPStatusCode: res.StatusCode,
  1699  		},
  1700  	}
  1701  	target := &ret
  1702  	if err := gensupport.DecodeResponse(target, res); err != nil {
  1703  		return nil, err
  1704  	}
  1705  	return ret, nil
  1706  }
  1707  
  1708  type ReportsGetFileCall struct {
  1709  	s              *Service
  1710  	reportId       string
  1711  	reportFragment int64
  1712  	urlParams_     gensupport.URLParams
  1713  	ifNoneMatch_   string
  1714  	ctx_           context.Context
  1715  	header_        http.Header
  1716  }
  1717  
  1718  // GetFile: Downloads a report file encoded in UTF-8.
  1719  //
  1720  // - reportFragment: The index of the report fragment to download.
  1721  // - reportId: ID of the report.
  1722  func (r *ReportsService) GetFile(reportId string, reportFragment int64) *ReportsGetFileCall {
  1723  	c := &ReportsGetFileCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  1724  	c.reportId = reportId
  1725  	c.reportFragment = reportFragment
  1726  	return c
  1727  }
  1728  
  1729  // Fields allows partial responses to be retrieved. See
  1730  // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse for more
  1731  // details.
  1732  func (c *ReportsGetFileCall) Fields(s ...googleapi.Field) *ReportsGetFileCall {
  1733  	c.urlParams_.Set("fields", googleapi.CombineFields(s))
  1734  	return c
  1735  }
  1736  
  1737  // IfNoneMatch sets an optional parameter which makes the operation fail if the
  1738  // object's ETag matches the given value. This is useful for getting updates
  1739  // only after the object has changed since the last request.
  1740  func (c *ReportsGetFileCall) IfNoneMatch(entityTag string) *ReportsGetFileCall {
  1741  	c.ifNoneMatch_ = entityTag
  1742  	return c
  1743  }
  1744  
  1745  // Context sets the context to be used in this call's Do and Download methods.
  1746  func (c *ReportsGetFileCall) Context(ctx context.Context) *ReportsGetFileCall {
  1747  	c.ctx_ = ctx
  1748  	return c
  1749  }
  1750  
  1751  // Header returns a http.Header that can be modified by the caller to add
  1752  // headers to the request.
  1753  func (c *ReportsGetFileCall) Header() http.Header {
  1754  	if c.header_ == nil {
  1755  		c.header_ = make(http.Header)
  1756  	}
  1757  	return c.header_
  1758  }
  1759  
  1760  func (c *ReportsGetFileCall) doRequest(alt string) (*http.Response, error) {
  1761  	reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_)
  1762  	if c.ifNoneMatch_ != "" {
  1763  		reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  1764  	}
  1765  	var body io.Reader = nil
  1766  	c.urlParams_.Set("alt", alt)
  1767  	c.urlParams_.Set("prettyPrint", "false")
  1768  	urls := googleapi.ResolveRelative(c.s.BasePath, "doubleclicksearch/v2/reports/{reportId}/files/{reportFragment}")
  1769  	urls += "?" + c.urlParams_.Encode()
  1770  	req, err := http.NewRequest("GET", urls, body)
  1771  	if err != nil {
  1772  		return nil, err
  1773  	}
  1774  	req.Header = reqHeaders
  1775  	googleapi.Expand(req.URL, map[string]string{
  1776  		"reportId":       c.reportId,
  1777  		"reportFragment": strconv.FormatInt(c.reportFragment, 10),
  1778  	})
  1779  	return gensupport.SendRequest(c.ctx_, c.s.client, req)
  1780  }
  1781  
  1782  // Download fetches the API endpoint's "media" value, instead of the normal
  1783  // API response value. If the returned error is nil, the Response is guaranteed to
  1784  // have a 2xx status code. Callers must close the Response.Body as usual.
  1785  func (c *ReportsGetFileCall) Download(opts ...googleapi.CallOption) (*http.Response, error) {
  1786  	gensupport.SetOptions(c.urlParams_, opts...)
  1787  	res, err := c.doRequest("media")
  1788  	if err != nil {
  1789  		return nil, err
  1790  	}
  1791  	if err := googleapi.CheckResponse(res); err != nil {
  1792  		res.Body.Close()
  1793  		return nil, gensupport.WrapError(err)
  1794  	}
  1795  	return res, nil
  1796  }
  1797  
  1798  // Do executes the "doubleclicksearch.reports.getFile" call.
  1799  func (c *ReportsGetFileCall) Do(opts ...googleapi.CallOption) error {
  1800  	gensupport.SetOptions(c.urlParams_, opts...)
  1801  	res, err := c.doRequest("json")
  1802  	if err != nil {
  1803  		return err
  1804  	}
  1805  	defer googleapi.CloseBody(res)
  1806  	if err := googleapi.CheckResponse(res); err != nil {
  1807  		return gensupport.WrapError(err)
  1808  	}
  1809  	return nil
  1810  }
  1811  
  1812  type ReportsGetIdMappingFileCall struct {
  1813  	s            *Service
  1814  	agencyId     int64
  1815  	advertiserId int64
  1816  	urlParams_   gensupport.URLParams
  1817  	ifNoneMatch_ string
  1818  	ctx_         context.Context
  1819  	header_      http.Header
  1820  }
  1821  
  1822  // GetIdMappingFile: Downloads a csv file(encoded in UTF-8) that contains ID
  1823  // mappings between legacy SA360 and new SA360. The file includes all children
  1824  // entities of the given advertiser(e.g. engine accounts, campaigns, ad groups,
  1825  // etc.) that exist in both legacy SA360 and new SA360.
  1826  //
  1827  // - advertiserId: Legacy SA360 advertiser ID.
  1828  // - agencyId: Legacy SA360 agency ID.
  1829  func (r *ReportsService) GetIdMappingFile(agencyId int64, advertiserId int64) *ReportsGetIdMappingFileCall {
  1830  	c := &ReportsGetIdMappingFileCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  1831  	c.agencyId = agencyId
  1832  	c.advertiserId = advertiserId
  1833  	return c
  1834  }
  1835  
  1836  // Fields allows partial responses to be retrieved. See
  1837  // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse for more
  1838  // details.
  1839  func (c *ReportsGetIdMappingFileCall) Fields(s ...googleapi.Field) *ReportsGetIdMappingFileCall {
  1840  	c.urlParams_.Set("fields", googleapi.CombineFields(s))
  1841  	return c
  1842  }
  1843  
  1844  // IfNoneMatch sets an optional parameter which makes the operation fail if the
  1845  // object's ETag matches the given value. This is useful for getting updates
  1846  // only after the object has changed since the last request.
  1847  func (c *ReportsGetIdMappingFileCall) IfNoneMatch(entityTag string) *ReportsGetIdMappingFileCall {
  1848  	c.ifNoneMatch_ = entityTag
  1849  	return c
  1850  }
  1851  
  1852  // Context sets the context to be used in this call's Do and Download methods.
  1853  func (c *ReportsGetIdMappingFileCall) Context(ctx context.Context) *ReportsGetIdMappingFileCall {
  1854  	c.ctx_ = ctx
  1855  	return c
  1856  }
  1857  
  1858  // Header returns a http.Header that can be modified by the caller to add
  1859  // headers to the request.
  1860  func (c *ReportsGetIdMappingFileCall) Header() http.Header {
  1861  	if c.header_ == nil {
  1862  		c.header_ = make(http.Header)
  1863  	}
  1864  	return c.header_
  1865  }
  1866  
  1867  func (c *ReportsGetIdMappingFileCall) doRequest(alt string) (*http.Response, error) {
  1868  	reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_)
  1869  	if c.ifNoneMatch_ != "" {
  1870  		reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  1871  	}
  1872  	var body io.Reader = nil
  1873  	c.urlParams_.Set("alt", alt)
  1874  	c.urlParams_.Set("prettyPrint", "false")
  1875  	urls := googleapi.ResolveRelative(c.s.BasePath, "doubleclicksearch/v2/agency/{agencyId}/advertiser/{advertiserId}/idmapping")
  1876  	urls += "?" + c.urlParams_.Encode()
  1877  	req, err := http.NewRequest("GET", urls, body)
  1878  	if err != nil {
  1879  		return nil, err
  1880  	}
  1881  	req.Header = reqHeaders
  1882  	googleapi.Expand(req.URL, map[string]string{
  1883  		"agencyId":     strconv.FormatInt(c.agencyId, 10),
  1884  		"advertiserId": strconv.FormatInt(c.advertiserId, 10),
  1885  	})
  1886  	return gensupport.SendRequest(c.ctx_, c.s.client, req)
  1887  }
  1888  
  1889  // Download fetches the API endpoint's "media" value, instead of the normal
  1890  // API response value. If the returned error is nil, the Response is guaranteed to
  1891  // have a 2xx status code. Callers must close the Response.Body as usual.
  1892  func (c *ReportsGetIdMappingFileCall) Download(opts ...googleapi.CallOption) (*http.Response, error) {
  1893  	gensupport.SetOptions(c.urlParams_, opts...)
  1894  	res, err := c.doRequest("media")
  1895  	if err != nil {
  1896  		return nil, err
  1897  	}
  1898  	if err := googleapi.CheckResponse(res); err != nil {
  1899  		res.Body.Close()
  1900  		return nil, gensupport.WrapError(err)
  1901  	}
  1902  	return res, nil
  1903  }
  1904  
  1905  // Do executes the "doubleclicksearch.reports.getIdMappingFile" call.
  1906  // Any non-2xx status code is an error. Response headers are in either
  1907  // *IdMappingFile.ServerResponse.Header or (if a response was returned at all)
  1908  // in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to check
  1909  // whether the returned error was because http.StatusNotModified was returned.
  1910  func (c *ReportsGetIdMappingFileCall) Do(opts ...googleapi.CallOption) (*IdMappingFile, error) {
  1911  	gensupport.SetOptions(c.urlParams_, opts...)
  1912  	res, err := c.doRequest("json")
  1913  	if res != nil && res.StatusCode == http.StatusNotModified {
  1914  		if res.Body != nil {
  1915  			res.Body.Close()
  1916  		}
  1917  		return nil, gensupport.WrapError(&googleapi.Error{
  1918  			Code:   res.StatusCode,
  1919  			Header: res.Header,
  1920  		})
  1921  	}
  1922  	if err != nil {
  1923  		return nil, err
  1924  	}
  1925  	defer googleapi.CloseBody(res)
  1926  	if err := googleapi.CheckResponse(res); err != nil {
  1927  		return nil, gensupport.WrapError(err)
  1928  	}
  1929  	ret := &IdMappingFile{
  1930  		ServerResponse: googleapi.ServerResponse{
  1931  			Header:         res.Header,
  1932  			HTTPStatusCode: res.StatusCode,
  1933  		},
  1934  	}
  1935  	target := &ret
  1936  	if err := gensupport.DecodeResponse(target, res); err != nil {
  1937  		return nil, err
  1938  	}
  1939  	return ret, nil
  1940  }
  1941  
  1942  type ReportsRequestCall struct {
  1943  	s             *Service
  1944  	reportrequest *ReportRequest
  1945  	urlParams_    gensupport.URLParams
  1946  	ctx_          context.Context
  1947  	header_       http.Header
  1948  }
  1949  
  1950  // Request: Inserts a report request into the reporting system.
  1951  func (r *ReportsService) Request(reportrequest *ReportRequest) *ReportsRequestCall {
  1952  	c := &ReportsRequestCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  1953  	c.reportrequest = reportrequest
  1954  	return c
  1955  }
  1956  
  1957  // Fields allows partial responses to be retrieved. See
  1958  // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse for more
  1959  // details.
  1960  func (c *ReportsRequestCall) Fields(s ...googleapi.Field) *ReportsRequestCall {
  1961  	c.urlParams_.Set("fields", googleapi.CombineFields(s))
  1962  	return c
  1963  }
  1964  
  1965  // Context sets the context to be used in this call's Do method.
  1966  func (c *ReportsRequestCall) Context(ctx context.Context) *ReportsRequestCall {
  1967  	c.ctx_ = ctx
  1968  	return c
  1969  }
  1970  
  1971  // Header returns a http.Header that can be modified by the caller to add
  1972  // headers to the request.
  1973  func (c *ReportsRequestCall) Header() http.Header {
  1974  	if c.header_ == nil {
  1975  		c.header_ = make(http.Header)
  1976  	}
  1977  	return c.header_
  1978  }
  1979  
  1980  func (c *ReportsRequestCall) doRequest(alt string) (*http.Response, error) {
  1981  	reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_)
  1982  	var body io.Reader = nil
  1983  	body, err := googleapi.WithoutDataWrapper.JSONReader(c.reportrequest)
  1984  	if err != nil {
  1985  		return nil, err
  1986  	}
  1987  	c.urlParams_.Set("alt", alt)
  1988  	c.urlParams_.Set("prettyPrint", "false")
  1989  	urls := googleapi.ResolveRelative(c.s.BasePath, "doubleclicksearch/v2/reports")
  1990  	urls += "?" + c.urlParams_.Encode()
  1991  	req, err := http.NewRequest("POST", urls, body)
  1992  	if err != nil {
  1993  		return nil, err
  1994  	}
  1995  	req.Header = reqHeaders
  1996  	return gensupport.SendRequest(c.ctx_, c.s.client, req)
  1997  }
  1998  
  1999  // Do executes the "doubleclicksearch.reports.request" call.
  2000  // Any non-2xx status code is an error. Response headers are in either
  2001  // *Report.ServerResponse.Header or (if a response was returned at all) in
  2002  // error.(*googleapi.Error).Header. Use googleapi.IsNotModified to check
  2003  // whether the returned error was because http.StatusNotModified was returned.
  2004  func (c *ReportsRequestCall) Do(opts ...googleapi.CallOption) (*Report, error) {
  2005  	gensupport.SetOptions(c.urlParams_, opts...)
  2006  	res, err := c.doRequest("json")
  2007  	if res != nil && res.StatusCode == http.StatusNotModified {
  2008  		if res.Body != nil {
  2009  			res.Body.Close()
  2010  		}
  2011  		return nil, gensupport.WrapError(&googleapi.Error{
  2012  			Code:   res.StatusCode,
  2013  			Header: res.Header,
  2014  		})
  2015  	}
  2016  	if err != nil {
  2017  		return nil, err
  2018  	}
  2019  	defer googleapi.CloseBody(res)
  2020  	if err := googleapi.CheckResponse(res); err != nil {
  2021  		return nil, gensupport.WrapError(err)
  2022  	}
  2023  	ret := &Report{
  2024  		ServerResponse: googleapi.ServerResponse{
  2025  			Header:         res.Header,
  2026  			HTTPStatusCode: res.StatusCode,
  2027  		},
  2028  	}
  2029  	target := &ret
  2030  	if err := gensupport.DecodeResponse(target, res); err != nil {
  2031  		return nil, err
  2032  	}
  2033  	return ret, nil
  2034  }
  2035  
  2036  type SavedColumnsListCall struct {
  2037  	s            *Service
  2038  	agencyId     int64
  2039  	advertiserId int64
  2040  	urlParams_   gensupport.URLParams
  2041  	ifNoneMatch_ string
  2042  	ctx_         context.Context
  2043  	header_      http.Header
  2044  }
  2045  
  2046  // List: Retrieve the list of saved columns for a specified advertiser.
  2047  //
  2048  // - advertiserId: DS ID of the advertiser.
  2049  // - agencyId: DS ID of the agency.
  2050  func (r *SavedColumnsService) List(agencyId int64, advertiserId int64) *SavedColumnsListCall {
  2051  	c := &SavedColumnsListCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  2052  	c.agencyId = agencyId
  2053  	c.advertiserId = advertiserId
  2054  	return c
  2055  }
  2056  
  2057  // Fields allows partial responses to be retrieved. See
  2058  // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse for more
  2059  // details.
  2060  func (c *SavedColumnsListCall) Fields(s ...googleapi.Field) *SavedColumnsListCall {
  2061  	c.urlParams_.Set("fields", googleapi.CombineFields(s))
  2062  	return c
  2063  }
  2064  
  2065  // IfNoneMatch sets an optional parameter which makes the operation fail if the
  2066  // object's ETag matches the given value. This is useful for getting updates
  2067  // only after the object has changed since the last request.
  2068  func (c *SavedColumnsListCall) IfNoneMatch(entityTag string) *SavedColumnsListCall {
  2069  	c.ifNoneMatch_ = entityTag
  2070  	return c
  2071  }
  2072  
  2073  // Context sets the context to be used in this call's Do method.
  2074  func (c *SavedColumnsListCall) Context(ctx context.Context) *SavedColumnsListCall {
  2075  	c.ctx_ = ctx
  2076  	return c
  2077  }
  2078  
  2079  // Header returns a http.Header that can be modified by the caller to add
  2080  // headers to the request.
  2081  func (c *SavedColumnsListCall) Header() http.Header {
  2082  	if c.header_ == nil {
  2083  		c.header_ = make(http.Header)
  2084  	}
  2085  	return c.header_
  2086  }
  2087  
  2088  func (c *SavedColumnsListCall) doRequest(alt string) (*http.Response, error) {
  2089  	reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_)
  2090  	if c.ifNoneMatch_ != "" {
  2091  		reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  2092  	}
  2093  	var body io.Reader = nil
  2094  	c.urlParams_.Set("alt", alt)
  2095  	c.urlParams_.Set("prettyPrint", "false")
  2096  	urls := googleapi.ResolveRelative(c.s.BasePath, "doubleclicksearch/v2/agency/{agencyId}/advertiser/{advertiserId}/savedcolumns")
  2097  	urls += "?" + c.urlParams_.Encode()
  2098  	req, err := http.NewRequest("GET", urls, body)
  2099  	if err != nil {
  2100  		return nil, err
  2101  	}
  2102  	req.Header = reqHeaders
  2103  	googleapi.Expand(req.URL, map[string]string{
  2104  		"agencyId":     strconv.FormatInt(c.agencyId, 10),
  2105  		"advertiserId": strconv.FormatInt(c.advertiserId, 10),
  2106  	})
  2107  	return gensupport.SendRequest(c.ctx_, c.s.client, req)
  2108  }
  2109  
  2110  // Do executes the "doubleclicksearch.savedColumns.list" call.
  2111  // Any non-2xx status code is an error. Response headers are in either
  2112  // *SavedColumnList.ServerResponse.Header or (if a response was returned at
  2113  // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to
  2114  // check whether the returned error was because http.StatusNotModified was
  2115  // returned.
  2116  func (c *SavedColumnsListCall) Do(opts ...googleapi.CallOption) (*SavedColumnList, error) {
  2117  	gensupport.SetOptions(c.urlParams_, opts...)
  2118  	res, err := c.doRequest("json")
  2119  	if res != nil && res.StatusCode == http.StatusNotModified {
  2120  		if res.Body != nil {
  2121  			res.Body.Close()
  2122  		}
  2123  		return nil, gensupport.WrapError(&googleapi.Error{
  2124  			Code:   res.StatusCode,
  2125  			Header: res.Header,
  2126  		})
  2127  	}
  2128  	if err != nil {
  2129  		return nil, err
  2130  	}
  2131  	defer googleapi.CloseBody(res)
  2132  	if err := googleapi.CheckResponse(res); err != nil {
  2133  		return nil, gensupport.WrapError(err)
  2134  	}
  2135  	ret := &SavedColumnList{
  2136  		ServerResponse: googleapi.ServerResponse{
  2137  			Header:         res.Header,
  2138  			HTTPStatusCode: res.StatusCode,
  2139  		},
  2140  	}
  2141  	target := &ret
  2142  	if err := gensupport.DecodeResponse(target, res); err != nil {
  2143  		return nil, err
  2144  	}
  2145  	return ret, nil
  2146  }
  2147  

View as plain text