Debian Codegraph @

adexchangebuyer/v1.3/adexchangebuyer-gen.go

raw
1 // Copyright 2021 Google LLC.
2 // Use of this source code is governed by a BSD-style
3 // license that can be found in the LICENSE file.
4
5 // Code generated file. DO NOT EDIT.
6
7 // Package adexchangebuyer provides access to the Ad Exchange Buyer API.
8 //
9 // For product documentation, see: https://developers.google.com/ad-exchange/buyer-rest
10 //
11 // # Creating a client
12 //
13 // Usage example:
14 //
15 // import "google.golang.org/api/adexchangebuyer/v1.3"
16 // ...
17 // ctx := context.Background()
18 // adexchangebuyerService, err := adexchangebuyer.NewService(ctx)
19 //
20 // In this example, Google Application Default Credentials are used for authentication.
21 //
22 // For information on how to create and obtain Application Default Credentials, see https://developers.google.com/identity/protocols/application-default-credentials.
23 //
24 // # Other authentication options
25 //
26 // To use an API key for authentication (note: some APIs do not support API keys), use option.WithAPIKey:
27 //
28 // adexchangebuyerService, err := adexchangebuyer.NewService(ctx, option.WithAPIKey("AIza..."))
29 //
30 // To use an OAuth token (e.g., a user token obtained via a three-legged OAuth flow), use option.WithTokenSource:
31 //
32 // config := &oauth2.Config{...}
33 // // ...
34 // token, err := config.Exchange(ctx, ...)
35 // adexchangebuyerService, err := adexchangebuyer.NewService(ctx, option.WithTokenSource(config.TokenSource(ctx, token)))
36 //
37 // See https://godoc.org/google.golang.org/api/option/ for details on options.
38 package adexchangebuyer // import "google.golang.org/api/adexchangebuyer/v1.3"
39
40 import (
41 "bytes"
42 "context"
43 "encoding/json"
44 "errors"
45 "fmt"
46 "io"
47 "net/http"
48 "net/url"
49 "strconv"
50 "strings"
51
52 googleapi "google.golang.org/api/googleapi"
53 gensupport "google.golang.org/api/internal/gensupport"
54 option "google.golang.org/api/option"
55 internaloption "google.golang.org/api/option/internaloption"
56 htransport "google.golang.org/api/transport/http"
57 )
58
59 // Always reference these packages, just in case the auto-generated code
60 // below doesn't.
61 var _ = bytes.NewBuffer
62 var _ = strconv.Itoa
63 var _ = fmt.Sprintf
64 var _ = json.NewDecoder
65 var _ = io.Copy
66 var _ = url.Parse
67 var _ = gensupport.MarshalJSON
68 var _ = googleapi.Version
69 var _ = errors.New
70 var _ = strings.Replace
71 var _ = context.Canceled
72 var _ = internaloption.WithDefaultEndpoint
73
74 const apiId = "adexchangebuyer:v1.3"
75 const apiName = "adexchangebuyer"
76 const apiVersion = "v1.3"
77 const basePath = "https://www.googleapis.com/adexchangebuyer/v1.3/"
78
79 // OAuth2 scopes used by this API.
80 const (
81 // Manage your Ad Exchange buyer account configuration
82 AdexchangeBuyerScope = "https://www.googleapis.com/auth/adexchange.buyer"
83 )
84
85 // NewService creates a new Service.
86 func NewService(ctx context.Context, opts ...option.ClientOption) (*Service, error) {
87 scopesOption := option.WithScopes(
88 "https://www.googleapis.com/auth/adexchange.buyer",
89 )
90 // NOTE: prepend, so we don't override user-specified scopes.
91 opts = append([]option.ClientOption{scopesOption}, opts...)
92 opts = append(opts, internaloption.WithDefaultEndpoint(basePath))
93 client, endpoint, err := htransport.NewClient(ctx, opts...)
94 if err != nil {
95 return nil, err
96 }
97 s, err := New(client)
98 if err != nil {
99 return nil, err
100 }
101 if endpoint != "" {
102 s.BasePath = endpoint
103 }
104 return s, nil
105 }
106
107 // New creates a new Service. It uses the provided http.Client for requests.
108 //
109 // Deprecated: please use NewService instead.
110 // To provide a custom HTTP client, use option.WithHTTPClient.
111 // If you are using google.golang.org/api/googleapis/transport.APIKey, use option.WithAPIKey with NewService instead.
112 func New(client *http.Client) (*Service, error) {
113 if client == nil {
114 return nil, errors.New("client is nil")
115 }
116 s := &Service{client: client, BasePath: basePath}
117 s.Accounts = NewAccountsService(s)
118 s.BillingInfo = NewBillingInfoService(s)
119 s.Budget = NewBudgetService(s)
120 s.Creatives = NewCreativesService(s)
121 s.DirectDeals = NewDirectDealsService(s)
122 s.PerformanceReport = NewPerformanceReportService(s)
123 s.PretargetingConfig = NewPretargetingConfigService(s)
124 return s, nil
125 }
126
127 type Service struct {
128 client *http.Client
129 BasePath string // API endpoint base URL
130 UserAgent string // optional additional User-Agent fragment
131
132 Accounts *AccountsService
133
134 BillingInfo *BillingInfoService
135
136 Budget *BudgetService
137
138 Creatives *CreativesService
139
140 DirectDeals *DirectDealsService
141
142 PerformanceReport *PerformanceReportService
143
144 PretargetingConfig *PretargetingConfigService
145 }
146
147 func (s *Service) userAgent() string {
148 if s.UserAgent == "" {
149 return googleapi.UserAgent
150 }
151 return googleapi.UserAgent + " " + s.UserAgent
152 }
153
154 func NewAccountsService(s *Service) *AccountsService {
155 rs := &AccountsService{s: s}
156 return rs
157 }
158
159 type AccountsService struct {
160 s *Service
161 }
162
163 func NewBillingInfoService(s *Service) *BillingInfoService {
164 rs := &BillingInfoService{s: s}
165 return rs
166 }
167
168 type BillingInfoService struct {
169 s *Service
170 }
171
172 func NewBudgetService(s *Service) *BudgetService {
173 rs := &BudgetService{s: s}
174 return rs
175 }
176
177 type BudgetService struct {
178 s *Service
179 }
180
181 func NewCreativesService(s *Service) *CreativesService {
182 rs := &CreativesService{s: s}
183 return rs
184 }
185
186 type CreativesService struct {
187 s *Service
188 }
189
190 func NewDirectDealsService(s *Service) *DirectDealsService {
191 rs := &DirectDealsService{s: s}
192 return rs
193 }
194
195 type DirectDealsService struct {
196 s *Service
197 }
198
199 func NewPerformanceReportService(s *Service) *PerformanceReportService {
200 rs := &PerformanceReportService{s: s}
201 return rs
202 }
203
204 type PerformanceReportService struct {
205 s *Service
206 }
207
208 func NewPretargetingConfigService(s *Service) *PretargetingConfigService {
209 rs := &PretargetingConfigService{s: s}
210 return rs
211 }
212
213 type PretargetingConfigService struct {
214 s *Service
215 }
216
217 // Account: Configuration data for an Ad Exchange buyer account.
218 type Account struct {
219 // BidderLocation: Your bidder locations that have distinct URLs.
220 BidderLocation []*AccountBidderLocation `json:"bidderLocation,omitempty"`
221
222 // CookieMatchingNid: The nid parameter value used in cookie match
223 // requests. Please contact your technical account manager if you need
224 // to change this.
225 CookieMatchingNid string `json:"cookieMatchingNid,omitempty"`
226
227 // CookieMatchingUrl: The base URL used in cookie match requests.
228 CookieMatchingUrl string `json:"cookieMatchingUrl,omitempty"`
229
230 // Id: Account id.
231 Id int64 `json:"id,omitempty"`
232
233 // Kind: Resource type.
234 Kind string `json:"kind,omitempty"`
235
236 // MaximumActiveCreatives: The maximum number of active creatives that
237 // an account can have, where a creative is active if it was inserted or
238 // bid with in the last 30 days. Please contact your technical account
239 // manager if you need to change this.
240 MaximumActiveCreatives int64 `json:"maximumActiveCreatives,omitempty"`
241
242 // MaximumTotalQps: The sum of all bidderLocation.maximumQps values
243 // cannot exceed this. Please contact your technical account manager if
244 // you need to change this.
245 MaximumTotalQps int64 `json:"maximumTotalQps,omitempty"`
246
247 // NumberActiveCreatives: The number of creatives that this account
248 // inserted or bid with in the last 30 days.
249 NumberActiveCreatives int64 `json:"numberActiveCreatives,omitempty"`
250
251 // ServerResponse contains the HTTP response code and headers from the
252 // server.
253 googleapi.ServerResponse `json:"-"`
254
255 // ForceSendFields is a list of field names (e.g. "BidderLocation") to
256 // unconditionally include in API requests. By default, fields with
257 // empty or default values are omitted from API requests. However, any
258 // non-pointer, non-interface field appearing in ForceSendFields will be
259 // sent to the server regardless of whether the field is empty or not.
260 // This may be used to include empty fields in Patch requests.
261 ForceSendFields []string `json:"-"`
262
263 // NullFields is a list of field names (e.g. "BidderLocation") to
264 // include in API requests with the JSON null value. By default, fields
265 // with empty values are omitted from API requests. However, any field
266 // with an empty value appearing in NullFields will be sent to the
267 // server as null. It is an error if a field in this list has a
268 // non-empty value. This may be used to include null fields in Patch
269 // requests.
270 NullFields []string `json:"-"`
271 }
272
273 func (s *Account) MarshalJSON() ([]byte, error) {
274 type NoMethod Account
275 raw := NoMethod(*s)
276 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
277 }
278
279 type AccountBidderLocation struct {
280 // MaximumQps: The maximum queries per second the Ad Exchange will send.
281 MaximumQps int64 `json:"maximumQps,omitempty"`
282
283 // Region: The geographical region the Ad Exchange should send requests
284 // from. Only used by some quota systems, but always setting the value
285 // is recommended. Allowed values:
286 // - ASIA
287 // - EUROPE
288 // - US_EAST
289 // - US_WEST
290 Region string `json:"region,omitempty"`
291
292 // Url: The URL to which the Ad Exchange will send bid requests.
293 Url string `json:"url,omitempty"`
294
295 // ForceSendFields is a list of field names (e.g. "MaximumQps") to
296 // unconditionally include in API requests. By default, fields with
297 // empty or default values are omitted from API requests. However, any
298 // non-pointer, non-interface field appearing in ForceSendFields will be
299 // sent to the server regardless of whether the field is empty or not.
300 // This may be used to include empty fields in Patch requests.
301 ForceSendFields []string `json:"-"`
302
303 // NullFields is a list of field names (e.g. "MaximumQps") to include in
304 // API requests with the JSON null value. By default, fields with empty
305 // values are omitted from API requests. However, any field with an
306 // empty value appearing in NullFields will be sent to the server as
307 // null. It is an error if a field in this list has a non-empty value.
308 // This may be used to include null fields in Patch requests.
309 NullFields []string `json:"-"`
310 }
311
312 func (s *AccountBidderLocation) MarshalJSON() ([]byte, error) {
313 type NoMethod AccountBidderLocation
314 raw := NoMethod(*s)
315 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
316 }
317
318 // AccountsList: An account feed lists Ad Exchange buyer accounts that
319 // the user has access to. Each entry in the feed corresponds to a
320 // single buyer account.
321 type AccountsList struct {
322 // Items: A list of accounts.
323 Items []*Account `json:"items,omitempty"`
324
325 // Kind: Resource type.
326 Kind string `json:"kind,omitempty"`
327
328 // ServerResponse contains the HTTP response code and headers from the
329 // server.
330 googleapi.ServerResponse `json:"-"`
331
332 // ForceSendFields is a list of field names (e.g. "Items") to
333 // unconditionally include in API requests. By default, fields with
334 // empty or default values are omitted from API requests. However, any
335 // non-pointer, non-interface field appearing in ForceSendFields will be
336 // sent to the server regardless of whether the field is empty or not.
337 // This may be used to include empty fields in Patch requests.
338 ForceSendFields []string `json:"-"`
339
340 // NullFields is a list of field names (e.g. "Items") to include in API
341 // requests with the JSON null value. By default, fields with empty
342 // values are omitted from API requests. However, any field with an
343 // empty value appearing in NullFields will be sent to the server as
344 // null. It is an error if a field in this list has a non-empty value.
345 // This may be used to include null fields in Patch requests.
346 NullFields []string `json:"-"`
347 }
348
349 func (s *AccountsList) MarshalJSON() ([]byte, error) {
350 type NoMethod AccountsList
351 raw := NoMethod(*s)
352 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
353 }
354
355 // BillingInfo: The configuration data for an Ad Exchange billing info.
356 type BillingInfo struct {
357 // AccountId: Account id.
358 AccountId int64 `json:"accountId,omitempty"`
359
360 // AccountName: Account name.
361 AccountName string `json:"accountName,omitempty"`
362
363 // BillingId: A list of adgroup IDs associated with this particular
364 // account. These IDs may show up as part of a realtime bidding
365 // BidRequest, which indicates a bid request for this account.
366 BillingId []string `json:"billingId,omitempty"`
367
368 // Kind: Resource type.
369 Kind string `json:"kind,omitempty"`
370
371 // ServerResponse contains the HTTP response code and headers from the
372 // server.
373 googleapi.ServerResponse `json:"-"`
374
375 // ForceSendFields is a list of field names (e.g. "AccountId") to
376 // unconditionally include in API requests. By default, fields with
377 // empty or default values are omitted from API requests. However, any
378 // non-pointer, non-interface field appearing in ForceSendFields will be
379 // sent to the server regardless of whether the field is empty or not.
380 // This may be used to include empty fields in Patch requests.
381 ForceSendFields []string `json:"-"`
382
383 // NullFields is a list of field names (e.g. "AccountId") to include in
384 // API requests with the JSON null value. By default, fields with empty
385 // values are omitted from API requests. However, any field with an
386 // empty value appearing in NullFields will be sent to the server as
387 // null. It is an error if a field in this list has a non-empty value.
388 // This may be used to include null fields in Patch requests.
389 NullFields []string `json:"-"`
390 }
391
392 func (s *BillingInfo) MarshalJSON() ([]byte, error) {
393 type NoMethod BillingInfo
394 raw := NoMethod(*s)
395 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
396 }
397
398 // BillingInfoList: A billing info feed lists Billing Info the Ad
399 // Exchange buyer account has access to. Each entry in the feed
400 // corresponds to a single billing info.
401 type BillingInfoList struct {
402 // Items: A list of billing info relevant for your account.
403 Items []*BillingInfo `json:"items,omitempty"`
404
405 // Kind: Resource type.
406 Kind string `json:"kind,omitempty"`
407
408 // ServerResponse contains the HTTP response code and headers from the
409 // server.
410 googleapi.ServerResponse `json:"-"`
411
412 // ForceSendFields is a list of field names (e.g. "Items") to
413 // unconditionally include in API requests. By default, fields with
414 // empty or default values are omitted from API requests. However, any
415 // non-pointer, non-interface field appearing in ForceSendFields will be
416 // sent to the server regardless of whether the field is empty or not.
417 // This may be used to include empty fields in Patch requests.
418 ForceSendFields []string `json:"-"`
419
420 // NullFields is a list of field names (e.g. "Items") to include in API
421 // requests with the JSON null value. By default, fields with empty
422 // values are omitted from API requests. However, any field with an
423 // empty value appearing in NullFields will be sent to the server as
424 // null. It is an error if a field in this list has a non-empty value.
425 // This may be used to include null fields in Patch requests.
426 NullFields []string `json:"-"`
427 }
428
429 func (s *BillingInfoList) MarshalJSON() ([]byte, error) {
430 type NoMethod BillingInfoList
431 raw := NoMethod(*s)
432 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
433 }
434
435 // Budget: The configuration data for Ad Exchange RTB - Budget API.
436 type Budget struct {
437 // AccountId: The id of the account. This is required for get and update
438 // requests.
439 AccountId int64 `json:"accountId,omitempty,string"`
440
441 // BillingId: The billing id to determine which adgroup to provide
442 // budget information for. This is required for get and update requests.
443 BillingId int64 `json:"billingId,omitempty,string"`
444
445 // BudgetAmount: The daily budget amount in unit amount of the account
446 // currency to apply for the billingId provided. This is required for
447 // update requests.
448 BudgetAmount int64 `json:"budgetAmount,omitempty,string"`
449
450 // CurrencyCode: The currency code for the buyer. This cannot be altered
451 // here.
452 CurrencyCode string `json:"currencyCode,omitempty"`
453
454 // Id: The unique id that describes this item.
455 Id string `json:"id,omitempty"`
456
457 // Kind: The kind of the resource, i.e. "adexchangebuyer#budget".
458 Kind string `json:"kind,omitempty"`
459
460 // ServerResponse contains the HTTP response code and headers from the
461 // server.
462 googleapi.ServerResponse `json:"-"`
463
464 // ForceSendFields is a list of field names (e.g. "AccountId") to
465 // unconditionally include in API requests. By default, fields with
466 // empty or default values are omitted from API requests. However, any
467 // non-pointer, non-interface field appearing in ForceSendFields will be
468 // sent to the server regardless of whether the field is empty or not.
469 // This may be used to include empty fields in Patch requests.
470 ForceSendFields []string `json:"-"`
471
472 // NullFields is a list of field names (e.g. "AccountId") to include in
473 // API requests with the JSON null value. By default, fields with empty
474 // values are omitted from API requests. However, any field with an
475 // empty value appearing in NullFields will be sent to the server as
476 // null. It is an error if a field in this list has a non-empty value.
477 // This may be used to include null fields in Patch requests.
478 NullFields []string `json:"-"`
479 }
480
481 func (s *Budget) MarshalJSON() ([]byte, error) {
482 type NoMethod Budget
483 raw := NoMethod(*s)
484 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
485 }
486
487 // Creative: A creative and its classification data.
488 type Creative struct {
489 // HTMLSnippet: The HTML snippet that displays the ad when inserted in
490 // the web page. If set, videoURL should not be set.
491 HTMLSnippet string `json:"HTMLSnippet,omitempty"`
492
493 // AccountId: Account id.
494 AccountId int64 `json:"accountId,omitempty"`
495
496 AdTechnologyProviders *CreativeAdTechnologyProviders `json:"adTechnologyProviders,omitempty"`
497
498 // AdvertiserId: Detected advertiser id, if any. Read-only. This field
499 // should not be set in requests.
500 AdvertiserId googleapi.Int64s `json:"advertiserId,omitempty"`
501
502 // AdvertiserName: The name of the company being advertised in the
503 // creative.
504 AdvertiserName string `json:"advertiserName,omitempty"`
505
506 // AgencyId: The agency id for this creative.
507 AgencyId int64 `json:"agencyId,omitempty,string"`
508
509 // ApiUploadTimestamp: The last upload timestamp of this creative if it
510 // was uploaded via API. Read-only. The value of this field is
511 // generated, and will be ignored for uploads. (formatted RFC 3339
512 // timestamp).
513 ApiUploadTimestamp string `json:"apiUploadTimestamp,omitempty"`
514
515 // Attribute: All attributes for the ads that may be shown from this
516 // snippet.
517 Attribute []int64 `json:"attribute,omitempty"`
518
519 // BuyerCreativeId: A buyer-specific id identifying the creative in this
520 // ad.
521 BuyerCreativeId string `json:"buyerCreativeId,omitempty"`
522
523 // ClickThroughUrl: The set of destination urls for the snippet.
524 ClickThroughUrl []string `json:"clickThroughUrl,omitempty"`
525
526 // Corrections: Shows any corrections that were applied to this
527 // creative. Read-only. This field should not be set in requests.
528 Corrections []*CreativeCorrections `json:"corrections,omitempty"`
529
530 // DisapprovalReasons: The reasons for disapproval, if any. Note that
531 // not all disapproval reasons may be categorized, so it is possible for
532 // the creative to have a status of DISAPPROVED with an empty list for
533 // disapproval_reasons. In this case, please reach out to your TAM to
534 // help debug the issue. Read-only. This field should not be set in
535 // requests.
536 DisapprovalReasons []*CreativeDisapprovalReasons `json:"disapprovalReasons,omitempty"`
537
538 // FilteringReasons: The filtering reasons for the creative. Read-only.
539 // This field should not be set in requests.
540 FilteringReasons *CreativeFilteringReasons `json:"filteringReasons,omitempty"`
541
542 // Height: Ad height.
543 Height int64 `json:"height,omitempty"`
544
545 // ImpressionTrackingUrl: The set of urls to be called to record an
546 // impression.
547 ImpressionTrackingUrl []string `json:"impressionTrackingUrl,omitempty"`
548
549 // Kind: Resource type.
550 Kind string `json:"kind,omitempty"`
551
552 // NativeAd: If nativeAd is set, HTMLSnippet and videoURL should not be
553 // set.
554 NativeAd *CreativeNativeAd `json:"nativeAd,omitempty"`
555
556 // ProductCategories: Detected product categories, if any. Read-only.
557 // This field should not be set in requests.
558 ProductCategories []int64 `json:"productCategories,omitempty"`
559
560 // RestrictedCategories: All restricted categories for the ads that may
561 // be shown from this snippet.
562 RestrictedCategories []int64 `json:"restrictedCategories,omitempty"`
563
564 // SensitiveCategories: Detected sensitive categories, if any.
565 // Read-only. This field should not be set in requests.
566 SensitiveCategories []int64 `json:"sensitiveCategories,omitempty"`
567
568 // Status: Creative serving status. Read-only. This field should not be
569 // set in requests.
570 Status string `json:"status,omitempty"`
571
572 // VendorType: All vendor types for the ads that may be shown from this
573 // snippet.
574 VendorType []int64 `json:"vendorType,omitempty"`
575
576 // Version: The version for this creative. Read-only. This field should
577 // not be set in requests.
578 Version int64 `json:"version,omitempty"`
579
580 // VideoURL: The URL to fetch a video ad. If set, HTMLSnippet and the
581 // nativeAd should not be set.
582 VideoURL string `json:"videoURL,omitempty"`
583
584 // Width: Ad width.
585 Width int64 `json:"width,omitempty"`
586
587 // ServerResponse contains the HTTP response code and headers from the
588 // server.
589 googleapi.ServerResponse `json:"-"`
590
591 // ForceSendFields is a list of field names (e.g. "HTMLSnippet") to
592 // unconditionally include in API requests. By default, fields with
593 // empty or default values are omitted from API requests. However, any
594 // non-pointer, non-interface field appearing in ForceSendFields will be
595 // sent to the server regardless of whether the field is empty or not.
596 // This may be used to include empty fields in Patch requests.
597 ForceSendFields []string `json:"-"`
598
599 // NullFields is a list of field names (e.g. "HTMLSnippet") to include
600 // in API requests with the JSON null value. By default, fields with
601 // empty values are omitted from API requests. However, any field with
602 // an empty value appearing in NullFields will be sent to the server as
603 // null. It is an error if a field in this list has a non-empty value.
604 // This may be used to include null fields in Patch requests.
605 NullFields []string `json:"-"`
606 }
607
608 func (s *Creative) MarshalJSON() ([]byte, error) {
609 type NoMethod Creative
610 raw := NoMethod(*s)
611 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
612 }
613
614 type CreativeAdTechnologyProviders struct {
615 // DetectedProviderIds: The detected ad technology provider IDs for this
616 // creative. See
617 // https://storage.googleapis.com/adx-rtb-dictionaries/providers.csv for
618 // mapping of provider ID to provided name, a privacy policy URL, and a
619 // list of domains which can be attributed to the provider. If this
620 // creative contains provider IDs that are outside of those listed in
621 // the
622 // `BidRequest.adslot.consented_providers_settings.consented_providers`
623 // field on the Authorized Buyers Real-Time Bidding protocol or the
624 // `BidRequest.user.ext.consented_providers_settings.consented_providers`
625 // field on the OpenRTB protocol, a bid submitted for a European
626 // Economic Area (EEA) user with this creative is not compliant with the
627 // GDPR policies as mentioned in the "Third-party Ad Technology Vendors"
628 // section of Authorized Buyers Program Guidelines.
629 DetectedProviderIds googleapi.Int64s `json:"detectedProviderIds,omitempty"`
630
631 // HasUnidentifiedProvider: Whether the creative contains an
632 // unidentified ad technology provider. If true, a bid submitted for a
633 // European Economic Area (EEA) user with this creative is not compliant
634 // with the GDPR policies as mentioned in the "Third-party Ad Technology
635 // Vendors" section of Authorized Buyers Program Guidelines.
636 HasUnidentifiedProvider bool `json:"hasUnidentifiedProvider,omitempty"`
637
638 // ForceSendFields is a list of field names (e.g. "DetectedProviderIds")
639 // to unconditionally include in API requests. By default, fields with
640 // empty or default values are omitted from API requests. However, any
641 // non-pointer, non-interface field appearing in ForceSendFields will be
642 // sent to the server regardless of whether the field is empty or not.
643 // This may be used to include empty fields in Patch requests.
644 ForceSendFields []string `json:"-"`
645
646 // NullFields is a list of field names (e.g. "DetectedProviderIds") to
647 // include in API requests with the JSON null value. By default, fields
648 // with empty values are omitted from API requests. However, any field
649 // with an empty value appearing in NullFields will be sent to the
650 // server as null. It is an error if a field in this list has a
651 // non-empty value. This may be used to include null fields in Patch
652 // requests.
653 NullFields []string `json:"-"`
654 }
655
656 func (s *CreativeAdTechnologyProviders) MarshalJSON() ([]byte, error) {
657 type NoMethod CreativeAdTechnologyProviders
658 raw := NoMethod(*s)
659 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
660 }
661
662 type CreativeCorrections struct {
663 // Details: Additional details about the correction.
664 Details []string `json:"details,omitempty"`
665
666 // Reason: The type of correction that was applied to the creative.
667 Reason string `json:"reason,omitempty"`
668
669 // ForceSendFields is a list of field names (e.g. "Details") to
670 // unconditionally include in API requests. By default, fields with
671 // empty or default values are omitted from API requests. However, any
672 // non-pointer, non-interface field appearing in ForceSendFields will be
673 // sent to the server regardless of whether the field is empty or not.
674 // This may be used to include empty fields in Patch requests.
675 ForceSendFields []string `json:"-"`
676
677 // NullFields is a list of field names (e.g. "Details") to include in
678 // API requests with the JSON null value. By default, fields with empty
679 // values are omitted from API requests. However, any field with an
680 // empty value appearing in NullFields will be sent to the server as
681 // null. It is an error if a field in this list has a non-empty value.
682 // This may be used to include null fields in Patch requests.
683 NullFields []string `json:"-"`
684 }
685
686 func (s *CreativeCorrections) MarshalJSON() ([]byte, error) {
687 type NoMethod CreativeCorrections
688 raw := NoMethod(*s)
689 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
690 }
691
692 type CreativeDisapprovalReasons struct {
693 // Details: Additional details about the reason for disapproval.
694 Details []string `json:"details,omitempty"`
695
696 // Reason: The categorized reason for disapproval.
697 Reason string `json:"reason,omitempty"`
698
699 // ForceSendFields is a list of field names (e.g. "Details") to
700 // unconditionally include in API requests. By default, fields with
701 // empty or default values are omitted from API requests. However, any
702 // non-pointer, non-interface field appearing in ForceSendFields will be
703 // sent to the server regardless of whether the field is empty or not.
704 // This may be used to include empty fields in Patch requests.
705 ForceSendFields []string `json:"-"`
706
707 // NullFields is a list of field names (e.g. "Details") to include in
708 // API requests with the JSON null value. By default, fields with empty
709 // values are omitted from API requests. However, any field with an
710 // empty value appearing in NullFields will be sent to the server as
711 // null. It is an error if a field in this list has a non-empty value.
712 // This may be used to include null fields in Patch requests.
713 NullFields []string `json:"-"`
714 }
715
716 func (s *CreativeDisapprovalReasons) MarshalJSON() ([]byte, error) {
717 type NoMethod CreativeDisapprovalReasons
718 raw := NoMethod(*s)
719 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
720 }
721
722 // CreativeFilteringReasons: The filtering reasons for the creative.
723 // Read-only. This field should not be set in requests.
724 type CreativeFilteringReasons struct {
725 // Date: The date in ISO 8601 format for the data. The data is collected
726 // from 00:00:00 to 23:59:59 in PST.
727 Date string `json:"date,omitempty"`
728
729 // Reasons: The filtering reasons.
730 Reasons []*CreativeFilteringReasonsReasons `json:"reasons,omitempty"`
731
732 // ForceSendFields is a list of field names (e.g. "Date") to
733 // unconditionally include in API requests. By default, fields with
734 // empty or default values are omitted from API requests. However, any
735 // non-pointer, non-interface field appearing in ForceSendFields will be
736 // sent to the server regardless of whether the field is empty or not.
737 // This may be used to include empty fields in Patch requests.
738 ForceSendFields []string `json:"-"`
739
740 // NullFields is a list of field names (e.g. "Date") to include in API
741 // requests with the JSON null value. By default, fields with empty
742 // values are omitted from API requests. However, any field with an
743 // empty value appearing in NullFields will be sent to the server as
744 // null. It is an error if a field in this list has a non-empty value.
745 // This may be used to include null fields in Patch requests.
746 NullFields []string `json:"-"`
747 }
748
749 func (s *CreativeFilteringReasons) MarshalJSON() ([]byte, error) {
750 type NoMethod CreativeFilteringReasons
751 raw := NoMethod(*s)
752 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
753 }
754
755 type CreativeFilteringReasonsReasons struct {
756 // FilteringCount: The number of times the creative was filtered for the
757 // status. The count is aggregated across all publishers on the
758 // exchange.
759 FilteringCount int64 `json:"filteringCount,omitempty,string"`
760
761 // FilteringStatus: The filtering status code. Please refer to the
762 // creative-status-codes.txt file for different statuses.
763 FilteringStatus int64 `json:"filteringStatus,omitempty"`
764
765 // ForceSendFields is a list of field names (e.g. "FilteringCount") to
766 // unconditionally include in API requests. By default, fields with
767 // empty or default values are omitted from API requests. However, any
768 // non-pointer, non-interface field appearing in ForceSendFields will be
769 // sent to the server regardless of whether the field is empty or not.
770 // This may be used to include empty fields in Patch requests.
771 ForceSendFields []string `json:"-"`
772
773 // NullFields is a list of field names (e.g. "FilteringCount") to
774 // include in API requests with the JSON null value. By default, fields
775 // with empty values are omitted from API requests. However, any field
776 // with an empty value appearing in NullFields will be sent to the
777 // server as null. It is an error if a field in this list has a
778 // non-empty value. This may be used to include null fields in Patch
779 // requests.
780 NullFields []string `json:"-"`
781 }
782
783 func (s *CreativeFilteringReasonsReasons) MarshalJSON() ([]byte, error) {
784 type NoMethod CreativeFilteringReasonsReasons
785 raw := NoMethod(*s)
786 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
787 }
788
789 // CreativeNativeAd: If nativeAd is set, HTMLSnippet and videoURL should
790 // not be set.
791 type CreativeNativeAd struct {
792 Advertiser string `json:"advertiser,omitempty"`
793
794 // AppIcon: The app icon, for app download ads.
795 AppIcon *CreativeNativeAdAppIcon `json:"appIcon,omitempty"`
796
797 // Body: A long description of the ad.
798 Body string `json:"body,omitempty"`
799
800 // CallToAction: A label for the button that the user is supposed to
801 // click.
802 CallToAction string `json:"callToAction,omitempty"`
803
804 // ClickTrackingUrl: The URL to use for click tracking.
805 ClickTrackingUrl string `json:"clickTrackingUrl,omitempty"`
806
807 // Headline: A short title for the ad.
808 Headline string `json:"headline,omitempty"`
809
810 // Image: A large image.
811 Image *CreativeNativeAdImage `json:"image,omitempty"`
812
813 // ImpressionTrackingUrl: The URLs are called when the impression is
814 // rendered.
815 ImpressionTrackingUrl []string `json:"impressionTrackingUrl,omitempty"`
816
817 // Logo: A smaller image, for the advertiser logo.
818 Logo *CreativeNativeAdLogo `json:"logo,omitempty"`
819
820 // Price: The price of the promoted app including the currency info.
821 Price string `json:"price,omitempty"`
822
823 // StarRating: The app rating in the app store. Must be in the range
824 // [0-5].
825 StarRating float64 `json:"starRating,omitempty"`
826
827 // ForceSendFields is a list of field names (e.g. "Advertiser") to
828 // unconditionally include in API requests. By default, fields with
829 // empty or default values are omitted from API requests. However, any
830 // non-pointer, non-interface field appearing in ForceSendFields will be
831 // sent to the server regardless of whether the field is empty or not.
832 // This may be used to include empty fields in Patch requests.
833 ForceSendFields []string `json:"-"`
834
835 // NullFields is a list of field names (e.g. "Advertiser") to include in
836 // API requests with the JSON null value. By default, fields with empty
837 // values are omitted from API requests. However, any field with an
838 // empty value appearing in NullFields will be sent to the server as
839 // null. It is an error if a field in this list has a non-empty value.
840 // This may be used to include null fields in Patch requests.
841 NullFields []string `json:"-"`
842 }
843
844 func (s *CreativeNativeAd) MarshalJSON() ([]byte, error) {
845 type NoMethod CreativeNativeAd
846 raw := NoMethod(*s)
847 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
848 }
849
850 func (s *CreativeNativeAd) UnmarshalJSON(data []byte) error {
851 type NoMethod CreativeNativeAd
852 var s1 struct {
853 StarRating gensupport.JSONFloat64 `json:"starRating"`
854 *NoMethod
855 }
856 s1.NoMethod = (*NoMethod)(s)
857 if err := json.Unmarshal(data, &s1); err != nil {
858 return err
859 }
860 s.StarRating = float64(s1.StarRating)
861 return nil
862 }
863
864 // CreativeNativeAdAppIcon: The app icon, for app download ads.
865 type CreativeNativeAdAppIcon struct {
866 Height int64 `json:"height,omitempty"`
867
868 Url string `json:"url,omitempty"`
869
870 Width int64 `json:"width,omitempty"`
871
872 // ForceSendFields is a list of field names (e.g. "Height") to
873 // unconditionally include in API requests. By default, fields with
874 // empty or default values are omitted from API requests. However, any
875 // non-pointer, non-interface field appearing in ForceSendFields will be
876 // sent to the server regardless of whether the field is empty or not.
877 // This may be used to include empty fields in Patch requests.
878 ForceSendFields []string `json:"-"`
879
880 // NullFields is a list of field names (e.g. "Height") to include in API
881 // requests with the JSON null value. By default, fields with empty
882 // values are omitted from API requests. However, any field with an
883 // empty value appearing in NullFields will be sent to the server as
884 // null. It is an error if a field in this list has a non-empty value.
885 // This may be used to include null fields in Patch requests.
886 NullFields []string `json:"-"`
887 }
888
889 func (s *CreativeNativeAdAppIcon) MarshalJSON() ([]byte, error) {
890 type NoMethod CreativeNativeAdAppIcon
891 raw := NoMethod(*s)
892 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
893 }
894
895 // CreativeNativeAdImage: A large image.
896 type CreativeNativeAdImage struct {
897 Height int64 `json:"height,omitempty"`
898
899 Url string `json:"url,omitempty"`
900
901 Width int64 `json:"width,omitempty"`
902
903 // ForceSendFields is a list of field names (e.g. "Height") to
904 // unconditionally include in API requests. By default, fields with
905 // empty or default values are omitted from API requests. However, any
906 // non-pointer, non-interface field appearing in ForceSendFields will be
907 // sent to the server regardless of whether the field is empty or not.
908 // This may be used to include empty fields in Patch requests.
909 ForceSendFields []string `json:"-"`
910
911 // NullFields is a list of field names (e.g. "Height") to include in API
912 // requests with the JSON null value. By default, fields with empty
913 // values are omitted from API requests. However, any field with an
914 // empty value appearing in NullFields will be sent to the server as
915 // null. It is an error if a field in this list has a non-empty value.
916 // This may be used to include null fields in Patch requests.
917 NullFields []string `json:"-"`
918 }
919
920 func (s *CreativeNativeAdImage) MarshalJSON() ([]byte, error) {
921 type NoMethod CreativeNativeAdImage
922 raw := NoMethod(*s)
923 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
924 }
925
926 // CreativeNativeAdLogo: A smaller image, for the advertiser logo.
927 type CreativeNativeAdLogo struct {
928 Height int64 `json:"height,omitempty"`
929
930 Url string `json:"url,omitempty"`
931
932 Width int64 `json:"width,omitempty"`
933
934 // ForceSendFields is a list of field names (e.g. "Height") to
935 // unconditionally include in API requests. By default, fields with
936 // empty or default values are omitted from API requests. However, any
937 // non-pointer, non-interface field appearing in ForceSendFields will be
938 // sent to the server regardless of whether the field is empty or not.
939 // This may be used to include empty fields in Patch requests.
940 ForceSendFields []string `json:"-"`
941
942 // NullFields is a list of field names (e.g. "Height") to include in API
943 // requests with the JSON null value. By default, fields with empty
944 // values are omitted from API requests. However, any field with an
945 // empty value appearing in NullFields will be sent to the server as
946 // null. It is an error if a field in this list has a non-empty value.
947 // This may be used to include null fields in Patch requests.
948 NullFields []string `json:"-"`
949 }
950
951 func (s *CreativeNativeAdLogo) MarshalJSON() ([]byte, error) {
952 type NoMethod CreativeNativeAdLogo
953 raw := NoMethod(*s)
954 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
955 }
956
957 // CreativesList: The creatives feed lists the active creatives for the
958 // Ad Exchange buyer accounts that the user has access to. Each entry in
959 // the feed corresponds to a single creative.
960 type CreativesList struct {
961 // Items: A list of creatives.
962 Items []*Creative `json:"items,omitempty"`
963
964 // Kind: Resource type.
965 Kind string `json:"kind,omitempty"`
966
967 // NextPageToken: Continuation token used to page through creatives. To
968 // retrieve the next page of results, set the next request's "pageToken"
969 // value to this.
970 NextPageToken string `json:"nextPageToken,omitempty"`
971
972 // ServerResponse contains the HTTP response code and headers from the
973 // server.
974 googleapi.ServerResponse `json:"-"`
975
976 // ForceSendFields is a list of field names (e.g. "Items") to
977 // unconditionally include in API requests. By default, fields with
978 // empty or default values are omitted from API requests. However, any
979 // non-pointer, non-interface field appearing in ForceSendFields will be
980 // sent to the server regardless of whether the field is empty or not.
981 // This may be used to include empty fields in Patch requests.
982 ForceSendFields []string `json:"-"`
983
984 // NullFields is a list of field names (e.g. "Items") to include in API
985 // requests with the JSON null value. By default, fields with empty
986 // values are omitted from API requests. However, any field with an
987 // empty value appearing in NullFields will be sent to the server as
988 // null. It is an error if a field in this list has a non-empty value.
989 // This may be used to include null fields in Patch requests.
990 NullFields []string `json:"-"`
991 }
992
993 func (s *CreativesList) MarshalJSON() ([]byte, error) {
994 type NoMethod CreativesList
995 raw := NoMethod(*s)
996 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
997 }
998
999 // DirectDeal: The configuration data for an Ad Exchange direct deal.
1000 type DirectDeal struct {
1001 // AccountId: The account id of the buyer this deal is for.
1002 AccountId int64 `json:"accountId,omitempty"`
1003
1004 // Advertiser: The name of the advertiser this deal is for.
1005 Advertiser string `json:"advertiser,omitempty"`
1006
1007 // AllowsAlcohol: Whether the publisher for this deal is eligible for
1008 // alcohol ads.
1009 AllowsAlcohol bool `json:"allowsAlcohol,omitempty"`
1010
1011 // BuyerAccountId: The account id that this deal was negotiated for. It
1012 // is either the buyer or the client that this deal was negotiated on
1013 // behalf of.
1014 BuyerAccountId int64 `json:"buyerAccountId,omitempty,string"`
1015
1016 // CurrencyCode: The currency code that applies to the fixed_cpm value.
1017 // If not set then assumed to be USD.
1018 CurrencyCode string `json:"currencyCode,omitempty"`
1019
1020 // DealTier: The deal type such as programmatic reservation or fixed
1021 // price and so on.
1022 DealTier string `json:"dealTier,omitempty"`
1023
1024 // EndTime: End time for when this deal stops being active. If not set
1025 // then this deal is valid until manually disabled by the publisher. In
1026 // seconds since the epoch.
1027 EndTime int64 `json:"endTime,omitempty,string"`
1028
1029 // FixedCpm: The fixed price for this direct deal. In cpm micros of
1030 // currency according to currency_code. If set, then this deal is
1031 // eligible for the fixed price tier of buying (highest priority, pay
1032 // exactly the configured fixed price).
1033 FixedCpm int64 `json:"fixedCpm,omitempty,string"`
1034
1035 // Id: Deal id.
1036 Id int64 `json:"id,omitempty,string"`
1037
1038 // Kind: Resource type.
1039 Kind string `json:"kind,omitempty"`
1040
1041 // Name: Deal name.
1042 Name string `json:"name,omitempty"`
1043
1044 // PrivateExchangeMinCpm: The minimum price for this direct deal. In cpm
1045 // micros of currency according to currency_code. If set, then this deal
1046 // is eligible for the private exchange tier of buying (below fixed
1047 // price priority, run as a second price auction).
1048 PrivateExchangeMinCpm int64 `json:"privateExchangeMinCpm,omitempty,string"`
1049
1050 // PublisherBlocksOverriden: If true, the publisher has opted to have
1051 // their blocks ignored when a creative is bid with for this deal.
1052 PublisherBlocksOverriden bool `json:"publisherBlocksOverriden,omitempty"`
1053
1054 // SellerNetwork: The name of the publisher offering this direct deal.
1055 SellerNetwork string `json:"sellerNetwork,omitempty"`
1056
1057 // StartTime: Start time for when this deal becomes active. If not set
1058 // then this deal is active immediately upon creation. In seconds since
1059 // the epoch.
1060 StartTime int64 `json:"startTime,omitempty,string"`
1061
1062 // ServerResponse contains the HTTP response code and headers from the
1063 // server.
1064 googleapi.ServerResponse `json:"-"`
1065
1066 // ForceSendFields is a list of field names (e.g. "AccountId") to
1067 // unconditionally include in API requests. By default, fields with
1068 // empty or default values are omitted from API requests. However, any
1069 // non-pointer, non-interface field appearing in ForceSendFields will be
1070 // sent to the server regardless of whether the field is empty or not.
1071 // This may be used to include empty fields in Patch requests.
1072 ForceSendFields []string `json:"-"`
1073
1074 // NullFields is a list of field names (e.g. "AccountId") to include in
1075 // API requests with the JSON null value. By default, fields with empty
1076 // values are omitted from API requests. However, any field with an
1077 // empty value appearing in NullFields will be sent to the server as
1078 // null. It is an error if a field in this list has a non-empty value.
1079 // This may be used to include null fields in Patch requests.
1080 NullFields []string `json:"-"`
1081 }
1082
1083 func (s *DirectDeal) MarshalJSON() ([]byte, error) {
1084 type NoMethod DirectDeal
1085 raw := NoMethod(*s)
1086 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
1087 }
1088
1089 // DirectDealsList: A direct deals feed lists Direct Deals the Ad
1090 // Exchange buyer account has access to. This includes direct deals set
1091 // up for the buyer account as well as its merged stream seats.
1092 type DirectDealsList struct {
1093 // DirectDeals: A list of direct deals relevant for your account.
1094 DirectDeals []*DirectDeal `json:"directDeals,omitempty"`
1095
1096 // Kind: Resource type.
1097 Kind string `json:"kind,omitempty"`
1098
1099 // ServerResponse contains the HTTP response code and headers from the
1100 // server.
1101 googleapi.ServerResponse `json:"-"`
1102
1103 // ForceSendFields is a list of field names (e.g. "DirectDeals") to
1104 // unconditionally include in API requests. By default, fields with
1105 // empty or default values are omitted from API requests. However, any
1106 // non-pointer, non-interface field appearing in ForceSendFields will be
1107 // sent to the server regardless of whether the field is empty or not.
1108 // This may be used to include empty fields in Patch requests.
1109 ForceSendFields []string `json:"-"`
1110
1111 // NullFields is a list of field names (e.g. "DirectDeals") to include
1112 // in API requests with the JSON null value. By default, fields with
1113 // empty values are omitted from API requests. However, any field with
1114 // an empty value appearing in NullFields will be sent to the server as
1115 // null. It is an error if a field in this list has a non-empty value.
1116 // This may be used to include null fields in Patch requests.
1117 NullFields []string `json:"-"`
1118 }
1119
1120 func (s *DirectDealsList) MarshalJSON() ([]byte, error) {
1121 type NoMethod DirectDealsList
1122 raw := NoMethod(*s)
1123 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
1124 }
1125
1126 // PerformanceReport: The configuration data for an Ad Exchange
1127 // performance report list.
1128 type PerformanceReport struct {
1129 // BidRate: The number of bid responses with an ad.
1130 BidRate float64 `json:"bidRate,omitempty"`
1131
1132 // BidRequestRate: The number of bid requests sent to your bidder.
1133 BidRequestRate float64 `json:"bidRequestRate,omitempty"`
1134
1135 // CalloutStatusRate: Rate of various prefiltering statuses per match.
1136 // Please refer to the callout-status-codes.txt file for different
1137 // statuses.
1138 CalloutStatusRate []interface{} `json:"calloutStatusRate,omitempty"`
1139
1140 // CookieMatcherStatusRate: Average QPS for cookie matcher operations.
1141 CookieMatcherStatusRate []interface{} `json:"cookieMatcherStatusRate,omitempty"`
1142
1143 // CreativeStatusRate: Rate of ads with a given status. Please refer to
1144 // the creative-status-codes.txt file for different statuses.
1145 CreativeStatusRate []interface{} `json:"creativeStatusRate,omitempty"`
1146
1147 // FilteredBidRate: The number of bid responses that were filtered due
1148 // to a policy violation or other errors.
1149 FilteredBidRate float64 `json:"filteredBidRate,omitempty"`
1150
1151 // HostedMatchStatusRate: Average QPS for hosted match operations.
1152 HostedMatchStatusRate []interface{} `json:"hostedMatchStatusRate,omitempty"`
1153
1154 // InventoryMatchRate: The number of potential queries based on your
1155 // pretargeting settings.
1156 InventoryMatchRate float64 `json:"inventoryMatchRate,omitempty"`
1157
1158 // Kind: Resource type.
1159 Kind string `json:"kind,omitempty"`
1160
1161 // Latency50thPercentile: The 50th percentile round trip latency(ms) as
1162 // perceived from Google servers for the duration period covered by the
1163 // report.
1164 Latency50thPercentile float64 `json:"latency50thPercentile,omitempty"`
1165
1166 // Latency85thPercentile: The 85th percentile round trip latency(ms) as
1167 // perceived from Google servers for the duration period covered by the
1168 // report.
1169 Latency85thPercentile float64 `json:"latency85thPercentile,omitempty"`
1170
1171 // Latency95thPercentile: The 95th percentile round trip latency(ms) as
1172 // perceived from Google servers for the duration period covered by the
1173 // report.
1174 Latency95thPercentile float64 `json:"latency95thPercentile,omitempty"`
1175
1176 // NoQuotaInRegion: Rate of various quota account statuses per quota
1177 // check.
1178 NoQuotaInRegion float64 `json:"noQuotaInRegion,omitempty"`
1179
1180 // OutOfQuota: Rate of various quota account statuses per quota check.
1181 OutOfQuota float64 `json:"outOfQuota,omitempty"`
1182
1183 // PixelMatchRequests: Average QPS for pixel match requests from
1184 // clients.
1185 PixelMatchRequests float64 `json:"pixelMatchRequests,omitempty"`
1186
1187 // PixelMatchResponses: Average QPS for pixel match responses from
1188 // clients.
1189 PixelMatchResponses float64 `json:"pixelMatchResponses,omitempty"`
1190
1191 // QuotaConfiguredLimit: The configured quota limits for this account.
1192 QuotaConfiguredLimit float64 `json:"quotaConfiguredLimit,omitempty"`
1193
1194 // QuotaThrottledLimit: The throttled quota limits for this account.
1195 QuotaThrottledLimit float64 `json:"quotaThrottledLimit,omitempty"`
1196
1197 // Region: The trading location of this data.
1198 Region string `json:"region,omitempty"`
1199
1200 // SuccessfulRequestRate: The number of properly formed bid responses
1201 // received by our servers within the deadline.
1202 SuccessfulRequestRate float64 `json:"successfulRequestRate,omitempty"`
1203
1204 // Timestamp: The unix timestamp of the starting time of this
1205 // performance data.
1206 Timestamp int64 `json:"timestamp,omitempty,string"`
1207
1208 // UnsuccessfulRequestRate: The number of bid responses that were
1209 // unsuccessful due to timeouts, incorrect formatting, etc.
1210 UnsuccessfulRequestRate float64 `json:"unsuccessfulRequestRate,omitempty"`
1211
1212 // ForceSendFields is a list of field names (e.g. "BidRate") to
1213 // unconditionally include in API requests. By default, fields with
1214 // empty or default values are omitted from API requests. However, any
1215 // non-pointer, non-interface field appearing in ForceSendFields will be
1216 // sent to the server regardless of whether the field is empty or not.
1217 // This may be used to include empty fields in Patch requests.
1218 ForceSendFields []string `json:"-"`
1219
1220 // NullFields is a list of field names (e.g. "BidRate") to include in
1221 // API requests with the JSON null value. By default, fields with empty
1222 // values are omitted from API requests. However, any field with an
1223 // empty value appearing in NullFields will be sent to the server as
1224 // null. It is an error if a field in this list has a non-empty value.
1225 // This may be used to include null fields in Patch requests.
1226 NullFields []string `json:"-"`
1227 }
1228
1229 func (s *PerformanceReport) MarshalJSON() ([]byte, error) {
1230 type NoMethod PerformanceReport
1231 raw := NoMethod(*s)
1232 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
1233 }
1234
1235 func (s *PerformanceReport) UnmarshalJSON(data []byte) error {
1236 type NoMethod PerformanceReport
1237 var s1 struct {
1238 BidRate gensupport.JSONFloat64 `json:"bidRate"`
1239 BidRequestRate gensupport.JSONFloat64 `json:"bidRequestRate"`
1240 FilteredBidRate gensupport.JSONFloat64 `json:"filteredBidRate"`
1241 InventoryMatchRate gensupport.JSONFloat64 `json:"inventoryMatchRate"`
1242 Latency50thPercentile gensupport.JSONFloat64 `json:"latency50thPercentile"`
1243 Latency85thPercentile gensupport.JSONFloat64 `json:"latency85thPercentile"`
1244 Latency95thPercentile gensupport.JSONFloat64 `json:"latency95thPercentile"`
1245 NoQuotaInRegion gensupport.JSONFloat64 `json:"noQuotaInRegion"`
1246 OutOfQuota gensupport.JSONFloat64 `json:"outOfQuota"`
1247 PixelMatchRequests gensupport.JSONFloat64 `json:"pixelMatchRequests"`
1248 PixelMatchResponses gensupport.JSONFloat64 `json:"pixelMatchResponses"`
1249 QuotaConfiguredLimit gensupport.JSONFloat64 `json:"quotaConfiguredLimit"`
1250 QuotaThrottledLimit gensupport.JSONFloat64 `json:"quotaThrottledLimit"`
1251 SuccessfulRequestRate gensupport.JSONFloat64 `json:"successfulRequestRate"`
1252 UnsuccessfulRequestRate gensupport.JSONFloat64 `json:"unsuccessfulRequestRate"`
1253 *NoMethod
1254 }
1255 s1.NoMethod = (*NoMethod)(s)
1256 if err := json.Unmarshal(data, &s1); err != nil {
1257 return err
1258 }
1259 s.BidRate = float64(s1.BidRate)
1260 s.BidRequestRate = float64(s1.BidRequestRate)
1261 s.FilteredBidRate = float64(s1.FilteredBidRate)
1262 s.InventoryMatchRate = float64(s1.InventoryMatchRate)
1263 s.Latency50thPercentile = float64(s1.Latency50thPercentile)
1264 s.Latency85thPercentile = float64(s1.Latency85thPercentile)
1265 s.Latency95thPercentile = float64(s1.Latency95thPercentile)
1266 s.NoQuotaInRegion = float64(s1.NoQuotaInRegion)
1267 s.OutOfQuota = float64(s1.OutOfQuota)
1268 s.PixelMatchRequests = float64(s1.PixelMatchRequests)
1269 s.PixelMatchResponses = float64(s1.PixelMatchResponses)
1270 s.QuotaConfiguredLimit = float64(s1.QuotaConfiguredLimit)
1271 s.QuotaThrottledLimit = float64(s1.QuotaThrottledLimit)
1272 s.SuccessfulRequestRate = float64(s1.SuccessfulRequestRate)
1273 s.UnsuccessfulRequestRate = float64(s1.UnsuccessfulRequestRate)
1274 return nil
1275 }
1276
1277 // PerformanceReportList: The configuration data for an Ad Exchange
1278 // performance report list.
1279 type PerformanceReportList struct {
1280 // Kind: Resource type.
1281 Kind string `json:"kind,omitempty"`
1282
1283 // PerformanceReport: A list of performance reports relevant for the
1284 // account.
1285 PerformanceReport []*PerformanceReport `json:"performanceReport,omitempty"`
1286
1287 // ServerResponse contains the HTTP response code and headers from the
1288 // server.
1289 googleapi.ServerResponse `json:"-"`
1290
1291 // ForceSendFields is a list of field names (e.g. "Kind") to
1292 // unconditionally include in API requests. By default, fields with
1293 // empty or default values are omitted from API requests. However, any
1294 // non-pointer, non-interface field appearing in ForceSendFields will be
1295 // sent to the server regardless of whether the field is empty or not.
1296 // This may be used to include empty fields in Patch requests.
1297 ForceSendFields []string `json:"-"`
1298
1299 // NullFields is a list of field names (e.g. "Kind") to include in API
1300 // requests with the JSON null value. By default, fields with empty
1301 // values are omitted from API requests. However, any field with an
1302 // empty value appearing in NullFields will be sent to the server as
1303 // null. It is an error if a field in this list has a non-empty value.
1304 // This may be used to include null fields in Patch requests.
1305 NullFields []string `json:"-"`
1306 }
1307
1308 func (s *PerformanceReportList) MarshalJSON() ([]byte, error) {
1309 type NoMethod PerformanceReportList
1310 raw := NoMethod(*s)
1311 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
1312 }
1313
1314 type PretargetingConfig struct {
1315 // BillingId: The id for billing purposes, provided for reference. Leave
1316 // this field blank for insert requests; the id will be generated
1317 // automatically.
1318 BillingId int64 `json:"billingId,omitempty,string"`
1319
1320 // ConfigId: The config id; generated automatically. Leave this field
1321 // blank for insert requests.
1322 ConfigId int64 `json:"configId,omitempty,string"`
1323
1324 // ConfigName: The name of the config. Must be unique. Required for all
1325 // requests.
1326 ConfigName string `json:"configName,omitempty"`
1327
1328 // CreativeType: List must contain exactly one of
1329 // PRETARGETING_CREATIVE_TYPE_HTML or PRETARGETING_CREATIVE_TYPE_VIDEO.
1330 CreativeType []string `json:"creativeType,omitempty"`
1331
1332 // Dimensions: Requests which allow one of these (width, height) pairs
1333 // will match. All pairs must be supported ad dimensions.
1334 Dimensions []*PretargetingConfigDimensions `json:"dimensions,omitempty"`
1335
1336 // ExcludedContentLabels: Requests with any of these content labels will
1337 // not match. Values are from content-labels.txt in the downloadable
1338 // files section.
1339 ExcludedContentLabels googleapi.Int64s `json:"excludedContentLabels,omitempty"`
1340
1341 // ExcludedGeoCriteriaIds: Requests containing any of these geo criteria
1342 // ids will not match.
1343 ExcludedGeoCriteriaIds googleapi.Int64s `json:"excludedGeoCriteriaIds,omitempty"`
1344
1345 // ExcludedPlacements: Requests containing any of these placements will
1346 // not match.
1347 ExcludedPlacements []*PretargetingConfigExcludedPlacements `json:"excludedPlacements,omitempty"`
1348
1349 // ExcludedUserLists: Requests containing any of these users list ids
1350 // will not match.
1351 ExcludedUserLists googleapi.Int64s `json:"excludedUserLists,omitempty"`
1352
1353 // ExcludedVerticals: Requests containing any of these vertical ids will
1354 // not match. Values are from the publisher-verticals.txt file in the
1355 // downloadable files section.
1356 ExcludedVerticals googleapi.Int64s `json:"excludedVerticals,omitempty"`
1357
1358 // GeoCriteriaIds: Requests containing any of these geo criteria ids
1359 // will match.
1360 GeoCriteriaIds googleapi.Int64s `json:"geoCriteriaIds,omitempty"`
1361
1362 // IsActive: Whether this config is active. Required for all requests.
1363 IsActive bool `json:"isActive,omitempty"`
1364
1365 // Kind: The kind of the resource, i.e.
1366 // "adexchangebuyer#pretargetingConfig".
1367 Kind string `json:"kind,omitempty"`
1368
1369 // Languages: Request containing any of these language codes will match.
1370 Languages []string `json:"languages,omitempty"`
1371
1372 // MaximumQps: The maximum QPS allocated to this pretargeting
1373 // configuration, used for pretargeting-level QPS limits. By default,
1374 // this is not set, which indicates that there is no QPS limit at the
1375 // configuration level (a global or account-level limit may still be
1376 // imposed).
1377 MaximumQps int64 `json:"maximumQps,omitempty,string"`
1378
1379 // MobileCarriers: Requests containing any of these mobile carrier ids
1380 // will match. Values are from mobile-carriers.csv in the downloadable
1381 // files section.
1382 MobileCarriers googleapi.Int64s `json:"mobileCarriers,omitempty"`
1383
1384 // MobileDevices: Requests containing any of these mobile device ids
1385 // will match. Values are from mobile-devices.csv in the downloadable
1386 // files section.
1387 MobileDevices googleapi.Int64s `json:"mobileDevices,omitempty"`
1388
1389 // MobileOperatingSystemVersions: Requests containing any of these
1390 // mobile operating system version ids will match. Values are from
1391 // mobile-os.csv in the downloadable files section.
1392 MobileOperatingSystemVersions googleapi.Int64s `json:"mobileOperatingSystemVersions,omitempty"`
1393
1394 // Placements: Requests containing any of these placements will match.
1395 Placements []*PretargetingConfigPlacements `json:"placements,omitempty"`
1396
1397 // Platforms: Requests matching any of these platforms will match.
1398 // Possible values are PRETARGETING_PLATFORM_MOBILE,
1399 // PRETARGETING_PLATFORM_DESKTOP, and PRETARGETING_PLATFORM_TABLET.
1400 Platforms []string `json:"platforms,omitempty"`
1401
1402 // SupportedCreativeAttributes: Creative attributes should be declared
1403 // here if all creatives corresponding to this pretargeting
1404 // configuration have that creative attribute. Values are from
1405 // pretargetable-creative-attributes.txt in the downloadable files
1406 // section.
1407 SupportedCreativeAttributes googleapi.Int64s `json:"supportedCreativeAttributes,omitempty"`
1408
1409 // UserLists: Requests containing any of these user list ids will match.
1410 UserLists googleapi.Int64s `json:"userLists,omitempty"`
1411
1412 // VendorTypes: Requests that allow any of these vendor ids will match.
1413 // Values are from vendors.txt in the downloadable files section.
1414 VendorTypes googleapi.Int64s `json:"vendorTypes,omitempty"`
1415
1416 // Verticals: Requests containing any of these vertical ids will match.
1417 Verticals googleapi.Int64s `json:"verticals,omitempty"`
1418
1419 // ServerResponse contains the HTTP response code and headers from the
1420 // server.
1421 googleapi.ServerResponse `json:"-"`
1422
1423 // ForceSendFields is a list of field names (e.g. "BillingId") to
1424 // unconditionally include in API requests. By default, fields with
1425 // empty or default values are omitted from API requests. However, any
1426 // non-pointer, non-interface field appearing in ForceSendFields will be
1427 // sent to the server regardless of whether the field is empty or not.
1428 // This may be used to include empty fields in Patch requests.
1429 ForceSendFields []string `json:"-"`
1430
1431 // NullFields is a list of field names (e.g. "BillingId") to include in
1432 // API requests with the JSON null value. By default, fields with empty
1433 // values are omitted from API requests. However, any field with an
1434 // empty value appearing in NullFields will be sent to the server as
1435 // null. It is an error if a field in this list has a non-empty value.
1436 // This may be used to include null fields in Patch requests.
1437 NullFields []string `json:"-"`
1438 }
1439
1440 func (s *PretargetingConfig) MarshalJSON() ([]byte, error) {
1441 type NoMethod PretargetingConfig
1442 raw := NoMethod(*s)
1443 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
1444 }
1445
1446 type PretargetingConfigDimensions struct {
1447 // Height: Height in pixels.
1448 Height int64 `json:"height,omitempty,string"`
1449
1450 // Width: Width in pixels.
1451 Width int64 `json:"width,omitempty,string"`
1452
1453 // ForceSendFields is a list of field names (e.g. "Height") to
1454 // unconditionally include in API requests. By default, fields with
1455 // empty or default values are omitted from API requests. However, any
1456 // non-pointer, non-interface field appearing in ForceSendFields will be
1457 // sent to the server regardless of whether the field is empty or not.
1458 // This may be used to include empty fields in Patch requests.
1459 ForceSendFields []string `json:"-"`
1460
1461 // NullFields is a list of field names (e.g. "Height") to include in API
1462 // requests with the JSON null value. By default, fields with empty
1463 // values are omitted from API requests. However, any field with an
1464 // empty value appearing in NullFields will be sent to the server as
1465 // null. It is an error if a field in this list has a non-empty value.
1466 // This may be used to include null fields in Patch requests.
1467 NullFields []string `json:"-"`
1468 }
1469
1470 func (s *PretargetingConfigDimensions) MarshalJSON() ([]byte, error) {
1471 type NoMethod PretargetingConfigDimensions
1472 raw := NoMethod(*s)
1473 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
1474 }
1475
1476 type PretargetingConfigExcludedPlacements struct {
1477 // Token: The value of the placement. Interpretation depends on the
1478 // placement type, e.g. URL for a site placement, channel name for a
1479 // channel placement, app id for a mobile app placement.
1480 Token string `json:"token,omitempty"`
1481
1482 // Type: The type of the placement.
1483 Type string `json:"type,omitempty"`
1484
1485 // ForceSendFields is a list of field names (e.g. "Token") to
1486 // unconditionally include in API requests. By default, fields with
1487 // empty or default values are omitted from API requests. However, any
1488 // non-pointer, non-interface field appearing in ForceSendFields will be
1489 // sent to the server regardless of whether the field is empty or not.
1490 // This may be used to include empty fields in Patch requests.
1491 ForceSendFields []string `json:"-"`
1492
1493 // NullFields is a list of field names (e.g. "Token") to include in API
1494 // requests with the JSON null value. By default, fields with empty
1495 // values are omitted from API requests. However, any field with an
1496 // empty value appearing in NullFields will be sent to the server as
1497 // null. It is an error if a field in this list has a non-empty value.
1498 // This may be used to include null fields in Patch requests.
1499 NullFields []string `json:"-"`
1500 }
1501
1502 func (s *PretargetingConfigExcludedPlacements) MarshalJSON() ([]byte, error) {
1503 type NoMethod PretargetingConfigExcludedPlacements
1504 raw := NoMethod(*s)
1505 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
1506 }
1507
1508 type PretargetingConfigPlacements struct {
1509 // Token: The value of the placement. Interpretation depends on the
1510 // placement type, e.g. URL for a site placement, channel name for a
1511 // channel placement, app id for a mobile app placement.
1512 Token string `json:"token,omitempty"`
1513
1514 // Type: The type of the placement.
1515 Type string `json:"type,omitempty"`
1516
1517 // ForceSendFields is a list of field names (e.g. "Token") to
1518 // unconditionally include in API requests. By default, fields with
1519 // empty or default values are omitted from API requests. However, any
1520 // non-pointer, non-interface field appearing in ForceSendFields will be
1521 // sent to the server regardless of whether the field is empty or not.
1522 // This may be used to include empty fields in Patch requests.
1523 ForceSendFields []string `json:"-"`
1524
1525 // NullFields is a list of field names (e.g. "Token") to include in API
1526 // requests with the JSON null value. By default, fields with empty
1527 // values are omitted from API requests. However, any field with an
1528 // empty value appearing in NullFields will be sent to the server as
1529 // null. It is an error if a field in this list has a non-empty value.
1530 // This may be used to include null fields in Patch requests.
1531 NullFields []string `json:"-"`
1532 }
1533
1534 func (s *PretargetingConfigPlacements) MarshalJSON() ([]byte, error) {
1535 type NoMethod PretargetingConfigPlacements
1536 raw := NoMethod(*s)
1537 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
1538 }
1539
1540 type PretargetingConfigList struct {
1541 // Items: A list of pretargeting configs
1542 Items []*PretargetingConfig `json:"items,omitempty"`
1543
1544 // Kind: Resource type.
1545 Kind string `json:"kind,omitempty"`
1546
1547 // ServerResponse contains the HTTP response code and headers from the
1548 // server.
1549 googleapi.ServerResponse `json:"-"`
1550
1551 // ForceSendFields is a list of field names (e.g. "Items") to
1552 // unconditionally include in API requests. By default, fields with
1553 // empty or default values are omitted from API requests. However, any
1554 // non-pointer, non-interface field appearing in ForceSendFields will be
1555 // sent to the server regardless of whether the field is empty or not.
1556 // This may be used to include empty fields in Patch requests.
1557 ForceSendFields []string `json:"-"`
1558
1559 // NullFields is a list of field names (e.g. "Items") to include in API
1560 // requests with the JSON null value. By default, fields with empty
1561 // values are omitted from API requests. However, any field with an
1562 // empty value appearing in NullFields will be sent to the server as
1563 // null. It is an error if a field in this list has a non-empty value.
1564 // This may be used to include null fields in Patch requests.
1565 NullFields []string `json:"-"`
1566 }
1567
1568 func (s *PretargetingConfigList) MarshalJSON() ([]byte, error) {
1569 type NoMethod PretargetingConfigList
1570 raw := NoMethod(*s)
1571 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
1572 }
1573
1574 // method id "adexchangebuyer.accounts.get":
1575
1576 type AccountsGetCall struct {
1577 s *Service
1578 id int64
1579 urlParams_ gensupport.URLParams
1580 ifNoneMatch_ string
1581 ctx_ context.Context
1582 header_ http.Header
1583 }
1584
1585 // Get: Gets one account by ID.
1586 //
1587 // - id: The account id.
1588 func (r *AccountsService) Get(id int64) *AccountsGetCall {
1589 c := &AccountsGetCall{s: r.s, urlParams_: make(gensupport.URLParams)}
1590 c.id = id
1591 return c
1592 }
1593
1594 // Fields allows partial responses to be retrieved. See
1595 // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
1596 // for more information.
1597 func (c *AccountsGetCall) Fields(s ...googleapi.Field) *AccountsGetCall {
1598 c.urlParams_.Set("fields", googleapi.CombineFields(s))
1599 return c
1600 }
1601
1602 // IfNoneMatch sets the optional parameter which makes the operation
1603 // fail if the object's ETag matches the given value. This is useful for
1604 // getting updates only after the object has changed since the last
1605 // request. Use googleapi.IsNotModified to check whether the response
1606 // error from Do is the result of In-None-Match.
1607 func (c *AccountsGetCall) IfNoneMatch(entityTag string) *AccountsGetCall {
1608 c.ifNoneMatch_ = entityTag
1609 return c
1610 }
1611
1612 // Context sets the context to be used in this call's Do method. Any
1613 // pending HTTP request will be aborted if the provided context is
1614 // canceled.
1615 func (c *AccountsGetCall) Context(ctx context.Context) *AccountsGetCall {
1616 c.ctx_ = ctx
1617 return c
1618 }
1619
1620 // Header returns an http.Header that can be modified by the caller to
1621 // add HTTP headers to the request.
1622 func (c *AccountsGetCall) Header() http.Header {
1623 if c.header_ == nil {
1624 c.header_ = make(http.Header)
1625 }
1626 return c.header_
1627 }
1628
1629 func (c *AccountsGetCall) doRequest(alt string) (*http.Response, error) {
1630 reqHeaders := make(http.Header)
1631 reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/20210819")
1632 for k, v := range c.header_ {
1633 reqHeaders[k] = v
1634 }
1635 reqHeaders.Set("User-Agent", c.s.userAgent())
1636 if c.ifNoneMatch_ != "" {
1637 reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
1638 }
1639 var body io.Reader = nil
1640 c.urlParams_.Set("alt", alt)
1641 c.urlParams_.Set("prettyPrint", "false")
1642 urls := googleapi.ResolveRelative(c.s.BasePath, "accounts/{id}")
1643 urls += "?" + c.urlParams_.Encode()
1644 req, err := http.NewRequest("GET", urls, body)
1645 if err != nil {
1646 return nil, err
1647 }
1648 req.Header = reqHeaders
1649 googleapi.Expand(req.URL, map[string]string{
1650 "id": strconv.FormatInt(c.id, 10),
1651 })
1652 return gensupport.SendRequest(c.ctx_, c.s.client, req)
1653 }
1654
1655 // Do executes the "adexchangebuyer.accounts.get" call.
1656 // Exactly one of *Account or error will be non-nil. Any non-2xx status
1657 // code is an error. Response headers are in either
1658 // *Account.ServerResponse.Header or (if a response was returned at all)
1659 // in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to
1660 // check whether the returned error was because http.StatusNotModified
1661 // was returned.
1662 func (c *AccountsGetCall) Do(opts ...googleapi.CallOption) (*Account, error) {
1663 gensupport.SetOptions(c.urlParams_, opts...)
1664 res, err := c.doRequest("json")
1665 if res != nil && res.StatusCode == http.StatusNotModified {
1666 if res.Body != nil {
1667 res.Body.Close()
1668 }
1669 return nil, &googleapi.Error{
1670 Code: res.StatusCode,
1671 Header: res.Header,
1672 }
1673 }
1674 if err != nil {
1675 return nil, err
1676 }
1677 defer googleapi.CloseBody(res)
1678 if err := googleapi.CheckResponse(res); err != nil {
1679 return nil, err
1680 }
1681 ret := &Account{
1682 ServerResponse: googleapi.ServerResponse{
1683 Header: res.Header,
1684 HTTPStatusCode: res.StatusCode,
1685 },
1686 }
1687 target := &ret
1688 if err := gensupport.DecodeResponse(target, res); err != nil {
1689 return nil, err
1690 }
1691 return ret, nil
1692 // {
1693 // "description": "Gets one account by ID.",
1694 // "httpMethod": "GET",
1695 // "id": "adexchangebuyer.accounts.get",
1696 // "parameterOrder": [
1697 // "id"
1698 // ],
1699 // "parameters": {
1700 // "id": {
1701 // "description": "The account id",
1702 // "format": "int32",
1703 // "location": "path",
1704 // "required": true,
1705 // "type": "integer"
1706 // }
1707 // },
1708 // "path": "accounts/{id}",
1709 // "response": {
1710 // "$ref": "Account"
1711 // },
1712 // "scopes": [
1713 // "https://www.googleapis.com/auth/adexchange.buyer"
1714 // ]
1715 // }
1716
1717 }
1718
1719 // method id "adexchangebuyer.accounts.list":
1720
1721 type AccountsListCall struct {
1722 s *Service
1723 urlParams_ gensupport.URLParams
1724 ifNoneMatch_ string
1725 ctx_ context.Context
1726 header_ http.Header
1727 }
1728
1729 // List: Retrieves the authenticated user's list of accounts.
1730 func (r *AccountsService) List() *AccountsListCall {
1731 c := &AccountsListCall{s: r.s, urlParams_: make(gensupport.URLParams)}
1732 return c
1733 }
1734
1735 // Fields allows partial responses to be retrieved. See
1736 // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
1737 // for more information.
1738 func (c *AccountsListCall) Fields(s ...googleapi.Field) *AccountsListCall {
1739 c.urlParams_.Set("fields", googleapi.CombineFields(s))
1740 return c
1741 }
1742
1743 // IfNoneMatch sets the optional parameter which makes the operation
1744 // fail if the object's ETag matches the given value. This is useful for
1745 // getting updates only after the object has changed since the last
1746 // request. Use googleapi.IsNotModified to check whether the response
1747 // error from Do is the result of In-None-Match.
1748 func (c *AccountsListCall) IfNoneMatch(entityTag string) *AccountsListCall {
1749 c.ifNoneMatch_ = entityTag
1750 return c
1751 }
1752
1753 // Context sets the context to be used in this call's Do method. Any
1754 // pending HTTP request will be aborted if the provided context is
1755 // canceled.
1756 func (c *AccountsListCall) Context(ctx context.Context) *AccountsListCall {
1757 c.ctx_ = ctx
1758 return c
1759 }
1760
1761 // Header returns an http.Header that can be modified by the caller to
1762 // add HTTP headers to the request.
1763 func (c *AccountsListCall) Header() http.Header {
1764 if c.header_ == nil {
1765 c.header_ = make(http.Header)
1766 }
1767 return c.header_
1768 }
1769
1770 func (c *AccountsListCall) doRequest(alt string) (*http.Response, error) {
1771 reqHeaders := make(http.Header)
1772 reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/20210819")
1773 for k, v := range c.header_ {
1774 reqHeaders[k] = v
1775 }
1776 reqHeaders.Set("User-Agent", c.s.userAgent())
1777 if c.ifNoneMatch_ != "" {
1778 reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
1779 }
1780 var body io.Reader = nil
1781 c.urlParams_.Set("alt", alt)
1782 c.urlParams_.Set("prettyPrint", "false")
1783 urls := googleapi.ResolveRelative(c.s.BasePath, "accounts")
1784 urls += "?" + c.urlParams_.Encode()
1785 req, err := http.NewRequest("GET", urls, body)
1786 if err != nil {
1787 return nil, err
1788 }
1789 req.Header = reqHeaders
1790 return gensupport.SendRequest(c.ctx_, c.s.client, req)
1791 }
1792
1793 // Do executes the "adexchangebuyer.accounts.list" call.
1794 // Exactly one of *AccountsList or error will be non-nil. Any non-2xx
1795 // status code is an error. Response headers are in either
1796 // *AccountsList.ServerResponse.Header or (if a response was returned at
1797 // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
1798 // to check whether the returned error was because
1799 // http.StatusNotModified was returned.
1800 func (c *AccountsListCall) Do(opts ...googleapi.CallOption) (*AccountsList, error) {
1801 gensupport.SetOptions(c.urlParams_, opts...)
1802 res, err := c.doRequest("json")
1803 if res != nil && res.StatusCode == http.StatusNotModified {
1804 if res.Body != nil {
1805 res.Body.Close()
1806 }
1807 return nil, &googleapi.Error{
1808 Code: res.StatusCode,
1809 Header: res.Header,
1810 }
1811 }
1812 if err != nil {
1813 return nil, err
1814 }
1815 defer googleapi.CloseBody(res)
1816 if err := googleapi.CheckResponse(res); err != nil {
1817 return nil, err
1818 }
1819 ret := &AccountsList{
1820 ServerResponse: googleapi.ServerResponse{
1821 Header: res.Header,
1822 HTTPStatusCode: res.StatusCode,
1823 },
1824 }
1825 target := &ret
1826 if err := gensupport.DecodeResponse(target, res); err != nil {
1827 return nil, err
1828 }
1829 return ret, nil
1830 // {
1831 // "description": "Retrieves the authenticated user's list of accounts.",
1832 // "httpMethod": "GET",
1833 // "id": "adexchangebuyer.accounts.list",
1834 // "path": "accounts",
1835 // "response": {
1836 // "$ref": "AccountsList"
1837 // },
1838 // "scopes": [
1839 // "https://www.googleapis.com/auth/adexchange.buyer"
1840 // ]
1841 // }
1842
1843 }
1844
1845 // method id "adexchangebuyer.accounts.patch":
1846
1847 type AccountsPatchCall struct {
1848 s *Service
1849 id int64
1850 account *Account
1851 urlParams_ gensupport.URLParams
1852 ctx_ context.Context
1853 header_ http.Header
1854 }
1855
1856 // Patch: Updates an existing account. This method supports patch
1857 // semantics.
1858 //
1859 // - id: The account id.
1860 func (r *AccountsService) Patch(id int64, account *Account) *AccountsPatchCall {
1861 c := &AccountsPatchCall{s: r.s, urlParams_: make(gensupport.URLParams)}
1862 c.id = id
1863 c.account = account
1864 return c
1865 }
1866
1867 // Fields allows partial responses to be retrieved. See
1868 // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
1869 // for more information.
1870 func (c *AccountsPatchCall) Fields(s ...googleapi.Field) *AccountsPatchCall {
1871 c.urlParams_.Set("fields", googleapi.CombineFields(s))
1872 return c
1873 }
1874
1875 // Context sets the context to be used in this call's Do method. Any
1876 // pending HTTP request will be aborted if the provided context is
1877 // canceled.
1878 func (c *AccountsPatchCall) Context(ctx context.Context) *AccountsPatchCall {
1879 c.ctx_ = ctx
1880 return c
1881 }
1882
1883 // Header returns an http.Header that can be modified by the caller to
1884 // add HTTP headers to the request.
1885 func (c *AccountsPatchCall) Header() http.Header {
1886 if c.header_ == nil {
1887 c.header_ = make(http.Header)
1888 }
1889 return c.header_
1890 }
1891
1892 func (c *AccountsPatchCall) doRequest(alt string) (*http.Response, error) {
1893 reqHeaders := make(http.Header)
1894 reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/20210819")
1895 for k, v := range c.header_ {
1896 reqHeaders[k] = v
1897 }
1898 reqHeaders.Set("User-Agent", c.s.userAgent())
1899 var body io.Reader = nil
1900 body, err := googleapi.WithoutDataWrapper.JSONReader(c.account)
1901 if err != nil {
1902 return nil, err
1903 }
1904 reqHeaders.Set("Content-Type", "application/json")
1905 c.urlParams_.Set("alt", alt)
1906 c.urlParams_.Set("prettyPrint", "false")
1907 urls := googleapi.ResolveRelative(c.s.BasePath, "accounts/{id}")
1908 urls += "?" + c.urlParams_.Encode()
1909 req, err := http.NewRequest("PATCH", urls, body)
1910 if err != nil {
1911 return nil, err
1912 }
1913 req.Header = reqHeaders
1914 googleapi.Expand(req.URL, map[string]string{
1915 "id": strconv.FormatInt(c.id, 10),
1916 })
1917 return gensupport.SendRequest(c.ctx_, c.s.client, req)
1918 }
1919
1920 // Do executes the "adexchangebuyer.accounts.patch" call.
1921 // Exactly one of *Account or error will be non-nil. Any non-2xx status
1922 // code is an error. Response headers are in either
1923 // *Account.ServerResponse.Header or (if a response was returned at all)
1924 // in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to
1925 // check whether the returned error was because http.StatusNotModified
1926 // was returned.
1927 func (c *AccountsPatchCall) Do(opts ...googleapi.CallOption) (*Account, error) {
1928 gensupport.SetOptions(c.urlParams_, opts...)
1929 res, err := c.doRequest("json")
1930 if res != nil && res.StatusCode == http.StatusNotModified {
1931 if res.Body != nil {
1932 res.Body.Close()
1933 }
1934 return nil, &googleapi.Error{
1935 Code: res.StatusCode,
1936 Header: res.Header,
1937 }
1938 }
1939 if err != nil {
1940 return nil, err
1941 }
1942 defer googleapi.CloseBody(res)
1943 if err := googleapi.CheckResponse(res); err != nil {
1944 return nil, err
1945 }
1946 ret := &Account{
1947 ServerResponse: googleapi.ServerResponse{
1948 Header: res.Header,
1949 HTTPStatusCode: res.StatusCode,
1950 },
1951 }
1952 target := &ret
1953 if err := gensupport.DecodeResponse(target, res); err != nil {
1954 return nil, err
1955 }
1956 return ret, nil
1957 // {
1958 // "description": "Updates an existing account. This method supports patch semantics.",
1959 // "httpMethod": "PATCH",
1960 // "id": "adexchangebuyer.accounts.patch",
1961 // "parameterOrder": [
1962 // "id"
1963 // ],
1964 // "parameters": {
1965 // "id": {
1966 // "description": "The account id",
1967 // "format": "int32",
1968 // "location": "path",
1969 // "required": true,
1970 // "type": "integer"
1971 // }
1972 // },
1973 // "path": "accounts/{id}",
1974 // "request": {
1975 // "$ref": "Account"
1976 // },
1977 // "response": {
1978 // "$ref": "Account"
1979 // },
1980 // "scopes": [
1981 // "https://www.googleapis.com/auth/adexchange.buyer"
1982 // ]
1983 // }
1984
1985 }
1986
1987 // method id "adexchangebuyer.accounts.update":
1988
1989 type AccountsUpdateCall struct {
1990 s *Service
1991 id int64
1992 account *Account
1993 urlParams_ gensupport.URLParams
1994 ctx_ context.Context
1995 header_ http.Header
1996 }
1997
1998 // Update: Updates an existing account.
1999 //
2000 // - id: The account id.
2001 func (r *AccountsService) Update(id int64, account *Account) *AccountsUpdateCall {
2002 c := &AccountsUpdateCall{s: r.s, urlParams_: make(gensupport.URLParams)}
2003 c.id = id
2004 c.account = account
2005 return c
2006 }
2007
2008 // Fields allows partial responses to be retrieved. See
2009 // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
2010 // for more information.
2011 func (c *AccountsUpdateCall) Fields(s ...googleapi.Field) *AccountsUpdateCall {
2012 c.urlParams_.Set("fields", googleapi.CombineFields(s))
2013 return c
2014 }
2015
2016 // Context sets the context to be used in this call's Do method. Any
2017 // pending HTTP request will be aborted if the provided context is
2018 // canceled.
2019 func (c *AccountsUpdateCall) Context(ctx context.Context) *AccountsUpdateCall {
2020 c.ctx_ = ctx
2021 return c
2022 }
2023
2024 // Header returns an http.Header that can be modified by the caller to
2025 // add HTTP headers to the request.
2026 func (c *AccountsUpdateCall) Header() http.Header {
2027 if c.header_ == nil {
2028 c.header_ = make(http.Header)
2029 }
2030 return c.header_
2031 }
2032
2033 func (c *AccountsUpdateCall) doRequest(alt string) (*http.Response, error) {
2034 reqHeaders := make(http.Header)
2035 reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/20210819")
2036 for k, v := range c.header_ {
2037 reqHeaders[k] = v
2038 }
2039 reqHeaders.Set("User-Agent", c.s.userAgent())
2040 var body io.Reader = nil
2041 body, err := googleapi.WithoutDataWrapper.JSONReader(c.account)
2042 if err != nil {
2043 return nil, err
2044 }
2045 reqHeaders.Set("Content-Type", "application/json")
2046 c.urlParams_.Set("alt", alt)
2047 c.urlParams_.Set("prettyPrint", "false")
2048 urls := googleapi.ResolveRelative(c.s.BasePath, "accounts/{id}")
2049 urls += "?" + c.urlParams_.Encode()
2050 req, err := http.NewRequest("PUT", urls, body)
2051 if err != nil {
2052 return nil, err
2053 }
2054 req.Header = reqHeaders
2055 googleapi.Expand(req.URL, map[string]string{
2056 "id": strconv.FormatInt(c.id, 10),
2057 })
2058 return gensupport.SendRequest(c.ctx_, c.s.client, req)
2059 }
2060
2061 // Do executes the "adexchangebuyer.accounts.update" call.
2062 // Exactly one of *Account or error will be non-nil. Any non-2xx status
2063 // code is an error. Response headers are in either
2064 // *Account.ServerResponse.Header or (if a response was returned at all)
2065 // in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to
2066 // check whether the returned error was because http.StatusNotModified
2067 // was returned.
2068 func (c *AccountsUpdateCall) Do(opts ...googleapi.CallOption) (*Account, error) {
2069 gensupport.SetOptions(c.urlParams_, opts...)
2070 res, err := c.doRequest("json")
2071 if res != nil && res.StatusCode == http.StatusNotModified {
2072 if res.Body != nil {
2073 res.Body.Close()
2074 }
2075 return nil, &googleapi.Error{
2076 Code: res.StatusCode,
2077 Header: res.Header,
2078 }
2079 }
2080 if err != nil {
2081 return nil, err
2082 }
2083 defer googleapi.CloseBody(res)
2084 if err := googleapi.CheckResponse(res); err != nil {
2085 return nil, err
2086 }
2087 ret := &Account{
2088 ServerResponse: googleapi.ServerResponse{
2089 Header: res.Header,
2090 HTTPStatusCode: res.StatusCode,
2091 },
2092 }
2093 target := &ret
2094 if err := gensupport.DecodeResponse(target, res); err != nil {
2095 return nil, err
2096 }
2097 return ret, nil
2098 // {
2099 // "description": "Updates an existing account.",
2100 // "httpMethod": "PUT",
2101 // "id": "adexchangebuyer.accounts.update",
2102 // "parameterOrder": [
2103 // "id"
2104 // ],
2105 // "parameters": {
2106 // "id": {
2107 // "description": "The account id",
2108 // "format": "int32",
2109 // "location": "path",
2110 // "required": true,
2111 // "type": "integer"
2112 // }
2113 // },
2114 // "path": "accounts/{id}",
2115 // "request": {
2116 // "$ref": "Account"
2117 // },
2118 // "response": {
2119 // "$ref": "Account"
2120 // },
2121 // "scopes": [
2122 // "https://www.googleapis.com/auth/adexchange.buyer"
2123 // ]
2124 // }
2125
2126 }
2127
2128 // method id "adexchangebuyer.billingInfo.get":
2129
2130 type BillingInfoGetCall struct {
2131 s *Service
2132 accountId int64
2133 urlParams_ gensupport.URLParams
2134 ifNoneMatch_ string
2135 ctx_ context.Context
2136 header_ http.Header
2137 }
2138
2139 // Get: Returns the billing information for one account specified by
2140 // account ID.
2141 //
2142 // - accountId: The account id.
2143 func (r *BillingInfoService) Get(accountId int64) *BillingInfoGetCall {
2144 c := &BillingInfoGetCall{s: r.s, urlParams_: make(gensupport.URLParams)}
2145 c.accountId = accountId
2146 return c
2147 }
2148
2149 // Fields allows partial responses to be retrieved. See
2150 // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
2151 // for more information.
2152 func (c *BillingInfoGetCall) Fields(s ...googleapi.Field) *BillingInfoGetCall {
2153 c.urlParams_.Set("fields", googleapi.CombineFields(s))
2154 return c
2155 }
2156
2157 // IfNoneMatch sets the optional parameter which makes the operation
2158 // fail if the object's ETag matches the given value. This is useful for
2159 // getting updates only after the object has changed since the last
2160 // request. Use googleapi.IsNotModified to check whether the response
2161 // error from Do is the result of In-None-Match.
2162 func (c *BillingInfoGetCall) IfNoneMatch(entityTag string) *BillingInfoGetCall {
2163 c.ifNoneMatch_ = entityTag
2164 return c
2165 }
2166
2167 // Context sets the context to be used in this call's Do method. Any
2168 // pending HTTP request will be aborted if the provided context is
2169 // canceled.
2170 func (c *BillingInfoGetCall) Context(ctx context.Context) *BillingInfoGetCall {
2171 c.ctx_ = ctx
2172 return c
2173 }
2174
2175 // Header returns an http.Header that can be modified by the caller to
2176 // add HTTP headers to the request.
2177 func (c *BillingInfoGetCall) Header() http.Header {
2178 if c.header_ == nil {
2179 c.header_ = make(http.Header)
2180 }
2181 return c.header_
2182 }
2183
2184 func (c *BillingInfoGetCall) doRequest(alt string) (*http.Response, error) {
2185 reqHeaders := make(http.Header)
2186 reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/20210819")
2187 for k, v := range c.header_ {
2188 reqHeaders[k] = v
2189 }
2190 reqHeaders.Set("User-Agent", c.s.userAgent())
2191 if c.ifNoneMatch_ != "" {
2192 reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
2193 }
2194 var body io.Reader = nil
2195 c.urlParams_.Set("alt", alt)
2196 c.urlParams_.Set("prettyPrint", "false")
2197 urls := googleapi.ResolveRelative(c.s.BasePath, "billinginfo/{accountId}")
2198 urls += "?" + c.urlParams_.Encode()
2199 req, err := http.NewRequest("GET", urls, body)
2200 if err != nil {
2201 return nil, err
2202 }
2203 req.Header = reqHeaders
2204 googleapi.Expand(req.URL, map[string]string{
2205 "accountId": strconv.FormatInt(c.accountId, 10),
2206 })
2207 return gensupport.SendRequest(c.ctx_, c.s.client, req)
2208 }
2209
2210 // Do executes the "adexchangebuyer.billingInfo.get" call.
2211 // Exactly one of *BillingInfo or error will be non-nil. Any non-2xx
2212 // status code is an error. Response headers are in either
2213 // *BillingInfo.ServerResponse.Header or (if a response was returned at
2214 // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
2215 // to check whether the returned error was because
2216 // http.StatusNotModified was returned.
2217 func (c *BillingInfoGetCall) Do(opts ...googleapi.CallOption) (*BillingInfo, error) {
2218 gensupport.SetOptions(c.urlParams_, opts...)
2219 res, err := c.doRequest("json")
2220 if res != nil && res.StatusCode == http.StatusNotModified {
2221 if res.Body != nil {
2222 res.Body.Close()
2223 }
2224 return nil, &googleapi.Error{
2225 Code: res.StatusCode,
2226 Header: res.Header,
2227 }
2228 }
2229 if err != nil {
2230 return nil, err
2231 }
2232 defer googleapi.CloseBody(res)
2233 if err := googleapi.CheckResponse(res); err != nil {
2234 return nil, err
2235 }
2236 ret := &BillingInfo{
2237 ServerResponse: googleapi.ServerResponse{
2238 Header: res.Header,
2239 HTTPStatusCode: res.StatusCode,
2240 },
2241 }
2242 target := &ret
2243 if err := gensupport.DecodeResponse(target, res); err != nil {
2244 return nil, err
2245 }
2246 return ret, nil
2247 // {
2248 // "description": "Returns the billing information for one account specified by account ID.",
2249 // "httpMethod": "GET",
2250 // "id": "adexchangebuyer.billingInfo.get",
2251 // "parameterOrder": [
2252 // "accountId"
2253 // ],
2254 // "parameters": {
2255 // "accountId": {
2256 // "description": "The account id.",
2257 // "format": "int32",
2258 // "location": "path",
2259 // "required": true,
2260 // "type": "integer"
2261 // }
2262 // },
2263 // "path": "billinginfo/{accountId}",
2264 // "response": {
2265 // "$ref": "BillingInfo"
2266 // },
2267 // "scopes": [
2268 // "https://www.googleapis.com/auth/adexchange.buyer"
2269 // ]
2270 // }
2271
2272 }
2273
2274 // method id "adexchangebuyer.billingInfo.list":
2275
2276 type BillingInfoListCall struct {
2277 s *Service
2278 urlParams_ gensupport.URLParams
2279 ifNoneMatch_ string
2280 ctx_ context.Context
2281 header_ http.Header
2282 }
2283
2284 // List: Retrieves a list of billing information for all accounts of the
2285 // authenticated user.
2286 func (r *BillingInfoService) List() *BillingInfoListCall {
2287 c := &BillingInfoListCall{s: r.s, urlParams_: make(gensupport.URLParams)}
2288 return c
2289 }
2290
2291 // Fields allows partial responses to be retrieved. See
2292 // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
2293 // for more information.
2294 func (c *BillingInfoListCall) Fields(s ...googleapi.Field) *BillingInfoListCall {
2295 c.urlParams_.Set("fields", googleapi.CombineFields(s))
2296 return c
2297 }
2298
2299 // IfNoneMatch sets the optional parameter which makes the operation
2300 // fail if the object's ETag matches the given value. This is useful for
2301 // getting updates only after the object has changed since the last
2302 // request. Use googleapi.IsNotModified to check whether the response
2303 // error from Do is the result of In-None-Match.
2304 func (c *BillingInfoListCall) IfNoneMatch(entityTag string) *BillingInfoListCall {
2305 c.ifNoneMatch_ = entityTag
2306 return c
2307 }
2308
2309 // Context sets the context to be used in this call's Do method. Any
2310 // pending HTTP request will be aborted if the provided context is
2311 // canceled.
2312 func (c *BillingInfoListCall) Context(ctx context.Context) *BillingInfoListCall {
2313 c.ctx_ = ctx
2314 return c
2315 }
2316
2317 // Header returns an http.Header that can be modified by the caller to
2318 // add HTTP headers to the request.
2319 func (c *BillingInfoListCall) Header() http.Header {
2320 if c.header_ == nil {
2321 c.header_ = make(http.Header)
2322 }
2323 return c.header_
2324 }
2325
2326 func (c *BillingInfoListCall) doRequest(alt string) (*http.Response, error) {
2327 reqHeaders := make(http.Header)
2328 reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/20210819")
2329 for k, v := range c.header_ {
2330 reqHeaders[k] = v
2331 }
2332 reqHeaders.Set("User-Agent", c.s.userAgent())
2333 if c.ifNoneMatch_ != "" {
2334 reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
2335 }
2336 var body io.Reader = nil
2337 c.urlParams_.Set("alt", alt)
2338 c.urlParams_.Set("prettyPrint", "false")
2339 urls := googleapi.ResolveRelative(c.s.BasePath, "billinginfo")
2340 urls += "?" + c.urlParams_.Encode()
2341 req, err := http.NewRequest("GET", urls, body)
2342 if err != nil {
2343 return nil, err
2344 }
2345 req.Header = reqHeaders
2346 return gensupport.SendRequest(c.ctx_, c.s.client, req)
2347 }
2348
2349 // Do executes the "adexchangebuyer.billingInfo.list" call.
2350 // Exactly one of *BillingInfoList or error will be non-nil. Any non-2xx
2351 // status code is an error. Response headers are in either
2352 // *BillingInfoList.ServerResponse.Header or (if a response was returned
2353 // at all) in error.(*googleapi.Error).Header. Use
2354 // googleapi.IsNotModified to check whether the returned error was
2355 // because http.StatusNotModified was returned.
2356 func (c *BillingInfoListCall) Do(opts ...googleapi.CallOption) (*BillingInfoList, error) {
2357 gensupport.SetOptions(c.urlParams_, opts...)
2358 res, err := c.doRequest("json")
2359 if res != nil && res.StatusCode == http.StatusNotModified {
2360 if res.Body != nil {
2361 res.Body.Close()
2362 }
2363 return nil, &googleapi.Error{
2364 Code: res.StatusCode,
2365 Header: res.Header,
2366 }
2367 }
2368 if err != nil {
2369 return nil, err
2370 }
2371 defer googleapi.CloseBody(res)
2372 if err := googleapi.CheckResponse(res); err != nil {
2373 return nil, err
2374 }
2375 ret := &BillingInfoList{
2376 ServerResponse: googleapi.ServerResponse{
2377 Header: res.Header,
2378 HTTPStatusCode: res.StatusCode,
2379 },
2380 }
2381 target := &ret
2382 if err := gensupport.DecodeResponse(target, res); err != nil {
2383 return nil, err
2384 }
2385 return ret, nil
2386 // {
2387 // "description": "Retrieves a list of billing information for all accounts of the authenticated user.",
2388 // "httpMethod": "GET",
2389 // "id": "adexchangebuyer.billingInfo.list",
2390 // "path": "billinginfo",
2391 // "response": {
2392 // "$ref": "BillingInfoList"
2393 // },
2394 // "scopes": [
2395 // "https://www.googleapis.com/auth/adexchange.buyer"
2396 // ]
2397 // }
2398
2399 }
2400
2401 // method id "adexchangebuyer.budget.get":
2402
2403 type BudgetGetCall struct {
2404 s *Service
2405 accountId int64
2406 billingId int64
2407 urlParams_ gensupport.URLParams
2408 ifNoneMatch_ string
2409 ctx_ context.Context
2410 header_ http.Header
2411 }
2412
2413 // Get: Returns the budget information for the adgroup specified by the
2414 // accountId and billingId.
2415 //
2416 // - accountId: The account id to get the budget information for.
2417 // - billingId: The billing id to get the budget information for.
2418 func (r *BudgetService) Get(accountId int64, billingId int64) *BudgetGetCall {
2419 c := &BudgetGetCall{s: r.s, urlParams_: make(gensupport.URLParams)}
2420 c.accountId = accountId
2421 c.billingId = billingId
2422 return c
2423 }
2424
2425 // Fields allows partial responses to be retrieved. See
2426 // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
2427 // for more information.
2428 func (c *BudgetGetCall) Fields(s ...googleapi.Field) *BudgetGetCall {
2429 c.urlParams_.Set("fields", googleapi.CombineFields(s))
2430 return c
2431 }
2432
2433 // IfNoneMatch sets the optional parameter which makes the operation
2434 // fail if the object's ETag matches the given value. This is useful for
2435 // getting updates only after the object has changed since the last
2436 // request. Use googleapi.IsNotModified to check whether the response
2437 // error from Do is the result of In-None-Match.
2438 func (c *BudgetGetCall) IfNoneMatch(entityTag string) *BudgetGetCall {
2439 c.ifNoneMatch_ = entityTag
2440 return c
2441 }
2442
2443 // Context sets the context to be used in this call's Do method. Any
2444 // pending HTTP request will be aborted if the provided context is
2445 // canceled.
2446 func (c *BudgetGetCall) Context(ctx context.Context) *BudgetGetCall {
2447 c.ctx_ = ctx
2448 return c
2449 }
2450
2451 // Header returns an http.Header that can be modified by the caller to
2452 // add HTTP headers to the request.
2453 func (c *BudgetGetCall) Header() http.Header {
2454 if c.header_ == nil {
2455 c.header_ = make(http.Header)
2456 }
2457 return c.header_
2458 }
2459
2460 func (c *BudgetGetCall) doRequest(alt string) (*http.Response, error) {
2461 reqHeaders := make(http.Header)
2462 reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/20210819")
2463 for k, v := range c.header_ {
2464 reqHeaders[k] = v
2465 }
2466 reqHeaders.Set("User-Agent", c.s.userAgent())
2467 if c.ifNoneMatch_ != "" {
2468 reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
2469 }
2470 var body io.Reader = nil
2471 c.urlParams_.Set("alt", alt)
2472 c.urlParams_.Set("prettyPrint", "false")
2473 urls := googleapi.ResolveRelative(c.s.BasePath, "billinginfo/{accountId}/{billingId}")
2474 urls += "?" + c.urlParams_.Encode()
2475 req, err := http.NewRequest("GET", urls, body)
2476 if err != nil {
2477 return nil, err
2478 }
2479 req.Header = reqHeaders
2480 googleapi.Expand(req.URL, map[string]string{
2481 "accountId": strconv.FormatInt(c.accountId, 10),
2482 "billingId": strconv.FormatInt(c.billingId, 10),
2483 })
2484 return gensupport.SendRequest(c.ctx_, c.s.client, req)
2485 }
2486
2487 // Do executes the "adexchangebuyer.budget.get" call.
2488 // Exactly one of *Budget or error will be non-nil. Any non-2xx status
2489 // code is an error. Response headers are in either
2490 // *Budget.ServerResponse.Header or (if a response was returned at all)
2491 // in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to
2492 // check whether the returned error was because http.StatusNotModified
2493 // was returned.
2494 func (c *BudgetGetCall) Do(opts ...googleapi.CallOption) (*Budget, error) {
2495 gensupport.SetOptions(c.urlParams_, opts...)
2496 res, err := c.doRequest("json")
2497 if res != nil && res.StatusCode == http.StatusNotModified {
2498 if res.Body != nil {
2499 res.Body.Close()
2500 }
2501 return nil, &googleapi.Error{
2502 Code: res.StatusCode,
2503 Header: res.Header,
2504 }
2505 }
2506 if err != nil {
2507 return nil, err
2508 }
2509 defer googleapi.CloseBody(res)
2510 if err := googleapi.CheckResponse(res); err != nil {
2511 return nil, err
2512 }
2513 ret := &Budget{
2514 ServerResponse: googleapi.ServerResponse{
2515 Header: res.Header,
2516 HTTPStatusCode: res.StatusCode,
2517 },
2518 }
2519 target := &ret
2520 if err := gensupport.DecodeResponse(target, res); err != nil {
2521 return nil, err
2522 }
2523 return ret, nil
2524 // {
2525 // "description": "Returns the budget information for the adgroup specified by the accountId and billingId.",
2526 // "httpMethod": "GET",
2527 // "id": "adexchangebuyer.budget.get",
2528 // "parameterOrder": [
2529 // "accountId",
2530 // "billingId"
2531 // ],
2532 // "parameters": {
2533 // "accountId": {
2534 // "description": "The account id to get the budget information for.",
2535 // "format": "int64",
2536 // "location": "path",
2537 // "required": true,
2538 // "type": "string"
2539 // },
2540 // "billingId": {
2541 // "description": "The billing id to get the budget information for.",
2542 // "format": "int64",
2543 // "location": "path",
2544 // "required": true,
2545 // "type": "string"
2546 // }
2547 // },
2548 // "path": "billinginfo/{accountId}/{billingId}",
2549 // "response": {
2550 // "$ref": "Budget"
2551 // },
2552 // "scopes": [
2553 // "https://www.googleapis.com/auth/adexchange.buyer"
2554 // ]
2555 // }
2556
2557 }
2558
2559 // method id "adexchangebuyer.budget.patch":
2560
2561 type BudgetPatchCall struct {
2562 s *Service
2563 accountId int64
2564 billingId int64
2565 budget *Budget
2566 urlParams_ gensupport.URLParams
2567 ctx_ context.Context
2568 header_ http.Header
2569 }
2570
2571 // Patch: Updates the budget amount for the budget of the adgroup
2572 // specified by the accountId and billingId, with the budget amount in
2573 // the request. This method supports patch semantics.
2574 //
2575 // - accountId: The account id associated with the budget being updated.
2576 // - billingId: The billing id associated with the budget being updated.
2577 func (r *BudgetService) Patch(accountId int64, billingId int64, budget *Budget) *BudgetPatchCall {
2578 c := &BudgetPatchCall{s: r.s, urlParams_: make(gensupport.URLParams)}
2579 c.accountId = accountId
2580 c.billingId = billingId
2581 c.budget = budget
2582 return c
2583 }
2584
2585 // Fields allows partial responses to be retrieved. See
2586 // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
2587 // for more information.
2588 func (c *BudgetPatchCall) Fields(s ...googleapi.Field) *BudgetPatchCall {
2589 c.urlParams_.Set("fields", googleapi.CombineFields(s))
2590 return c
2591 }
2592
2593 // Context sets the context to be used in this call's Do method. Any
2594 // pending HTTP request will be aborted if the provided context is
2595 // canceled.
2596 func (c *BudgetPatchCall) Context(ctx context.Context) *BudgetPatchCall {
2597 c.ctx_ = ctx
2598 return c
2599 }
2600
2601 // Header returns an http.Header that can be modified by the caller to
2602 // add HTTP headers to the request.
2603 func (c *BudgetPatchCall) Header() http.Header {
2604 if c.header_ == nil {
2605 c.header_ = make(http.Header)
2606 }
2607 return c.header_
2608 }
2609
2610 func (c *BudgetPatchCall) doRequest(alt string) (*http.Response, error) {
2611 reqHeaders := make(http.Header)
2612 reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/20210819")
2613 for k, v := range c.header_ {
2614 reqHeaders[k] = v
2615 }
2616 reqHeaders.Set("User-Agent", c.s.userAgent())
2617 var body io.Reader = nil
2618 body, err := googleapi.WithoutDataWrapper.JSONReader(c.budget)
2619 if err != nil {
2620 return nil, err
2621 }
2622 reqHeaders.Set("Content-Type", "application/json")
2623 c.urlParams_.Set("alt", alt)
2624 c.urlParams_.Set("prettyPrint", "false")
2625 urls := googleapi.ResolveRelative(c.s.BasePath, "billinginfo/{accountId}/{billingId}")
2626 urls += "?" + c.urlParams_.Encode()
2627 req, err := http.NewRequest("PATCH", urls, body)
2628 if err != nil {
2629 return nil, err
2630 }
2631 req.Header = reqHeaders
2632 googleapi.Expand(req.URL, map[string]string{
2633 "accountId": strconv.FormatInt(c.accountId, 10),
2634 "billingId": strconv.FormatInt(c.billingId, 10),
2635 })
2636 return gensupport.SendRequest(c.ctx_, c.s.client, req)
2637 }
2638
2639 // Do executes the "adexchangebuyer.budget.patch" call.
2640 // Exactly one of *Budget or error will be non-nil. Any non-2xx status
2641 // code is an error. Response headers are in either
2642 // *Budget.ServerResponse.Header or (if a response was returned at all)
2643 // in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to
2644 // check whether the returned error was because http.StatusNotModified
2645 // was returned.
2646 func (c *BudgetPatchCall) Do(opts ...googleapi.CallOption) (*Budget, error) {
2647 gensupport.SetOptions(c.urlParams_, opts...)
2648 res, err := c.doRequest("json")
2649 if res != nil && res.StatusCode == http.StatusNotModified {
2650 if res.Body != nil {
2651 res.Body.Close()
2652 }
2653 return nil, &googleapi.Error{
2654 Code: res.StatusCode,
2655 Header: res.Header,
2656 }
2657 }
2658 if err != nil {
2659 return nil, err
2660 }
2661 defer googleapi.CloseBody(res)
2662 if err := googleapi.CheckResponse(res); err != nil {
2663 return nil, err
2664 }
2665 ret := &Budget{
2666 ServerResponse: googleapi.ServerResponse{
2667 Header: res.Header,
2668 HTTPStatusCode: res.StatusCode,
2669 },
2670 }
2671 target := &ret
2672 if err := gensupport.DecodeResponse(target, res); err != nil {
2673 return nil, err
2674 }
2675 return ret, nil
2676 // {
2677 // "description": "Updates the budget amount for the budget of the adgroup specified by the accountId and billingId, with the budget amount in the request. This method supports patch semantics.",
2678 // "httpMethod": "PATCH",
2679 // "id": "adexchangebuyer.budget.patch",
2680 // "parameterOrder": [
2681 // "accountId",
2682 // "billingId"
2683 // ],
2684 // "parameters": {
2685 // "accountId": {
2686 // "description": "The account id associated with the budget being updated.",
2687 // "format": "int64",
2688 // "location": "path",
2689 // "required": true,
2690 // "type": "string"
2691 // },
2692 // "billingId": {
2693 // "description": "The billing id associated with the budget being updated.",
2694 // "format": "int64",
2695 // "location": "path",
2696 // "required": true,
2697 // "type": "string"
2698 // }
2699 // },
2700 // "path": "billinginfo/{accountId}/{billingId}",
2701 // "request": {
2702 // "$ref": "Budget"
2703 // },
2704 // "response": {
2705 // "$ref": "Budget"
2706 // },
2707 // "scopes": [
2708 // "https://www.googleapis.com/auth/adexchange.buyer"
2709 // ]
2710 // }
2711
2712 }
2713
2714 // method id "adexchangebuyer.budget.update":
2715
2716 type BudgetUpdateCall struct {
2717 s *Service
2718 accountId int64
2719 billingId int64
2720 budget *Budget
2721 urlParams_ gensupport.URLParams
2722 ctx_ context.Context
2723 header_ http.Header
2724 }
2725
2726 // Update: Updates the budget amount for the budget of the adgroup
2727 // specified by the accountId and billingId, with the budget amount in
2728 // the request.
2729 //
2730 // - accountId: The account id associated with the budget being updated.
2731 // - billingId: The billing id associated with the budget being updated.
2732 func (r *BudgetService) Update(accountId int64, billingId int64, budget *Budget) *BudgetUpdateCall {
2733 c := &BudgetUpdateCall{s: r.s, urlParams_: make(gensupport.URLParams)}
2734 c.accountId = accountId
2735 c.billingId = billingId
2736 c.budget = budget
2737 return c
2738 }
2739
2740 // Fields allows partial responses to be retrieved. See
2741 // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
2742 // for more information.
2743 func (c *BudgetUpdateCall) Fields(s ...googleapi.Field) *BudgetUpdateCall {
2744 c.urlParams_.Set("fields", googleapi.CombineFields(s))
2745 return c
2746 }
2747
2748 // Context sets the context to be used in this call's Do method. Any
2749 // pending HTTP request will be aborted if the provided context is
2750 // canceled.
2751 func (c *BudgetUpdateCall) Context(ctx context.Context) *BudgetUpdateCall {
2752 c.ctx_ = ctx
2753 return c
2754 }
2755
2756 // Header returns an http.Header that can be modified by the caller to
2757 // add HTTP headers to the request.
2758 func (c *BudgetUpdateCall) Header() http.Header {
2759 if c.header_ == nil {
2760 c.header_ = make(http.Header)
2761 }
2762 return c.header_
2763 }
2764
2765 func (c *BudgetUpdateCall) doRequest(alt string) (*http.Response, error) {
2766 reqHeaders := make(http.Header)
2767 reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/20210819")
2768 for k, v := range c.header_ {
2769 reqHeaders[k] = v
2770 }
2771 reqHeaders.Set("User-Agent", c.s.userAgent())
2772 var body io.Reader = nil
2773 body, err := googleapi.WithoutDataWrapper.JSONReader(c.budget)
2774 if err != nil {
2775 return nil, err
2776 }
2777 reqHeaders.Set("Content-Type", "application/json")
2778 c.urlParams_.Set("alt", alt)
2779 c.urlParams_.Set("prettyPrint", "false")
2780 urls := googleapi.ResolveRelative(c.s.BasePath, "billinginfo/{accountId}/{billingId}")
2781 urls += "?" + c.urlParams_.Encode()
2782 req, err := http.NewRequest("PUT", urls, body)
2783 if err != nil {
2784 return nil, err
2785 }
2786 req.Header = reqHeaders
2787 googleapi.Expand(req.URL, map[string]string{
2788 "accountId": strconv.FormatInt(c.accountId, 10),
2789 "billingId": strconv.FormatInt(c.billingId, 10),
2790 })
2791 return gensupport.SendRequest(c.ctx_, c.s.client, req)
2792 }
2793
2794 // Do executes the "adexchangebuyer.budget.update" call.
2795 // Exactly one of *Budget or error will be non-nil. Any non-2xx status
2796 // code is an error. Response headers are in either
2797 // *Budget.ServerResponse.Header or (if a response was returned at all)
2798 // in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to
2799 // check whether the returned error was because http.StatusNotModified
2800 // was returned.
2801 func (c *BudgetUpdateCall) Do(opts ...googleapi.CallOption) (*Budget, error) {
2802 gensupport.SetOptions(c.urlParams_, opts...)
2803 res, err := c.doRequest("json")
2804 if res != nil && res.StatusCode == http.StatusNotModified {
2805 if res.Body != nil {
2806 res.Body.Close()
2807 }
2808 return nil, &googleapi.Error{
2809 Code: res.StatusCode,
2810 Header: res.Header,
2811 }
2812 }
2813 if err != nil {
2814 return nil, err
2815 }
2816 defer googleapi.CloseBody(res)
2817 if err := googleapi.CheckResponse(res); err != nil {
2818 return nil, err
2819 }
2820 ret := &Budget{
2821 ServerResponse: googleapi.ServerResponse{
2822 Header: res.Header,
2823 HTTPStatusCode: res.StatusCode,
2824 },
2825 }
2826 target := &ret
2827 if err := gensupport.DecodeResponse(target, res); err != nil {
2828 return nil, err
2829 }
2830 return ret, nil
2831 // {
2832 // "description": "Updates the budget amount for the budget of the adgroup specified by the accountId and billingId, with the budget amount in the request.",
2833 // "httpMethod": "PUT",
2834 // "id": "adexchangebuyer.budget.update",
2835 // "parameterOrder": [
2836 // "accountId",
2837 // "billingId"
2838 // ],
2839 // "parameters": {
2840 // "accountId": {
2841 // "description": "The account id associated with the budget being updated.",
2842 // "format": "int64",
2843 // "location": "path",
2844 // "required": true,
2845 // "type": "string"
2846 // },
2847 // "billingId": {
2848 // "description": "The billing id associated with the budget being updated.",
2849 // "format": "int64",
2850 // "location": "path",
2851 // "required": true,
2852 // "type": "string"
2853 // }
2854 // },
2855 // "path": "billinginfo/{accountId}/{billingId}",
2856 // "request": {
2857 // "$ref": "Budget"
2858 // },
2859 // "response": {
2860 // "$ref": "Budget"
2861 // },
2862 // "scopes": [
2863 // "https://www.googleapis.com/auth/adexchange.buyer"
2864 // ]
2865 // }
2866
2867 }
2868
2869 // method id "adexchangebuyer.creatives.get":
2870
2871 type CreativesGetCall struct {
2872 s *Service
2873 accountId int64
2874 buyerCreativeId string
2875 urlParams_ gensupport.URLParams
2876 ifNoneMatch_ string
2877 ctx_ context.Context
2878 header_ http.Header
2879 }
2880
2881 // Get: Gets the status for a single creative. A creative will be
2882 // available 30-40 minutes after submission.
2883 //
2884 // - accountId: The id for the account that will serve this creative.
2885 // - buyerCreativeId: The buyer-specific id for this creative.
2886 func (r *CreativesService) Get(accountId int64, buyerCreativeId string) *CreativesGetCall {
2887 c := &CreativesGetCall{s: r.s, urlParams_: make(gensupport.URLParams)}
2888 c.accountId = accountId
2889 c.buyerCreativeId = buyerCreativeId
2890 return c
2891 }
2892
2893 // Fields allows partial responses to be retrieved. See
2894 // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
2895 // for more information.
2896 func (c *CreativesGetCall) Fields(s ...googleapi.Field) *CreativesGetCall {
2897 c.urlParams_.Set("fields", googleapi.CombineFields(s))
2898 return c
2899 }
2900
2901 // IfNoneMatch sets the optional parameter which makes the operation
2902 // fail if the object's ETag matches the given value. This is useful for
2903 // getting updates only after the object has changed since the last
2904 // request. Use googleapi.IsNotModified to check whether the response
2905 // error from Do is the result of In-None-Match.
2906 func (c *CreativesGetCall) IfNoneMatch(entityTag string) *CreativesGetCall {
2907 c.ifNoneMatch_ = entityTag
2908 return c
2909 }
2910
2911 // Context sets the context to be used in this call's Do method. Any
2912 // pending HTTP request will be aborted if the provided context is
2913 // canceled.
2914 func (c *CreativesGetCall) Context(ctx context.Context) *CreativesGetCall {
2915 c.ctx_ = ctx
2916 return c
2917 }
2918
2919 // Header returns an http.Header that can be modified by the caller to
2920 // add HTTP headers to the request.
2921 func (c *CreativesGetCall) Header() http.Header {
2922 if c.header_ == nil {
2923 c.header_ = make(http.Header)
2924 }
2925 return c.header_
2926 }
2927
2928 func (c *CreativesGetCall) doRequest(alt string) (*http.Response, error) {
2929 reqHeaders := make(http.Header)
2930 reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/20210819")
2931 for k, v := range c.header_ {
2932 reqHeaders[k] = v
2933 }
2934 reqHeaders.Set("User-Agent", c.s.userAgent())
2935 if c.ifNoneMatch_ != "" {
2936 reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
2937 }
2938 var body io.Reader = nil
2939 c.urlParams_.Set("alt", alt)
2940 c.urlParams_.Set("prettyPrint", "false")
2941 urls := googleapi.ResolveRelative(c.s.BasePath, "creatives/{accountId}/{buyerCreativeId}")
2942 urls += "?" + c.urlParams_.Encode()
2943 req, err := http.NewRequest("GET", urls, body)
2944 if err != nil {
2945 return nil, err
2946 }
2947 req.Header = reqHeaders
2948 googleapi.Expand(req.URL, map[string]string{
2949 "accountId": strconv.FormatInt(c.accountId, 10),
2950 "buyerCreativeId": c.buyerCreativeId,
2951 })
2952 return gensupport.SendRequest(c.ctx_, c.s.client, req)
2953 }
2954
2955 // Do executes the "adexchangebuyer.creatives.get" call.
2956 // Exactly one of *Creative or error will be non-nil. Any non-2xx status
2957 // code is an error. Response headers are in either
2958 // *Creative.ServerResponse.Header or (if a response was returned at
2959 // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
2960 // to check whether the returned error was because
2961 // http.StatusNotModified was returned.
2962 func (c *CreativesGetCall) Do(opts ...googleapi.CallOption) (*Creative, error) {
2963 gensupport.SetOptions(c.urlParams_, opts...)
2964 res, err := c.doRequest("json")
2965 if res != nil && res.StatusCode == http.StatusNotModified {
2966 if res.Body != nil {
2967 res.Body.Close()
2968 }
2969 return nil, &googleapi.Error{
2970 Code: res.StatusCode,
2971 Header: res.Header,
2972 }
2973 }
2974 if err != nil {
2975 return nil, err
2976 }
2977 defer googleapi.CloseBody(res)
2978 if err := googleapi.CheckResponse(res); err != nil {
2979 return nil, err
2980 }
2981 ret := &Creative{
2982 ServerResponse: googleapi.ServerResponse{
2983 Header: res.Header,
2984 HTTPStatusCode: res.StatusCode,
2985 },
2986 }
2987 target := &ret
2988 if err := gensupport.DecodeResponse(target, res); err != nil {
2989 return nil, err
2990 }
2991 return ret, nil
2992 // {
2993 // "description": "Gets the status for a single creative. A creative will be available 30-40 minutes after submission.",
2994 // "httpMethod": "GET",
2995 // "id": "adexchangebuyer.creatives.get",
2996 // "parameterOrder": [
2997 // "accountId",
2998 // "buyerCreativeId"
2999 // ],
3000 // "parameters": {
3001 // "accountId": {
3002 // "description": "The id for the account that will serve this creative.",
3003 // "format": "int32",
3004 // "location": "path",
3005 // "required": true,
3006 // "type": "integer"
3007 // },
3008 // "buyerCreativeId": {
3009 // "description": "The buyer-specific id for this creative.",
3010 // "location": "path",
3011 // "required": true,
3012 // "type": "string"
3013 // }
3014 // },
3015 // "path": "creatives/{accountId}/{buyerCreativeId}",
3016 // "response": {
3017 // "$ref": "Creative"
3018 // },
3019 // "scopes": [
3020 // "https://www.googleapis.com/auth/adexchange.buyer"
3021 // ]
3022 // }
3023
3024 }
3025
3026 // method id "adexchangebuyer.creatives.insert":
3027
3028 type CreativesInsertCall struct {
3029 s *Service
3030 creative *Creative
3031 urlParams_ gensupport.URLParams
3032 ctx_ context.Context
3033 header_ http.Header
3034 }
3035
3036 // Insert: Submit a new creative.
3037 func (r *CreativesService) Insert(creative *Creative) *CreativesInsertCall {
3038 c := &CreativesInsertCall{s: r.s, urlParams_: make(gensupport.URLParams)}
3039 c.creative = creative
3040 return c
3041 }
3042
3043 // Fields allows partial responses to be retrieved. See
3044 // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
3045 // for more information.
3046 func (c *CreativesInsertCall) Fields(s ...googleapi.Field) *CreativesInsertCall {
3047 c.urlParams_.Set("fields", googleapi.CombineFields(s))
3048 return c
3049 }
3050
3051 // Context sets the context to be used in this call's Do method. Any
3052 // pending HTTP request will be aborted if the provided context is
3053 // canceled.
3054 func (c *CreativesInsertCall) Context(ctx context.Context) *CreativesInsertCall {
3055 c.ctx_ = ctx
3056 return c
3057 }
3058
3059 // Header returns an http.Header that can be modified by the caller to
3060 // add HTTP headers to the request.
3061 func (c *CreativesInsertCall) Header() http.Header {
3062 if c.header_ == nil {
3063 c.header_ = make(http.Header)
3064 }
3065 return c.header_
3066 }
3067
3068 func (c *CreativesInsertCall) doRequest(alt string) (*http.Response, error) {
3069 reqHeaders := make(http.Header)
3070 reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/20210819")
3071 for k, v := range c.header_ {
3072 reqHeaders[k] = v
3073 }
3074 reqHeaders.Set("User-Agent", c.s.userAgent())
3075 var body io.Reader = nil
3076 body, err := googleapi.WithoutDataWrapper.JSONReader(c.creative)
3077 if err != nil {
3078 return nil, err
3079 }
3080 reqHeaders.Set("Content-Type", "application/json")
3081 c.urlParams_.Set("alt", alt)
3082 c.urlParams_.Set("prettyPrint", "false")
3083 urls := googleapi.ResolveRelative(c.s.BasePath, "creatives")
3084 urls += "?" + c.urlParams_.Encode()
3085 req, err := http.NewRequest("POST", urls, body)
3086 if err != nil {
3087 return nil, err
3088 }
3089 req.Header = reqHeaders
3090 return gensupport.SendRequest(c.ctx_, c.s.client, req)
3091 }
3092
3093 // Do executes the "adexchangebuyer.creatives.insert" call.
3094 // Exactly one of *Creative or error will be non-nil. Any non-2xx status
3095 // code is an error. Response headers are in either
3096 // *Creative.ServerResponse.Header or (if a response was returned at
3097 // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
3098 // to check whether the returned error was because
3099 // http.StatusNotModified was returned.
3100 func (c *CreativesInsertCall) Do(opts ...googleapi.CallOption) (*Creative, error) {
3101 gensupport.SetOptions(c.urlParams_, opts...)
3102 res, err := c.doRequest("json")
3103 if res != nil && res.StatusCode == http.StatusNotModified {
3104 if res.Body != nil {
3105 res.Body.Close()
3106 }
3107 return nil, &googleapi.Error{
3108 Code: res.StatusCode,
3109 Header: res.Header,
3110 }
3111 }
3112 if err != nil {
3113 return nil, err
3114 }
3115 defer googleapi.CloseBody(res)
3116 if err := googleapi.CheckResponse(res); err != nil {
3117 return nil, err
3118 }
3119 ret := &Creative{
3120 ServerResponse: googleapi.ServerResponse{
3121 Header: res.Header,
3122 HTTPStatusCode: res.StatusCode,
3123 },
3124 }
3125 target := &ret
3126 if err := gensupport.DecodeResponse(target, res); err != nil {
3127 return nil, err
3128 }
3129 return ret, nil
3130 // {
3131 // "description": "Submit a new creative.",
3132 // "httpMethod": "POST",
3133 // "id": "adexchangebuyer.creatives.insert",
3134 // "path": "creatives",
3135 // "request": {
3136 // "$ref": "Creative"
3137 // },
3138 // "response": {
3139 // "$ref": "Creative"
3140 // },
3141 // "scopes": [
3142 // "https://www.googleapis.com/auth/adexchange.buyer"
3143 // ]
3144 // }
3145
3146 }
3147
3148 // method id "adexchangebuyer.creatives.list":
3149
3150 type CreativesListCall struct {
3151 s *Service
3152 urlParams_ gensupport.URLParams
3153 ifNoneMatch_ string
3154 ctx_ context.Context
3155 header_ http.Header
3156 }
3157
3158 // List: Retrieves a list of the authenticated user's active creatives.
3159 // A creative will be available 30-40 minutes after submission.
3160 func (r *CreativesService) List() *CreativesListCall {
3161 c := &CreativesListCall{s: r.s, urlParams_: make(gensupport.URLParams)}
3162 return c
3163 }
3164
3165 // AccountId sets the optional parameter "accountId": When specified,
3166 // only creatives for the given account ids are returned.
3167 func (c *CreativesListCall) AccountId(accountId ...int64) *CreativesListCall {
3168 var accountId_ []string
3169 for _, v := range accountId {
3170 accountId_ = append(accountId_, fmt.Sprint(v))
3171 }
3172 c.urlParams_.SetMulti("accountId", accountId_)
3173 return c
3174 }
3175
3176 // BuyerCreativeId sets the optional parameter "buyerCreativeId": When
3177 // specified, only creatives for the given buyer creative ids are
3178 // returned.
3179 func (c *CreativesListCall) BuyerCreativeId(buyerCreativeId ...string) *CreativesListCall {
3180 c.urlParams_.SetMulti("buyerCreativeId", append([]string{}, buyerCreativeId...))
3181 return c
3182 }
3183
3184 // MaxResults sets the optional parameter "maxResults": Maximum number
3185 // of entries returned on one result page. If not set, the default is
3186 // 100.
3187 func (c *CreativesListCall) MaxResults(maxResults int64) *CreativesListCall {
3188 c.urlParams_.Set("maxResults", fmt.Sprint(maxResults))
3189 return c
3190 }
3191
3192 // PageToken sets the optional parameter "pageToken": A continuation
3193 // token, used to page through ad clients. To retrieve the next page,
3194 // set this parameter to the value of "nextPageToken" from the previous
3195 // response.
3196 func (c *CreativesListCall) PageToken(pageToken string) *CreativesListCall {
3197 c.urlParams_.Set("pageToken", pageToken)
3198 return c
3199 }
3200
3201 // StatusFilter sets the optional parameter "statusFilter": When
3202 // specified, only creatives having the given status are returned.
3203 //
3204 // Possible values:
3205 //
3206 // "approved" - Creatives which have been approved.
3207 // "disapproved" - Creatives which have been disapproved.
3208 // "not_checked" - Creatives whose status is not yet checked.
3209 func (c *CreativesListCall) StatusFilter(statusFilter string) *CreativesListCall {
3210 c.urlParams_.Set("statusFilter", statusFilter)
3211 return c
3212 }
3213
3214 // Fields allows partial responses to be retrieved. See
3215 // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
3216 // for more information.
3217 func (c *CreativesListCall) Fields(s ...googleapi.Field) *CreativesListCall {
3218 c.urlParams_.Set("fields", googleapi.CombineFields(s))
3219 return c
3220 }
3221
3222 // IfNoneMatch sets the optional parameter which makes the operation
3223 // fail if the object's ETag matches the given value. This is useful for
3224 // getting updates only after the object has changed since the last
3225 // request. Use googleapi.IsNotModified to check whether the response
3226 // error from Do is the result of In-None-Match.
3227 func (c *CreativesListCall) IfNoneMatch(entityTag string) *CreativesListCall {
3228 c.ifNoneMatch_ = entityTag
3229 return c
3230 }
3231
3232 // Context sets the context to be used in this call's Do method. Any
3233 // pending HTTP request will be aborted if the provided context is
3234 // canceled.
3235 func (c *CreativesListCall) Context(ctx context.Context) *CreativesListCall {
3236 c.ctx_ = ctx
3237 return c
3238 }
3239
3240 // Header returns an http.Header that can be modified by the caller to
3241 // add HTTP headers to the request.
3242 func (c *CreativesListCall) Header() http.Header {
3243 if c.header_ == nil {
3244 c.header_ = make(http.Header)
3245 }
3246 return c.header_
3247 }
3248
3249 func (c *CreativesListCall) doRequest(alt string) (*http.Response, error) {
3250 reqHeaders := make(http.Header)
3251 reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/20210819")
3252 for k, v := range c.header_ {
3253 reqHeaders[k] = v
3254 }
3255 reqHeaders.Set("User-Agent", c.s.userAgent())
3256 if c.ifNoneMatch_ != "" {
3257 reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
3258 }
3259 var body io.Reader = nil
3260 c.urlParams_.Set("alt", alt)
3261 c.urlParams_.Set("prettyPrint", "false")
3262 urls := googleapi.ResolveRelative(c.s.BasePath, "creatives")
3263 urls += "?" + c.urlParams_.Encode()
3264 req, err := http.NewRequest("GET", urls, body)
3265 if err != nil {
3266 return nil, err
3267 }
3268 req.Header = reqHeaders
3269 return gensupport.SendRequest(c.ctx_, c.s.client, req)
3270 }
3271
3272 // Do executes the "adexchangebuyer.creatives.list" call.
3273 // Exactly one of *CreativesList or error will be non-nil. Any non-2xx
3274 // status code is an error. Response headers are in either
3275 // *CreativesList.ServerResponse.Header or (if a response was returned
3276 // at all) in error.(*googleapi.Error).Header. Use
3277 // googleapi.IsNotModified to check whether the returned error was
3278 // because http.StatusNotModified was returned.
3279 func (c *CreativesListCall) Do(opts ...googleapi.CallOption) (*CreativesList, error) {
3280 gensupport.SetOptions(c.urlParams_, opts...)
3281 res, err := c.doRequest("json")
3282 if res != nil && res.StatusCode == http.StatusNotModified {
3283 if res.Body != nil {
3284 res.Body.Close()
3285 }
3286 return nil, &googleapi.Error{
3287 Code: res.StatusCode,
3288 Header: res.Header,
3289 }
3290 }
3291 if err != nil {
3292 return nil, err
3293 }
3294 defer googleapi.CloseBody(res)
3295 if err := googleapi.CheckResponse(res); err != nil {
3296 return nil, err
3297 }
3298 ret := &CreativesList{
3299 ServerResponse: googleapi.ServerResponse{
3300 Header: res.Header,
3301 HTTPStatusCode: res.StatusCode,
3302 },
3303 }
3304 target := &ret
3305 if err := gensupport.DecodeResponse(target, res); err != nil {
3306 return nil, err
3307 }
3308 return ret, nil
3309 // {
3310 // "description": "Retrieves a list of the authenticated user's active creatives. A creative will be available 30-40 minutes after submission.",
3311 // "httpMethod": "GET",
3312 // "id": "adexchangebuyer.creatives.list",
3313 // "parameters": {
3314 // "accountId": {
3315 // "description": "When specified, only creatives for the given account ids are returned.",
3316 // "format": "int32",
3317 // "location": "query",
3318 // "repeated": true,
3319 // "type": "integer"
3320 // },
3321 // "buyerCreativeId": {
3322 // "description": "When specified, only creatives for the given buyer creative ids are returned.",
3323 // "location": "query",
3324 // "repeated": true,
3325 // "type": "string"
3326 // },
3327 // "maxResults": {
3328 // "description": "Maximum number of entries returned on one result page. If not set, the default is 100. Optional.",
3329 // "format": "uint32",
3330 // "location": "query",
3331 // "maximum": "1000",
3332 // "minimum": "1",
3333 // "type": "integer"
3334 // },
3335 // "pageToken": {
3336 // "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. Optional.",
3337 // "location": "query",
3338 // "type": "string"
3339 // },
3340 // "statusFilter": {
3341 // "description": "When specified, only creatives having the given status are returned.",
3342 // "enum": [
3343 // "approved",
3344 // "disapproved",
3345 // "not_checked"
3346 // ],
3347 // "enumDescriptions": [
3348 // "Creatives which have been approved.",
3349 // "Creatives which have been disapproved.",
3350 // "Creatives whose status is not yet checked."
3351 // ],
3352 // "location": "query",
3353 // "type": "string"
3354 // }
3355 // },
3356 // "path": "creatives",
3357 // "response": {
3358 // "$ref": "CreativesList"
3359 // },
3360 // "scopes": [
3361 // "https://www.googleapis.com/auth/adexchange.buyer"
3362 // ]
3363 // }
3364
3365 }
3366
3367 // Pages invokes f for each page of results.
3368 // A non-nil error returned from f will halt the iteration.
3369 // The provided context supersedes any context provided to the Context method.
3370 func (c *CreativesListCall) Pages(ctx context.Context, f func(*CreativesList) error) error {
3371 c.ctx_ = ctx
3372 defer c.PageToken(c.urlParams_.Get("pageToken")) // reset paging to original point
3373 for {
3374 x, err := c.Do()
3375 if err != nil {
3376 return err
3377 }
3378 if err := f(x); err != nil {
3379 return err
3380 }
3381 if x.NextPageToken == "" {
3382 return nil
3383 }
3384 c.PageToken(x.NextPageToken)
3385 }
3386 }
3387
3388 // method id "adexchangebuyer.directDeals.get":
3389
3390 type DirectDealsGetCall struct {
3391 s *Service
3392 id int64
3393 urlParams_ gensupport.URLParams
3394 ifNoneMatch_ string
3395 ctx_ context.Context
3396 header_ http.Header
3397 }
3398
3399 // Get: Gets one direct deal by ID.
3400 //
3401 // - id: The direct deal id.
3402 func (r *DirectDealsService) Get(id int64) *DirectDealsGetCall {
3403 c := &DirectDealsGetCall{s: r.s, urlParams_: make(gensupport.URLParams)}
3404 c.id = id
3405 return c
3406 }
3407
3408 // Fields allows partial responses to be retrieved. See
3409 // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
3410 // for more information.
3411 func (c *DirectDealsGetCall) Fields(s ...googleapi.Field) *DirectDealsGetCall {
3412 c.urlParams_.Set("fields", googleapi.CombineFields(s))
3413 return c
3414 }
3415
3416 // IfNoneMatch sets the optional parameter which makes the operation
3417 // fail if the object's ETag matches the given value. This is useful for
3418 // getting updates only after the object has changed since the last
3419 // request. Use googleapi.IsNotModified to check whether the response
3420 // error from Do is the result of In-None-Match.
3421 func (c *DirectDealsGetCall) IfNoneMatch(entityTag string) *DirectDealsGetCall {
3422 c.ifNoneMatch_ = entityTag
3423 return c
3424 }
3425
3426 // Context sets the context to be used in this call's Do method. Any
3427 // pending HTTP request will be aborted if the provided context is
3428 // canceled.
3429 func (c *DirectDealsGetCall) Context(ctx context.Context) *DirectDealsGetCall {
3430 c.ctx_ = ctx
3431 return c
3432 }
3433
3434 // Header returns an http.Header that can be modified by the caller to
3435 // add HTTP headers to the request.
3436 func (c *DirectDealsGetCall) Header() http.Header {
3437 if c.header_ == nil {
3438 c.header_ = make(http.Header)
3439 }
3440 return c.header_
3441 }
3442
3443 func (c *DirectDealsGetCall) doRequest(alt string) (*http.Response, error) {
3444 reqHeaders := make(http.Header)
3445 reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/20210819")
3446 for k, v := range c.header_ {
3447 reqHeaders[k] = v
3448 }
3449 reqHeaders.Set("User-Agent", c.s.userAgent())
3450 if c.ifNoneMatch_ != "" {
3451 reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
3452 }
3453 var body io.Reader = nil
3454 c.urlParams_.Set("alt", alt)
3455 c.urlParams_.Set("prettyPrint", "false")
3456 urls := googleapi.ResolveRelative(c.s.BasePath, "directdeals/{id}")
3457 urls += "?" + c.urlParams_.Encode()
3458 req, err := http.NewRequest("GET", urls, body)
3459 if err != nil {
3460 return nil, err
3461 }
3462 req.Header = reqHeaders
3463 googleapi.Expand(req.URL, map[string]string{
3464 "id": strconv.FormatInt(c.id, 10),
3465 })
3466 return gensupport.SendRequest(c.ctx_, c.s.client, req)
3467 }
3468
3469 // Do executes the "adexchangebuyer.directDeals.get" call.
3470 // Exactly one of *DirectDeal or error will be non-nil. Any non-2xx
3471 // status code is an error. Response headers are in either
3472 // *DirectDeal.ServerResponse.Header or (if a response was returned at
3473 // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
3474 // to check whether the returned error was because
3475 // http.StatusNotModified was returned.
3476 func (c *DirectDealsGetCall) Do(opts ...googleapi.CallOption) (*DirectDeal, error) {
3477 gensupport.SetOptions(c.urlParams_, opts...)
3478 res, err := c.doRequest("json")
3479 if res != nil && res.StatusCode == http.StatusNotModified {
3480 if res.Body != nil {
3481 res.Body.Close()
3482 }
3483 return nil, &googleapi.Error{
3484 Code: res.StatusCode,
3485 Header: res.Header,
3486 }
3487 }
3488 if err != nil {
3489 return nil, err
3490 }
3491 defer googleapi.CloseBody(res)
3492 if err := googleapi.CheckResponse(res); err != nil {
3493 return nil, err
3494 }
3495 ret := &DirectDeal{
3496 ServerResponse: googleapi.ServerResponse{
3497 Header: res.Header,
3498 HTTPStatusCode: res.StatusCode,
3499 },
3500 }
3501 target := &ret
3502 if err := gensupport.DecodeResponse(target, res); err != nil {
3503 return nil, err
3504 }
3505 return ret, nil
3506 // {
3507 // "description": "Gets one direct deal by ID.",
3508 // "httpMethod": "GET",
3509 // "id": "adexchangebuyer.directDeals.get",
3510 // "parameterOrder": [
3511 // "id"
3512 // ],
3513 // "parameters": {
3514 // "id": {
3515 // "description": "The direct deal id",
3516 // "format": "int64",
3517 // "location": "path",
3518 // "required": true,
3519 // "type": "string"
3520 // }
3521 // },
3522 // "path": "directdeals/{id}",
3523 // "response": {
3524 // "$ref": "DirectDeal"
3525 // },
3526 // "scopes": [
3527 // "https://www.googleapis.com/auth/adexchange.buyer"
3528 // ]
3529 // }
3530
3531 }
3532
3533 // method id "adexchangebuyer.directDeals.list":
3534
3535 type DirectDealsListCall struct {
3536 s *Service
3537 urlParams_ gensupport.URLParams
3538 ifNoneMatch_ string
3539 ctx_ context.Context
3540 header_ http.Header
3541 }
3542
3543 // List: Retrieves the authenticated user's list of direct deals.
3544 func (r *DirectDealsService) List() *DirectDealsListCall {
3545 c := &DirectDealsListCall{s: r.s, urlParams_: make(gensupport.URLParams)}
3546 return c
3547 }
3548
3549 // Fields allows partial responses to be retrieved. See
3550 // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
3551 // for more information.
3552 func (c *DirectDealsListCall) Fields(s ...googleapi.Field) *DirectDealsListCall {
3553 c.urlParams_.Set("fields", googleapi.CombineFields(s))
3554 return c
3555 }
3556
3557 // IfNoneMatch sets the optional parameter which makes the operation
3558 // fail if the object's ETag matches the given value. This is useful for
3559 // getting updates only after the object has changed since the last
3560 // request. Use googleapi.IsNotModified to check whether the response
3561 // error from Do is the result of In-None-Match.
3562 func (c *DirectDealsListCall) IfNoneMatch(entityTag string) *DirectDealsListCall {
3563 c.ifNoneMatch_ = entityTag
3564 return c
3565 }
3566
3567 // Context sets the context to be used in this call's Do method. Any
3568 // pending HTTP request will be aborted if the provided context is
3569 // canceled.
3570 func (c *DirectDealsListCall) Context(ctx context.Context) *DirectDealsListCall {
3571 c.ctx_ = ctx
3572 return c
3573 }
3574
3575 // Header returns an http.Header that can be modified by the caller to
3576 // add HTTP headers to the request.
3577 func (c *DirectDealsListCall) Header() http.Header {
3578 if c.header_ == nil {
3579 c.header_ = make(http.Header)
3580 }
3581 return c.header_
3582 }
3583
3584 func (c *DirectDealsListCall) doRequest(alt string) (*http.Response, error) {
3585 reqHeaders := make(http.Header)
3586 reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/20210819")
3587 for k, v := range c.header_ {
3588 reqHeaders[k] = v
3589 }
3590 reqHeaders.Set("User-Agent", c.s.userAgent())
3591 if c.ifNoneMatch_ != "" {
3592 reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
3593 }
3594 var body io.Reader = nil
3595 c.urlParams_.Set("alt", alt)
3596 c.urlParams_.Set("prettyPrint", "false")
3597 urls := googleapi.ResolveRelative(c.s.BasePath, "directdeals")
3598 urls += "?" + c.urlParams_.Encode()
3599 req, err := http.NewRequest("GET", urls, body)
3600 if err != nil {
3601 return nil, err
3602 }
3603 req.Header = reqHeaders
3604 return gensupport.SendRequest(c.ctx_, c.s.client, req)
3605 }
3606
3607 // Do executes the "adexchangebuyer.directDeals.list" call.
3608 // Exactly one of *DirectDealsList or error will be non-nil. Any non-2xx
3609 // status code is an error. Response headers are in either
3610 // *DirectDealsList.ServerResponse.Header or (if a response was returned
3611 // at all) in error.(*googleapi.Error).Header. Use
3612 // googleapi.IsNotModified to check whether the returned error was
3613 // because http.StatusNotModified was returned.
3614 func (c *DirectDealsListCall) Do(opts ...googleapi.CallOption) (*DirectDealsList, error) {
3615 gensupport.SetOptions(c.urlParams_, opts...)
3616 res, err := c.doRequest("json")
3617 if res != nil && res.StatusCode == http.StatusNotModified {
3618 if res.Body != nil {
3619 res.Body.Close()
3620 }
3621 return nil, &googleapi.Error{
3622 Code: res.StatusCode,
3623 Header: res.Header,
3624 }
3625 }
3626 if err != nil {
3627 return nil, err
3628 }
3629 defer googleapi.CloseBody(res)
3630 if err := googleapi.CheckResponse(res); err != nil {
3631 return nil, err
3632 }
3633 ret := &DirectDealsList{
3634 ServerResponse: googleapi.ServerResponse{
3635 Header: res.Header,
3636 HTTPStatusCode: res.StatusCode,
3637 },
3638 }
3639 target := &ret
3640 if err := gensupport.DecodeResponse(target, res); err != nil {
3641 return nil, err
3642 }
3643 return ret, nil
3644 // {
3645 // "description": "Retrieves the authenticated user's list of direct deals.",
3646 // "httpMethod": "GET",
3647 // "id": "adexchangebuyer.directDeals.list",
3648 // "path": "directdeals",
3649 // "response": {
3650 // "$ref": "DirectDealsList"
3651 // },
3652 // "scopes": [
3653 // "https://www.googleapis.com/auth/adexchange.buyer"
3654 // ]
3655 // }
3656
3657 }
3658
3659 // method id "adexchangebuyer.performanceReport.list":
3660
3661 type PerformanceReportListCall struct {
3662 s *Service
3663 urlParams_ gensupport.URLParams
3664 ifNoneMatch_ string
3665 ctx_ context.Context
3666 header_ http.Header
3667 }
3668
3669 // List: Retrieves the authenticated user's list of performance metrics.
3670 //
3671 // - accountId: The account id to get the reports.
3672 // - endDateTime: The end time of the report in ISO 8601 timestamp
3673 // format using UTC.
3674 // - startDateTime: The start time of the report in ISO 8601 timestamp
3675 // format using UTC.
3676 func (r *PerformanceReportService) List(accountId int64, endDateTime string, startDateTime string) *PerformanceReportListCall {
3677 c := &PerformanceReportListCall{s: r.s, urlParams_: make(gensupport.URLParams)}
3678 c.urlParams_.Set("accountId", fmt.Sprint(accountId))
3679 c.urlParams_.Set("endDateTime", endDateTime)
3680 c.urlParams_.Set("startDateTime", startDateTime)
3681 return c
3682 }
3683
3684 // MaxResults sets the optional parameter "maxResults": Maximum number
3685 // of entries returned on one result page. If not set, the default is
3686 // 100.
3687 func (c *PerformanceReportListCall) MaxResults(maxResults int64) *PerformanceReportListCall {
3688 c.urlParams_.Set("maxResults", fmt.Sprint(maxResults))
3689 return c
3690 }
3691
3692 // PageToken sets the optional parameter "pageToken": A continuation
3693 // token, used to page through performance reports. To retrieve the next
3694 // page, set this parameter to the value of "nextPageToken" from the
3695 // previous response.
3696 func (c *PerformanceReportListCall) PageToken(pageToken string) *PerformanceReportListCall {
3697 c.urlParams_.Set("pageToken", pageToken)
3698 return c
3699 }
3700
3701 // Fields allows partial responses to be retrieved. See
3702 // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
3703 // for more information.
3704 func (c *PerformanceReportListCall) Fields(s ...googleapi.Field) *PerformanceReportListCall {
3705 c.urlParams_.Set("fields", googleapi.CombineFields(s))
3706 return c
3707 }
3708
3709 // IfNoneMatch sets the optional parameter which makes the operation
3710 // fail if the object's ETag matches the given value. This is useful for
3711 // getting updates only after the object has changed since the last
3712 // request. Use googleapi.IsNotModified to check whether the response
3713 // error from Do is the result of In-None-Match.
3714 func (c *PerformanceReportListCall) IfNoneMatch(entityTag string) *PerformanceReportListCall {
3715 c.ifNoneMatch_ = entityTag
3716 return c
3717 }
3718
3719 // Context sets the context to be used in this call's Do method. Any
3720 // pending HTTP request will be aborted if the provided context is
3721 // canceled.
3722 func (c *PerformanceReportListCall) Context(ctx context.Context) *PerformanceReportListCall {
3723 c.ctx_ = ctx
3724 return c
3725 }
3726
3727 // Header returns an http.Header that can be modified by the caller to
3728 // add HTTP headers to the request.
3729 func (c *PerformanceReportListCall) Header() http.Header {
3730 if c.header_ == nil {
3731 c.header_ = make(http.Header)
3732 }
3733 return c.header_
3734 }
3735
3736 func (c *PerformanceReportListCall) doRequest(alt string) (*http.Response, error) {
3737 reqHeaders := make(http.Header)
3738 reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/20210819")
3739 for k, v := range c.header_ {
3740 reqHeaders[k] = v
3741 }
3742 reqHeaders.Set("User-Agent", c.s.userAgent())
3743 if c.ifNoneMatch_ != "" {
3744 reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
3745 }
3746 var body io.Reader = nil
3747 c.urlParams_.Set("alt", alt)
3748 c.urlParams_.Set("prettyPrint", "false")
3749 urls := googleapi.ResolveRelative(c.s.BasePath, "performancereport")
3750 urls += "?" + c.urlParams_.Encode()
3751 req, err := http.NewRequest("GET", urls, body)
3752 if err != nil {
3753 return nil, err
3754 }
3755 req.Header = reqHeaders
3756 return gensupport.SendRequest(c.ctx_, c.s.client, req)
3757 }
3758
3759 // Do executes the "adexchangebuyer.performanceReport.list" call.
3760 // Exactly one of *PerformanceReportList or error will be non-nil. Any
3761 // non-2xx status code is an error. Response headers are in either
3762 // *PerformanceReportList.ServerResponse.Header or (if a response was
3763 // returned at all) in error.(*googleapi.Error).Header. Use
3764 // googleapi.IsNotModified to check whether the returned error was
3765 // because http.StatusNotModified was returned.
3766 func (c *PerformanceReportListCall) Do(opts ...googleapi.CallOption) (*PerformanceReportList, error) {
3767 gensupport.SetOptions(c.urlParams_, opts...)
3768 res, err := c.doRequest("json")
3769 if res != nil && res.StatusCode == http.StatusNotModified {
3770 if res.Body != nil {
3771 res.Body.Close()
3772 }
3773 return nil, &googleapi.Error{
3774 Code: res.StatusCode,
3775 Header: res.Header,
3776 }
3777 }
3778 if err != nil {
3779 return nil, err
3780 }
3781 defer googleapi.CloseBody(res)
3782 if err := googleapi.CheckResponse(res); err != nil {
3783 return nil, err
3784 }
3785 ret := &PerformanceReportList{
3786 ServerResponse: googleapi.ServerResponse{
3787 Header: res.Header,
3788 HTTPStatusCode: res.StatusCode,
3789 },
3790 }
3791 target := &ret
3792 if err := gensupport.DecodeResponse(target, res); err != nil {
3793 return nil, err
3794 }
3795 return ret, nil
3796 // {
3797 // "description": "Retrieves the authenticated user's list of performance metrics.",
3798 // "httpMethod": "GET",
3799 // "id": "adexchangebuyer.performanceReport.list",
3800 // "parameterOrder": [
3801 // "accountId",
3802 // "endDateTime",
3803 // "startDateTime"
3804 // ],
3805 // "parameters": {
3806 // "accountId": {
3807 // "description": "The account id to get the reports.",
3808 // "format": "int64",
3809 // "location": "query",
3810 // "required": true,
3811 // "type": "string"
3812 // },
3813 // "endDateTime": {
3814 // "description": "The end time of the report in ISO 8601 timestamp format using UTC.",
3815 // "location": "query",
3816 // "required": true,
3817 // "type": "string"
3818 // },
3819 // "maxResults": {
3820 // "description": "Maximum number of entries returned on one result page. If not set, the default is 100. Optional.",
3821 // "format": "uint32",
3822 // "location": "query",
3823 // "maximum": "1000",
3824 // "minimum": "1",
3825 // "type": "integer"
3826 // },
3827 // "pageToken": {
3828 // "description": "A continuation token, used to page through performance reports. To retrieve the next page, set this parameter to the value of \"nextPageToken\" from the previous response. Optional.",
3829 // "location": "query",
3830 // "type": "string"
3831 // },
3832 // "startDateTime": {
3833 // "description": "The start time of the report in ISO 8601 timestamp format using UTC.",
3834 // "location": "query",
3835 // "required": true,
3836 // "type": "string"
3837 // }
3838 // },
3839 // "path": "performancereport",
3840 // "response": {
3841 // "$ref": "PerformanceReportList"
3842 // },
3843 // "scopes": [
3844 // "https://www.googleapis.com/auth/adexchange.buyer"
3845 // ]
3846 // }
3847
3848 }
3849
3850 // method id "adexchangebuyer.pretargetingConfig.delete":
3851
3852 type PretargetingConfigDeleteCall struct {
3853 s *Service
3854 accountId int64
3855 configId int64
3856 urlParams_ gensupport.URLParams
3857 ctx_ context.Context
3858 header_ http.Header
3859 }
3860
3861 // Delete: Deletes an existing pretargeting config.
3862 //
3863 // - accountId: The account id to delete the pretargeting config for.
3864 // - configId: The specific id of the configuration to delete.
3865 func (r *PretargetingConfigService) Delete(accountId int64, configId int64) *PretargetingConfigDeleteCall {
3866 c := &PretargetingConfigDeleteCall{s: r.s, urlParams_: make(gensupport.URLParams)}
3867 c.accountId = accountId
3868 c.configId = configId
3869 return c
3870 }
3871
3872 // Fields allows partial responses to be retrieved. See
3873 // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
3874 // for more information.
3875 func (c *PretargetingConfigDeleteCall) Fields(s ...googleapi.Field) *PretargetingConfigDeleteCall {
3876 c.urlParams_.Set("fields", googleapi.CombineFields(s))
3877 return c
3878 }
3879
3880 // Context sets the context to be used in this call's Do method. Any
3881 // pending HTTP request will be aborted if the provided context is
3882 // canceled.
3883 func (c *PretargetingConfigDeleteCall) Context(ctx context.Context) *PretargetingConfigDeleteCall {
3884 c.ctx_ = ctx
3885 return c
3886 }
3887
3888 // Header returns an http.Header that can be modified by the caller to
3889 // add HTTP headers to the request.
3890 func (c *PretargetingConfigDeleteCall) Header() http.Header {
3891 if c.header_ == nil {
3892 c.header_ = make(http.Header)
3893 }
3894 return c.header_
3895 }
3896
3897 func (c *PretargetingConfigDeleteCall) doRequest(alt string) (*http.Response, error) {
3898 reqHeaders := make(http.Header)
3899 reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/20210819")
3900 for k, v := range c.header_ {
3901 reqHeaders[k] = v
3902 }
3903 reqHeaders.Set("User-Agent", c.s.userAgent())
3904 var body io.Reader = nil
3905 c.urlParams_.Set("alt", alt)
3906 c.urlParams_.Set("prettyPrint", "false")
3907 urls := googleapi.ResolveRelative(c.s.BasePath, "pretargetingconfigs/{accountId}/{configId}")
3908 urls += "?" + c.urlParams_.Encode()
3909 req, err := http.NewRequest("DELETE", urls, body)
3910 if err != nil {
3911 return nil, err
3912 }
3913 req.Header = reqHeaders
3914 googleapi.Expand(req.URL, map[string]string{
3915 "accountId": strconv.FormatInt(c.accountId, 10),
3916 "configId": strconv.FormatInt(c.configId, 10),
3917 })
3918 return gensupport.SendRequest(c.ctx_, c.s.client, req)
3919 }
3920
3921 // Do executes the "adexchangebuyer.pretargetingConfig.delete" call.
3922 func (c *PretargetingConfigDeleteCall) Do(opts ...googleapi.CallOption) error {
3923 gensupport.SetOptions(c.urlParams_, opts...)
3924 res, err := c.doRequest("json")
3925 if err != nil {
3926 return err
3927 }
3928 defer googleapi.CloseBody(res)
3929 if err := googleapi.CheckResponse(res); err != nil {
3930 return err
3931 }
3932 return nil
3933 // {
3934 // "description": "Deletes an existing pretargeting config.",
3935 // "httpMethod": "DELETE",
3936 // "id": "adexchangebuyer.pretargetingConfig.delete",
3937 // "parameterOrder": [
3938 // "accountId",
3939 // "configId"
3940 // ],
3941 // "parameters": {
3942 // "accountId": {
3943 // "description": "The account id to delete the pretargeting config for.",
3944 // "format": "int64",
3945 // "location": "path",
3946 // "required": true,
3947 // "type": "string"
3948 // },
3949 // "configId": {
3950 // "description": "The specific id of the configuration to delete.",
3951 // "format": "int64",
3952 // "location": "path",
3953 // "required": true,
3954 // "type": "string"
3955 // }
3956 // },
3957 // "path": "pretargetingconfigs/{accountId}/{configId}",
3958 // "scopes": [
3959 // "https://www.googleapis.com/auth/adexchange.buyer"
3960 // ]
3961 // }
3962
3963 }
3964
3965 // method id "adexchangebuyer.pretargetingConfig.get":
3966
3967 type PretargetingConfigGetCall struct {
3968 s *Service
3969 accountId int64
3970 configId int64
3971 urlParams_ gensupport.URLParams
3972 ifNoneMatch_ string
3973 ctx_ context.Context
3974 header_ http.Header
3975 }
3976
3977 // Get: Gets a specific pretargeting configuration
3978 //
3979 // - accountId: The account id to get the pretargeting config for.
3980 // - configId: The specific id of the configuration to retrieve.
3981 func (r *PretargetingConfigService) Get(accountId int64, configId int64) *PretargetingConfigGetCall {
3982 c := &PretargetingConfigGetCall{s: r.s, urlParams_: make(gensupport.URLParams)}
3983 c.accountId = accountId
3984 c.configId = configId
3985 return c
3986 }
3987
3988 // Fields allows partial responses to be retrieved. See
3989 // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
3990 // for more information.
3991 func (c *PretargetingConfigGetCall) Fields(s ...googleapi.Field) *PretargetingConfigGetCall {
3992 c.urlParams_.Set("fields", googleapi.CombineFields(s))
3993 return c
3994 }
3995
3996 // IfNoneMatch sets the optional parameter which makes the operation
3997 // fail if the object's ETag matches the given value. This is useful for
3998 // getting updates only after the object has changed since the last
3999 // request. Use googleapi.IsNotModified to check whether the response
4000 // error from Do is the result of In-None-Match.
4001 func (c *PretargetingConfigGetCall) IfNoneMatch(entityTag string) *PretargetingConfigGetCall {
4002 c.ifNoneMatch_ = entityTag
4003 return c
4004 }
4005
4006 // Context sets the context to be used in this call's Do method. Any
4007 // pending HTTP request will be aborted if the provided context is
4008 // canceled.
4009 func (c *PretargetingConfigGetCall) Context(ctx context.Context) *PretargetingConfigGetCall {
4010 c.ctx_ = ctx
4011 return c
4012 }
4013
4014 // Header returns an http.Header that can be modified by the caller to
4015 // add HTTP headers to the request.
4016 func (c *PretargetingConfigGetCall) Header() http.Header {
4017 if c.header_ == nil {
4018 c.header_ = make(http.Header)
4019 }
4020 return c.header_
4021 }
4022
4023 func (c *PretargetingConfigGetCall) doRequest(alt string) (*http.Response, error) {
4024 reqHeaders := make(http.Header)
4025 reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/20210819")
4026 for k, v := range c.header_ {
4027 reqHeaders[k] = v
4028 }
4029 reqHeaders.Set("User-Agent", c.s.userAgent())
4030 if c.ifNoneMatch_ != "" {
4031 reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
4032 }
4033 var body io.Reader = nil
4034 c.urlParams_.Set("alt", alt)
4035 c.urlParams_.Set("prettyPrint", "false")
4036 urls := googleapi.ResolveRelative(c.s.BasePath, "pretargetingconfigs/{accountId}/{configId}")
4037 urls += "?" + c.urlParams_.Encode()
4038 req, err := http.NewRequest("GET", urls, body)
4039 if err != nil {
4040 return nil, err
4041 }
4042 req.Header = reqHeaders
4043 googleapi.Expand(req.URL, map[string]string{
4044 "accountId": strconv.FormatInt(c.accountId, 10),
4045 "configId": strconv.FormatInt(c.configId, 10),
4046 })
4047 return gensupport.SendRequest(c.ctx_, c.s.client, req)
4048 }
4049
4050 // Do executes the "adexchangebuyer.pretargetingConfig.get" call.
4051 // Exactly one of *PretargetingConfig or error will be non-nil. Any
4052 // non-2xx status code is an error. Response headers are in either
4053 // *PretargetingConfig.ServerResponse.Header or (if a response was
4054 // returned at all) in error.(*googleapi.Error).Header. Use
4055 // googleapi.IsNotModified to check whether the returned error was
4056 // because http.StatusNotModified was returned.
4057 func (c *PretargetingConfigGetCall) Do(opts ...googleapi.CallOption) (*PretargetingConfig, error) {
4058 gensupport.SetOptions(c.urlParams_, opts...)
4059 res, err := c.doRequest("json")
4060 if res != nil && res.StatusCode == http.StatusNotModified {
4061 if res.Body != nil {
4062 res.Body.Close()
4063 }
4064 return nil, &googleapi.Error{
4065 Code: res.StatusCode,
4066 Header: res.Header,
4067 }
4068 }
4069 if err != nil {
4070 return nil, err
4071 }
4072 defer googleapi.CloseBody(res)
4073 if err := googleapi.CheckResponse(res); err != nil {
4074 return nil, err
4075 }
4076 ret := &PretargetingConfig{
4077 ServerResponse: googleapi.ServerResponse{
4078 Header: res.Header,
4079 HTTPStatusCode: res.StatusCode,
4080 },
4081 }
4082 target := &ret
4083 if err := gensupport.DecodeResponse(target, res); err != nil {
4084 return nil, err
4085 }
4086 return ret, nil
4087 // {
4088 // "description": "Gets a specific pretargeting configuration",
4089 // "httpMethod": "GET",
4090 // "id": "adexchangebuyer.pretargetingConfig.get",
4091 // "parameterOrder": [
4092 // "accountId",
4093 // "configId"
4094 // ],
4095 // "parameters": {
4096 // "accountId": {
4097 // "description": "The account id to get the pretargeting config for.",
4098 // "format": "int64",
4099 // "location": "path",
4100 // "required": true,
4101 // "type": "string"
4102 // },
4103 // "configId": {
4104 // "description": "The specific id of the configuration to retrieve.",
4105 // "format": "int64",
4106 // "location": "path",
4107 // "required": true,
4108 // "type": "string"
4109 // }
4110 // },
4111 // "path": "pretargetingconfigs/{accountId}/{configId}",
4112 // "response": {
4113 // "$ref": "PretargetingConfig"
4114 // },
4115 // "scopes": [
4116 // "https://www.googleapis.com/auth/adexchange.buyer"
4117 // ]
4118 // }
4119
4120 }
4121
4122 // method id "adexchangebuyer.pretargetingConfig.insert":
4123
4124 type PretargetingConfigInsertCall struct {
4125 s *Service
4126 accountId int64
4127 pretargetingconfig *PretargetingConfig
4128 urlParams_ gensupport.URLParams
4129 ctx_ context.Context
4130 header_ http.Header
4131 }
4132
4133 // Insert: Inserts a new pretargeting configuration.
4134 //
4135 // - accountId: The account id to insert the pretargeting config for.
4136 func (r *PretargetingConfigService) Insert(accountId int64, pretargetingconfig *PretargetingConfig) *PretargetingConfigInsertCall {
4137 c := &PretargetingConfigInsertCall{s: r.s, urlParams_: make(gensupport.URLParams)}
4138 c.accountId = accountId
4139 c.pretargetingconfig = pretargetingconfig
4140 return c
4141 }
4142
4143 // Fields allows partial responses to be retrieved. See
4144 // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
4145 // for more information.
4146 func (c *PretargetingConfigInsertCall) Fields(s ...googleapi.Field) *PretargetingConfigInsertCall {
4147 c.urlParams_.Set("fields", googleapi.CombineFields(s))
4148 return c
4149 }
4150
4151 // Context sets the context to be used in this call's Do method. Any
4152 // pending HTTP request will be aborted if the provided context is
4153 // canceled.
4154 func (c *PretargetingConfigInsertCall) Context(ctx context.Context) *PretargetingConfigInsertCall {
4155 c.ctx_ = ctx
4156 return c
4157 }
4158
4159 // Header returns an http.Header that can be modified by the caller to
4160 // add HTTP headers to the request.
4161 func (c *PretargetingConfigInsertCall) Header() http.Header {
4162 if c.header_ == nil {
4163 c.header_ = make(http.Header)
4164 }
4165 return c.header_
4166 }
4167
4168 func (c *PretargetingConfigInsertCall) doRequest(alt string) (*http.Response, error) {
4169 reqHeaders := make(http.Header)
4170 reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/20210819")
4171 for k, v := range c.header_ {
4172 reqHeaders[k] = v
4173 }
4174 reqHeaders.Set("User-Agent", c.s.userAgent())
4175 var body io.Reader = nil
4176 body, err := googleapi.WithoutDataWrapper.JSONReader(c.pretargetingconfig)
4177 if err != nil {
4178 return nil, err
4179 }
4180 reqHeaders.Set("Content-Type", "application/json")
4181 c.urlParams_.Set("alt", alt)
4182 c.urlParams_.Set("prettyPrint", "false")
4183 urls := googleapi.ResolveRelative(c.s.BasePath, "pretargetingconfigs/{accountId}")
4184 urls += "?" + c.urlParams_.Encode()
4185 req, err := http.NewRequest("POST", urls, body)
4186 if err != nil {
4187 return nil, err
4188 }
4189 req.Header = reqHeaders
4190 googleapi.Expand(req.URL, map[string]string{
4191 "accountId": strconv.FormatInt(c.accountId, 10),
4192 })
4193 return gensupport.SendRequest(c.ctx_, c.s.client, req)
4194 }
4195
4196 // Do executes the "adexchangebuyer.pretargetingConfig.insert" call.
4197 // Exactly one of *PretargetingConfig or error will be non-nil. Any
4198 // non-2xx status code is an error. Response headers are in either
4199 // *PretargetingConfig.ServerResponse.Header or (if a response was
4200 // returned at all) in error.(*googleapi.Error).Header. Use
4201 // googleapi.IsNotModified to check whether the returned error was
4202 // because http.StatusNotModified was returned.
4203 func (c *PretargetingConfigInsertCall) Do(opts ...googleapi.CallOption) (*PretargetingConfig, error) {
4204 gensupport.SetOptions(c.urlParams_, opts...)
4205 res, err := c.doRequest("json")
4206 if res != nil && res.StatusCode == http.StatusNotModified {
4207 if res.Body != nil {
4208 res.Body.Close()
4209 }
4210 return nil, &googleapi.Error{
4211 Code: res.StatusCode,
4212 Header: res.Header,
4213 }
4214 }
4215 if err != nil {
4216 return nil, err
4217 }
4218 defer googleapi.CloseBody(res)
4219 if err := googleapi.CheckResponse(res); err != nil {
4220 return nil, err
4221 }
4222 ret := &PretargetingConfig{
4223 ServerResponse: googleapi.ServerResponse{
4224 Header: res.Header,
4225 HTTPStatusCode: res.StatusCode,
4226 },
4227 }
4228 target := &ret
4229 if err := gensupport.DecodeResponse(target, res); err != nil {
4230 return nil, err
4231 }
4232 return ret, nil
4233 // {
4234 // "description": "Inserts a new pretargeting configuration.",
4235 // "httpMethod": "POST",
4236 // "id": "adexchangebuyer.pretargetingConfig.insert",
4237 // "parameterOrder": [
4238 // "accountId"
4239 // ],
4240 // "parameters": {
4241 // "accountId": {
4242 // "description": "The account id to insert the pretargeting config for.",
4243 // "format": "int64",
4244 // "location": "path",
4245 // "required": true,
4246 // "type": "string"
4247 // }
4248 // },
4249 // "path": "pretargetingconfigs/{accountId}",
4250 // "request": {
4251 // "$ref": "PretargetingConfig"
4252 // },
4253 // "response": {
4254 // "$ref": "PretargetingConfig"
4255 // },
4256 // "scopes": [
4257 // "https://www.googleapis.com/auth/adexchange.buyer"
4258 // ]
4259 // }
4260
4261 }
4262
4263 // method id "adexchangebuyer.pretargetingConfig.list":
4264
4265 type PretargetingConfigListCall struct {
4266 s *Service
4267 accountId int64
4268 urlParams_ gensupport.URLParams
4269 ifNoneMatch_ string
4270 ctx_ context.Context
4271 header_ http.Header
4272 }
4273
4274 // List: Retrieves a list of the authenticated user's pretargeting
4275 // configurations.
4276 //
4277 // - accountId: The account id to get the pretargeting configs for.
4278 func (r *PretargetingConfigService) List(accountId int64) *PretargetingConfigListCall {
4279 c := &PretargetingConfigListCall{s: r.s, urlParams_: make(gensupport.URLParams)}
4280 c.accountId = accountId
4281 return c
4282 }
4283
4284 // Fields allows partial responses to be retrieved. See
4285 // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
4286 // for more information.
4287 func (c *PretargetingConfigListCall) Fields(s ...googleapi.Field) *PretargetingConfigListCall {
4288 c.urlParams_.Set("fields", googleapi.CombineFields(s))
4289 return c
4290 }
4291
4292 // IfNoneMatch sets the optional parameter which makes the operation
4293 // fail if the object's ETag matches the given value. This is useful for
4294 // getting updates only after the object has changed since the last
4295 // request. Use googleapi.IsNotModified to check whether the response
4296 // error from Do is the result of In-None-Match.
4297 func (c *PretargetingConfigListCall) IfNoneMatch(entityTag string) *PretargetingConfigListCall {
4298 c.ifNoneMatch_ = entityTag
4299 return c
4300 }
4301
4302 // Context sets the context to be used in this call's Do method. Any
4303 // pending HTTP request will be aborted if the provided context is
4304 // canceled.
4305 func (c *PretargetingConfigListCall) Context(ctx context.Context) *PretargetingConfigListCall {
4306 c.ctx_ = ctx
4307 return c
4308 }
4309
4310 // Header returns an http.Header that can be modified by the caller to
4311 // add HTTP headers to the request.
4312 func (c *PretargetingConfigListCall) Header() http.Header {
4313 if c.header_ == nil {
4314 c.header_ = make(http.Header)
4315 }
4316 return c.header_
4317 }
4318
4319 func (c *PretargetingConfigListCall) doRequest(alt string) (*http.Response, error) {
4320 reqHeaders := make(http.Header)
4321 reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/20210819")
4322 for k, v := range c.header_ {
4323 reqHeaders[k] = v
4324 }
4325 reqHeaders.Set("User-Agent", c.s.userAgent())
4326 if c.ifNoneMatch_ != "" {
4327 reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
4328 }
4329 var body io.Reader = nil
4330 c.urlParams_.Set("alt", alt)
4331 c.urlParams_.Set("prettyPrint", "false")
4332 urls := googleapi.ResolveRelative(c.s.BasePath, "pretargetingconfigs/{accountId}")
4333 urls += "?" + c.urlParams_.Encode()
4334 req, err := http.NewRequest("GET", urls, body)
4335 if err != nil {
4336 return nil, err
4337 }
4338 req.Header = reqHeaders
4339 googleapi.Expand(req.URL, map[string]string{
4340 "accountId": strconv.FormatInt(c.accountId, 10),
4341 })
4342 return gensupport.SendRequest(c.ctx_, c.s.client, req)
4343 }
4344
4345 // Do executes the "adexchangebuyer.pretargetingConfig.list" call.
4346 // Exactly one of *PretargetingConfigList or error will be non-nil. Any
4347 // non-2xx status code is an error. Response headers are in either
4348 // *PretargetingConfigList.ServerResponse.Header or (if a response was
4349 // returned at all) in error.(*googleapi.Error).Header. Use
4350 // googleapi.IsNotModified to check whether the returned error was
4351 // because http.StatusNotModified was returned.
4352 func (c *PretargetingConfigListCall) Do(opts ...googleapi.CallOption) (*PretargetingConfigList, error) {
4353 gensupport.SetOptions(c.urlParams_, opts...)
4354 res, err := c.doRequest("json")
4355 if res != nil && res.StatusCode == http.StatusNotModified {
4356 if res.Body != nil {
4357 res.Body.Close()
4358 }
4359 return nil, &googleapi.Error{
4360 Code: res.StatusCode,
4361 Header: res.Header,
4362 }
4363 }
4364 if err != nil {
4365 return nil, err
4366 }
4367 defer googleapi.CloseBody(res)
4368 if err := googleapi.CheckResponse(res); err != nil {
4369 return nil, err
4370 }
4371 ret := &PretargetingConfigList{
4372 ServerResponse: googleapi.ServerResponse{
4373 Header: res.Header,
4374 HTTPStatusCode: res.StatusCode,
4375 },
4376 }
4377 target := &ret
4378 if err := gensupport.DecodeResponse(target, res); err != nil {
4379 return nil, err
4380 }
4381 return ret, nil
4382 // {
4383 // "description": "Retrieves a list of the authenticated user's pretargeting configurations.",
4384 // "httpMethod": "GET",
4385 // "id": "adexchangebuyer.pretargetingConfig.list",
4386 // "parameterOrder": [
4387 // "accountId"
4388 // ],
4389 // "parameters": {
4390 // "accountId": {
4391 // "description": "The account id to get the pretargeting configs for.",
4392 // "format": "int64",
4393 // "location": "path",
4394 // "required": true,
4395 // "type": "string"
4396 // }
4397 // },
4398 // "path": "pretargetingconfigs/{accountId}",
4399 // "response": {
4400 // "$ref": "PretargetingConfigList"
4401 // },
4402 // "scopes": [
4403 // "https://www.googleapis.com/auth/adexchange.buyer"
4404 // ]
4405 // }
4406
4407 }
4408
4409 // method id "adexchangebuyer.pretargetingConfig.patch":
4410
4411 type PretargetingConfigPatchCall struct {
4412 s *Service
4413 accountId int64
4414 configId int64
4415 pretargetingconfig *PretargetingConfig
4416 urlParams_ gensupport.URLParams
4417 ctx_ context.Context
4418 header_ http.Header
4419 }
4420
4421 // Patch: Updates an existing pretargeting config. This method supports
4422 // patch semantics.
4423 //
4424 // - accountId: The account id to update the pretargeting config for.
4425 // - configId: The specific id of the configuration to update.
4426 func (r *PretargetingConfigService) Patch(accountId int64, configId int64, pretargetingconfig *PretargetingConfig) *PretargetingConfigPatchCall {
4427 c := &PretargetingConfigPatchCall{s: r.s, urlParams_: make(gensupport.URLParams)}
4428 c.accountId = accountId
4429 c.configId = configId
4430 c.pretargetingconfig = pretargetingconfig
4431 return c
4432 }
4433
4434 // Fields allows partial responses to be retrieved. See
4435 // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
4436 // for more information.
4437 func (c *PretargetingConfigPatchCall) Fields(s ...googleapi.Field) *PretargetingConfigPatchCall {
4438 c.urlParams_.Set("fields", googleapi.CombineFields(s))
4439 return c
4440 }
4441
4442 // Context sets the context to be used in this call's Do method. Any
4443 // pending HTTP request will be aborted if the provided context is
4444 // canceled.
4445 func (c *PretargetingConfigPatchCall) Context(ctx context.Context) *PretargetingConfigPatchCall {
4446 c.ctx_ = ctx
4447 return c
4448 }
4449
4450 // Header returns an http.Header that can be modified by the caller to
4451 // add HTTP headers to the request.
4452 func (c *PretargetingConfigPatchCall) Header() http.Header {
4453 if c.header_ == nil {
4454 c.header_ = make(http.Header)
4455 }
4456 return c.header_
4457 }
4458
4459 func (c *PretargetingConfigPatchCall) doRequest(alt string) (*http.Response, error) {
4460 reqHeaders := make(http.Header)
4461 reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/20210819")
4462 for k, v := range c.header_ {
4463 reqHeaders[k] = v
4464 }
4465 reqHeaders.Set("User-Agent", c.s.userAgent())
4466 var body io.Reader = nil
4467 body, err := googleapi.WithoutDataWrapper.JSONReader(c.pretargetingconfig)
4468 if err != nil {
4469 return nil, err
4470 }
4471 reqHeaders.Set("Content-Type", "application/json")
4472 c.urlParams_.Set("alt", alt)
4473 c.urlParams_.Set("prettyPrint", "false")
4474 urls := googleapi.ResolveRelative(c.s.BasePath, "pretargetingconfigs/{accountId}/{configId}")
4475 urls += "?" + c.urlParams_.Encode()
4476 req, err := http.NewRequest("PATCH", urls, body)
4477 if err != nil {
4478 return nil, err
4479 }
4480 req.Header = reqHeaders
4481 googleapi.Expand(req.URL, map[string]string{
4482 "accountId": strconv.FormatInt(c.accountId, 10),
4483 "configId": strconv.FormatInt(c.configId, 10),
4484 })
4485 return gensupport.SendRequest(c.ctx_, c.s.client, req)
4486 }
4487
4488 // Do executes the "adexchangebuyer.pretargetingConfig.patch" call.
4489 // Exactly one of *PretargetingConfig or error will be non-nil. Any
4490 // non-2xx status code is an error. Response headers are in either
4491 // *PretargetingConfig.ServerResponse.Header or (if a response was
4492 // returned at all) in error.(*googleapi.Error).Header. Use
4493 // googleapi.IsNotModified to check whether the returned error was
4494 // because http.StatusNotModified was returned.
4495 func (c *PretargetingConfigPatchCall) Do(opts ...googleapi.CallOption) (*PretargetingConfig, error) {
4496 gensupport.SetOptions(c.urlParams_, opts...)
4497 res, err := c.doRequest("json")
4498 if res != nil && res.StatusCode == http.StatusNotModified {
4499 if res.Body != nil {
4500 res.Body.Close()
4501 }
4502 return nil, &googleapi.Error{
4503 Code: res.StatusCode,
4504 Header: res.Header,
4505 }
4506 }
4507 if err != nil {
4508 return nil, err
4509 }
4510 defer googleapi.CloseBody(res)
4511 if err := googleapi.CheckResponse(res); err != nil {
4512 return nil, err
4513 }
4514 ret := &PretargetingConfig{
4515 ServerResponse: googleapi.ServerResponse{
4516 Header: res.Header,
4517 HTTPStatusCode: res.StatusCode,
4518 },
4519 }
4520 target := &ret
4521 if err := gensupport.DecodeResponse(target, res); err != nil {
4522 return nil, err
4523 }
4524 return ret, nil
4525 // {
4526 // "description": "Updates an existing pretargeting config. This method supports patch semantics.",
4527 // "httpMethod": "PATCH",
4528 // "id": "adexchangebuyer.pretargetingConfig.patch",
4529 // "parameterOrder": [
4530 // "accountId",
4531 // "configId"
4532 // ],
4533 // "parameters": {
4534 // "accountId": {
4535 // "description": "The account id to update the pretargeting config for.",
4536 // "format": "int64",
4537 // "location": "path",
4538 // "required": true,
4539 // "type": "string"
4540 // },
4541 // "configId": {
4542 // "description": "The specific id of the configuration to update.",
4543 // "format": "int64",
4544 // "location": "path",
4545 // "required": true,
4546 // "type": "string"
4547 // }
4548 // },
4549 // "path": "pretargetingconfigs/{accountId}/{configId}",
4550 // "request": {
4551 // "$ref": "PretargetingConfig"
4552 // },
4553 // "response": {
4554 // "$ref": "PretargetingConfig"
4555 // },
4556 // "scopes": [
4557 // "https://www.googleapis.com/auth/adexchange.buyer"
4558 // ]
4559 // }
4560
4561 }
4562
4563 // method id "adexchangebuyer.pretargetingConfig.update":
4564
4565 type PretargetingConfigUpdateCall struct {
4566 s *Service
4567 accountId int64
4568 configId int64
4569 pretargetingconfig *PretargetingConfig
4570 urlParams_ gensupport.URLParams
4571 ctx_ context.Context
4572 header_ http.Header
4573 }
4574
4575 // Update: Updates an existing pretargeting config.
4576 //
4577 // - accountId: The account id to update the pretargeting config for.
4578 // - configId: The specific id of the configuration to update.
4579 func (r *PretargetingConfigService) Update(accountId int64, configId int64, pretargetingconfig *PretargetingConfig) *PretargetingConfigUpdateCall {
4580 c := &PretargetingConfigUpdateCall{s: r.s, urlParams_: make(gensupport.URLParams)}
4581 c.accountId = accountId
4582 c.configId = configId
4583 c.pretargetingconfig = pretargetingconfig
4584 return c
4585 }
4586
4587 // Fields allows partial responses to be retrieved. See
4588 // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
4589 // for more information.
4590 func (c *PretargetingConfigUpdateCall) Fields(s ...googleapi.Field) *PretargetingConfigUpdateCall {
4591 c.urlParams_.Set("fields", googleapi.CombineFields(s))
4592 return c
4593 }
4594
4595 // Context sets the context to be used in this call's Do method. Any
4596 // pending HTTP request will be aborted if the provided context is
4597 // canceled.
4598 func (c *PretargetingConfigUpdateCall) Context(ctx context.Context) *PretargetingConfigUpdateCall {
4599 c.ctx_ = ctx
4600 return c
4601 }
4602
4603 // Header returns an http.Header that can be modified by the caller to
4604 // add HTTP headers to the request.
4605 func (c *PretargetingConfigUpdateCall) Header() http.Header {
4606 if c.header_ == nil {
4607 c.header_ = make(http.Header)
4608 }
4609 return c.header_
4610 }
4611
4612 func (c *PretargetingConfigUpdateCall) doRequest(alt string) (*http.Response, error) {
4613 reqHeaders := make(http.Header)
4614 reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/20210819")
4615 for k, v := range c.header_ {
4616 reqHeaders[k] = v
4617 }
4618 reqHeaders.Set("User-Agent", c.s.userAgent())
4619 var body io.Reader = nil
4620 body, err := googleapi.WithoutDataWrapper.JSONReader(c.pretargetingconfig)
4621 if err != nil {
4622 return nil, err
4623 }
4624 reqHeaders.Set("Content-Type", "application/json")
4625 c.urlParams_.Set("alt", alt)
4626 c.urlParams_.Set("prettyPrint", "false")
4627 urls := googleapi.ResolveRelative(c.s.BasePath, "pretargetingconfigs/{accountId}/{configId}")
4628 urls += "?" + c.urlParams_.Encode()
4629 req, err := http.NewRequest("PUT", urls, body)
4630 if err != nil {
4631 return nil, err
4632 }
4633 req.Header = reqHeaders
4634 googleapi.Expand(req.URL, map[string]string{
4635 "accountId": strconv.FormatInt(c.accountId, 10),
4636 "configId": strconv.FormatInt(c.configId, 10),
4637 })
4638 return gensupport.SendRequest(c.ctx_, c.s.client, req)
4639 }
4640
4641 // Do executes the "adexchangebuyer.pretargetingConfig.update" call.
4642 // Exactly one of *PretargetingConfig or error will be non-nil. Any
4643 // non-2xx status code is an error. Response headers are in either
4644 // *PretargetingConfig.ServerResponse.Header or (if a response was
4645 // returned at all) in error.(*googleapi.Error).Header. Use
4646 // googleapi.IsNotModified to check whether the returned error was
4647 // because http.StatusNotModified was returned.
4648 func (c *PretargetingConfigUpdateCall) Do(opts ...googleapi.CallOption) (*PretargetingConfig, error) {
4649 gensupport.SetOptions(c.urlParams_, opts...)
4650 res, err := c.doRequest("json")
4651 if res != nil && res.StatusCode == http.StatusNotModified {
4652 if res.Body != nil {
4653 res.Body.Close()
4654 }
4655 return nil, &googleapi.Error{
4656 Code: res.StatusCode,
4657 Header: res.Header,
4658 }
4659 }
4660 if err != nil {
4661 return nil, err
4662 }
4663 defer googleapi.CloseBody(res)
4664 if err := googleapi.CheckResponse(res); err != nil {
4665 return nil, err
4666 }
4667 ret := &PretargetingConfig{
4668 ServerResponse: googleapi.ServerResponse{
4669 Header: res.Header,
4670 HTTPStatusCode: res.StatusCode,
4671 },
4672 }
4673 target := &ret
4674 if err := gensupport.DecodeResponse(target, res); err != nil {
4675 return nil, err
4676 }
4677 return ret, nil
4678 // {
4679 // "description": "Updates an existing pretargeting config.",
4680 // "httpMethod": "PUT",
4681 // "id": "adexchangebuyer.pretargetingConfig.update",
4682 // "parameterOrder": [
4683 // "accountId",
4684 // "configId"
4685 // ],
4686 // "parameters": {
4687 // "accountId": {
4688 // "description": "The account id to update the pretargeting config for.",
4689 // "format": "int64",
4690 // "location": "path",
4691 // "required": true,
4692 // "type": "string"
4693 // },
4694 // "configId": {
4695 // "description": "The specific id of the configuration to update.",
4696 // "format": "int64",
4697 // "location": "path",
4698 // "required": true,
4699 // "type": "string"
4700 // }
4701 // },
4702 // "path": "pretargetingconfigs/{accountId}/{configId}",
4703 // "request": {
4704 // "$ref": "PretargetingConfig"
4705 // },
4706 // "response": {
4707 // "$ref": "PretargetingConfig"
4708 // },
4709 // "scopes": [
4710 // "https://www.googleapis.com/auth/adexchange.buyer"
4711 // ]
4712 // }
4713
4714 }