1// Copyright 2020 Google LLC.
2// Use of this source code is governed by a BSD-style
3// license that can be found in the LICENSE file.
4
5// Code generated file. DO NOT EDIT.
6
7// Package adexchangeseller provides access to the Ad Exchange Seller API.
8//
9// For product documentation, see: https://developers.google.com/ad-exchange/seller-rest/
10//
11// Creating a client
12//
13// Usage example:
14//
15//   import "google.golang.org/api/adexchangeseller/v1"
16//   ...
17//   ctx := context.Background()
18//   adexchangesellerService, err := adexchangeseller.NewService(ctx)
19//
20// In this example, Google Application Default Credentials are used for authentication.
21//
22// For information on how to create and obtain Application Default Credentials, see https://developers.google.com/identity/protocols/application-default-credentials.
23//
24// Other authentication options
25//
26// By default, all available scopes (see "Constants") are used to authenticate. To restrict scopes, use option.WithScopes:
27//
28//   adexchangesellerService, err := adexchangeseller.NewService(ctx, option.WithScopes(adexchangeseller.AdexchangeSellerReadonlyScope))
29//
30// To use an API key for authentication (note: some APIs do not support API keys), use option.WithAPIKey:
31//
32//   adexchangesellerService, err := adexchangeseller.NewService(ctx, option.WithAPIKey("AIza..."))
33//
34// To use an OAuth token (e.g., a user token obtained via a three-legged OAuth flow), use option.WithTokenSource:
35//
36//   config := &oauth2.Config{...}
37//   // ...
38//   token, err := config.Exchange(ctx, ...)
39//   adexchangesellerService, err := adexchangeseller.NewService(ctx, option.WithTokenSource(config.TokenSource(ctx, token)))
40//
41// See https://godoc.org/google.golang.org/api/option/ for details on options.
42package adexchangeseller // import "google.golang.org/api/adexchangeseller/v1"
43
44import (
45	"bytes"
46	"context"
47	"encoding/json"
48	"errors"
49	"fmt"
50	"io"
51	"net/http"
52	"net/url"
53	"strconv"
54	"strings"
55
56	googleapi "google.golang.org/api/googleapi"
57	gensupport "google.golang.org/api/internal/gensupport"
58	option "google.golang.org/api/option"
59	htransport "google.golang.org/api/transport/http"
60)
61
62// Always reference these packages, just in case the auto-generated code
63// below doesn't.
64var _ = bytes.NewBuffer
65var _ = strconv.Itoa
66var _ = fmt.Sprintf
67var _ = json.NewDecoder
68var _ = io.Copy
69var _ = url.Parse
70var _ = gensupport.MarshalJSON
71var _ = googleapi.Version
72var _ = errors.New
73var _ = strings.Replace
74var _ = context.Canceled
75
76const apiId = "adexchangeseller:v1"
77const apiName = "adexchangeseller"
78const apiVersion = "v1"
79const basePath = "https://www.googleapis.com/adexchangeseller/v1/"
80
81// OAuth2 scopes used by this API.
82const (
83	// View and manage your Ad Exchange data
84	AdexchangeSellerScope = "https://www.googleapis.com/auth/adexchange.seller"
85
86	// View your Ad Exchange data
87	AdexchangeSellerReadonlyScope = "https://www.googleapis.com/auth/adexchange.seller.readonly"
88)
89
90// NewService creates a new Service.
91func NewService(ctx context.Context, opts ...option.ClientOption) (*Service, error) {
92	scopesOption := option.WithScopes(
93		"https://www.googleapis.com/auth/adexchange.seller",
94		"https://www.googleapis.com/auth/adexchange.seller.readonly",
95	)
96	// NOTE: prepend, so we don't override user-specified scopes.
97	opts = append([]option.ClientOption{scopesOption}, opts...)
98	client, endpoint, err := htransport.NewClient(ctx, opts...)
99	if err != nil {
100		return nil, err
101	}
102	s, err := New(client)
103	if err != nil {
104		return nil, err
105	}
106	if endpoint != "" {
107		s.BasePath = endpoint
108	}
109	return s, nil
110}
111
112// New creates a new Service. It uses the provided http.Client for requests.
113//
114// Deprecated: please use NewService instead.
115// To provide a custom HTTP client, use option.WithHTTPClient.
116// If you are using google.golang.org/api/googleapis/transport.APIKey, use option.WithAPIKey with NewService instead.
117func New(client *http.Client) (*Service, error) {
118	if client == nil {
119		return nil, errors.New("client is nil")
120	}
121	s := &Service{client: client, BasePath: basePath}
122	s.Adclients = NewAdclientsService(s)
123	s.Adunits = NewAdunitsService(s)
124	s.Customchannels = NewCustomchannelsService(s)
125	s.Reports = NewReportsService(s)
126	s.Urlchannels = NewUrlchannelsService(s)
127	return s, nil
128}
129
130type Service struct {
131	client    *http.Client
132	BasePath  string // API endpoint base URL
133	UserAgent string // optional additional User-Agent fragment
134
135	Adclients *AdclientsService
136
137	Adunits *AdunitsService
138
139	Customchannels *CustomchannelsService
140
141	Reports *ReportsService
142
143	Urlchannels *UrlchannelsService
144}
145
146func (s *Service) userAgent() string {
147	if s.UserAgent == "" {
148		return googleapi.UserAgent
149	}
150	return googleapi.UserAgent + " " + s.UserAgent
151}
152
153func NewAdclientsService(s *Service) *AdclientsService {
154	rs := &AdclientsService{s: s}
155	return rs
156}
157
158type AdclientsService struct {
159	s *Service
160}
161
162func NewAdunitsService(s *Service) *AdunitsService {
163	rs := &AdunitsService{s: s}
164	rs.Customchannels = NewAdunitsCustomchannelsService(s)
165	return rs
166}
167
168type AdunitsService struct {
169	s *Service
170
171	Customchannels *AdunitsCustomchannelsService
172}
173
174func NewAdunitsCustomchannelsService(s *Service) *AdunitsCustomchannelsService {
175	rs := &AdunitsCustomchannelsService{s: s}
176	return rs
177}
178
179type AdunitsCustomchannelsService struct {
180	s *Service
181}
182
183func NewCustomchannelsService(s *Service) *CustomchannelsService {
184	rs := &CustomchannelsService{s: s}
185	rs.Adunits = NewCustomchannelsAdunitsService(s)
186	return rs
187}
188
189type CustomchannelsService struct {
190	s *Service
191
192	Adunits *CustomchannelsAdunitsService
193}
194
195func NewCustomchannelsAdunitsService(s *Service) *CustomchannelsAdunitsService {
196	rs := &CustomchannelsAdunitsService{s: s}
197	return rs
198}
199
200type CustomchannelsAdunitsService struct {
201	s *Service
202}
203
204func NewReportsService(s *Service) *ReportsService {
205	rs := &ReportsService{s: s}
206	rs.Saved = NewReportsSavedService(s)
207	return rs
208}
209
210type ReportsService struct {
211	s *Service
212
213	Saved *ReportsSavedService
214}
215
216func NewReportsSavedService(s *Service) *ReportsSavedService {
217	rs := &ReportsSavedService{s: s}
218	return rs
219}
220
221type ReportsSavedService struct {
222	s *Service
223}
224
225func NewUrlchannelsService(s *Service) *UrlchannelsService {
226	rs := &UrlchannelsService{s: s}
227	return rs
228}
229
230type UrlchannelsService struct {
231	s *Service
232}
233
234type AdClient struct {
235	// ArcOptIn: Whether this ad client is opted in to ARC.
236	ArcOptIn bool `json:"arcOptIn,omitempty"`
237
238	// Id: Unique identifier of this ad client.
239	Id string `json:"id,omitempty"`
240
241	// Kind: Kind of resource this is, in this case
242	// adexchangeseller#adClient.
243	Kind string `json:"kind,omitempty"`
244
245	// ProductCode: This ad client's product code, which corresponds to the
246	// PRODUCT_CODE report dimension.
247	ProductCode string `json:"productCode,omitempty"`
248
249	// SupportsReporting: Whether this ad client supports being reported on.
250	SupportsReporting bool `json:"supportsReporting,omitempty"`
251
252	// ForceSendFields is a list of field names (e.g. "ArcOptIn") to
253	// unconditionally include in API requests. By default, fields with
254	// empty values are omitted from API requests. However, any non-pointer,
255	// non-interface field appearing in ForceSendFields will be sent to the
256	// server regardless of whether the field is empty or not. This may be
257	// used to include empty fields in Patch requests.
258	ForceSendFields []string `json:"-"`
259
260	// NullFields is a list of field names (e.g. "ArcOptIn") to include in
261	// API requests with the JSON null value. By default, fields with empty
262	// values are omitted from API requests. However, any field with an
263	// empty value appearing in NullFields will be sent to the server as
264	// null. It is an error if a field in this list has a non-empty value.
265	// This may be used to include null fields in Patch requests.
266	NullFields []string `json:"-"`
267}
268
269func (s *AdClient) MarshalJSON() ([]byte, error) {
270	type NoMethod AdClient
271	raw := NoMethod(*s)
272	return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
273}
274
275type AdClients struct {
276	// Etag: ETag of this response for caching purposes.
277	Etag string `json:"etag,omitempty"`
278
279	// Items: The ad clients returned in this list response.
280	Items []*AdClient `json:"items,omitempty"`
281
282	// Kind: Kind of list this is, in this case adexchangeseller#adClients.
283	Kind string `json:"kind,omitempty"`
284
285	// NextPageToken: Continuation token used to page through ad clients. To
286	// retrieve the next page of results, set the next request's "pageToken"
287	// value to this.
288	NextPageToken string `json:"nextPageToken,omitempty"`
289
290	// ServerResponse contains the HTTP response code and headers from the
291	// server.
292	googleapi.ServerResponse `json:"-"`
293
294	// ForceSendFields is a list of field names (e.g. "Etag") to
295	// unconditionally include in API requests. By default, fields with
296	// empty values are omitted from API requests. However, any non-pointer,
297	// non-interface field appearing in ForceSendFields will be sent to the
298	// server regardless of whether the field is empty or not. This may be
299	// used to include empty fields in Patch requests.
300	ForceSendFields []string `json:"-"`
301
302	// NullFields is a list of field names (e.g. "Etag") to include in API
303	// requests with the JSON null value. By default, fields with empty
304	// values are omitted from API requests. However, any field with an
305	// empty value appearing in NullFields will be sent to the server as
306	// null. It is an error if a field in this list has a non-empty value.
307	// This may be used to include null fields in Patch requests.
308	NullFields []string `json:"-"`
309}
310
311func (s *AdClients) MarshalJSON() ([]byte, error) {
312	type NoMethod AdClients
313	raw := NoMethod(*s)
314	return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
315}
316
317type AdUnit struct {
318	// Code: Identity code of this ad unit, not necessarily unique across ad
319	// clients.
320	Code string `json:"code,omitempty"`
321
322	// Id: Unique identifier of this ad unit. This should be considered an
323	// opaque identifier; it is not safe to rely on it being in any
324	// particular format.
325	Id string `json:"id,omitempty"`
326
327	// Kind: Kind of resource this is, in this case adexchangeseller#adUnit.
328	Kind string `json:"kind,omitempty"`
329
330	// Name: Name of this ad unit.
331	Name string `json:"name,omitempty"`
332
333	// Status: Status of this ad unit. Possible values are:
334	// NEW: Indicates that the ad unit was created within the last seven
335	// days and does not yet have any activity associated with it.
336	//
337	// ACTIVE: Indicates that there has been activity on this ad unit in the
338	// last seven days.
339	//
340	// INACTIVE: Indicates that there has been no activity on this ad unit
341	// in the last seven days.
342	Status string `json:"status,omitempty"`
343
344	// ServerResponse contains the HTTP response code and headers from the
345	// server.
346	googleapi.ServerResponse `json:"-"`
347
348	// ForceSendFields is a list of field names (e.g. "Code") to
349	// unconditionally include in API requests. By default, fields with
350	// empty values are omitted from API requests. However, any non-pointer,
351	// non-interface field appearing in ForceSendFields will be sent to the
352	// server regardless of whether the field is empty or not. This may be
353	// used to include empty fields in Patch requests.
354	ForceSendFields []string `json:"-"`
355
356	// NullFields is a list of field names (e.g. "Code") to include in API
357	// requests with the JSON null value. By default, fields with empty
358	// values are omitted from API requests. However, any field with an
359	// empty value appearing in NullFields will be sent to the server as
360	// null. It is an error if a field in this list has a non-empty value.
361	// This may be used to include null fields in Patch requests.
362	NullFields []string `json:"-"`
363}
364
365func (s *AdUnit) MarshalJSON() ([]byte, error) {
366	type NoMethod AdUnit
367	raw := NoMethod(*s)
368	return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
369}
370
371type AdUnits struct {
372	// Etag: ETag of this response for caching purposes.
373	Etag string `json:"etag,omitempty"`
374
375	// Items: The ad units returned in this list response.
376	Items []*AdUnit `json:"items,omitempty"`
377
378	// Kind: Kind of list this is, in this case adexchangeseller#adUnits.
379	Kind string `json:"kind,omitempty"`
380
381	// NextPageToken: Continuation token used to page through ad units. To
382	// retrieve the next page of results, set the next request's "pageToken"
383	// value to this.
384	NextPageToken string `json:"nextPageToken,omitempty"`
385
386	// ServerResponse contains the HTTP response code and headers from the
387	// server.
388	googleapi.ServerResponse `json:"-"`
389
390	// ForceSendFields is a list of field names (e.g. "Etag") to
391	// unconditionally include in API requests. By default, fields with
392	// empty values are omitted from API requests. However, any non-pointer,
393	// non-interface field appearing in ForceSendFields will be sent to the
394	// server regardless of whether the field is empty or not. This may be
395	// used to include empty fields in Patch requests.
396	ForceSendFields []string `json:"-"`
397
398	// NullFields is a list of field names (e.g. "Etag") to include in API
399	// requests with the JSON null value. By default, fields with empty
400	// values are omitted from API requests. However, any field with an
401	// empty value appearing in NullFields will be sent to the server as
402	// null. It is an error if a field in this list has a non-empty value.
403	// This may be used to include null fields in Patch requests.
404	NullFields []string `json:"-"`
405}
406
407func (s *AdUnits) MarshalJSON() ([]byte, error) {
408	type NoMethod AdUnits
409	raw := NoMethod(*s)
410	return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
411}
412
413type CustomChannel struct {
414	// Code: Code of this custom channel, not necessarily unique across ad
415	// clients.
416	Code string `json:"code,omitempty"`
417
418	// Id: Unique identifier of this custom channel. This should be
419	// considered an opaque identifier; it is not safe to rely on it being
420	// in any particular format.
421	Id string `json:"id,omitempty"`
422
423	// Kind: Kind of resource this is, in this case
424	// adexchangeseller#customChannel.
425	Kind string `json:"kind,omitempty"`
426
427	// Name: Name of this custom channel.
428	Name string `json:"name,omitempty"`
429
430	// TargetingInfo: The targeting information of this custom channel, if
431	// activated.
432	TargetingInfo *CustomChannelTargetingInfo `json:"targetingInfo,omitempty"`
433
434	// ServerResponse contains the HTTP response code and headers from the
435	// server.
436	googleapi.ServerResponse `json:"-"`
437
438	// ForceSendFields is a list of field names (e.g. "Code") to
439	// unconditionally include in API requests. By default, fields with
440	// empty values are omitted from API requests. However, any non-pointer,
441	// non-interface field appearing in ForceSendFields will be sent to the
442	// server regardless of whether the field is empty or not. This may be
443	// used to include empty fields in Patch requests.
444	ForceSendFields []string `json:"-"`
445
446	// NullFields is a list of field names (e.g. "Code") to include in API
447	// requests with the JSON null value. By default, fields with empty
448	// values are omitted from API requests. However, any field with an
449	// empty value appearing in NullFields will be sent to the server as
450	// null. It is an error if a field in this list has a non-empty value.
451	// This may be used to include null fields in Patch requests.
452	NullFields []string `json:"-"`
453}
454
455func (s *CustomChannel) MarshalJSON() ([]byte, error) {
456	type NoMethod CustomChannel
457	raw := NoMethod(*s)
458	return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
459}
460
461// CustomChannelTargetingInfo: The targeting information of this custom
462// channel, if activated.
463type CustomChannelTargetingInfo struct {
464	// AdsAppearOn: The name used to describe this channel externally.
465	AdsAppearOn string `json:"adsAppearOn,omitempty"`
466
467	// Description: The external description of the channel.
468	Description string `json:"description,omitempty"`
469
470	// Location: The locations in which ads appear. (Only valid for content
471	// and mobile content ads). Acceptable values for content ads are:
472	// TOP_LEFT, TOP_CENTER, TOP_RIGHT, MIDDLE_LEFT, MIDDLE_CENTER,
473	// MIDDLE_RIGHT, BOTTOM_LEFT, BOTTOM_CENTER, BOTTOM_RIGHT,
474	// MULTIPLE_LOCATIONS. Acceptable values for mobile content ads are:
475	// TOP, MIDDLE, BOTTOM, MULTIPLE_LOCATIONS.
476	Location string `json:"location,omitempty"`
477
478	// SiteLanguage: The language of the sites ads will be displayed on.
479	SiteLanguage string `json:"siteLanguage,omitempty"`
480
481	// ForceSendFields is a list of field names (e.g. "AdsAppearOn") to
482	// unconditionally include in API requests. By default, fields with
483	// empty values are omitted from API requests. However, any non-pointer,
484	// non-interface field appearing in ForceSendFields will be sent to the
485	// server regardless of whether the field is empty or not. This may be
486	// used to include empty fields in Patch requests.
487	ForceSendFields []string `json:"-"`
488
489	// NullFields is a list of field names (e.g. "AdsAppearOn") to include
490	// in API requests with the JSON null value. By default, fields with
491	// empty values are omitted from API requests. However, any field with
492	// an empty value appearing in NullFields will be sent to the server as
493	// null. It is an error if a field in this list has a non-empty value.
494	// This may be used to include null fields in Patch requests.
495	NullFields []string `json:"-"`
496}
497
498func (s *CustomChannelTargetingInfo) MarshalJSON() ([]byte, error) {
499	type NoMethod CustomChannelTargetingInfo
500	raw := NoMethod(*s)
501	return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
502}
503
504type CustomChannels struct {
505	// Etag: ETag of this response for caching purposes.
506	Etag string `json:"etag,omitempty"`
507
508	// Items: The custom channels returned in this list response.
509	Items []*CustomChannel `json:"items,omitempty"`
510
511	// Kind: Kind of list this is, in this case
512	// adexchangeseller#customChannels.
513	Kind string `json:"kind,omitempty"`
514
515	// NextPageToken: Continuation token used to page through custom
516	// channels. To retrieve the next page of results, set the next
517	// request's "pageToken" value to this.
518	NextPageToken string `json:"nextPageToken,omitempty"`
519
520	// ServerResponse contains the HTTP response code and headers from the
521	// server.
522	googleapi.ServerResponse `json:"-"`
523
524	// ForceSendFields is a list of field names (e.g. "Etag") to
525	// unconditionally include in API requests. By default, fields with
526	// empty values are omitted from API requests. However, any non-pointer,
527	// non-interface field appearing in ForceSendFields will be sent to the
528	// server regardless of whether the field is empty or not. This may be
529	// used to include empty fields in Patch requests.
530	ForceSendFields []string `json:"-"`
531
532	// NullFields is a list of field names (e.g. "Etag") to include in API
533	// requests with the JSON null value. By default, fields with empty
534	// values are omitted from API requests. However, any field with an
535	// empty value appearing in NullFields will be sent to the server as
536	// null. It is an error if a field in this list has a non-empty value.
537	// This may be used to include null fields in Patch requests.
538	NullFields []string `json:"-"`
539}
540
541func (s *CustomChannels) MarshalJSON() ([]byte, error) {
542	type NoMethod CustomChannels
543	raw := NoMethod(*s)
544	return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
545}
546
547type Report struct {
548	// Averages: The averages of the report. This is the same length as any
549	// other row in the report; cells corresponding to dimension columns are
550	// empty.
551	Averages []string `json:"averages,omitempty"`
552
553	// Headers: The header information of the columns requested in the
554	// report. This is a list of headers; one for each dimension in the
555	// request, followed by one for each metric in the request.
556	Headers []*ReportHeaders `json:"headers,omitempty"`
557
558	// Kind: Kind this is, in this case adexchangeseller#report.
559	Kind string `json:"kind,omitempty"`
560
561	// Rows: The output rows of the report. Each row is a list of cells; one
562	// for each dimension in the request, followed by one for each metric in
563	// the request. The dimension cells contain strings, and the metric
564	// cells contain numbers.
565	Rows [][]string `json:"rows,omitempty"`
566
567	// TotalMatchedRows: The total number of rows matched by the report
568	// request. Fewer rows may be returned in the response due to being
569	// limited by the row count requested or the report row limit.
570	TotalMatchedRows int64 `json:"totalMatchedRows,omitempty,string"`
571
572	// Totals: The totals of the report. This is the same length as any
573	// other row in the report; cells corresponding to dimension columns are
574	// empty.
575	Totals []string `json:"totals,omitempty"`
576
577	// Warnings: Any warnings associated with generation of the report.
578	Warnings []string `json:"warnings,omitempty"`
579
580	// ServerResponse contains the HTTP response code and headers from the
581	// server.
582	googleapi.ServerResponse `json:"-"`
583
584	// ForceSendFields is a list of field names (e.g. "Averages") to
585	// unconditionally include in API requests. By default, fields with
586	// empty values are omitted from API requests. However, any non-pointer,
587	// non-interface field appearing in ForceSendFields will be sent to the
588	// server regardless of whether the field is empty or not. This may be
589	// used to include empty fields in Patch requests.
590	ForceSendFields []string `json:"-"`
591
592	// NullFields is a list of field names (e.g. "Averages") to include in
593	// API requests with the JSON null value. By default, fields with empty
594	// values are omitted from API requests. However, any field with an
595	// empty value appearing in NullFields will be sent to the server as
596	// null. It is an error if a field in this list has a non-empty value.
597	// This may be used to include null fields in Patch requests.
598	NullFields []string `json:"-"`
599}
600
601func (s *Report) MarshalJSON() ([]byte, error) {
602	type NoMethod Report
603	raw := NoMethod(*s)
604	return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
605}
606
607type ReportHeaders struct {
608	// Currency: The currency of this column. Only present if the header
609	// type is METRIC_CURRENCY.
610	Currency string `json:"currency,omitempty"`
611
612	// Name: The name of the header.
613	Name string `json:"name,omitempty"`
614
615	// Type: The type of the header; one of DIMENSION, METRIC_TALLY,
616	// METRIC_RATIO, or METRIC_CURRENCY.
617	Type string `json:"type,omitempty"`
618
619	// ForceSendFields is a list of field names (e.g. "Currency") to
620	// unconditionally include in API requests. By default, fields with
621	// empty values are omitted from API requests. However, any non-pointer,
622	// non-interface field appearing in ForceSendFields will be sent to the
623	// server regardless of whether the field is empty or not. This may be
624	// used to include empty fields in Patch requests.
625	ForceSendFields []string `json:"-"`
626
627	// NullFields is a list of field names (e.g. "Currency") to include in
628	// API requests with the JSON null value. By default, fields with empty
629	// values are omitted from API requests. However, any field with an
630	// empty value appearing in NullFields will be sent to the server as
631	// null. It is an error if a field in this list has a non-empty value.
632	// This may be used to include null fields in Patch requests.
633	NullFields []string `json:"-"`
634}
635
636func (s *ReportHeaders) MarshalJSON() ([]byte, error) {
637	type NoMethod ReportHeaders
638	raw := NoMethod(*s)
639	return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
640}
641
642type SavedReport struct {
643	// Id: Unique identifier of this saved report.
644	Id string `json:"id,omitempty"`
645
646	// Kind: Kind of resource this is, in this case
647	// adexchangeseller#savedReport.
648	Kind string `json:"kind,omitempty"`
649
650	// Name: This saved report's name.
651	Name string `json:"name,omitempty"`
652
653	// ForceSendFields is a list of field names (e.g. "Id") to
654	// unconditionally include in API requests. By default, fields with
655	// empty values are omitted from API requests. However, any non-pointer,
656	// non-interface field appearing in ForceSendFields will be sent to the
657	// server regardless of whether the field is empty or not. This may be
658	// used to include empty fields in Patch requests.
659	ForceSendFields []string `json:"-"`
660
661	// NullFields is a list of field names (e.g. "Id") to include in API
662	// requests with the JSON null value. By default, fields with empty
663	// values are omitted from API requests. However, any field with an
664	// empty value appearing in NullFields will be sent to the server as
665	// null. It is an error if a field in this list has a non-empty value.
666	// This may be used to include null fields in Patch requests.
667	NullFields []string `json:"-"`
668}
669
670func (s *SavedReport) MarshalJSON() ([]byte, error) {
671	type NoMethod SavedReport
672	raw := NoMethod(*s)
673	return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
674}
675
676type SavedReports struct {
677	// Etag: ETag of this response for caching purposes.
678	Etag string `json:"etag,omitempty"`
679
680	// Items: The saved reports returned in this list response.
681	Items []*SavedReport `json:"items,omitempty"`
682
683	// Kind: Kind of list this is, in this case
684	// adexchangeseller#savedReports.
685	Kind string `json:"kind,omitempty"`
686
687	// NextPageToken: Continuation token used to page through saved reports.
688	// To retrieve the next page of results, set the next request's
689	// "pageToken" value to this.
690	NextPageToken string `json:"nextPageToken,omitempty"`
691
692	// ServerResponse contains the HTTP response code and headers from the
693	// server.
694	googleapi.ServerResponse `json:"-"`
695
696	// ForceSendFields is a list of field names (e.g. "Etag") to
697	// unconditionally include in API requests. By default, fields with
698	// empty values are omitted from API requests. However, any non-pointer,
699	// non-interface field appearing in ForceSendFields will be sent to the
700	// server regardless of whether the field is empty or not. This may be
701	// used to include empty fields in Patch requests.
702	ForceSendFields []string `json:"-"`
703
704	// NullFields is a list of field names (e.g. "Etag") to include in API
705	// requests with the JSON null value. By default, fields with empty
706	// values are omitted from API requests. However, any field with an
707	// empty value appearing in NullFields will be sent to the server as
708	// null. It is an error if a field in this list has a non-empty value.
709	// This may be used to include null fields in Patch requests.
710	NullFields []string `json:"-"`
711}
712
713func (s *SavedReports) MarshalJSON() ([]byte, error) {
714	type NoMethod SavedReports
715	raw := NoMethod(*s)
716	return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
717}
718
719type UrlChannel struct {
720	// Id: Unique identifier of this URL channel. This should be considered
721	// an opaque identifier; it is not safe to rely on it being in any
722	// particular format.
723	Id string `json:"id,omitempty"`
724
725	// Kind: Kind of resource this is, in this case
726	// adexchangeseller#urlChannel.
727	Kind string `json:"kind,omitempty"`
728
729	// UrlPattern: URL Pattern of this URL channel. Does not include
730	// "http://" or "https://". Example: www.example.com/home
731	UrlPattern string `json:"urlPattern,omitempty"`
732
733	// ForceSendFields is a list of field names (e.g. "Id") to
734	// unconditionally include in API requests. By default, fields with
735	// empty values are omitted from API requests. However, any non-pointer,
736	// non-interface field appearing in ForceSendFields will be sent to the
737	// server regardless of whether the field is empty or not. This may be
738	// used to include empty fields in Patch requests.
739	ForceSendFields []string `json:"-"`
740
741	// NullFields is a list of field names (e.g. "Id") to include in API
742	// requests with the JSON null value. By default, fields with empty
743	// values are omitted from API requests. However, any field with an
744	// empty value appearing in NullFields will be sent to the server as
745	// null. It is an error if a field in this list has a non-empty value.
746	// This may be used to include null fields in Patch requests.
747	NullFields []string `json:"-"`
748}
749
750func (s *UrlChannel) MarshalJSON() ([]byte, error) {
751	type NoMethod UrlChannel
752	raw := NoMethod(*s)
753	return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
754}
755
756type UrlChannels struct {
757	// Etag: ETag of this response for caching purposes.
758	Etag string `json:"etag,omitempty"`
759
760	// Items: The URL channels returned in this list response.
761	Items []*UrlChannel `json:"items,omitempty"`
762
763	// Kind: Kind of list this is, in this case
764	// adexchangeseller#urlChannels.
765	Kind string `json:"kind,omitempty"`
766
767	// NextPageToken: Continuation token used to page through URL channels.
768	// To retrieve the next page of results, set the next request's
769	// "pageToken" value to this.
770	NextPageToken string `json:"nextPageToken,omitempty"`
771
772	// ServerResponse contains the HTTP response code and headers from the
773	// server.
774	googleapi.ServerResponse `json:"-"`
775
776	// ForceSendFields is a list of field names (e.g. "Etag") to
777	// unconditionally include in API requests. By default, fields with
778	// empty values are omitted from API requests. However, any non-pointer,
779	// non-interface field appearing in ForceSendFields will be sent to the
780	// server regardless of whether the field is empty or not. This may be
781	// used to include empty fields in Patch requests.
782	ForceSendFields []string `json:"-"`
783
784	// NullFields is a list of field names (e.g. "Etag") to include in API
785	// requests with the JSON null value. By default, fields with empty
786	// values are omitted from API requests. However, any field with an
787	// empty value appearing in NullFields will be sent to the server as
788	// null. It is an error if a field in this list has a non-empty value.
789	// This may be used to include null fields in Patch requests.
790	NullFields []string `json:"-"`
791}
792
793func (s *UrlChannels) MarshalJSON() ([]byte, error) {
794	type NoMethod UrlChannels
795	raw := NoMethod(*s)
796	return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
797}
798
799// method id "adexchangeseller.adclients.list":
800
801type AdclientsListCall struct {
802	s            *Service
803	urlParams_   gensupport.URLParams
804	ifNoneMatch_ string
805	ctx_         context.Context
806	header_      http.Header
807}
808
809// List: List all ad clients in this Ad Exchange account.
810func (r *AdclientsService) List() *AdclientsListCall {
811	c := &AdclientsListCall{s: r.s, urlParams_: make(gensupport.URLParams)}
812	return c
813}
814
815// MaxResults sets the optional parameter "maxResults": The maximum
816// number of ad clients to include in the response, used for paging.
817func (c *AdclientsListCall) MaxResults(maxResults int64) *AdclientsListCall {
818	c.urlParams_.Set("maxResults", fmt.Sprint(maxResults))
819	return c
820}
821
822// PageToken sets the optional parameter "pageToken": A continuation
823// token, used to page through ad clients. To retrieve the next page,
824// set this parameter to the value of "nextPageToken" from the previous
825// response.
826func (c *AdclientsListCall) PageToken(pageToken string) *AdclientsListCall {
827	c.urlParams_.Set("pageToken", pageToken)
828	return c
829}
830
831// Fields allows partial responses to be retrieved. See
832// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
833// for more information.
834func (c *AdclientsListCall) Fields(s ...googleapi.Field) *AdclientsListCall {
835	c.urlParams_.Set("fields", googleapi.CombineFields(s))
836	return c
837}
838
839// IfNoneMatch sets the optional parameter which makes the operation
840// fail if the object's ETag matches the given value. This is useful for
841// getting updates only after the object has changed since the last
842// request. Use googleapi.IsNotModified to check whether the response
843// error from Do is the result of In-None-Match.
844func (c *AdclientsListCall) IfNoneMatch(entityTag string) *AdclientsListCall {
845	c.ifNoneMatch_ = entityTag
846	return c
847}
848
849// Context sets the context to be used in this call's Do method. Any
850// pending HTTP request will be aborted if the provided context is
851// canceled.
852func (c *AdclientsListCall) Context(ctx context.Context) *AdclientsListCall {
853	c.ctx_ = ctx
854	return c
855}
856
857// Header returns an http.Header that can be modified by the caller to
858// add HTTP headers to the request.
859func (c *AdclientsListCall) Header() http.Header {
860	if c.header_ == nil {
861		c.header_ = make(http.Header)
862	}
863	return c.header_
864}
865
866func (c *AdclientsListCall) doRequest(alt string) (*http.Response, error) {
867	reqHeaders := make(http.Header)
868	reqHeaders.Set("x-goog-api-client", "gl-go/1.13.7 gdcl/20200203")
869	for k, v := range c.header_ {
870		reqHeaders[k] = v
871	}
872	reqHeaders.Set("User-Agent", c.s.userAgent())
873	if c.ifNoneMatch_ != "" {
874		reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
875	}
876	var body io.Reader = nil
877	c.urlParams_.Set("alt", alt)
878	c.urlParams_.Set("prettyPrint", "false")
879	urls := googleapi.ResolveRelative(c.s.BasePath, "adclients")
880	urls += "?" + c.urlParams_.Encode()
881	req, err := http.NewRequest("GET", urls, body)
882	if err != nil {
883		return nil, err
884	}
885	req.Header = reqHeaders
886	return gensupport.SendRequest(c.ctx_, c.s.client, req)
887}
888
889// Do executes the "adexchangeseller.adclients.list" call.
890// Exactly one of *AdClients or error will be non-nil. Any non-2xx
891// status code is an error. Response headers are in either
892// *AdClients.ServerResponse.Header or (if a response was returned at
893// all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
894// to check whether the returned error was because
895// http.StatusNotModified was returned.
896func (c *AdclientsListCall) Do(opts ...googleapi.CallOption) (*AdClients, error) {
897	gensupport.SetOptions(c.urlParams_, opts...)
898	res, err := c.doRequest("json")
899	if res != nil && res.StatusCode == http.StatusNotModified {
900		if res.Body != nil {
901			res.Body.Close()
902		}
903		return nil, &googleapi.Error{
904			Code:   res.StatusCode,
905			Header: res.Header,
906		}
907	}
908	if err != nil {
909		return nil, err
910	}
911	defer googleapi.CloseBody(res)
912	if err := googleapi.CheckResponse(res); err != nil {
913		return nil, err
914	}
915	ret := &AdClients{
916		ServerResponse: googleapi.ServerResponse{
917			Header:         res.Header,
918			HTTPStatusCode: res.StatusCode,
919		},
920	}
921	target := &ret
922	if err := gensupport.DecodeResponse(target, res); err != nil {
923		return nil, err
924	}
925	return ret, nil
926	// {
927	//   "description": "List all ad clients in this Ad Exchange account.",
928	//   "httpMethod": "GET",
929	//   "id": "adexchangeseller.adclients.list",
930	//   "parameters": {
931	//     "maxResults": {
932	//       "description": "The maximum number of ad clients to include in the response, used for paging.",
933	//       "format": "uint32",
934	//       "location": "query",
935	//       "maximum": "10000",
936	//       "minimum": "0",
937	//       "type": "integer"
938	//     },
939	//     "pageToken": {
940	//       "description": "A continuation token, used to page through ad clients. To retrieve the next page, set this parameter to the value of \"nextPageToken\" from the previous response.",
941	//       "location": "query",
942	//       "type": "string"
943	//     }
944	//   },
945	//   "path": "adclients",
946	//   "response": {
947	//     "$ref": "AdClients"
948	//   },
949	//   "scopes": [
950	//     "https://www.googleapis.com/auth/adexchange.seller",
951	//     "https://www.googleapis.com/auth/adexchange.seller.readonly"
952	//   ]
953	// }
954
955}
956
957// Pages invokes f for each page of results.
958// A non-nil error returned from f will halt the iteration.
959// The provided context supersedes any context provided to the Context method.
960func (c *AdclientsListCall) Pages(ctx context.Context, f func(*AdClients) error) error {
961	c.ctx_ = ctx
962	defer c.PageToken(c.urlParams_.Get("pageToken")) // reset paging to original point
963	for {
964		x, err := c.Do()
965		if err != nil {
966			return err
967		}
968		if err := f(x); err != nil {
969			return err
970		}
971		if x.NextPageToken == "" {
972			return nil
973		}
974		c.PageToken(x.NextPageToken)
975	}
976}
977
978// method id "adexchangeseller.adunits.get":
979
980type AdunitsGetCall struct {
981	s            *Service
982	adClientId   string
983	adUnitId     string
984	urlParams_   gensupport.URLParams
985	ifNoneMatch_ string
986	ctx_         context.Context
987	header_      http.Header
988}
989
990// Get: Gets the specified ad unit in the specified ad client.
991func (r *AdunitsService) Get(adClientId string, adUnitId string) *AdunitsGetCall {
992	c := &AdunitsGetCall{s: r.s, urlParams_: make(gensupport.URLParams)}
993	c.adClientId = adClientId
994	c.adUnitId = adUnitId
995	return c
996}
997
998// Fields allows partial responses to be retrieved. See
999// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
1000// for more information.
1001func (c *AdunitsGetCall) Fields(s ...googleapi.Field) *AdunitsGetCall {
1002	c.urlParams_.Set("fields", googleapi.CombineFields(s))
1003	return c
1004}
1005
1006// IfNoneMatch sets the optional parameter which makes the operation
1007// fail if the object's ETag matches the given value. This is useful for
1008// getting updates only after the object has changed since the last
1009// request. Use googleapi.IsNotModified to check whether the response
1010// error from Do is the result of In-None-Match.
1011func (c *AdunitsGetCall) IfNoneMatch(entityTag string) *AdunitsGetCall {
1012	c.ifNoneMatch_ = entityTag
1013	return c
1014}
1015
1016// Context sets the context to be used in this call's Do method. Any
1017// pending HTTP request will be aborted if the provided context is
1018// canceled.
1019func (c *AdunitsGetCall) Context(ctx context.Context) *AdunitsGetCall {
1020	c.ctx_ = ctx
1021	return c
1022}
1023
1024// Header returns an http.Header that can be modified by the caller to
1025// add HTTP headers to the request.
1026func (c *AdunitsGetCall) Header() http.Header {
1027	if c.header_ == nil {
1028		c.header_ = make(http.Header)
1029	}
1030	return c.header_
1031}
1032
1033func (c *AdunitsGetCall) doRequest(alt string) (*http.Response, error) {
1034	reqHeaders := make(http.Header)
1035	reqHeaders.Set("x-goog-api-client", "gl-go/1.13.7 gdcl/20200203")
1036	for k, v := range c.header_ {
1037		reqHeaders[k] = v
1038	}
1039	reqHeaders.Set("User-Agent", c.s.userAgent())
1040	if c.ifNoneMatch_ != "" {
1041		reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
1042	}
1043	var body io.Reader = nil
1044	c.urlParams_.Set("alt", alt)
1045	c.urlParams_.Set("prettyPrint", "false")
1046	urls := googleapi.ResolveRelative(c.s.BasePath, "adclients/{adClientId}/adunits/{adUnitId}")
1047	urls += "?" + c.urlParams_.Encode()
1048	req, err := http.NewRequest("GET", urls, body)
1049	if err != nil {
1050		return nil, err
1051	}
1052	req.Header = reqHeaders
1053	googleapi.Expand(req.URL, map[string]string{
1054		"adClientId": c.adClientId,
1055		"adUnitId":   c.adUnitId,
1056	})
1057	return gensupport.SendRequest(c.ctx_, c.s.client, req)
1058}
1059
1060// Do executes the "adexchangeseller.adunits.get" call.
1061// Exactly one of *AdUnit or error will be non-nil. Any non-2xx status
1062// code is an error. Response headers are in either
1063// *AdUnit.ServerResponse.Header or (if a response was returned at all)
1064// in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to
1065// check whether the returned error was because http.StatusNotModified
1066// was returned.
1067func (c *AdunitsGetCall) Do(opts ...googleapi.CallOption) (*AdUnit, error) {
1068	gensupport.SetOptions(c.urlParams_, opts...)
1069	res, err := c.doRequest("json")
1070	if res != nil && res.StatusCode == http.StatusNotModified {
1071		if res.Body != nil {
1072			res.Body.Close()
1073		}
1074		return nil, &googleapi.Error{
1075			Code:   res.StatusCode,
1076			Header: res.Header,
1077		}
1078	}
1079	if err != nil {
1080		return nil, err
1081	}
1082	defer googleapi.CloseBody(res)
1083	if err := googleapi.CheckResponse(res); err != nil {
1084		return nil, err
1085	}
1086	ret := &AdUnit{
1087		ServerResponse: googleapi.ServerResponse{
1088			Header:         res.Header,
1089			HTTPStatusCode: res.StatusCode,
1090		},
1091	}
1092	target := &ret
1093	if err := gensupport.DecodeResponse(target, res); err != nil {
1094		return nil, err
1095	}
1096	return ret, nil
1097	// {
1098	//   "description": "Gets the specified ad unit in the specified ad client.",
1099	//   "httpMethod": "GET",
1100	//   "id": "adexchangeseller.adunits.get",
1101	//   "parameterOrder": [
1102	//     "adClientId",
1103	//     "adUnitId"
1104	//   ],
1105	//   "parameters": {
1106	//     "adClientId": {
1107	//       "description": "Ad client for which to get the ad unit.",
1108	//       "location": "path",
1109	//       "required": true,
1110	//       "type": "string"
1111	//     },
1112	//     "adUnitId": {
1113	//       "description": "Ad unit to retrieve.",
1114	//       "location": "path",
1115	//       "required": true,
1116	//       "type": "string"
1117	//     }
1118	//   },
1119	//   "path": "adclients/{adClientId}/adunits/{adUnitId}",
1120	//   "response": {
1121	//     "$ref": "AdUnit"
1122	//   },
1123	//   "scopes": [
1124	//     "https://www.googleapis.com/auth/adexchange.seller",
1125	//     "https://www.googleapis.com/auth/adexchange.seller.readonly"
1126	//   ]
1127	// }
1128
1129}
1130
1131// method id "adexchangeseller.adunits.list":
1132
1133type AdunitsListCall struct {
1134	s            *Service
1135	adClientId   string
1136	urlParams_   gensupport.URLParams
1137	ifNoneMatch_ string
1138	ctx_         context.Context
1139	header_      http.Header
1140}
1141
1142// List: List all ad units in the specified ad client for this Ad
1143// Exchange account.
1144func (r *AdunitsService) List(adClientId string) *AdunitsListCall {
1145	c := &AdunitsListCall{s: r.s, urlParams_: make(gensupport.URLParams)}
1146	c.adClientId = adClientId
1147	return c
1148}
1149
1150// IncludeInactive sets the optional parameter "includeInactive":
1151// Whether to include inactive ad units. Default: true.
1152func (c *AdunitsListCall) IncludeInactive(includeInactive bool) *AdunitsListCall {
1153	c.urlParams_.Set("includeInactive", fmt.Sprint(includeInactive))
1154	return c
1155}
1156
1157// MaxResults sets the optional parameter "maxResults": The maximum
1158// number of ad units to include in the response, used for paging.
1159func (c *AdunitsListCall) MaxResults(maxResults int64) *AdunitsListCall {
1160	c.urlParams_.Set("maxResults", fmt.Sprint(maxResults))
1161	return c
1162}
1163
1164// PageToken sets the optional parameter "pageToken": A continuation
1165// token, used to page through ad units. To retrieve the next page, set
1166// this parameter to the value of "nextPageToken" from the previous
1167// response.
1168func (c *AdunitsListCall) PageToken(pageToken string) *AdunitsListCall {
1169	c.urlParams_.Set("pageToken", pageToken)
1170	return c
1171}
1172
1173// Fields allows partial responses to be retrieved. See
1174// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
1175// for more information.
1176func (c *AdunitsListCall) Fields(s ...googleapi.Field) *AdunitsListCall {
1177	c.urlParams_.Set("fields", googleapi.CombineFields(s))
1178	return c
1179}
1180
1181// IfNoneMatch sets the optional parameter which makes the operation
1182// fail if the object's ETag matches the given value. This is useful for
1183// getting updates only after the object has changed since the last
1184// request. Use googleapi.IsNotModified to check whether the response
1185// error from Do is the result of In-None-Match.
1186func (c *AdunitsListCall) IfNoneMatch(entityTag string) *AdunitsListCall {
1187	c.ifNoneMatch_ = entityTag
1188	return c
1189}
1190
1191// Context sets the context to be used in this call's Do method. Any
1192// pending HTTP request will be aborted if the provided context is
1193// canceled.
1194func (c *AdunitsListCall) Context(ctx context.Context) *AdunitsListCall {
1195	c.ctx_ = ctx
1196	return c
1197}
1198
1199// Header returns an http.Header that can be modified by the caller to
1200// add HTTP headers to the request.
1201func (c *AdunitsListCall) Header() http.Header {
1202	if c.header_ == nil {
1203		c.header_ = make(http.Header)
1204	}
1205	return c.header_
1206}
1207
1208func (c *AdunitsListCall) doRequest(alt string) (*http.Response, error) {
1209	reqHeaders := make(http.Header)
1210	reqHeaders.Set("x-goog-api-client", "gl-go/1.13.7 gdcl/20200203")
1211	for k, v := range c.header_ {
1212		reqHeaders[k] = v
1213	}
1214	reqHeaders.Set("User-Agent", c.s.userAgent())
1215	if c.ifNoneMatch_ != "" {
1216		reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
1217	}
1218	var body io.Reader = nil
1219	c.urlParams_.Set("alt", alt)
1220	c.urlParams_.Set("prettyPrint", "false")
1221	urls := googleapi.ResolveRelative(c.s.BasePath, "adclients/{adClientId}/adunits")
1222	urls += "?" + c.urlParams_.Encode()
1223	req, err := http.NewRequest("GET", urls, body)
1224	if err != nil {
1225		return nil, err
1226	}
1227	req.Header = reqHeaders
1228	googleapi.Expand(req.URL, map[string]string{
1229		"adClientId": c.adClientId,
1230	})
1231	return gensupport.SendRequest(c.ctx_, c.s.client, req)
1232}
1233
1234// Do executes the "adexchangeseller.adunits.list" call.
1235// Exactly one of *AdUnits or error will be non-nil. Any non-2xx status
1236// code is an error. Response headers are in either
1237// *AdUnits.ServerResponse.Header or (if a response was returned at all)
1238// in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to
1239// check whether the returned error was because http.StatusNotModified
1240// was returned.
1241func (c *AdunitsListCall) Do(opts ...googleapi.CallOption) (*AdUnits, error) {
1242	gensupport.SetOptions(c.urlParams_, opts...)
1243	res, err := c.doRequest("json")
1244	if res != nil && res.StatusCode == http.StatusNotModified {
1245		if res.Body != nil {
1246			res.Body.Close()
1247		}
1248		return nil, &googleapi.Error{
1249			Code:   res.StatusCode,
1250			Header: res.Header,
1251		}
1252	}
1253	if err != nil {
1254		return nil, err
1255	}
1256	defer googleapi.CloseBody(res)
1257	if err := googleapi.CheckResponse(res); err != nil {
1258		return nil, err
1259	}
1260	ret := &AdUnits{
1261		ServerResponse: googleapi.ServerResponse{
1262			Header:         res.Header,
1263			HTTPStatusCode: res.StatusCode,
1264		},
1265	}
1266	target := &ret
1267	if err := gensupport.DecodeResponse(target, res); err != nil {
1268		return nil, err
1269	}
1270	return ret, nil
1271	// {
1272	//   "description": "List all ad units in the specified ad client for this Ad Exchange account.",
1273	//   "httpMethod": "GET",
1274	//   "id": "adexchangeseller.adunits.list",
1275	//   "parameterOrder": [
1276	//     "adClientId"
1277	//   ],
1278	//   "parameters": {
1279	//     "adClientId": {
1280	//       "description": "Ad client for which to list ad units.",
1281	//       "location": "path",
1282	//       "required": true,
1283	//       "type": "string"
1284	//     },
1285	//     "includeInactive": {
1286	//       "description": "Whether to include inactive ad units. Default: true.",
1287	//       "location": "query",
1288	//       "type": "boolean"
1289	//     },
1290	//     "maxResults": {
1291	//       "description": "The maximum number of ad units to include in the response, used for paging.",
1292	//       "format": "uint32",
1293	//       "location": "query",
1294	//       "maximum": "10000",
1295	//       "minimum": "0",
1296	//       "type": "integer"
1297	//     },
1298	//     "pageToken": {
1299	//       "description": "A continuation token, used to page through ad units. To retrieve the next page, set this parameter to the value of \"nextPageToken\" from the previous response.",
1300	//       "location": "query",
1301	//       "type": "string"
1302	//     }
1303	//   },
1304	//   "path": "adclients/{adClientId}/adunits",
1305	//   "response": {
1306	//     "$ref": "AdUnits"
1307	//   },
1308	//   "scopes": [
1309	//     "https://www.googleapis.com/auth/adexchange.seller",
1310	//     "https://www.googleapis.com/auth/adexchange.seller.readonly"
1311	//   ]
1312	// }
1313
1314}
1315
1316// Pages invokes f for each page of results.
1317// A non-nil error returned from f will halt the iteration.
1318// The provided context supersedes any context provided to the Context method.
1319func (c *AdunitsListCall) Pages(ctx context.Context, f func(*AdUnits) error) error {
1320	c.ctx_ = ctx
1321	defer c.PageToken(c.urlParams_.Get("pageToken")) // reset paging to original point
1322	for {
1323		x, err := c.Do()
1324		if err != nil {
1325			return err
1326		}
1327		if err := f(x); err != nil {
1328			return err
1329		}
1330		if x.NextPageToken == "" {
1331			return nil
1332		}
1333		c.PageToken(x.NextPageToken)
1334	}
1335}
1336
1337// method id "adexchangeseller.adunits.customchannels.list":
1338
1339type AdunitsCustomchannelsListCall struct {
1340	s            *Service
1341	adClientId   string
1342	adUnitId     string
1343	urlParams_   gensupport.URLParams
1344	ifNoneMatch_ string
1345	ctx_         context.Context
1346	header_      http.Header
1347}
1348
1349// List: List all custom channels which the specified ad unit belongs
1350// to.
1351func (r *AdunitsCustomchannelsService) List(adClientId string, adUnitId string) *AdunitsCustomchannelsListCall {
1352	c := &AdunitsCustomchannelsListCall{s: r.s, urlParams_: make(gensupport.URLParams)}
1353	c.adClientId = adClientId
1354	c.adUnitId = adUnitId
1355	return c
1356}
1357
1358// MaxResults sets the optional parameter "maxResults": The maximum
1359// number of custom channels to include in the response, used for
1360// paging.
1361func (c *AdunitsCustomchannelsListCall) MaxResults(maxResults int64) *AdunitsCustomchannelsListCall {
1362	c.urlParams_.Set("maxResults", fmt.Sprint(maxResults))
1363	return c
1364}
1365
1366// PageToken sets the optional parameter "pageToken": A continuation
1367// token, used to page through custom channels. To retrieve the next
1368// page, set this parameter to the value of "nextPageToken" from the
1369// previous response.
1370func (c *AdunitsCustomchannelsListCall) PageToken(pageToken string) *AdunitsCustomchannelsListCall {
1371	c.urlParams_.Set("pageToken", pageToken)
1372	return c
1373}
1374
1375// Fields allows partial responses to be retrieved. See
1376// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
1377// for more information.
1378func (c *AdunitsCustomchannelsListCall) Fields(s ...googleapi.Field) *AdunitsCustomchannelsListCall {
1379	c.urlParams_.Set("fields", googleapi.CombineFields(s))
1380	return c
1381}
1382
1383// IfNoneMatch sets the optional parameter which makes the operation
1384// fail if the object's ETag matches the given value. This is useful for
1385// getting updates only after the object has changed since the last
1386// request. Use googleapi.IsNotModified to check whether the response
1387// error from Do is the result of In-None-Match.
1388func (c *AdunitsCustomchannelsListCall) IfNoneMatch(entityTag string) *AdunitsCustomchannelsListCall {
1389	c.ifNoneMatch_ = entityTag
1390	return c
1391}
1392
1393// Context sets the context to be used in this call's Do method. Any
1394// pending HTTP request will be aborted if the provided context is
1395// canceled.
1396func (c *AdunitsCustomchannelsListCall) Context(ctx context.Context) *AdunitsCustomchannelsListCall {
1397	c.ctx_ = ctx
1398	return c
1399}
1400
1401// Header returns an http.Header that can be modified by the caller to
1402// add HTTP headers to the request.
1403func (c *AdunitsCustomchannelsListCall) Header() http.Header {
1404	if c.header_ == nil {
1405		c.header_ = make(http.Header)
1406	}
1407	return c.header_
1408}
1409
1410func (c *AdunitsCustomchannelsListCall) doRequest(alt string) (*http.Response, error) {
1411	reqHeaders := make(http.Header)
1412	reqHeaders.Set("x-goog-api-client", "gl-go/1.13.7 gdcl/20200203")
1413	for k, v := range c.header_ {
1414		reqHeaders[k] = v
1415	}
1416	reqHeaders.Set("User-Agent", c.s.userAgent())
1417	if c.ifNoneMatch_ != "" {
1418		reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
1419	}
1420	var body io.Reader = nil
1421	c.urlParams_.Set("alt", alt)
1422	c.urlParams_.Set("prettyPrint", "false")
1423	urls := googleapi.ResolveRelative(c.s.BasePath, "adclients/{adClientId}/adunits/{adUnitId}/customchannels")
1424	urls += "?" + c.urlParams_.Encode()
1425	req, err := http.NewRequest("GET", urls, body)
1426	if err != nil {
1427		return nil, err
1428	}
1429	req.Header = reqHeaders
1430	googleapi.Expand(req.URL, map[string]string{
1431		"adClientId": c.adClientId,
1432		"adUnitId":   c.adUnitId,
1433	})
1434	return gensupport.SendRequest(c.ctx_, c.s.client, req)
1435}
1436
1437// Do executes the "adexchangeseller.adunits.customchannels.list" call.
1438// Exactly one of *CustomChannels or error will be non-nil. Any non-2xx
1439// status code is an error. Response headers are in either
1440// *CustomChannels.ServerResponse.Header or (if a response was returned
1441// at all) in error.(*googleapi.Error).Header. Use
1442// googleapi.IsNotModified to check whether the returned error was
1443// because http.StatusNotModified was returned.
1444func (c *AdunitsCustomchannelsListCall) Do(opts ...googleapi.CallOption) (*CustomChannels, error) {
1445	gensupport.SetOptions(c.urlParams_, opts...)
1446	res, err := c.doRequest("json")
1447	if res != nil && res.StatusCode == http.StatusNotModified {
1448		if res.Body != nil {
1449			res.Body.Close()
1450		}
1451		return nil, &googleapi.Error{
1452			Code:   res.StatusCode,
1453			Header: res.Header,
1454		}
1455	}
1456	if err != nil {
1457		return nil, err
1458	}
1459	defer googleapi.CloseBody(res)
1460	if err := googleapi.CheckResponse(res); err != nil {
1461		return nil, err
1462	}
1463	ret := &CustomChannels{
1464		ServerResponse: googleapi.ServerResponse{
1465			Header:         res.Header,
1466			HTTPStatusCode: res.StatusCode,
1467		},
1468	}
1469	target := &ret
1470	if err := gensupport.DecodeResponse(target, res); err != nil {
1471		return nil, err
1472	}
1473	return ret, nil
1474	// {
1475	//   "description": "List all custom channels which the specified ad unit belongs to.",
1476	//   "httpMethod": "GET",
1477	//   "id": "adexchangeseller.adunits.customchannels.list",
1478	//   "parameterOrder": [
1479	//     "adClientId",
1480	//     "adUnitId"
1481	//   ],
1482	//   "parameters": {
1483	//     "adClientId": {
1484	//       "description": "Ad client which contains the ad unit.",
1485	//       "location": "path",
1486	//       "required": true,
1487	//       "type": "string"
1488	//     },
1489	//     "adUnitId": {
1490	//       "description": "Ad unit for which to list custom channels.",
1491	//       "location": "path",
1492	//       "required": true,
1493	//       "type": "string"
1494	//     },
1495	//     "maxResults": {
1496	//       "description": "The maximum number of custom channels to include in the response, used for paging.",
1497	//       "format": "uint32",
1498	//       "location": "query",
1499	//       "maximum": "10000",
1500	//       "minimum": "0",
1501	//       "type": "integer"
1502	//     },
1503	//     "pageToken": {
1504	//       "description": "A continuation token, used to page through custom channels. To retrieve the next page, set this parameter to the value of \"nextPageToken\" from the previous response.",
1505	//       "location": "query",
1506	//       "type": "string"
1507	//     }
1508	//   },
1509	//   "path": "adclients/{adClientId}/adunits/{adUnitId}/customchannels",
1510	//   "response": {
1511	//     "$ref": "CustomChannels"
1512	//   },
1513	//   "scopes": [
1514	//     "https://www.googleapis.com/auth/adexchange.seller",
1515	//     "https://www.googleapis.com/auth/adexchange.seller.readonly"
1516	//   ]
1517	// }
1518
1519}
1520
1521// Pages invokes f for each page of results.
1522// A non-nil error returned from f will halt the iteration.
1523// The provided context supersedes any context provided to the Context method.
1524func (c *AdunitsCustomchannelsListCall) Pages(ctx context.Context, f func(*CustomChannels) error) error {
1525	c.ctx_ = ctx
1526	defer c.PageToken(c.urlParams_.Get("pageToken")) // reset paging to original point
1527	for {
1528		x, err := c.Do()
1529		if err != nil {
1530			return err
1531		}
1532		if err := f(x); err != nil {
1533			return err
1534		}
1535		if x.NextPageToken == "" {
1536			return nil
1537		}
1538		c.PageToken(x.NextPageToken)
1539	}
1540}
1541
1542// method id "adexchangeseller.customchannels.get":
1543
1544type CustomchannelsGetCall struct {
1545	s               *Service
1546	adClientId      string
1547	customChannelId string
1548	urlParams_      gensupport.URLParams
1549	ifNoneMatch_    string
1550	ctx_            context.Context
1551	header_         http.Header
1552}
1553
1554// Get: Get the specified custom channel from the specified ad client.
1555func (r *CustomchannelsService) Get(adClientId string, customChannelId string) *CustomchannelsGetCall {
1556	c := &CustomchannelsGetCall{s: r.s, urlParams_: make(gensupport.URLParams)}
1557	c.adClientId = adClientId
1558	c.customChannelId = customChannelId
1559	return c
1560}
1561
1562// Fields allows partial responses to be retrieved. See
1563// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
1564// for more information.
1565func (c *CustomchannelsGetCall) Fields(s ...googleapi.Field) *CustomchannelsGetCall {
1566	c.urlParams_.Set("fields", googleapi.CombineFields(s))
1567	return c
1568}
1569
1570// IfNoneMatch sets the optional parameter which makes the operation
1571// fail if the object's ETag matches the given value. This is useful for
1572// getting updates only after the object has changed since the last
1573// request. Use googleapi.IsNotModified to check whether the response
1574// error from Do is the result of In-None-Match.
1575func (c *CustomchannelsGetCall) IfNoneMatch(entityTag string) *CustomchannelsGetCall {
1576	c.ifNoneMatch_ = entityTag
1577	return c
1578}
1579
1580// Context sets the context to be used in this call's Do method. Any
1581// pending HTTP request will be aborted if the provided context is
1582// canceled.
1583func (c *CustomchannelsGetCall) Context(ctx context.Context) *CustomchannelsGetCall {
1584	c.ctx_ = ctx
1585	return c
1586}
1587
1588// Header returns an http.Header that can be modified by the caller to
1589// add HTTP headers to the request.
1590func (c *CustomchannelsGetCall) Header() http.Header {
1591	if c.header_ == nil {
1592		c.header_ = make(http.Header)
1593	}
1594	return c.header_
1595}
1596
1597func (c *CustomchannelsGetCall) doRequest(alt string) (*http.Response, error) {
1598	reqHeaders := make(http.Header)
1599	reqHeaders.Set("x-goog-api-client", "gl-go/1.13.7 gdcl/20200203")
1600	for k, v := range c.header_ {
1601		reqHeaders[k] = v
1602	}
1603	reqHeaders.Set("User-Agent", c.s.userAgent())
1604	if c.ifNoneMatch_ != "" {
1605		reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
1606	}
1607	var body io.Reader = nil
1608	c.urlParams_.Set("alt", alt)
1609	c.urlParams_.Set("prettyPrint", "false")
1610	urls := googleapi.ResolveRelative(c.s.BasePath, "adclients/{adClientId}/customchannels/{customChannelId}")
1611	urls += "?" + c.urlParams_.Encode()
1612	req, err := http.NewRequest("GET", urls, body)
1613	if err != nil {
1614		return nil, err
1615	}
1616	req.Header = reqHeaders
1617	googleapi.Expand(req.URL, map[string]string{
1618		"adClientId":      c.adClientId,
1619		"customChannelId": c.customChannelId,
1620	})
1621	return gensupport.SendRequest(c.ctx_, c.s.client, req)
1622}
1623
1624// Do executes the "adexchangeseller.customchannels.get" call.
1625// Exactly one of *CustomChannel or error will be non-nil. Any non-2xx
1626// status code is an error. Response headers are in either
1627// *CustomChannel.ServerResponse.Header or (if a response was returned
1628// at all) in error.(*googleapi.Error).Header. Use
1629// googleapi.IsNotModified to check whether the returned error was
1630// because http.StatusNotModified was returned.
1631func (c *CustomchannelsGetCall) Do(opts ...googleapi.CallOption) (*CustomChannel, error) {
1632	gensupport.SetOptions(c.urlParams_, opts...)
1633	res, err := c.doRequest("json")
1634	if res != nil && res.StatusCode == http.StatusNotModified {
1635		if res.Body != nil {
1636			res.Body.Close()
1637		}
1638		return nil, &googleapi.Error{
1639			Code:   res.StatusCode,
1640			Header: res.Header,
1641		}
1642	}
1643	if err != nil {
1644		return nil, err
1645	}
1646	defer googleapi.CloseBody(res)
1647	if err := googleapi.CheckResponse(res); err != nil {
1648		return nil, err
1649	}
1650	ret := &CustomChannel{
1651		ServerResponse: googleapi.ServerResponse{
1652			Header:         res.Header,
1653			HTTPStatusCode: res.StatusCode,
1654		},
1655	}
1656	target := &ret
1657	if err := gensupport.DecodeResponse(target, res); err != nil {
1658		return nil, err
1659	}
1660	return ret, nil
1661	// {
1662	//   "description": "Get the specified custom channel from the specified ad client.",
1663	//   "httpMethod": "GET",
1664	//   "id": "adexchangeseller.customchannels.get",
1665	//   "parameterOrder": [
1666	//     "adClientId",
1667	//     "customChannelId"
1668	//   ],
1669	//   "parameters": {
1670	//     "adClientId": {
1671	//       "description": "Ad client which contains the custom channel.",
1672	//       "location": "path",
1673	//       "required": true,
1674	//       "type": "string"
1675	//     },
1676	//     "customChannelId": {
1677	//       "description": "Custom channel to retrieve.",
1678	//       "location": "path",
1679	//       "required": true,
1680	//       "type": "string"
1681	//     }
1682	//   },
1683	//   "path": "adclients/{adClientId}/customchannels/{customChannelId}",
1684	//   "response": {
1685	//     "$ref": "CustomChannel"
1686	//   },
1687	//   "scopes": [
1688	//     "https://www.googleapis.com/auth/adexchange.seller",
1689	//     "https://www.googleapis.com/auth/adexchange.seller.readonly"
1690	//   ]
1691	// }
1692
1693}
1694
1695// method id "adexchangeseller.customchannels.list":
1696
1697type CustomchannelsListCall struct {
1698	s            *Service
1699	adClientId   string
1700	urlParams_   gensupport.URLParams
1701	ifNoneMatch_ string
1702	ctx_         context.Context
1703	header_      http.Header
1704}
1705
1706// List: List all custom channels in the specified ad client for this Ad
1707// Exchange account.
1708func (r *CustomchannelsService) List(adClientId string) *CustomchannelsListCall {
1709	c := &CustomchannelsListCall{s: r.s, urlParams_: make(gensupport.URLParams)}
1710	c.adClientId = adClientId
1711	return c
1712}
1713
1714// MaxResults sets the optional parameter "maxResults": The maximum
1715// number of custom channels to include in the response, used for
1716// paging.
1717func (c *CustomchannelsListCall) MaxResults(maxResults int64) *CustomchannelsListCall {
1718	c.urlParams_.Set("maxResults", fmt.Sprint(maxResults))
1719	return c
1720}
1721
1722// PageToken sets the optional parameter "pageToken": A continuation
1723// token, used to page through custom channels. To retrieve the next
1724// page, set this parameter to the value of "nextPageToken" from the
1725// previous response.
1726func (c *CustomchannelsListCall) PageToken(pageToken string) *CustomchannelsListCall {
1727	c.urlParams_.Set("pageToken", pageToken)
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 *CustomchannelsListCall) Fields(s ...googleapi.Field) *CustomchannelsListCall {
1735	c.urlParams_.Set("fields", googleapi.CombineFields(s))
1736	return c
1737}
1738
1739// IfNoneMatch sets the optional parameter which makes the operation
1740// fail if the object's ETag matches the given value. This is useful for
1741// getting updates only after the object has changed since the last
1742// request. Use googleapi.IsNotModified to check whether the response
1743// error from Do is the result of In-None-Match.
1744func (c *CustomchannelsListCall) IfNoneMatch(entityTag string) *CustomchannelsListCall {
1745	c.ifNoneMatch_ = entityTag
1746	return c
1747}
1748
1749// Context sets the context to be used in this call's Do method. Any
1750// pending HTTP request will be aborted if the provided context is
1751// canceled.
1752func (c *CustomchannelsListCall) Context(ctx context.Context) *CustomchannelsListCall {
1753	c.ctx_ = ctx
1754	return c
1755}
1756
1757// Header returns an http.Header that can be modified by the caller to
1758// add HTTP headers to the request.
1759func (c *CustomchannelsListCall) Header() http.Header {
1760	if c.header_ == nil {
1761		c.header_ = make(http.Header)
1762	}
1763	return c.header_
1764}
1765
1766func (c *CustomchannelsListCall) doRequest(alt string) (*http.Response, error) {
1767	reqHeaders := make(http.Header)
1768	reqHeaders.Set("x-goog-api-client", "gl-go/1.13.7 gdcl/20200203")
1769	for k, v := range c.header_ {
1770		reqHeaders[k] = v
1771	}
1772	reqHeaders.Set("User-Agent", c.s.userAgent())
1773	if c.ifNoneMatch_ != "" {
1774		reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
1775	}
1776	var body io.Reader = nil
1777	c.urlParams_.Set("alt", alt)
1778	c.urlParams_.Set("prettyPrint", "false")
1779	urls := googleapi.ResolveRelative(c.s.BasePath, "adclients/{adClientId}/customchannels")
1780	urls += "?" + c.urlParams_.Encode()
1781	req, err := http.NewRequest("GET", urls, body)
1782	if err != nil {
1783		return nil, err
1784	}
1785	req.Header = reqHeaders
1786	googleapi.Expand(req.URL, map[string]string{
1787		"adClientId": c.adClientId,
1788	})
1789	return gensupport.SendRequest(c.ctx_, c.s.client, req)
1790}
1791
1792// Do executes the "adexchangeseller.customchannels.list" call.
1793// Exactly one of *CustomChannels or error will be non-nil. Any non-2xx
1794// status code is an error. Response headers are in either
1795// *CustomChannels.ServerResponse.Header or (if a response was returned
1796// at all) in error.(*googleapi.Error).Header. Use
1797// googleapi.IsNotModified to check whether the returned error was
1798// because http.StatusNotModified was returned.
1799func (c *CustomchannelsListCall) Do(opts ...googleapi.CallOption) (*CustomChannels, error) {
1800	gensupport.SetOptions(c.urlParams_, opts...)
1801	res, err := c.doRequest("json")
1802	if res != nil && res.StatusCode == http.StatusNotModified {
1803		if res.Body != nil {
1804			res.Body.Close()
1805		}
1806		return nil, &googleapi.Error{
1807			Code:   res.StatusCode,
1808			Header: res.Header,
1809		}
1810	}
1811	if err != nil {
1812		return nil, err
1813	}
1814	defer googleapi.CloseBody(res)
1815	if err := googleapi.CheckResponse(res); err != nil {
1816		return nil, err
1817	}
1818	ret := &CustomChannels{
1819		ServerResponse: googleapi.ServerResponse{
1820			Header:         res.Header,
1821			HTTPStatusCode: res.StatusCode,
1822		},
1823	}
1824	target := &ret
1825	if err := gensupport.DecodeResponse(target, res); err != nil {
1826		return nil, err
1827	}
1828	return ret, nil
1829	// {
1830	//   "description": "List all custom channels in the specified ad client for this Ad Exchange account.",
1831	//   "httpMethod": "GET",
1832	//   "id": "adexchangeseller.customchannels.list",
1833	//   "parameterOrder": [
1834	//     "adClientId"
1835	//   ],
1836	//   "parameters": {
1837	//     "adClientId": {
1838	//       "description": "Ad client for which to list custom channels.",
1839	//       "location": "path",
1840	//       "required": true,
1841	//       "type": "string"
1842	//     },
1843	//     "maxResults": {
1844	//       "description": "The maximum number of custom channels to include in the response, used for paging.",
1845	//       "format": "uint32",
1846	//       "location": "query",
1847	//       "maximum": "10000",
1848	//       "minimum": "0",
1849	//       "type": "integer"
1850	//     },
1851	//     "pageToken": {
1852	//       "description": "A continuation token, used to page through custom channels. To retrieve the next page, set this parameter to the value of \"nextPageToken\" from the previous response.",
1853	//       "location": "query",
1854	//       "type": "string"
1855	//     }
1856	//   },
1857	//   "path": "adclients/{adClientId}/customchannels",
1858	//   "response": {
1859	//     "$ref": "CustomChannels"
1860	//   },
1861	//   "scopes": [
1862	//     "https://www.googleapis.com/auth/adexchange.seller",
1863	//     "https://www.googleapis.com/auth/adexchange.seller.readonly"
1864	//   ]
1865	// }
1866
1867}
1868
1869// Pages invokes f for each page of results.
1870// A non-nil error returned from f will halt the iteration.
1871// The provided context supersedes any context provided to the Context method.
1872func (c *CustomchannelsListCall) Pages(ctx context.Context, f func(*CustomChannels) error) error {
1873	c.ctx_ = ctx
1874	defer c.PageToken(c.urlParams_.Get("pageToken")) // reset paging to original point
1875	for {
1876		x, err := c.Do()
1877		if err != nil {
1878			return err
1879		}
1880		if err := f(x); err != nil {
1881			return err
1882		}
1883		if x.NextPageToken == "" {
1884			return nil
1885		}
1886		c.PageToken(x.NextPageToken)
1887	}
1888}
1889
1890// method id "adexchangeseller.customchannels.adunits.list":
1891
1892type CustomchannelsAdunitsListCall struct {
1893	s               *Service
1894	adClientId      string
1895	customChannelId string
1896	urlParams_      gensupport.URLParams
1897	ifNoneMatch_    string
1898	ctx_            context.Context
1899	header_         http.Header
1900}
1901
1902// List: List all ad units in the specified custom channel.
1903func (r *CustomchannelsAdunitsService) List(adClientId string, customChannelId string) *CustomchannelsAdunitsListCall {
1904	c := &CustomchannelsAdunitsListCall{s: r.s, urlParams_: make(gensupport.URLParams)}
1905	c.adClientId = adClientId
1906	c.customChannelId = customChannelId
1907	return c
1908}
1909
1910// IncludeInactive sets the optional parameter "includeInactive":
1911// Whether to include inactive ad units. Default: true.
1912func (c *CustomchannelsAdunitsListCall) IncludeInactive(includeInactive bool) *CustomchannelsAdunitsListCall {
1913	c.urlParams_.Set("includeInactive", fmt.Sprint(includeInactive))
1914	return c
1915}
1916
1917// MaxResults sets the optional parameter "maxResults": The maximum
1918// number of ad units to include in the response, used for paging.
1919func (c *CustomchannelsAdunitsListCall) MaxResults(maxResults int64) *CustomchannelsAdunitsListCall {
1920	c.urlParams_.Set("maxResults", fmt.Sprint(maxResults))
1921	return c
1922}
1923
1924// PageToken sets the optional parameter "pageToken": A continuation
1925// token, used to page through ad units. To retrieve the next page, set
1926// this parameter to the value of "nextPageToken" from the previous
1927// response.
1928func (c *CustomchannelsAdunitsListCall) PageToken(pageToken string) *CustomchannelsAdunitsListCall {
1929	c.urlParams_.Set("pageToken", pageToken)
1930	return c
1931}
1932
1933// Fields allows partial responses to be retrieved. See
1934// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
1935// for more information.
1936func (c *CustomchannelsAdunitsListCall) Fields(s ...googleapi.Field) *CustomchannelsAdunitsListCall {
1937	c.urlParams_.Set("fields", googleapi.CombineFields(s))
1938	return c
1939}
1940
1941// IfNoneMatch sets the optional parameter which makes the operation
1942// fail if the object's ETag matches the given value. This is useful for
1943// getting updates only after the object has changed since the last
1944// request. Use googleapi.IsNotModified to check whether the response
1945// error from Do is the result of In-None-Match.
1946func (c *CustomchannelsAdunitsListCall) IfNoneMatch(entityTag string) *CustomchannelsAdunitsListCall {
1947	c.ifNoneMatch_ = entityTag
1948	return c
1949}
1950
1951// Context sets the context to be used in this call's Do method. Any
1952// pending HTTP request will be aborted if the provided context is
1953// canceled.
1954func (c *CustomchannelsAdunitsListCall) Context(ctx context.Context) *CustomchannelsAdunitsListCall {
1955	c.ctx_ = ctx
1956	return c
1957}
1958
1959// Header returns an http.Header that can be modified by the caller to
1960// add HTTP headers to the request.
1961func (c *CustomchannelsAdunitsListCall) Header() http.Header {
1962	if c.header_ == nil {
1963		c.header_ = make(http.Header)
1964	}
1965	return c.header_
1966}
1967
1968func (c *CustomchannelsAdunitsListCall) doRequest(alt string) (*http.Response, error) {
1969	reqHeaders := make(http.Header)
1970	reqHeaders.Set("x-goog-api-client", "gl-go/1.13.7 gdcl/20200203")
1971	for k, v := range c.header_ {
1972		reqHeaders[k] = v
1973	}
1974	reqHeaders.Set("User-Agent", c.s.userAgent())
1975	if c.ifNoneMatch_ != "" {
1976		reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
1977	}
1978	var body io.Reader = nil
1979	c.urlParams_.Set("alt", alt)
1980	c.urlParams_.Set("prettyPrint", "false")
1981	urls := googleapi.ResolveRelative(c.s.BasePath, "adclients/{adClientId}/customchannels/{customChannelId}/adunits")
1982	urls += "?" + c.urlParams_.Encode()
1983	req, err := http.NewRequest("GET", urls, body)
1984	if err != nil {
1985		return nil, err
1986	}
1987	req.Header = reqHeaders
1988	googleapi.Expand(req.URL, map[string]string{
1989		"adClientId":      c.adClientId,
1990		"customChannelId": c.customChannelId,
1991	})
1992	return gensupport.SendRequest(c.ctx_, c.s.client, req)
1993}
1994
1995// Do executes the "adexchangeseller.customchannels.adunits.list" call.
1996// Exactly one of *AdUnits or error will be non-nil. Any non-2xx status
1997// code is an error. Response headers are in either
1998// *AdUnits.ServerResponse.Header or (if a response was returned at all)
1999// in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to
2000// check whether the returned error was because http.StatusNotModified
2001// was returned.
2002func (c *CustomchannelsAdunitsListCall) Do(opts ...googleapi.CallOption) (*AdUnits, error) {
2003	gensupport.SetOptions(c.urlParams_, opts...)
2004	res, err := c.doRequest("json")
2005	if res != nil && res.StatusCode == http.StatusNotModified {
2006		if res.Body != nil {
2007			res.Body.Close()
2008		}
2009		return nil, &googleapi.Error{
2010			Code:   res.StatusCode,
2011			Header: res.Header,
2012		}
2013	}
2014	if err != nil {
2015		return nil, err
2016	}
2017	defer googleapi.CloseBody(res)
2018	if err := googleapi.CheckResponse(res); err != nil {
2019		return nil, err
2020	}
2021	ret := &AdUnits{
2022		ServerResponse: googleapi.ServerResponse{
2023			Header:         res.Header,
2024			HTTPStatusCode: res.StatusCode,
2025		},
2026	}
2027	target := &ret
2028	if err := gensupport.DecodeResponse(target, res); err != nil {
2029		return nil, err
2030	}
2031	return ret, nil
2032	// {
2033	//   "description": "List all ad units in the specified custom channel.",
2034	//   "httpMethod": "GET",
2035	//   "id": "adexchangeseller.customchannels.adunits.list",
2036	//   "parameterOrder": [
2037	//     "adClientId",
2038	//     "customChannelId"
2039	//   ],
2040	//   "parameters": {
2041	//     "adClientId": {
2042	//       "description": "Ad client which contains the custom channel.",
2043	//       "location": "path",
2044	//       "required": true,
2045	//       "type": "string"
2046	//     },
2047	//     "customChannelId": {
2048	//       "description": "Custom channel for which to list ad units.",
2049	//       "location": "path",
2050	//       "required": true,
2051	//       "type": "string"
2052	//     },
2053	//     "includeInactive": {
2054	//       "description": "Whether to include inactive ad units. Default: true.",
2055	//       "location": "query",
2056	//       "type": "boolean"
2057	//     },
2058	//     "maxResults": {
2059	//       "description": "The maximum number of ad units to include in the response, used for paging.",
2060	//       "format": "uint32",
2061	//       "location": "query",
2062	//       "maximum": "10000",
2063	//       "minimum": "0",
2064	//       "type": "integer"
2065	//     },
2066	//     "pageToken": {
2067	//       "description": "A continuation token, used to page through ad units. To retrieve the next page, set this parameter to the value of \"nextPageToken\" from the previous response.",
2068	//       "location": "query",
2069	//       "type": "string"
2070	//     }
2071	//   },
2072	//   "path": "adclients/{adClientId}/customchannels/{customChannelId}/adunits",
2073	//   "response": {
2074	//     "$ref": "AdUnits"
2075	//   },
2076	//   "scopes": [
2077	//     "https://www.googleapis.com/auth/adexchange.seller",
2078	//     "https://www.googleapis.com/auth/adexchange.seller.readonly"
2079	//   ]
2080	// }
2081
2082}
2083
2084// Pages invokes f for each page of results.
2085// A non-nil error returned from f will halt the iteration.
2086// The provided context supersedes any context provided to the Context method.
2087func (c *CustomchannelsAdunitsListCall) Pages(ctx context.Context, f func(*AdUnits) error) error {
2088	c.ctx_ = ctx
2089	defer c.PageToken(c.urlParams_.Get("pageToken")) // reset paging to original point
2090	for {
2091		x, err := c.Do()
2092		if err != nil {
2093			return err
2094		}
2095		if err := f(x); err != nil {
2096			return err
2097		}
2098		if x.NextPageToken == "" {
2099			return nil
2100		}
2101		c.PageToken(x.NextPageToken)
2102	}
2103}
2104
2105// method id "adexchangeseller.reports.generate":
2106
2107type ReportsGenerateCall struct {
2108	s            *Service
2109	urlParams_   gensupport.URLParams
2110	ifNoneMatch_ string
2111	ctx_         context.Context
2112	header_      http.Header
2113}
2114
2115// Generate: Generate an Ad Exchange report based on the report request
2116// sent in the query parameters. Returns the result as JSON; to retrieve
2117// output in CSV format specify "alt=csv" as a query parameter.
2118func (r *ReportsService) Generate(startDate string, endDate string) *ReportsGenerateCall {
2119	c := &ReportsGenerateCall{s: r.s, urlParams_: make(gensupport.URLParams)}
2120	c.urlParams_.Set("startDate", startDate)
2121	c.urlParams_.Set("endDate", endDate)
2122	return c
2123}
2124
2125// Dimension sets the optional parameter "dimension": Dimensions to base
2126// the report on.
2127func (c *ReportsGenerateCall) Dimension(dimension ...string) *ReportsGenerateCall {
2128	c.urlParams_.SetMulti("dimension", append([]string{}, dimension...))
2129	return c
2130}
2131
2132// Filter sets the optional parameter "filter": Filters to be run on the
2133// report.
2134func (c *ReportsGenerateCall) Filter(filter ...string) *ReportsGenerateCall {
2135	c.urlParams_.SetMulti("filter", append([]string{}, filter...))
2136	return c
2137}
2138
2139// Locale sets the optional parameter "locale": Optional locale to use
2140// for translating report output to a local language. Defaults to
2141// "en_US" if not specified.
2142func (c *ReportsGenerateCall) Locale(locale string) *ReportsGenerateCall {
2143	c.urlParams_.Set("locale", locale)
2144	return c
2145}
2146
2147// MaxResults sets the optional parameter "maxResults": The maximum
2148// number of rows of report data to return.
2149func (c *ReportsGenerateCall) MaxResults(maxResults int64) *ReportsGenerateCall {
2150	c.urlParams_.Set("maxResults", fmt.Sprint(maxResults))
2151	return c
2152}
2153
2154// Metric sets the optional parameter "metric": Numeric columns to
2155// include in the report.
2156func (c *ReportsGenerateCall) Metric(metric ...string) *ReportsGenerateCall {
2157	c.urlParams_.SetMulti("metric", append([]string{}, metric...))
2158	return c
2159}
2160
2161// Sort sets the optional parameter "sort": The name of a dimension or
2162// metric to sort the resulting report on, optionally prefixed with "+"
2163// to sort ascending or "-" to sort descending. If no prefix is
2164// specified, the column is sorted ascending.
2165func (c *ReportsGenerateCall) Sort(sort ...string) *ReportsGenerateCall {
2166	c.urlParams_.SetMulti("sort", append([]string{}, sort...))
2167	return c
2168}
2169
2170// StartIndex sets the optional parameter "startIndex": Index of the
2171// first row of report data to return.
2172func (c *ReportsGenerateCall) StartIndex(startIndex int64) *ReportsGenerateCall {
2173	c.urlParams_.Set("startIndex", fmt.Sprint(startIndex))
2174	return c
2175}
2176
2177// Fields allows partial responses to be retrieved. See
2178// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
2179// for more information.
2180func (c *ReportsGenerateCall) Fields(s ...googleapi.Field) *ReportsGenerateCall {
2181	c.urlParams_.Set("fields", googleapi.CombineFields(s))
2182	return c
2183}
2184
2185// IfNoneMatch sets the optional parameter which makes the operation
2186// fail if the object's ETag matches the given value. This is useful for
2187// getting updates only after the object has changed since the last
2188// request. Use googleapi.IsNotModified to check whether the response
2189// error from Do is the result of In-None-Match.
2190func (c *ReportsGenerateCall) IfNoneMatch(entityTag string) *ReportsGenerateCall {
2191	c.ifNoneMatch_ = entityTag
2192	return c
2193}
2194
2195// Context sets the context to be used in this call's Do and Download
2196// methods. Any pending HTTP request will be aborted if the provided
2197// context is canceled.
2198func (c *ReportsGenerateCall) Context(ctx context.Context) *ReportsGenerateCall {
2199	c.ctx_ = ctx
2200	return c
2201}
2202
2203// Header returns an http.Header that can be modified by the caller to
2204// add HTTP headers to the request.
2205func (c *ReportsGenerateCall) Header() http.Header {
2206	if c.header_ == nil {
2207		c.header_ = make(http.Header)
2208	}
2209	return c.header_
2210}
2211
2212func (c *ReportsGenerateCall) doRequest(alt string) (*http.Response, error) {
2213	reqHeaders := make(http.Header)
2214	reqHeaders.Set("x-goog-api-client", "gl-go/1.13.7 gdcl/20200203")
2215	for k, v := range c.header_ {
2216		reqHeaders[k] = v
2217	}
2218	reqHeaders.Set("User-Agent", c.s.userAgent())
2219	if c.ifNoneMatch_ != "" {
2220		reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
2221	}
2222	var body io.Reader = nil
2223	c.urlParams_.Set("alt", alt)
2224	c.urlParams_.Set("prettyPrint", "false")
2225	urls := googleapi.ResolveRelative(c.s.BasePath, "reports")
2226	urls += "?" + c.urlParams_.Encode()
2227	req, err := http.NewRequest("GET", urls, body)
2228	if err != nil {
2229		return nil, err
2230	}
2231	req.Header = reqHeaders
2232	return gensupport.SendRequest(c.ctx_, c.s.client, req)
2233}
2234
2235// Download fetches the API endpoint's "media" value, instead of the normal
2236// API response value. If the returned error is nil, the Response is guaranteed to
2237// have a 2xx status code. Callers must close the Response.Body as usual.
2238func (c *ReportsGenerateCall) Download(opts ...googleapi.CallOption) (*http.Response, error) {
2239	gensupport.SetOptions(c.urlParams_, opts...)
2240	res, err := c.doRequest("media")
2241	if err != nil {
2242		return nil, err
2243	}
2244	if err := googleapi.CheckMediaResponse(res); err != nil {
2245		res.Body.Close()
2246		return nil, err
2247	}
2248	return res, nil
2249}
2250
2251// Do executes the "adexchangeseller.reports.generate" call.
2252// Exactly one of *Report or error will be non-nil. Any non-2xx status
2253// code is an error. Response headers are in either
2254// *Report.ServerResponse.Header or (if a response was returned at all)
2255// in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to
2256// check whether the returned error was because http.StatusNotModified
2257// was returned.
2258func (c *ReportsGenerateCall) Do(opts ...googleapi.CallOption) (*Report, error) {
2259	gensupport.SetOptions(c.urlParams_, opts...)
2260	res, err := c.doRequest("json")
2261	if res != nil && res.StatusCode == http.StatusNotModified {
2262		if res.Body != nil {
2263			res.Body.Close()
2264		}
2265		return nil, &googleapi.Error{
2266			Code:   res.StatusCode,
2267			Header: res.Header,
2268		}
2269	}
2270	if err != nil {
2271		return nil, err
2272	}
2273	defer googleapi.CloseBody(res)
2274	if err := googleapi.CheckResponse(res); err != nil {
2275		return nil, err
2276	}
2277	ret := &Report{
2278		ServerResponse: googleapi.ServerResponse{
2279			Header:         res.Header,
2280			HTTPStatusCode: res.StatusCode,
2281		},
2282	}
2283	target := &ret
2284	if err := gensupport.DecodeResponse(target, res); err != nil {
2285		return nil, err
2286	}
2287	return ret, nil
2288	// {
2289	//   "description": "Generate an Ad Exchange report based on the report request sent in the query parameters. Returns the result as JSON; to retrieve output in CSV format specify \"alt=csv\" as a query parameter.",
2290	//   "httpMethod": "GET",
2291	//   "id": "adexchangeseller.reports.generate",
2292	//   "parameterOrder": [
2293	//     "startDate",
2294	//     "endDate"
2295	//   ],
2296	//   "parameters": {
2297	//     "dimension": {
2298	//       "description": "Dimensions to base the report on.",
2299	//       "location": "query",
2300	//       "pattern": "[a-zA-Z_]+",
2301	//       "repeated": true,
2302	//       "type": "string"
2303	//     },
2304	//     "endDate": {
2305	//       "description": "End of the date range to report on in \"YYYY-MM-DD\" format, inclusive.",
2306	//       "location": "query",
2307	//       "pattern": "\\d{4}-\\d{2}-\\d{2}|(today|startOfMonth|startOfYear)(([\\-\\+]\\d+[dwmy]){0,3}?)",
2308	//       "required": true,
2309	//       "type": "string"
2310	//     },
2311	//     "filter": {
2312	//       "description": "Filters to be run on the report.",
2313	//       "location": "query",
2314	//       "pattern": "[a-zA-Z_]+(==|=@).+",
2315	//       "repeated": true,
2316	//       "type": "string"
2317	//     },
2318	//     "locale": {
2319	//       "description": "Optional locale to use for translating report output to a local language. Defaults to \"en_US\" if not specified.",
2320	//       "location": "query",
2321	//       "pattern": "[a-zA-Z_]+",
2322	//       "type": "string"
2323	//     },
2324	//     "maxResults": {
2325	//       "description": "The maximum number of rows of report data to return.",
2326	//       "format": "uint32",
2327	//       "location": "query",
2328	//       "maximum": "50000",
2329	//       "minimum": "0",
2330	//       "type": "integer"
2331	//     },
2332	//     "metric": {
2333	//       "description": "Numeric columns to include in the report.",
2334	//       "location": "query",
2335	//       "pattern": "[a-zA-Z_]+",
2336	//       "repeated": true,
2337	//       "type": "string"
2338	//     },
2339	//     "sort": {
2340	//       "description": "The name of a dimension or metric to sort the resulting report on, optionally prefixed with \"+\" to sort ascending or \"-\" to sort descending. If no prefix is specified, the column is sorted ascending.",
2341	//       "location": "query",
2342	//       "pattern": "(\\+|-)?[a-zA-Z_]+",
2343	//       "repeated": true,
2344	//       "type": "string"
2345	//     },
2346	//     "startDate": {
2347	//       "description": "Start of the date range to report on in \"YYYY-MM-DD\" format, inclusive.",
2348	//       "location": "query",
2349	//       "pattern": "\\d{4}-\\d{2}-\\d{2}|(today|startOfMonth|startOfYear)(([\\-\\+]\\d+[dwmy]){0,3}?)",
2350	//       "required": true,
2351	//       "type": "string"
2352	//     },
2353	//     "startIndex": {
2354	//       "description": "Index of the first row of report data to return.",
2355	//       "format": "uint32",
2356	//       "location": "query",
2357	//       "maximum": "5000",
2358	//       "minimum": "0",
2359	//       "type": "integer"
2360	//     }
2361	//   },
2362	//   "path": "reports",
2363	//   "response": {
2364	//     "$ref": "Report"
2365	//   },
2366	//   "scopes": [
2367	//     "https://www.googleapis.com/auth/adexchange.seller",
2368	//     "https://www.googleapis.com/auth/adexchange.seller.readonly"
2369	//   ],
2370	//   "supportsMediaDownload": true
2371	// }
2372
2373}
2374
2375// method id "adexchangeseller.reports.saved.generate":
2376
2377type ReportsSavedGenerateCall struct {
2378	s             *Service
2379	savedReportId string
2380	urlParams_    gensupport.URLParams
2381	ifNoneMatch_  string
2382	ctx_          context.Context
2383	header_       http.Header
2384}
2385
2386// Generate: Generate an Ad Exchange report based on the saved report ID
2387// sent in the query parameters.
2388func (r *ReportsSavedService) Generate(savedReportId string) *ReportsSavedGenerateCall {
2389	c := &ReportsSavedGenerateCall{s: r.s, urlParams_: make(gensupport.URLParams)}
2390	c.savedReportId = savedReportId
2391	return c
2392}
2393
2394// Locale sets the optional parameter "locale": Optional locale to use
2395// for translating report output to a local language. Defaults to
2396// "en_US" if not specified.
2397func (c *ReportsSavedGenerateCall) Locale(locale string) *ReportsSavedGenerateCall {
2398	c.urlParams_.Set("locale", locale)
2399	return c
2400}
2401
2402// MaxResults sets the optional parameter "maxResults": The maximum
2403// number of rows of report data to return.
2404func (c *ReportsSavedGenerateCall) MaxResults(maxResults int64) *ReportsSavedGenerateCall {
2405	c.urlParams_.Set("maxResults", fmt.Sprint(maxResults))
2406	return c
2407}
2408
2409// StartIndex sets the optional parameter "startIndex": Index of the
2410// first row of report data to return.
2411func (c *ReportsSavedGenerateCall) StartIndex(startIndex int64) *ReportsSavedGenerateCall {
2412	c.urlParams_.Set("startIndex", fmt.Sprint(startIndex))
2413	return c
2414}
2415
2416// Fields allows partial responses to be retrieved. See
2417// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
2418// for more information.
2419func (c *ReportsSavedGenerateCall) Fields(s ...googleapi.Field) *ReportsSavedGenerateCall {
2420	c.urlParams_.Set("fields", googleapi.CombineFields(s))
2421	return c
2422}
2423
2424// IfNoneMatch sets the optional parameter which makes the operation
2425// fail if the object's ETag matches the given value. This is useful for
2426// getting updates only after the object has changed since the last
2427// request. Use googleapi.IsNotModified to check whether the response
2428// error from Do is the result of In-None-Match.
2429func (c *ReportsSavedGenerateCall) IfNoneMatch(entityTag string) *ReportsSavedGenerateCall {
2430	c.ifNoneMatch_ = entityTag
2431	return c
2432}
2433
2434// Context sets the context to be used in this call's Do method. Any
2435// pending HTTP request will be aborted if the provided context is
2436// canceled.
2437func (c *ReportsSavedGenerateCall) Context(ctx context.Context) *ReportsSavedGenerateCall {
2438	c.ctx_ = ctx
2439	return c
2440}
2441
2442// Header returns an http.Header that can be modified by the caller to
2443// add HTTP headers to the request.
2444func (c *ReportsSavedGenerateCall) Header() http.Header {
2445	if c.header_ == nil {
2446		c.header_ = make(http.Header)
2447	}
2448	return c.header_
2449}
2450
2451func (c *ReportsSavedGenerateCall) doRequest(alt string) (*http.Response, error) {
2452	reqHeaders := make(http.Header)
2453	reqHeaders.Set("x-goog-api-client", "gl-go/1.13.7 gdcl/20200203")
2454	for k, v := range c.header_ {
2455		reqHeaders[k] = v
2456	}
2457	reqHeaders.Set("User-Agent", c.s.userAgent())
2458	if c.ifNoneMatch_ != "" {
2459		reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
2460	}
2461	var body io.Reader = nil
2462	c.urlParams_.Set("alt", alt)
2463	c.urlParams_.Set("prettyPrint", "false")
2464	urls := googleapi.ResolveRelative(c.s.BasePath, "reports/{savedReportId}")
2465	urls += "?" + c.urlParams_.Encode()
2466	req, err := http.NewRequest("GET", urls, body)
2467	if err != nil {
2468		return nil, err
2469	}
2470	req.Header = reqHeaders
2471	googleapi.Expand(req.URL, map[string]string{
2472		"savedReportId": c.savedReportId,
2473	})
2474	return gensupport.SendRequest(c.ctx_, c.s.client, req)
2475}
2476
2477// Do executes the "adexchangeseller.reports.saved.generate" call.
2478// Exactly one of *Report or error will be non-nil. Any non-2xx status
2479// code is an error. Response headers are in either
2480// *Report.ServerResponse.Header or (if a response was returned at all)
2481// in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to
2482// check whether the returned error was because http.StatusNotModified
2483// was returned.
2484func (c *ReportsSavedGenerateCall) Do(opts ...googleapi.CallOption) (*Report, error) {
2485	gensupport.SetOptions(c.urlParams_, opts...)
2486	res, err := c.doRequest("json")
2487	if res != nil && res.StatusCode == http.StatusNotModified {
2488		if res.Body != nil {
2489			res.Body.Close()
2490		}
2491		return nil, &googleapi.Error{
2492			Code:   res.StatusCode,
2493			Header: res.Header,
2494		}
2495	}
2496	if err != nil {
2497		return nil, err
2498	}
2499	defer googleapi.CloseBody(res)
2500	if err := googleapi.CheckResponse(res); err != nil {
2501		return nil, err
2502	}
2503	ret := &Report{
2504		ServerResponse: googleapi.ServerResponse{
2505			Header:         res.Header,
2506			HTTPStatusCode: res.StatusCode,
2507		},
2508	}
2509	target := &ret
2510	if err := gensupport.DecodeResponse(target, res); err != nil {
2511		return nil, err
2512	}
2513	return ret, nil
2514	// {
2515	//   "description": "Generate an Ad Exchange report based on the saved report ID sent in the query parameters.",
2516	//   "httpMethod": "GET",
2517	//   "id": "adexchangeseller.reports.saved.generate",
2518	//   "parameterOrder": [
2519	//     "savedReportId"
2520	//   ],
2521	//   "parameters": {
2522	//     "locale": {
2523	//       "description": "Optional locale to use for translating report output to a local language. Defaults to \"en_US\" if not specified.",
2524	//       "location": "query",
2525	//       "pattern": "[a-zA-Z_]+",
2526	//       "type": "string"
2527	//     },
2528	//     "maxResults": {
2529	//       "description": "The maximum number of rows of report data to return.",
2530	//       "format": "int32",
2531	//       "location": "query",
2532	//       "maximum": "50000",
2533	//       "minimum": "0",
2534	//       "type": "integer"
2535	//     },
2536	//     "savedReportId": {
2537	//       "description": "The saved report to retrieve.",
2538	//       "location": "path",
2539	//       "required": true,
2540	//       "type": "string"
2541	//     },
2542	//     "startIndex": {
2543	//       "description": "Index of the first row of report data to return.",
2544	//       "format": "int32",
2545	//       "location": "query",
2546	//       "maximum": "5000",
2547	//       "minimum": "0",
2548	//       "type": "integer"
2549	//     }
2550	//   },
2551	//   "path": "reports/{savedReportId}",
2552	//   "response": {
2553	//     "$ref": "Report"
2554	//   },
2555	//   "scopes": [
2556	//     "https://www.googleapis.com/auth/adexchange.seller",
2557	//     "https://www.googleapis.com/auth/adexchange.seller.readonly"
2558	//   ]
2559	// }
2560
2561}
2562
2563// method id "adexchangeseller.reports.saved.list":
2564
2565type ReportsSavedListCall struct {
2566	s            *Service
2567	urlParams_   gensupport.URLParams
2568	ifNoneMatch_ string
2569	ctx_         context.Context
2570	header_      http.Header
2571}
2572
2573// List: List all saved reports in this Ad Exchange account.
2574func (r *ReportsSavedService) List() *ReportsSavedListCall {
2575	c := &ReportsSavedListCall{s: r.s, urlParams_: make(gensupport.URLParams)}
2576	return c
2577}
2578
2579// MaxResults sets the optional parameter "maxResults": The maximum
2580// number of saved reports to include in the response, used for paging.
2581func (c *ReportsSavedListCall) MaxResults(maxResults int64) *ReportsSavedListCall {
2582	c.urlParams_.Set("maxResults", fmt.Sprint(maxResults))
2583	return c
2584}
2585
2586// PageToken sets the optional parameter "pageToken": A continuation
2587// token, used to page through saved reports. To retrieve the next page,
2588// set this parameter to the value of "nextPageToken" from the previous
2589// response.
2590func (c *ReportsSavedListCall) PageToken(pageToken string) *ReportsSavedListCall {
2591	c.urlParams_.Set("pageToken", pageToken)
2592	return c
2593}
2594
2595// Fields allows partial responses to be retrieved. See
2596// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
2597// for more information.
2598func (c *ReportsSavedListCall) Fields(s ...googleapi.Field) *ReportsSavedListCall {
2599	c.urlParams_.Set("fields", googleapi.CombineFields(s))
2600	return c
2601}
2602
2603// IfNoneMatch sets the optional parameter which makes the operation
2604// fail if the object's ETag matches the given value. This is useful for
2605// getting updates only after the object has changed since the last
2606// request. Use googleapi.IsNotModified to check whether the response
2607// error from Do is the result of In-None-Match.
2608func (c *ReportsSavedListCall) IfNoneMatch(entityTag string) *ReportsSavedListCall {
2609	c.ifNoneMatch_ = entityTag
2610	return c
2611}
2612
2613// Context sets the context to be used in this call's Do method. Any
2614// pending HTTP request will be aborted if the provided context is
2615// canceled.
2616func (c *ReportsSavedListCall) Context(ctx context.Context) *ReportsSavedListCall {
2617	c.ctx_ = ctx
2618	return c
2619}
2620
2621// Header returns an http.Header that can be modified by the caller to
2622// add HTTP headers to the request.
2623func (c *ReportsSavedListCall) Header() http.Header {
2624	if c.header_ == nil {
2625		c.header_ = make(http.Header)
2626	}
2627	return c.header_
2628}
2629
2630func (c *ReportsSavedListCall) doRequest(alt string) (*http.Response, error) {
2631	reqHeaders := make(http.Header)
2632	reqHeaders.Set("x-goog-api-client", "gl-go/1.13.7 gdcl/20200203")
2633	for k, v := range c.header_ {
2634		reqHeaders[k] = v
2635	}
2636	reqHeaders.Set("User-Agent", c.s.userAgent())
2637	if c.ifNoneMatch_ != "" {
2638		reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
2639	}
2640	var body io.Reader = nil
2641	c.urlParams_.Set("alt", alt)
2642	c.urlParams_.Set("prettyPrint", "false")
2643	urls := googleapi.ResolveRelative(c.s.BasePath, "reports/saved")
2644	urls += "?" + c.urlParams_.Encode()
2645	req, err := http.NewRequest("GET", urls, body)
2646	if err != nil {
2647		return nil, err
2648	}
2649	req.Header = reqHeaders
2650	return gensupport.SendRequest(c.ctx_, c.s.client, req)
2651}
2652
2653// Do executes the "adexchangeseller.reports.saved.list" call.
2654// Exactly one of *SavedReports or error will be non-nil. Any non-2xx
2655// status code is an error. Response headers are in either
2656// *SavedReports.ServerResponse.Header or (if a response was returned at
2657// all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
2658// to check whether the returned error was because
2659// http.StatusNotModified was returned.
2660func (c *ReportsSavedListCall) Do(opts ...googleapi.CallOption) (*SavedReports, error) {
2661	gensupport.SetOptions(c.urlParams_, opts...)
2662	res, err := c.doRequest("json")
2663	if res != nil && res.StatusCode == http.StatusNotModified {
2664		if res.Body != nil {
2665			res.Body.Close()
2666		}
2667		return nil, &googleapi.Error{
2668			Code:   res.StatusCode,
2669			Header: res.Header,
2670		}
2671	}
2672	if err != nil {
2673		return nil, err
2674	}
2675	defer googleapi.CloseBody(res)
2676	if err := googleapi.CheckResponse(res); err != nil {
2677		return nil, err
2678	}
2679	ret := &SavedReports{
2680		ServerResponse: googleapi.ServerResponse{
2681			Header:         res.Header,
2682			HTTPStatusCode: res.StatusCode,
2683		},
2684	}
2685	target := &ret
2686	if err := gensupport.DecodeResponse(target, res); err != nil {
2687		return nil, err
2688	}
2689	return ret, nil
2690	// {
2691	//   "description": "List all saved reports in this Ad Exchange account.",
2692	//   "httpMethod": "GET",
2693	//   "id": "adexchangeseller.reports.saved.list",
2694	//   "parameters": {
2695	//     "maxResults": {
2696	//       "description": "The maximum number of saved reports to include in the response, used for paging.",
2697	//       "format": "int32",
2698	//       "location": "query",
2699	//       "maximum": "100",
2700	//       "minimum": "0",
2701	//       "type": "integer"
2702	//     },
2703	//     "pageToken": {
2704	//       "description": "A continuation token, used to page through saved reports. To retrieve the next page, set this parameter to the value of \"nextPageToken\" from the previous response.",
2705	//       "location": "query",
2706	//       "type": "string"
2707	//     }
2708	//   },
2709	//   "path": "reports/saved",
2710	//   "response": {
2711	//     "$ref": "SavedReports"
2712	//   },
2713	//   "scopes": [
2714	//     "https://www.googleapis.com/auth/adexchange.seller",
2715	//     "https://www.googleapis.com/auth/adexchange.seller.readonly"
2716	//   ]
2717	// }
2718
2719}
2720
2721// Pages invokes f for each page of results.
2722// A non-nil error returned from f will halt the iteration.
2723// The provided context supersedes any context provided to the Context method.
2724func (c *ReportsSavedListCall) Pages(ctx context.Context, f func(*SavedReports) error) error {
2725	c.ctx_ = ctx
2726	defer c.PageToken(c.urlParams_.Get("pageToken")) // reset paging to original point
2727	for {
2728		x, err := c.Do()
2729		if err != nil {
2730			return err
2731		}
2732		if err := f(x); err != nil {
2733			return err
2734		}
2735		if x.NextPageToken == "" {
2736			return nil
2737		}
2738		c.PageToken(x.NextPageToken)
2739	}
2740}
2741
2742// method id "adexchangeseller.urlchannels.list":
2743
2744type UrlchannelsListCall struct {
2745	s            *Service
2746	adClientId   string
2747	urlParams_   gensupport.URLParams
2748	ifNoneMatch_ string
2749	ctx_         context.Context
2750	header_      http.Header
2751}
2752
2753// List: List all URL channels in the specified ad client for this Ad
2754// Exchange account.
2755func (r *UrlchannelsService) List(adClientId string) *UrlchannelsListCall {
2756	c := &UrlchannelsListCall{s: r.s, urlParams_: make(gensupport.URLParams)}
2757	c.adClientId = adClientId
2758	return c
2759}
2760
2761// MaxResults sets the optional parameter "maxResults": The maximum
2762// number of URL channels to include in the response, used for paging.
2763func (c *UrlchannelsListCall) MaxResults(maxResults int64) *UrlchannelsListCall {
2764	c.urlParams_.Set("maxResults", fmt.Sprint(maxResults))
2765	return c
2766}
2767
2768// PageToken sets the optional parameter "pageToken": A continuation
2769// token, used to page through URL channels. To retrieve the next page,
2770// set this parameter to the value of "nextPageToken" from the previous
2771// response.
2772func (c *UrlchannelsListCall) PageToken(pageToken string) *UrlchannelsListCall {
2773	c.urlParams_.Set("pageToken", pageToken)
2774	return c
2775}
2776
2777// Fields allows partial responses to be retrieved. See
2778// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
2779// for more information.
2780func (c *UrlchannelsListCall) Fields(s ...googleapi.Field) *UrlchannelsListCall {
2781	c.urlParams_.Set("fields", googleapi.CombineFields(s))
2782	return c
2783}
2784
2785// IfNoneMatch sets the optional parameter which makes the operation
2786// fail if the object's ETag matches the given value. This is useful for
2787// getting updates only after the object has changed since the last
2788// request. Use googleapi.IsNotModified to check whether the response
2789// error from Do is the result of In-None-Match.
2790func (c *UrlchannelsListCall) IfNoneMatch(entityTag string) *UrlchannelsListCall {
2791	c.ifNoneMatch_ = entityTag
2792	return c
2793}
2794
2795// Context sets the context to be used in this call's Do method. Any
2796// pending HTTP request will be aborted if the provided context is
2797// canceled.
2798func (c *UrlchannelsListCall) Context(ctx context.Context) *UrlchannelsListCall {
2799	c.ctx_ = ctx
2800	return c
2801}
2802
2803// Header returns an http.Header that can be modified by the caller to
2804// add HTTP headers to the request.
2805func (c *UrlchannelsListCall) Header() http.Header {
2806	if c.header_ == nil {
2807		c.header_ = make(http.Header)
2808	}
2809	return c.header_
2810}
2811
2812func (c *UrlchannelsListCall) doRequest(alt string) (*http.Response, error) {
2813	reqHeaders := make(http.Header)
2814	reqHeaders.Set("x-goog-api-client", "gl-go/1.13.7 gdcl/20200203")
2815	for k, v := range c.header_ {
2816		reqHeaders[k] = v
2817	}
2818	reqHeaders.Set("User-Agent", c.s.userAgent())
2819	if c.ifNoneMatch_ != "" {
2820		reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
2821	}
2822	var body io.Reader = nil
2823	c.urlParams_.Set("alt", alt)
2824	c.urlParams_.Set("prettyPrint", "false")
2825	urls := googleapi.ResolveRelative(c.s.BasePath, "adclients/{adClientId}/urlchannels")
2826	urls += "?" + c.urlParams_.Encode()
2827	req, err := http.NewRequest("GET", urls, body)
2828	if err != nil {
2829		return nil, err
2830	}
2831	req.Header = reqHeaders
2832	googleapi.Expand(req.URL, map[string]string{
2833		"adClientId": c.adClientId,
2834	})
2835	return gensupport.SendRequest(c.ctx_, c.s.client, req)
2836}
2837
2838// Do executes the "adexchangeseller.urlchannels.list" call.
2839// Exactly one of *UrlChannels or error will be non-nil. Any non-2xx
2840// status code is an error. Response headers are in either
2841// *UrlChannels.ServerResponse.Header or (if a response was returned at
2842// all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
2843// to check whether the returned error was because
2844// http.StatusNotModified was returned.
2845func (c *UrlchannelsListCall) Do(opts ...googleapi.CallOption) (*UrlChannels, error) {
2846	gensupport.SetOptions(c.urlParams_, opts...)
2847	res, err := c.doRequest("json")
2848	if res != nil && res.StatusCode == http.StatusNotModified {
2849		if res.Body != nil {
2850			res.Body.Close()
2851		}
2852		return nil, &googleapi.Error{
2853			Code:   res.StatusCode,
2854			Header: res.Header,
2855		}
2856	}
2857	if err != nil {
2858		return nil, err
2859	}
2860	defer googleapi.CloseBody(res)
2861	if err := googleapi.CheckResponse(res); err != nil {
2862		return nil, err
2863	}
2864	ret := &UrlChannels{
2865		ServerResponse: googleapi.ServerResponse{
2866			Header:         res.Header,
2867			HTTPStatusCode: res.StatusCode,
2868		},
2869	}
2870	target := &ret
2871	if err := gensupport.DecodeResponse(target, res); err != nil {
2872		return nil, err
2873	}
2874	return ret, nil
2875	// {
2876	//   "description": "List all URL channels in the specified ad client for this Ad Exchange account.",
2877	//   "httpMethod": "GET",
2878	//   "id": "adexchangeseller.urlchannels.list",
2879	//   "parameterOrder": [
2880	//     "adClientId"
2881	//   ],
2882	//   "parameters": {
2883	//     "adClientId": {
2884	//       "description": "Ad client for which to list URL channels.",
2885	//       "location": "path",
2886	//       "required": true,
2887	//       "type": "string"
2888	//     },
2889	//     "maxResults": {
2890	//       "description": "The maximum number of URL channels to include in the response, used for paging.",
2891	//       "format": "uint32",
2892	//       "location": "query",
2893	//       "maximum": "10000",
2894	//       "minimum": "0",
2895	//       "type": "integer"
2896	//     },
2897	//     "pageToken": {
2898	//       "description": "A continuation token, used to page through URL channels. To retrieve the next page, set this parameter to the value of \"nextPageToken\" from the previous response.",
2899	//       "location": "query",
2900	//       "type": "string"
2901	//     }
2902	//   },
2903	//   "path": "adclients/{adClientId}/urlchannels",
2904	//   "response": {
2905	//     "$ref": "UrlChannels"
2906	//   },
2907	//   "scopes": [
2908	//     "https://www.googleapis.com/auth/adexchange.seller",
2909	//     "https://www.googleapis.com/auth/adexchange.seller.readonly"
2910	//   ]
2911	// }
2912
2913}
2914
2915// Pages invokes f for each page of results.
2916// A non-nil error returned from f will halt the iteration.
2917// The provided context supersedes any context provided to the Context method.
2918func (c *UrlchannelsListCall) Pages(ctx context.Context, f func(*UrlChannels) error) error {
2919	c.ctx_ = ctx
2920	defer c.PageToken(c.urlParams_.Get("pageToken")) // reset paging to original point
2921	for {
2922		x, err := c.Do()
2923		if err != nil {
2924			return err
2925		}
2926		if err := f(x); err != nil {
2927			return err
2928		}
2929		if x.NextPageToken == "" {
2930			return nil
2931		}
2932		c.PageToken(x.NextPageToken)
2933	}
2934}
2935