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