Debian Codegraph @

adexchangebuyer/v1.4/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.4"
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.4"
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.4"
75 const apiName = "adexchangebuyer"
76 const apiVersion = "v1.4"
77 const basePath = "https://www.googleapis.com/adexchangebuyer/v1.4/"
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.Marketplacedeals = NewMarketplacedealsService(s)
122 s.Marketplacenotes = NewMarketplacenotesService(s)
123 s.Marketplaceprivateauction = NewMarketplaceprivateauctionService(s)
124 s.PerformanceReport = NewPerformanceReportService(s)
125 s.PretargetingConfig = NewPretargetingConfigService(s)
126 s.Products = NewProductsService(s)
127 s.Proposals = NewProposalsService(s)
128 s.Pubprofiles = NewPubprofilesService(s)
129 return s, nil
130 }
131
132 type Service struct {
133 client *http.Client
134 BasePath string // API endpoint base URL
135 UserAgent string // optional additional User-Agent fragment
136
137 Accounts *AccountsService
138
139 BillingInfo *BillingInfoService
140
141 Budget *BudgetService
142
143 Creatives *CreativesService
144
145 Marketplacedeals *MarketplacedealsService
146
147 Marketplacenotes *MarketplacenotesService
148
149 Marketplaceprivateauction *MarketplaceprivateauctionService
150
151 PerformanceReport *PerformanceReportService
152
153 PretargetingConfig *PretargetingConfigService
154
155 Products *ProductsService
156
157 Proposals *ProposalsService
158
159 Pubprofiles *PubprofilesService
160 }
161
162 func (s *Service) userAgent() string {
163 if s.UserAgent == "" {
164 return googleapi.UserAgent
165 }
166 return googleapi.UserAgent + " " + s.UserAgent
167 }
168
169 func NewAccountsService(s *Service) *AccountsService {
170 rs := &AccountsService{s: s}
171 return rs
172 }
173
174 type AccountsService struct {
175 s *Service
176 }
177
178 func NewBillingInfoService(s *Service) *BillingInfoService {
179 rs := &BillingInfoService{s: s}
180 return rs
181 }
182
183 type BillingInfoService struct {
184 s *Service
185 }
186
187 func NewBudgetService(s *Service) *BudgetService {
188 rs := &BudgetService{s: s}
189 return rs
190 }
191
192 type BudgetService struct {
193 s *Service
194 }
195
196 func NewCreativesService(s *Service) *CreativesService {
197 rs := &CreativesService{s: s}
198 return rs
199 }
200
201 type CreativesService struct {
202 s *Service
203 }
204
205 func NewMarketplacedealsService(s *Service) *MarketplacedealsService {
206 rs := &MarketplacedealsService{s: s}
207 return rs
208 }
209
210 type MarketplacedealsService struct {
211 s *Service
212 }
213
214 func NewMarketplacenotesService(s *Service) *MarketplacenotesService {
215 rs := &MarketplacenotesService{s: s}
216 return rs
217 }
218
219 type MarketplacenotesService struct {
220 s *Service
221 }
222
223 func NewMarketplaceprivateauctionService(s *Service) *MarketplaceprivateauctionService {
224 rs := &MarketplaceprivateauctionService{s: s}
225 return rs
226 }
227
228 type MarketplaceprivateauctionService struct {
229 s *Service
230 }
231
232 func NewPerformanceReportService(s *Service) *PerformanceReportService {
233 rs := &PerformanceReportService{s: s}
234 return rs
235 }
236
237 type PerformanceReportService struct {
238 s *Service
239 }
240
241 func NewPretargetingConfigService(s *Service) *PretargetingConfigService {
242 rs := &PretargetingConfigService{s: s}
243 return rs
244 }
245
246 type PretargetingConfigService struct {
247 s *Service
248 }
249
250 func NewProductsService(s *Service) *ProductsService {
251 rs := &ProductsService{s: s}
252 return rs
253 }
254
255 type ProductsService struct {
256 s *Service
257 }
258
259 func NewProposalsService(s *Service) *ProposalsService {
260 rs := &ProposalsService{s: s}
261 return rs
262 }
263
264 type ProposalsService struct {
265 s *Service
266 }
267
268 func NewPubprofilesService(s *Service) *PubprofilesService {
269 rs := &PubprofilesService{s: s}
270 return rs
271 }
272
273 type PubprofilesService struct {
274 s *Service
275 }
276
277 // Account: Configuration data for an Ad Exchange buyer account.
278 type Account struct {
279 // ApplyPretargetingToNonGuaranteedDeals: When this is false, bid
280 // requests that include a deal ID for a private auction or preferred
281 // deal are always sent to your bidder. When true, all active
282 // pretargeting configs will be applied to private auctions and
283 // preferred deals. Programmatic Guaranteed deals (when enabled) are
284 // always sent to your bidder.
285 ApplyPretargetingToNonGuaranteedDeals bool `json:"applyPretargetingToNonGuaranteedDeals,omitempty"`
286
287 // BidderLocation: Your bidder locations that have distinct URLs.
288 BidderLocation []*AccountBidderLocation `json:"bidderLocation,omitempty"`
289
290 // CookieMatchingNid: The nid parameter value used in cookie match
291 // requests. Please contact your technical account manager if you need
292 // to change this.
293 CookieMatchingNid string `json:"cookieMatchingNid,omitempty"`
294
295 // CookieMatchingUrl: The base URL used in cookie match requests.
296 CookieMatchingUrl string `json:"cookieMatchingUrl,omitempty"`
297
298 // Id: Account id.
299 Id int64 `json:"id,omitempty"`
300
301 // Kind: Resource type.
302 Kind string `json:"kind,omitempty"`
303
304 // MaximumActiveCreatives: The maximum number of active creatives that
305 // an account can have, where a creative is active if it was inserted or
306 // bid with in the last 30 days. Please contact your technical account
307 // manager if you need to change this.
308 MaximumActiveCreatives int64 `json:"maximumActiveCreatives,omitempty"`
309
310 // MaximumTotalQps: The sum of all bidderLocation.maximumQps values
311 // cannot exceed this. Please contact your technical account manager if
312 // you need to change this.
313 MaximumTotalQps int64 `json:"maximumTotalQps,omitempty"`
314
315 // NumberActiveCreatives: The number of creatives that this account
316 // inserted or bid with in the last 30 days.
317 NumberActiveCreatives int64 `json:"numberActiveCreatives,omitempty"`
318
319 // ServerResponse contains the HTTP response code and headers from the
320 // server.
321 googleapi.ServerResponse `json:"-"`
322
323 // ForceSendFields is a list of field names (e.g.
324 // "ApplyPretargetingToNonGuaranteedDeals") to unconditionally include
325 // in API requests. By default, fields with empty or default values are
326 // omitted from API requests. However, any non-pointer, non-interface
327 // field appearing in ForceSendFields will be sent to the server
328 // regardless of whether the field is empty or not. This may be used to
329 // include empty fields in Patch requests.
330 ForceSendFields []string `json:"-"`
331
332 // NullFields is a list of field names (e.g.
333 // "ApplyPretargetingToNonGuaranteedDeals") to include in API requests
334 // with the JSON null value. By default, fields with empty values are
335 // omitted from API requests. However, any field with an empty value
336 // appearing in NullFields will be sent to the server as null. It is an
337 // error if a field in this list has a non-empty value. This may be used
338 // to include null fields in Patch requests.
339 NullFields []string `json:"-"`
340 }
341
342 func (s *Account) MarshalJSON() ([]byte, error) {
343 type NoMethod Account
344 raw := NoMethod(*s)
345 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
346 }
347
348 type AccountBidderLocation struct {
349 // BidProtocol: The protocol that the bidder endpoint is using. OpenRTB
350 // protocols with prefix PROTOCOL_OPENRTB_PROTOBUF use proto buffer,
351 // otherwise use JSON. Allowed values:
352 // - PROTOCOL_ADX
353 // - PROTOCOL_OPENRTB_2_2
354 // - PROTOCOL_OPENRTB_2_3
355 // - PROTOCOL_OPENRTB_2_4
356 // - PROTOCOL_OPENRTB_2_5
357 // - PROTOCOL_OPENRTB_PROTOBUF_2_3
358 // - PROTOCOL_OPENRTB_PROTOBUF_2_4
359 // - PROTOCOL_OPENRTB_PROTOBUF_2_5
360 BidProtocol string `json:"bidProtocol,omitempty"`
361
362 // MaximumQps: The maximum queries per second the Ad Exchange will send.
363 MaximumQps int64 `json:"maximumQps,omitempty"`
364
365 // Region: The geographical region the Ad Exchange should send requests
366 // from. Only used by some quota systems, but always setting the value
367 // is recommended. Allowed values:
368 // - ASIA
369 // - EUROPE
370 // - US_EAST
371 // - US_WEST
372 Region string `json:"region,omitempty"`
373
374 // Url: The URL to which the Ad Exchange will send bid requests.
375 Url string `json:"url,omitempty"`
376
377 // ForceSendFields is a list of field names (e.g. "BidProtocol") to
378 // unconditionally include in API requests. By default, fields with
379 // empty or default values are omitted from API requests. However, any
380 // non-pointer, non-interface field appearing in ForceSendFields will be
381 // sent to the server regardless of whether the field is empty or not.
382 // This may be used to include empty fields in Patch requests.
383 ForceSendFields []string `json:"-"`
384
385 // NullFields is a list of field names (e.g. "BidProtocol") to include
386 // in API requests with the JSON null value. By default, fields with
387 // empty values are omitted from API requests. However, any field with
388 // an empty value appearing in NullFields will be sent to the server as
389 // null. It is an error if a field in this list has a non-empty value.
390 // This may be used to include null fields in Patch requests.
391 NullFields []string `json:"-"`
392 }
393
394 func (s *AccountBidderLocation) MarshalJSON() ([]byte, error) {
395 type NoMethod AccountBidderLocation
396 raw := NoMethod(*s)
397 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
398 }
399
400 // AccountsList: An account feed lists Ad Exchange buyer accounts that
401 // the user has access to. Each entry in the feed corresponds to a
402 // single buyer account.
403 type AccountsList struct {
404 // Items: A list of accounts.
405 Items []*Account `json:"items,omitempty"`
406
407 // Kind: Resource type.
408 Kind string `json:"kind,omitempty"`
409
410 // ServerResponse contains the HTTP response code and headers from the
411 // server.
412 googleapi.ServerResponse `json:"-"`
413
414 // ForceSendFields is a list of field names (e.g. "Items") to
415 // unconditionally include in API requests. By default, fields with
416 // empty or default values are omitted from API requests. However, any
417 // non-pointer, non-interface field appearing in ForceSendFields will be
418 // sent to the server regardless of whether the field is empty or not.
419 // This may be used to include empty fields in Patch requests.
420 ForceSendFields []string `json:"-"`
421
422 // NullFields is a list of field names (e.g. "Items") to include in API
423 // requests with the JSON null value. By default, fields with empty
424 // values are omitted from API requests. However, any field with an
425 // empty value appearing in NullFields will be sent to the server as
426 // null. It is an error if a field in this list has a non-empty value.
427 // This may be used to include null fields in Patch requests.
428 NullFields []string `json:"-"`
429 }
430
431 func (s *AccountsList) MarshalJSON() ([]byte, error) {
432 type NoMethod AccountsList
433 raw := NoMethod(*s)
434 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
435 }
436
437 type AddOrderDealsRequest struct {
438 // Deals: The list of deals to add
439 Deals []*MarketplaceDeal `json:"deals,omitempty"`
440
441 // ProposalRevisionNumber: The last known proposal revision number.
442 ProposalRevisionNumber int64 `json:"proposalRevisionNumber,omitempty,string"`
443
444 // UpdateAction: Indicates an optional action to take on the proposal
445 UpdateAction string `json:"updateAction,omitempty"`
446
447 // ForceSendFields is a list of field names (e.g. "Deals") to
448 // unconditionally include in API requests. By default, fields with
449 // empty or default values are omitted from API requests. However, any
450 // non-pointer, non-interface field appearing in ForceSendFields will be
451 // sent to the server regardless of whether the field is empty or not.
452 // This may be used to include empty fields in Patch requests.
453 ForceSendFields []string `json:"-"`
454
455 // NullFields is a list of field names (e.g. "Deals") to include in API
456 // requests with the JSON null value. By default, fields with empty
457 // values are omitted from API requests. However, any field with an
458 // empty value appearing in NullFields will be sent to the server as
459 // null. It is an error if a field in this list has a non-empty value.
460 // This may be used to include null fields in Patch requests.
461 NullFields []string `json:"-"`
462 }
463
464 func (s *AddOrderDealsRequest) MarshalJSON() ([]byte, error) {
465 type NoMethod AddOrderDealsRequest
466 raw := NoMethod(*s)
467 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
468 }
469
470 type AddOrderDealsResponse struct {
471 // Deals: List of deals added (in the same proposal as passed in the
472 // request)
473 Deals []*MarketplaceDeal `json:"deals,omitempty"`
474
475 // ProposalRevisionNumber: The updated revision number for the proposal.
476 ProposalRevisionNumber int64 `json:"proposalRevisionNumber,omitempty,string"`
477
478 // ServerResponse contains the HTTP response code and headers from the
479 // server.
480 googleapi.ServerResponse `json:"-"`
481
482 // ForceSendFields is a list of field names (e.g. "Deals") to
483 // unconditionally include in API requests. By default, fields with
484 // empty or default values are omitted from API requests. However, any
485 // non-pointer, non-interface field appearing in ForceSendFields will be
486 // sent to the server regardless of whether the field is empty or not.
487 // This may be used to include empty fields in Patch requests.
488 ForceSendFields []string `json:"-"`
489
490 // NullFields is a list of field names (e.g. "Deals") to include in API
491 // requests with the JSON null value. By default, fields with empty
492 // values are omitted from API requests. However, any field with an
493 // empty value appearing in NullFields will be sent to the server as
494 // null. It is an error if a field in this list has a non-empty value.
495 // This may be used to include null fields in Patch requests.
496 NullFields []string `json:"-"`
497 }
498
499 func (s *AddOrderDealsResponse) MarshalJSON() ([]byte, error) {
500 type NoMethod AddOrderDealsResponse
501 raw := NoMethod(*s)
502 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
503 }
504
505 type AddOrderNotesRequest struct {
506 // Notes: The list of notes to add.
507 Notes []*MarketplaceNote `json:"notes,omitempty"`
508
509 // ForceSendFields is a list of field names (e.g. "Notes") to
510 // unconditionally include in API requests. By default, fields with
511 // empty or default values are omitted from API requests. However, any
512 // non-pointer, non-interface field appearing in ForceSendFields will be
513 // sent to the server regardless of whether the field is empty or not.
514 // This may be used to include empty fields in Patch requests.
515 ForceSendFields []string `json:"-"`
516
517 // NullFields is a list of field names (e.g. "Notes") to include in API
518 // requests with the JSON null value. By default, fields with empty
519 // values are omitted from API requests. However, any field with an
520 // empty value appearing in NullFields will be sent to the server as
521 // null. It is an error if a field in this list has a non-empty value.
522 // This may be used to include null fields in Patch requests.
523 NullFields []string `json:"-"`
524 }
525
526 func (s *AddOrderNotesRequest) MarshalJSON() ([]byte, error) {
527 type NoMethod AddOrderNotesRequest
528 raw := NoMethod(*s)
529 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
530 }
531
532 type AddOrderNotesResponse struct {
533 Notes []*MarketplaceNote `json:"notes,omitempty"`
534
535 // ServerResponse contains the HTTP response code and headers from the
536 // server.
537 googleapi.ServerResponse `json:"-"`
538
539 // ForceSendFields is a list of field names (e.g. "Notes") to
540 // unconditionally include in API requests. By default, fields with
541 // empty or default values are omitted from API requests. However, any
542 // non-pointer, non-interface field appearing in ForceSendFields will be
543 // sent to the server regardless of whether the field is empty or not.
544 // This may be used to include empty fields in Patch requests.
545 ForceSendFields []string `json:"-"`
546
547 // NullFields is a list of field names (e.g. "Notes") to include in API
548 // requests with the JSON null value. By default, fields with empty
549 // values are omitted from API requests. However, any field with an
550 // empty value appearing in NullFields will be sent to the server as
551 // null. It is an error if a field in this list has a non-empty value.
552 // This may be used to include null fields in Patch requests.
553 NullFields []string `json:"-"`
554 }
555
556 func (s *AddOrderNotesResponse) MarshalJSON() ([]byte, error) {
557 type NoMethod AddOrderNotesResponse
558 raw := NoMethod(*s)
559 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
560 }
561
562 // BillingInfo: The configuration data for an Ad Exchange billing info.
563 type BillingInfo struct {
564 // AccountId: Account id.
565 AccountId int64 `json:"accountId,omitempty"`
566
567 // AccountName: Account name.
568 AccountName string `json:"accountName,omitempty"`
569
570 // BillingId: A list of adgroup IDs associated with this particular
571 // account. These IDs may show up as part of a realtime bidding
572 // BidRequest, which indicates a bid request for this account.
573 BillingId []string `json:"billingId,omitempty"`
574
575 // Kind: Resource type.
576 Kind string `json:"kind,omitempty"`
577
578 // ServerResponse contains the HTTP response code and headers from the
579 // server.
580 googleapi.ServerResponse `json:"-"`
581
582 // ForceSendFields is a list of field names (e.g. "AccountId") to
583 // unconditionally include in API requests. By default, fields with
584 // empty or default values are omitted from API requests. However, any
585 // non-pointer, non-interface field appearing in ForceSendFields will be
586 // sent to the server regardless of whether the field is empty or not.
587 // This may be used to include empty fields in Patch requests.
588 ForceSendFields []string `json:"-"`
589
590 // NullFields is a list of field names (e.g. "AccountId") to include in
591 // API requests with the JSON null value. By default, fields with empty
592 // values are omitted from API requests. However, any field with an
593 // empty value appearing in NullFields will be sent to the server as
594 // null. It is an error if a field in this list has a non-empty value.
595 // This may be used to include null fields in Patch requests.
596 NullFields []string `json:"-"`
597 }
598
599 func (s *BillingInfo) MarshalJSON() ([]byte, error) {
600 type NoMethod BillingInfo
601 raw := NoMethod(*s)
602 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
603 }
604
605 // BillingInfoList: A billing info feed lists Billing Info the Ad
606 // Exchange buyer account has access to. Each entry in the feed
607 // corresponds to a single billing info.
608 type BillingInfoList struct {
609 // Items: A list of billing info relevant for your account.
610 Items []*BillingInfo `json:"items,omitempty"`
611
612 // Kind: Resource type.
613 Kind string `json:"kind,omitempty"`
614
615 // ServerResponse contains the HTTP response code and headers from the
616 // server.
617 googleapi.ServerResponse `json:"-"`
618
619 // ForceSendFields is a list of field names (e.g. "Items") to
620 // unconditionally include in API requests. By default, fields with
621 // empty or default values are omitted from API requests. However, any
622 // non-pointer, non-interface field appearing in ForceSendFields will be
623 // sent to the server regardless of whether the field is empty or not.
624 // This may be used to include empty fields in Patch requests.
625 ForceSendFields []string `json:"-"`
626
627 // NullFields is a list of field names (e.g. "Items") to include in API
628 // requests with the JSON null value. By default, fields with empty
629 // values are omitted from API requests. However, any field with an
630 // empty value appearing in NullFields will be sent to the server as
631 // null. It is an error if a field in this list has a non-empty value.
632 // This may be used to include null fields in Patch requests.
633 NullFields []string `json:"-"`
634 }
635
636 func (s *BillingInfoList) MarshalJSON() ([]byte, error) {
637 type NoMethod BillingInfoList
638 raw := NoMethod(*s)
639 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
640 }
641
642 // Budget: The configuration data for Ad Exchange RTB - Budget API.
643 type Budget struct {
644 // AccountId: The id of the account. This is required for get and update
645 // requests.
646 AccountId int64 `json:"accountId,omitempty,string"`
647
648 // BillingId: The billing id to determine which adgroup to provide
649 // budget information for. This is required for get and update requests.
650 BillingId int64 `json:"billingId,omitempty,string"`
651
652 // BudgetAmount: The daily budget amount in unit amount of the account
653 // currency to apply for the billingId provided. This is required for
654 // update requests.
655 BudgetAmount int64 `json:"budgetAmount,omitempty,string"`
656
657 // CurrencyCode: The currency code for the buyer. This cannot be altered
658 // here.
659 CurrencyCode string `json:"currencyCode,omitempty"`
660
661 // Id: The unique id that describes this item.
662 Id string `json:"id,omitempty"`
663
664 // Kind: The kind of the resource, i.e. "adexchangebuyer#budget".
665 Kind string `json:"kind,omitempty"`
666
667 // ServerResponse contains the HTTP response code and headers from the
668 // server.
669 googleapi.ServerResponse `json:"-"`
670
671 // ForceSendFields is a list of field names (e.g. "AccountId") to
672 // unconditionally include in API requests. By default, fields with
673 // empty or default values are omitted from API requests. However, any
674 // non-pointer, non-interface field appearing in ForceSendFields will be
675 // sent to the server regardless of whether the field is empty or not.
676 // This may be used to include empty fields in Patch requests.
677 ForceSendFields []string `json:"-"`
678
679 // NullFields is a list of field names (e.g. "AccountId") to include in
680 // API requests with the JSON null value. By default, fields with empty
681 // values are omitted from API requests. However, any field with an
682 // empty value appearing in NullFields will be sent to the server as
683 // null. It is an error if a field in this list has a non-empty value.
684 // This may be used to include null fields in Patch requests.
685 NullFields []string `json:"-"`
686 }
687
688 func (s *Budget) MarshalJSON() ([]byte, error) {
689 type NoMethod Budget
690 raw := NoMethod(*s)
691 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
692 }
693
694 type Buyer struct {
695 // AccountId: Adx account id of the buyer.
696 AccountId string `json:"accountId,omitempty"`
697
698 // ForceSendFields is a list of field names (e.g. "AccountId") to
699 // unconditionally include in API requests. By default, fields with
700 // empty or default values are omitted from API requests. However, any
701 // non-pointer, non-interface field appearing in ForceSendFields will be
702 // sent to the server regardless of whether the field is empty or not.
703 // This may be used to include empty fields in Patch requests.
704 ForceSendFields []string `json:"-"`
705
706 // NullFields is a list of field names (e.g. "AccountId") to include in
707 // API requests with the JSON null value. By default, fields with empty
708 // values are omitted from API requests. However, any field with an
709 // empty value appearing in NullFields will be sent to the server as
710 // null. It is an error if a field in this list has a non-empty value.
711 // This may be used to include null fields in Patch requests.
712 NullFields []string `json:"-"`
713 }
714
715 func (s *Buyer) MarshalJSON() ([]byte, error) {
716 type NoMethod Buyer
717 raw := NoMethod(*s)
718 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
719 }
720
721 type ContactInformation struct {
722 // Email: Email address of the contact.
723 Email string `json:"email,omitempty"`
724
725 // Name: The name of the contact.
726 Name string `json:"name,omitempty"`
727
728 // ForceSendFields is a list of field names (e.g. "Email") to
729 // unconditionally include in API requests. By default, fields with
730 // empty or default values are omitted from API requests. However, any
731 // non-pointer, non-interface field appearing in ForceSendFields will be
732 // sent to the server regardless of whether the field is empty or not.
733 // This may be used to include empty fields in Patch requests.
734 ForceSendFields []string `json:"-"`
735
736 // NullFields is a list of field names (e.g. "Email") to include in API
737 // requests with the JSON null value. By default, fields with empty
738 // values are omitted from API requests. However, any field with an
739 // empty value appearing in NullFields will be sent to the server as
740 // null. It is an error if a field in this list has a non-empty value.
741 // This may be used to include null fields in Patch requests.
742 NullFields []string `json:"-"`
743 }
744
745 func (s *ContactInformation) MarshalJSON() ([]byte, error) {
746 type NoMethod ContactInformation
747 raw := NoMethod(*s)
748 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
749 }
750
751 type CreateOrdersRequest struct {
752 // Proposals: The list of proposals to create.
753 Proposals []*Proposal `json:"proposals,omitempty"`
754
755 // WebPropertyCode: Web property id of the seller creating these orders
756 WebPropertyCode string `json:"webPropertyCode,omitempty"`
757
758 // ForceSendFields is a list of field names (e.g. "Proposals") to
759 // unconditionally include in API requests. By default, fields with
760 // empty or default values are omitted from API requests. However, any
761 // non-pointer, non-interface field appearing in ForceSendFields will be
762 // sent to the server regardless of whether the field is empty or not.
763 // This may be used to include empty fields in Patch requests.
764 ForceSendFields []string `json:"-"`
765
766 // NullFields is a list of field names (e.g. "Proposals") to include in
767 // API requests with the JSON null value. By default, fields with empty
768 // values are omitted from API requests. However, any field with an
769 // empty value appearing in NullFields will be sent to the server as
770 // null. It is an error if a field in this list has a non-empty value.
771 // This may be used to include null fields in Patch requests.
772 NullFields []string `json:"-"`
773 }
774
775 func (s *CreateOrdersRequest) MarshalJSON() ([]byte, error) {
776 type NoMethod CreateOrdersRequest
777 raw := NoMethod(*s)
778 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
779 }
780
781 type CreateOrdersResponse struct {
782 // Proposals: The list of proposals successfully created.
783 Proposals []*Proposal `json:"proposals,omitempty"`
784
785 // ServerResponse contains the HTTP response code and headers from the
786 // server.
787 googleapi.ServerResponse `json:"-"`
788
789 // ForceSendFields is a list of field names (e.g. "Proposals") to
790 // unconditionally include in API requests. By default, fields with
791 // empty or default values are omitted from API requests. However, any
792 // non-pointer, non-interface field appearing in ForceSendFields will be
793 // sent to the server regardless of whether the field is empty or not.
794 // This may be used to include empty fields in Patch requests.
795 ForceSendFields []string `json:"-"`
796
797 // NullFields is a list of field names (e.g. "Proposals") to include in
798 // API requests with the JSON null value. By default, fields with empty
799 // values are omitted from API requests. However, any field with an
800 // empty value appearing in NullFields will be sent to the server as
801 // null. It is an error if a field in this list has a non-empty value.
802 // This may be used to include null fields in Patch requests.
803 NullFields []string `json:"-"`
804 }
805
806 func (s *CreateOrdersResponse) MarshalJSON() ([]byte, error) {
807 type NoMethod CreateOrdersResponse
808 raw := NoMethod(*s)
809 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
810 }
811
812 // Creative: A creative and its classification data.
813 type Creative struct {
814 // HTMLSnippet: The HTML snippet that displays the ad when inserted in
815 // the web page. If set, videoURL, videoVastXML, and nativeAd should not
816 // be set.
817 HTMLSnippet string `json:"HTMLSnippet,omitempty"`
818
819 // AccountId: Account id.
820 AccountId int64 `json:"accountId,omitempty"`
821
822 // AdChoicesDestinationUrl: The link to the Ad Preferences page. This is
823 // only supported for native ads.
824 AdChoicesDestinationUrl string `json:"adChoicesDestinationUrl,omitempty"`
825
826 AdTechnologyProviders *CreativeAdTechnologyProviders `json:"adTechnologyProviders,omitempty"`
827
828 // AdvertiserId: Detected advertiser id, if any. Read-only. This field
829 // should not be set in requests.
830 AdvertiserId googleapi.Int64s `json:"advertiserId,omitempty"`
831
832 // AdvertiserName: The name of the company being advertised in the
833 // creative. A list of advertisers is provided in the advertisers.txt
834 // file.
835 AdvertiserName string `json:"advertiserName,omitempty"`
836
837 // AgencyId: The agency id for this creative.
838 AgencyId int64 `json:"agencyId,omitempty,string"`
839
840 // ApiUploadTimestamp: The last upload timestamp of this creative if it
841 // was uploaded via API. Read-only. The value of this field is
842 // generated, and will be ignored for uploads. (formatted RFC 3339
843 // timestamp).
844 ApiUploadTimestamp string `json:"apiUploadTimestamp,omitempty"`
845
846 // Attribute: List of buyer selectable attributes for the ads that may
847 // be shown from this snippet. Each attribute is represented by an
848 // integer as defined in buyer-declarable-creative-attributes.txt.
849 Attribute []int64 `json:"attribute,omitempty"`
850
851 // BuyerCreativeId: A buyer-specific id identifying the creative in this
852 // ad.
853 BuyerCreativeId string `json:"buyerCreativeId,omitempty"`
854
855 // ClickThroughUrl: The set of destination urls for the snippet.
856 ClickThroughUrl []string `json:"clickThroughUrl,omitempty"`
857
858 // Corrections: Shows any corrections that were applied to this
859 // creative. Read-only. This field should not be set in requests.
860 Corrections []*CreativeCorrections `json:"corrections,omitempty"`
861
862 // CreativeStatusIdentityType: Creative status identity type that the
863 // creative item applies to. Ad Exchange real-time bidding is migrating
864 // to the sizeless creative verification. Originally, Ad Exchange
865 // assigned creative verification status to a unique combination of a
866 // buyer creative ID and creative dimensions. Post-migration, a single
867 // verification status will be assigned at the buyer creative ID level.
868 // This field allows to distinguish whether a given creative status
869 // applies to a unique combination of a buyer creative ID and creative
870 // dimensions, or to a buyer creative ID as a whole.
871 CreativeStatusIdentityType string `json:"creativeStatusIdentityType,omitempty"`
872
873 // DealsStatus: Top-level deals status. Read-only. This field should not
874 // be set in requests. If disapproved, an entry for
875 // auctionType=DIRECT_DEALS (or ALL) in servingRestrictions will also
876 // exist. Note that this may be nuanced with other contextual
877 // restrictions, in which case it may be preferable to read from
878 // servingRestrictions directly.
879 DealsStatus string `json:"dealsStatus,omitempty"`
880
881 // DetectedDomains: Detected domains for this creative. Read-only. This
882 // field should not be set in requests.
883 DetectedDomains []string `json:"detectedDomains,omitempty"`
884
885 // FilteringReasons: The filtering reasons for the creative. Read-only.
886 // This field should not be set in requests.
887 FilteringReasons *CreativeFilteringReasons `json:"filteringReasons,omitempty"`
888
889 // Height: Ad height.
890 Height int64 `json:"height,omitempty"`
891
892 // ImpressionTrackingUrl: The set of urls to be called to record an
893 // impression.
894 ImpressionTrackingUrl []string `json:"impressionTrackingUrl,omitempty"`
895
896 // Kind: Resource type.
897 Kind string `json:"kind,omitempty"`
898
899 // Languages: Detected languages for this creative. Read-only. This
900 // field should not be set in requests.
901 Languages []string `json:"languages,omitempty"`
902
903 // NativeAd: If nativeAd is set, HTMLSnippet, videoVastXML, and the
904 // videoURL outside of nativeAd should not be set. (The videoURL inside
905 // nativeAd can be set.)
906 NativeAd *CreativeNativeAd `json:"nativeAd,omitempty"`
907
908 // OpenAuctionStatus: Top-level open auction status. Read-only. This
909 // field should not be set in requests. If disapproved, an entry for
910 // auctionType=OPEN_AUCTION (or ALL) in servingRestrictions will also
911 // exist. Note that this may be nuanced with other contextual
912 // restrictions, in which case it may be preferable to read from
913 // ServingRestrictions directly.
914 OpenAuctionStatus string `json:"openAuctionStatus,omitempty"`
915
916 // ProductCategories: Detected product categories, if any. Each category
917 // is represented by an integer as defined in
918 // ad-product-categories.txt. Read-only. This field should not be set in
919 // requests.
920 ProductCategories []int64 `json:"productCategories,omitempty"`
921
922 // RestrictedCategories: All restricted categories for the ads that may
923 // be shown from this snippet. Each category is represented by an
924 // integer as defined in the ad-restricted-categories.txt.
925 RestrictedCategories []int64 `json:"restrictedCategories,omitempty"`
926
927 // SensitiveCategories: Detected sensitive categories, if any. Each
928 // category is represented by an integer as defined in
929 // ad-sensitive-categories.txt. Read-only. This field should not be set
930 // in requests.
931 SensitiveCategories []int64 `json:"sensitiveCategories,omitempty"`
932
933 // ServingRestrictions: The granular status of this ad in specific
934 // contexts. A context here relates to where something ultimately serves
935 // (for example, a physical location, a platform, an HTTPS vs HTTP
936 // request, or the type of auction). Read-only. This field should not be
937 // set in requests. See the examples in the Creatives guide for more
938 // details.
939 ServingRestrictions []*CreativeServingRestrictions `json:"servingRestrictions,omitempty"`
940
941 // VendorType: List of vendor types for the ads that may be shown from
942 // this snippet. Each vendor type is represented by an integer as
943 // defined in vendors.txt.
944 VendorType []int64 `json:"vendorType,omitempty"`
945
946 // Version: The version for this creative. Read-only. This field should
947 // not be set in requests.
948 Version int64 `json:"version,omitempty"`
949
950 // VideoURL: The URL to fetch a video ad. If set, HTMLSnippet,
951 // videoVastXML, and nativeAd should not be set. Note, this is different
952 // from resource.native_ad.video_url above.
953 VideoURL string `json:"videoURL,omitempty"`
954
955 // VideoVastXML: The contents of a VAST document for a video ad. This
956 // document should conform to the VAST 2.0 or 3.0 standard. If set,
957 // HTMLSnippet, videoURL, and nativeAd and should not be set.
958 VideoVastXML string `json:"videoVastXML,omitempty"`
959
960 // Width: Ad width.
961 Width int64 `json:"width,omitempty"`
962
963 // ServerResponse contains the HTTP response code and headers from the
964 // server.
965 googleapi.ServerResponse `json:"-"`
966
967 // ForceSendFields is a list of field names (e.g. "HTMLSnippet") to
968 // unconditionally include in API requests. By default, fields with
969 // empty or default values are omitted from API requests. However, any
970 // non-pointer, non-interface field appearing in ForceSendFields will be
971 // sent to the server regardless of whether the field is empty or not.
972 // This may be used to include empty fields in Patch requests.
973 ForceSendFields []string `json:"-"`
974
975 // NullFields is a list of field names (e.g. "HTMLSnippet") to include
976 // in API requests with the JSON null value. By default, fields with
977 // empty values are omitted from API requests. However, any field with
978 // an empty value appearing in NullFields will be sent to the server as
979 // null. It is an error if a field in this list has a non-empty value.
980 // This may be used to include null fields in Patch requests.
981 NullFields []string `json:"-"`
982 }
983
984 func (s *Creative) MarshalJSON() ([]byte, error) {
985 type NoMethod Creative
986 raw := NoMethod(*s)
987 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
988 }
989
990 type CreativeAdTechnologyProviders struct {
991 // DetectedProviderIds: The detected ad technology provider IDs for this
992 // creative. See
993 // https://storage.googleapis.com/adx-rtb-dictionaries/providers.csv for
994 // mapping of provider ID to provided name, a privacy policy URL, and a
995 // list of domains which can be attributed to the provider. If this
996 // creative contains provider IDs that are outside of those listed in
997 // the
998 // `BidRequest.adslot.consented_providers_settings.consented_providers`
999 // field on the Authorized Buyers Real-Time Bidding protocol or the
1000 // `BidRequest.user.ext.consented_providers_settings.consented_providers`
1001 // field on the OpenRTB protocol, a bid submitted for a European
1002 // Economic Area (EEA) user with this creative is not compliant with the
1003 // GDPR policies as mentioned in the "Third-party Ad Technology Vendors"
1004 // section of Authorized Buyers Program Guidelines.
1005 DetectedProviderIds googleapi.Int64s `json:"detectedProviderIds,omitempty"`
1006
1007 // HasUnidentifiedProvider: Whether the creative contains an
1008 // unidentified ad technology provider. If true, a bid submitted for a
1009 // European Economic Area (EEA) user with this creative is not compliant
1010 // with the GDPR policies as mentioned in the "Third-party Ad Technology
1011 // Vendors" section of Authorized Buyers Program Guidelines.
1012 HasUnidentifiedProvider bool `json:"hasUnidentifiedProvider,omitempty"`
1013
1014 // ForceSendFields is a list of field names (e.g. "DetectedProviderIds")
1015 // to unconditionally include in API requests. By default, fields with
1016 // empty or default values are omitted from API requests. However, any
1017 // non-pointer, non-interface field appearing in ForceSendFields will be
1018 // sent to the server regardless of whether the field is empty or not.
1019 // This may be used to include empty fields in Patch requests.
1020 ForceSendFields []string `json:"-"`
1021
1022 // NullFields is a list of field names (e.g. "DetectedProviderIds") to
1023 // include in API requests with the JSON null value. By default, fields
1024 // with empty values are omitted from API requests. However, any field
1025 // with an empty value appearing in NullFields will be sent to the
1026 // server as null. It is an error if a field in this list has a
1027 // non-empty value. This may be used to include null fields in Patch
1028 // requests.
1029 NullFields []string `json:"-"`
1030 }
1031
1032 func (s *CreativeAdTechnologyProviders) MarshalJSON() ([]byte, error) {
1033 type NoMethod CreativeAdTechnologyProviders
1034 raw := NoMethod(*s)
1035 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
1036 }
1037
1038 type CreativeCorrections struct {
1039 // Contexts: All known serving contexts containing serving status
1040 // information.
1041 Contexts []*CreativeCorrectionsContexts `json:"contexts,omitempty"`
1042
1043 // Details: Additional details about the correction.
1044 Details []string `json:"details,omitempty"`
1045
1046 // Reason: The type of correction that was applied to the creative.
1047 Reason string `json:"reason,omitempty"`
1048
1049 // ForceSendFields is a list of field names (e.g. "Contexts") to
1050 // unconditionally include in API requests. By default, fields with
1051 // empty or default values are omitted from API requests. However, any
1052 // non-pointer, non-interface field appearing in ForceSendFields will be
1053 // sent to the server regardless of whether the field is empty or not.
1054 // This may be used to include empty fields in Patch requests.
1055 ForceSendFields []string `json:"-"`
1056
1057 // NullFields is a list of field names (e.g. "Contexts") to include in
1058 // API requests with the JSON null value. By default, fields with empty
1059 // values are omitted from API requests. However, any field with an
1060 // empty value appearing in NullFields will be sent to the server as
1061 // null. It is an error if a field in this list has a non-empty value.
1062 // This may be used to include null fields in Patch requests.
1063 NullFields []string `json:"-"`
1064 }
1065
1066 func (s *CreativeCorrections) MarshalJSON() ([]byte, error) {
1067 type NoMethod CreativeCorrections
1068 raw := NoMethod(*s)
1069 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
1070 }
1071
1072 type CreativeCorrectionsContexts struct {
1073 // AuctionType: Only set when contextType=AUCTION_TYPE. Represents the
1074 // auction types this correction applies to.
1075 AuctionType []string `json:"auctionType,omitempty"`
1076
1077 // ContextType: The type of context (e.g., location, platform, auction
1078 // type, SSL-ness).
1079 ContextType string `json:"contextType,omitempty"`
1080
1081 // GeoCriteriaId: Only set when contextType=LOCATION. Represents the geo
1082 // criterias this correction applies to.
1083 GeoCriteriaId []int64 `json:"geoCriteriaId,omitempty"`
1084
1085 // Platform: Only set when contextType=PLATFORM. Represents the
1086 // platforms this correction applies to.
1087 Platform []string `json:"platform,omitempty"`
1088
1089 // ForceSendFields is a list of field names (e.g. "AuctionType") to
1090 // unconditionally include in API requests. By default, fields with
1091 // empty or default values are omitted from API requests. However, any
1092 // non-pointer, non-interface field appearing in ForceSendFields will be
1093 // sent to the server regardless of whether the field is empty or not.
1094 // This may be used to include empty fields in Patch requests.
1095 ForceSendFields []string `json:"-"`
1096
1097 // NullFields is a list of field names (e.g. "AuctionType") to include
1098 // in API requests with the JSON null value. By default, fields with
1099 // empty values are omitted from API requests. However, any field with
1100 // an empty value appearing in NullFields will be sent to the server as
1101 // null. It is an error if a field in this list has a non-empty value.
1102 // This may be used to include null fields in Patch requests.
1103 NullFields []string `json:"-"`
1104 }
1105
1106 func (s *CreativeCorrectionsContexts) MarshalJSON() ([]byte, error) {
1107 type NoMethod CreativeCorrectionsContexts
1108 raw := NoMethod(*s)
1109 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
1110 }
1111
1112 // CreativeFilteringReasons: The filtering reasons for the creative.
1113 // Read-only. This field should not be set in requests.
1114 type CreativeFilteringReasons struct {
1115 // Date: The date in ISO 8601 format for the data. The data is collected
1116 // from 00:00:00 to 23:59:59 in PST.
1117 Date string `json:"date,omitempty"`
1118
1119 // Reasons: The filtering reasons.
1120 Reasons []*CreativeFilteringReasonsReasons `json:"reasons,omitempty"`
1121
1122 // ForceSendFields is a list of field names (e.g. "Date") to
1123 // unconditionally include in API requests. By default, fields with
1124 // empty or default values are omitted from API requests. However, any
1125 // non-pointer, non-interface field appearing in ForceSendFields will be
1126 // sent to the server regardless of whether the field is empty or not.
1127 // This may be used to include empty fields in Patch requests.
1128 ForceSendFields []string `json:"-"`
1129
1130 // NullFields is a list of field names (e.g. "Date") to include in API
1131 // requests with the JSON null value. By default, fields with empty
1132 // values are omitted from API requests. However, any field with an
1133 // empty value appearing in NullFields will be sent to the server as
1134 // null. It is an error if a field in this list has a non-empty value.
1135 // This may be used to include null fields in Patch requests.
1136 NullFields []string `json:"-"`
1137 }
1138
1139 func (s *CreativeFilteringReasons) MarshalJSON() ([]byte, error) {
1140 type NoMethod CreativeFilteringReasons
1141 raw := NoMethod(*s)
1142 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
1143 }
1144
1145 type CreativeFilteringReasonsReasons struct {
1146 // FilteringCount: The number of times the creative was filtered for the
1147 // status. The count is aggregated across all publishers on the
1148 // exchange.
1149 FilteringCount int64 `json:"filteringCount,omitempty,string"`
1150
1151 // FilteringStatus: The filtering status code as defined in
1152 // creative-status-codes.txt.
1153 FilteringStatus int64 `json:"filteringStatus,omitempty"`
1154
1155 // ForceSendFields is a list of field names (e.g. "FilteringCount") to
1156 // unconditionally include in API requests. By default, fields with
1157 // empty or default values are omitted from API requests. However, any
1158 // non-pointer, non-interface field appearing in ForceSendFields will be
1159 // sent to the server regardless of whether the field is empty or not.
1160 // This may be used to include empty fields in Patch requests.
1161 ForceSendFields []string `json:"-"`
1162
1163 // NullFields is a list of field names (e.g. "FilteringCount") to
1164 // include in API requests with the JSON null value. By default, fields
1165 // with empty values are omitted from API requests. However, any field
1166 // with an empty value appearing in NullFields will be sent to the
1167 // server as null. It is an error if a field in this list has a
1168 // non-empty value. This may be used to include null fields in Patch
1169 // requests.
1170 NullFields []string `json:"-"`
1171 }
1172
1173 func (s *CreativeFilteringReasonsReasons) MarshalJSON() ([]byte, error) {
1174 type NoMethod CreativeFilteringReasonsReasons
1175 raw := NoMethod(*s)
1176 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
1177 }
1178
1179 // CreativeNativeAd: If nativeAd is set, HTMLSnippet, videoVastXML, and
1180 // the videoURL outside of nativeAd should not be set. (The videoURL
1181 // inside nativeAd can be set.)
1182 type CreativeNativeAd struct {
1183 Advertiser string `json:"advertiser,omitempty"`
1184
1185 // AppIcon: The app icon, for app download ads.
1186 AppIcon *CreativeNativeAdAppIcon `json:"appIcon,omitempty"`
1187
1188 // Body: A long description of the ad.
1189 Body string `json:"body,omitempty"`
1190
1191 // CallToAction: A label for the button that the user is supposed to
1192 // click.
1193 CallToAction string `json:"callToAction,omitempty"`
1194
1195 // ClickLinkUrl: The URL that the browser/SDK will load when the user
1196 // clicks the ad.
1197 ClickLinkUrl string `json:"clickLinkUrl,omitempty"`
1198
1199 // ClickTrackingUrl: The URL to use for click tracking.
1200 ClickTrackingUrl string `json:"clickTrackingUrl,omitempty"`
1201
1202 // Headline: A short title for the ad.
1203 Headline string `json:"headline,omitempty"`
1204
1205 // Image: A large image.
1206 Image *CreativeNativeAdImage `json:"image,omitempty"`
1207
1208 // ImpressionTrackingUrl: The URLs are called when the impression is
1209 // rendered.
1210 ImpressionTrackingUrl []string `json:"impressionTrackingUrl,omitempty"`
1211
1212 // Logo: A smaller image, for the advertiser logo.
1213 Logo *CreativeNativeAdLogo `json:"logo,omitempty"`
1214
1215 // Price: The price of the promoted app including the currency info.
1216 Price string `json:"price,omitempty"`
1217
1218 // StarRating: The app rating in the app store. Must be in the range
1219 // [0-5].
1220 StarRating float64 `json:"starRating,omitempty"`
1221
1222 // VideoURL: The URL of the XML VAST for a native ad. Note this is a
1223 // separate field from resource.video_url.
1224 VideoURL string `json:"videoURL,omitempty"`
1225
1226 // ForceSendFields is a list of field names (e.g. "Advertiser") to
1227 // unconditionally include in API requests. By default, fields with
1228 // empty or default values are omitted from API requests. However, any
1229 // non-pointer, non-interface field appearing in ForceSendFields will be
1230 // sent to the server regardless of whether the field is empty or not.
1231 // This may be used to include empty fields in Patch requests.
1232 ForceSendFields []string `json:"-"`
1233
1234 // NullFields is a list of field names (e.g. "Advertiser") to include in
1235 // API requests with the JSON null value. By default, fields with empty
1236 // values are omitted from API requests. However, any field with an
1237 // empty value appearing in NullFields will be sent to the server as
1238 // null. It is an error if a field in this list has a non-empty value.
1239 // This may be used to include null fields in Patch requests.
1240 NullFields []string `json:"-"`
1241 }
1242
1243 func (s *CreativeNativeAd) MarshalJSON() ([]byte, error) {
1244 type NoMethod CreativeNativeAd
1245 raw := NoMethod(*s)
1246 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
1247 }
1248
1249 func (s *CreativeNativeAd) UnmarshalJSON(data []byte) error {
1250 type NoMethod CreativeNativeAd
1251 var s1 struct {
1252 StarRating gensupport.JSONFloat64 `json:"starRating"`
1253 *NoMethod
1254 }
1255 s1.NoMethod = (*NoMethod)(s)
1256 if err := json.Unmarshal(data, &s1); err != nil {
1257 return err
1258 }
1259 s.StarRating = float64(s1.StarRating)
1260 return nil
1261 }
1262
1263 // CreativeNativeAdAppIcon: The app icon, for app download ads.
1264 type CreativeNativeAdAppIcon struct {
1265 Height int64 `json:"height,omitempty"`
1266
1267 Url string `json:"url,omitempty"`
1268
1269 Width int64 `json:"width,omitempty"`
1270
1271 // ForceSendFields is a list of field names (e.g. "Height") to
1272 // unconditionally include in API requests. By default, fields with
1273 // empty or default values are omitted from API requests. However, any
1274 // non-pointer, non-interface field appearing in ForceSendFields will be
1275 // sent to the server regardless of whether the field is empty or not.
1276 // This may be used to include empty fields in Patch requests.
1277 ForceSendFields []string `json:"-"`
1278
1279 // NullFields is a list of field names (e.g. "Height") to include in API
1280 // requests with the JSON null value. By default, fields with empty
1281 // values are omitted from API requests. However, any field with an
1282 // empty value appearing in NullFields will be sent to the server as
1283 // null. It is an error if a field in this list has a non-empty value.
1284 // This may be used to include null fields in Patch requests.
1285 NullFields []string `json:"-"`
1286 }
1287
1288 func (s *CreativeNativeAdAppIcon) MarshalJSON() ([]byte, error) {
1289 type NoMethod CreativeNativeAdAppIcon
1290 raw := NoMethod(*s)
1291 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
1292 }
1293
1294 // CreativeNativeAdImage: A large image.
1295 type CreativeNativeAdImage struct {
1296 Height int64 `json:"height,omitempty"`
1297
1298 Url string `json:"url,omitempty"`
1299
1300 Width int64 `json:"width,omitempty"`
1301
1302 // ForceSendFields is a list of field names (e.g. "Height") to
1303 // unconditionally include in API requests. By default, fields with
1304 // empty or default values are omitted from API requests. However, any
1305 // non-pointer, non-interface field appearing in ForceSendFields will be
1306 // sent to the server regardless of whether the field is empty or not.
1307 // This may be used to include empty fields in Patch requests.
1308 ForceSendFields []string `json:"-"`
1309
1310 // NullFields is a list of field names (e.g. "Height") to include in API
1311 // requests with the JSON null value. By default, fields with empty
1312 // values are omitted from API requests. However, any field with an
1313 // empty value appearing in NullFields will be sent to the server as
1314 // null. It is an error if a field in this list has a non-empty value.
1315 // This may be used to include null fields in Patch requests.
1316 NullFields []string `json:"-"`
1317 }
1318
1319 func (s *CreativeNativeAdImage) MarshalJSON() ([]byte, error) {
1320 type NoMethod CreativeNativeAdImage
1321 raw := NoMethod(*s)
1322 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
1323 }
1324
1325 // CreativeNativeAdLogo: A smaller image, for the advertiser logo.
1326 type CreativeNativeAdLogo struct {
1327 Height int64 `json:"height,omitempty"`
1328
1329 Url string `json:"url,omitempty"`
1330
1331 Width int64 `json:"width,omitempty"`
1332
1333 // ForceSendFields is a list of field names (e.g. "Height") to
1334 // unconditionally include in API requests. By default, fields with
1335 // empty or default values are omitted from API requests. However, any
1336 // non-pointer, non-interface field appearing in ForceSendFields will be
1337 // sent to the server regardless of whether the field is empty or not.
1338 // This may be used to include empty fields in Patch requests.
1339 ForceSendFields []string `json:"-"`
1340
1341 // NullFields is a list of field names (e.g. "Height") to include in API
1342 // requests with the JSON null value. By default, fields with empty
1343 // values are omitted from API requests. However, any field with an
1344 // empty value appearing in NullFields will be sent to the server as
1345 // null. It is an error if a field in this list has a non-empty value.
1346 // This may be used to include null fields in Patch requests.
1347 NullFields []string `json:"-"`
1348 }
1349
1350 func (s *CreativeNativeAdLogo) MarshalJSON() ([]byte, error) {
1351 type NoMethod CreativeNativeAdLogo
1352 raw := NoMethod(*s)
1353 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
1354 }
1355
1356 type CreativeServingRestrictions struct {
1357 // Contexts: All known contexts/restrictions.
1358 Contexts []*CreativeServingRestrictionsContexts `json:"contexts,omitempty"`
1359
1360 // DisapprovalReasons: The reasons for disapproval within this
1361 // restriction, if any. Note that not all disapproval reasons may be
1362 // categorized, so it is possible for the creative to have a status of
1363 // DISAPPROVED or CONDITIONALLY_APPROVED with an empty list for
1364 // disapproval_reasons. In this case, please reach out to your TAM to
1365 // help debug the issue.
1366 DisapprovalReasons []*CreativeServingRestrictionsDisapprovalReasons `json:"disapprovalReasons,omitempty"`
1367
1368 // Reason: Why the creative is ineligible to serve in this context
1369 // (e.g., it has been explicitly disapproved or is pending review).
1370 Reason string `json:"reason,omitempty"`
1371
1372 // ForceSendFields is a list of field names (e.g. "Contexts") to
1373 // unconditionally include in API requests. By default, fields with
1374 // empty or default values are omitted from API requests. However, any
1375 // non-pointer, non-interface field appearing in ForceSendFields will be
1376 // sent to the server regardless of whether the field is empty or not.
1377 // This may be used to include empty fields in Patch requests.
1378 ForceSendFields []string `json:"-"`
1379
1380 // NullFields is a list of field names (e.g. "Contexts") to include in
1381 // API requests with the JSON null value. By default, fields with empty
1382 // values are omitted from API requests. However, any field with an
1383 // empty value appearing in NullFields will be sent to the server as
1384 // null. It is an error if a field in this list has a non-empty value.
1385 // This may be used to include null fields in Patch requests.
1386 NullFields []string `json:"-"`
1387 }
1388
1389 func (s *CreativeServingRestrictions) MarshalJSON() ([]byte, error) {
1390 type NoMethod CreativeServingRestrictions
1391 raw := NoMethod(*s)
1392 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
1393 }
1394
1395 type CreativeServingRestrictionsContexts struct {
1396 // AuctionType: Only set when contextType=AUCTION_TYPE. Represents the
1397 // auction types this restriction applies to.
1398 AuctionType []string `json:"auctionType,omitempty"`
1399
1400 // ContextType: The type of context (e.g., location, platform, auction
1401 // type, SSL-ness).
1402 ContextType string `json:"contextType,omitempty"`
1403
1404 // GeoCriteriaId: Only set when contextType=LOCATION. Represents the geo
1405 // criterias this restriction applies to. Impressions are considered to
1406 // match a context if either the user location or publisher location
1407 // matches a given geoCriteriaId.
1408 GeoCriteriaId []int64 `json:"geoCriteriaId,omitempty"`
1409
1410 // Platform: Only set when contextType=PLATFORM. Represents the
1411 // platforms this restriction applies to.
1412 Platform []string `json:"platform,omitempty"`
1413
1414 // ForceSendFields is a list of field names (e.g. "AuctionType") to
1415 // unconditionally include in API requests. By default, fields with
1416 // empty or default values are omitted from API requests. However, any
1417 // non-pointer, non-interface field appearing in ForceSendFields will be
1418 // sent to the server regardless of whether the field is empty or not.
1419 // This may be used to include empty fields in Patch requests.
1420 ForceSendFields []string `json:"-"`
1421
1422 // NullFields is a list of field names (e.g. "AuctionType") to include
1423 // in API requests with the JSON null value. By default, fields with
1424 // empty values are omitted from API requests. However, any field with
1425 // an empty value appearing in NullFields will be sent to the server as
1426 // null. It is an error if a field in this list has a non-empty value.
1427 // This may be used to include null fields in Patch requests.
1428 NullFields []string `json:"-"`
1429 }
1430
1431 func (s *CreativeServingRestrictionsContexts) MarshalJSON() ([]byte, error) {
1432 type NoMethod CreativeServingRestrictionsContexts
1433 raw := NoMethod(*s)
1434 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
1435 }
1436
1437 type CreativeServingRestrictionsDisapprovalReasons struct {
1438 // Details: Additional details about the reason for disapproval.
1439 Details []string `json:"details,omitempty"`
1440
1441 // Reason: The categorized reason for disapproval.
1442 Reason string `json:"reason,omitempty"`
1443
1444 // ForceSendFields is a list of field names (e.g. "Details") to
1445 // unconditionally include in API requests. By default, fields with
1446 // empty or default values are omitted from API requests. However, any
1447 // non-pointer, non-interface field appearing in ForceSendFields will be
1448 // sent to the server regardless of whether the field is empty or not.
1449 // This may be used to include empty fields in Patch requests.
1450 ForceSendFields []string `json:"-"`
1451
1452 // NullFields is a list of field names (e.g. "Details") to include in
1453 // API requests with the JSON null value. By default, fields with empty
1454 // values are omitted from API requests. However, any field with an
1455 // empty value appearing in NullFields will be sent to the server as
1456 // null. It is an error if a field in this list has a non-empty value.
1457 // This may be used to include null fields in Patch requests.
1458 NullFields []string `json:"-"`
1459 }
1460
1461 func (s *CreativeServingRestrictionsDisapprovalReasons) MarshalJSON() ([]byte, error) {
1462 type NoMethod CreativeServingRestrictionsDisapprovalReasons
1463 raw := NoMethod(*s)
1464 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
1465 }
1466
1467 // CreativeDealIds: The external deal ids associated with a creative.
1468 type CreativeDealIds struct {
1469 // DealStatuses: A list of external deal ids and ARC approval status.
1470 DealStatuses []*CreativeDealIdsDealStatuses `json:"dealStatuses,omitempty"`
1471
1472 // Kind: Resource type.
1473 Kind string `json:"kind,omitempty"`
1474
1475 // ServerResponse contains the HTTP response code and headers from the
1476 // server.
1477 googleapi.ServerResponse `json:"-"`
1478
1479 // ForceSendFields is a list of field names (e.g. "DealStatuses") to
1480 // unconditionally include in API requests. By default, fields with
1481 // empty or default values are omitted from API requests. However, any
1482 // non-pointer, non-interface field appearing in ForceSendFields will be
1483 // sent to the server regardless of whether the field is empty or not.
1484 // This may be used to include empty fields in Patch requests.
1485 ForceSendFields []string `json:"-"`
1486
1487 // NullFields is a list of field names (e.g. "DealStatuses") to include
1488 // in API requests with the JSON null value. By default, fields with
1489 // empty values are omitted from API requests. However, any field with
1490 // an empty value appearing in NullFields will be sent to the server as
1491 // null. It is an error if a field in this list has a non-empty value.
1492 // This may be used to include null fields in Patch requests.
1493 NullFields []string `json:"-"`
1494 }
1495
1496 func (s *CreativeDealIds) MarshalJSON() ([]byte, error) {
1497 type NoMethod CreativeDealIds
1498 raw := NoMethod(*s)
1499 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
1500 }
1501
1502 type CreativeDealIdsDealStatuses struct {
1503 // ArcStatus: ARC approval status.
1504 ArcStatus string `json:"arcStatus,omitempty"`
1505
1506 // DealId: External deal ID.
1507 DealId int64 `json:"dealId,omitempty,string"`
1508
1509 // WebPropertyId: Publisher ID.
1510 WebPropertyId int64 `json:"webPropertyId,omitempty"`
1511
1512 // ForceSendFields is a list of field names (e.g. "ArcStatus") to
1513 // unconditionally include in API requests. By default, fields with
1514 // empty or default values are omitted from API requests. However, any
1515 // non-pointer, non-interface field appearing in ForceSendFields will be
1516 // sent to the server regardless of whether the field is empty or not.
1517 // This may be used to include empty fields in Patch requests.
1518 ForceSendFields []string `json:"-"`
1519
1520 // NullFields is a list of field names (e.g. "ArcStatus") to include in
1521 // API requests with the JSON null value. By default, fields with empty
1522 // values are omitted from API requests. However, any field with an
1523 // empty value appearing in NullFields will be sent to the server as
1524 // null. It is an error if a field in this list has a non-empty value.
1525 // This may be used to include null fields in Patch requests.
1526 NullFields []string `json:"-"`
1527 }
1528
1529 func (s *CreativeDealIdsDealStatuses) MarshalJSON() ([]byte, error) {
1530 type NoMethod CreativeDealIdsDealStatuses
1531 raw := NoMethod(*s)
1532 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
1533 }
1534
1535 // CreativesList: The creatives feed lists the active creatives for the
1536 // Ad Exchange buyer accounts that the user has access to. Each entry in
1537 // the feed corresponds to a single creative.
1538 type CreativesList struct {
1539 // Items: A list of creatives.
1540 Items []*Creative `json:"items,omitempty"`
1541
1542 // Kind: Resource type.
1543 Kind string `json:"kind,omitempty"`
1544
1545 // NextPageToken: Continuation token used to page through creatives. To
1546 // retrieve the next page of results, set the next request's "pageToken"
1547 // value to this.
1548 NextPageToken string `json:"nextPageToken,omitempty"`
1549
1550 // ServerResponse contains the HTTP response code and headers from the
1551 // server.
1552 googleapi.ServerResponse `json:"-"`
1553
1554 // ForceSendFields is a list of field names (e.g. "Items") to
1555 // unconditionally include in API requests. By default, fields with
1556 // empty or default values are omitted from API requests. However, any
1557 // non-pointer, non-interface field appearing in ForceSendFields will be
1558 // sent to the server regardless of whether the field is empty or not.
1559 // This may be used to include empty fields in Patch requests.
1560 ForceSendFields []string `json:"-"`
1561
1562 // NullFields is a list of field names (e.g. "Items") to include in API
1563 // requests with the JSON null value. By default, fields with empty
1564 // values are omitted from API requests. However, any field with an
1565 // empty value appearing in NullFields will be sent to the server as
1566 // null. It is an error if a field in this list has a non-empty value.
1567 // This may be used to include null fields in Patch requests.
1568 NullFields []string `json:"-"`
1569 }
1570
1571 func (s *CreativesList) MarshalJSON() ([]byte, error) {
1572 type NoMethod CreativesList
1573 raw := NoMethod(*s)
1574 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
1575 }
1576
1577 type DealServingMetadata struct {
1578 // AlcoholAdsAllowed: True if alcohol ads are allowed for this deal
1579 // (read-only). This field is only populated when querying for finalized
1580 // orders using the method GetFinalizedOrderDeals
1581 AlcoholAdsAllowed bool `json:"alcoholAdsAllowed,omitempty"`
1582
1583 // DealPauseStatus: Tracks which parties (if any) have paused a deal.
1584 // (readonly, except via PauseResumeOrderDeals action)
1585 DealPauseStatus *DealServingMetadataDealPauseStatus `json:"dealPauseStatus,omitempty"`
1586
1587 // ForceSendFields is a list of field names (e.g. "AlcoholAdsAllowed")
1588 // to unconditionally include in API requests. By default, fields with
1589 // empty or default values are omitted from API requests. However, any
1590 // non-pointer, non-interface field appearing in ForceSendFields will be
1591 // sent to the server regardless of whether the field is empty or not.
1592 // This may be used to include empty fields in Patch requests.
1593 ForceSendFields []string `json:"-"`
1594
1595 // NullFields is a list of field names (e.g. "AlcoholAdsAllowed") to
1596 // include in API requests with the JSON null value. By default, fields
1597 // with empty values are omitted from API requests. However, any field
1598 // with an empty value appearing in NullFields will be sent to the
1599 // server as null. It is an error if a field in this list has a
1600 // non-empty value. This may be used to include null fields in Patch
1601 // requests.
1602 NullFields []string `json:"-"`
1603 }
1604
1605 func (s *DealServingMetadata) MarshalJSON() ([]byte, error) {
1606 type NoMethod DealServingMetadata
1607 raw := NoMethod(*s)
1608 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
1609 }
1610
1611 // DealServingMetadataDealPauseStatus: Tracks which parties (if any)
1612 // have paused a deal. The deal is considered paused if has_buyer_paused
1613 // || has_seller_paused. Each of the has_buyer_paused or the
1614 // has_seller_paused bits can be set independently.
1615 type DealServingMetadataDealPauseStatus struct {
1616 BuyerPauseReason string `json:"buyerPauseReason,omitempty"`
1617
1618 // FirstPausedBy: If the deal is paused, records which party paused the
1619 // deal first.
1620 FirstPausedBy string `json:"firstPausedBy,omitempty"`
1621
1622 HasBuyerPaused bool `json:"hasBuyerPaused,omitempty"`
1623
1624 HasSellerPaused bool `json:"hasSellerPaused,omitempty"`
1625
1626 SellerPauseReason string `json:"sellerPauseReason,omitempty"`
1627
1628 // ForceSendFields is a list of field names (e.g. "BuyerPauseReason") to
1629 // unconditionally include in API requests. By default, fields with
1630 // empty or default values are omitted from API requests. However, any
1631 // non-pointer, non-interface field appearing in ForceSendFields will be
1632 // sent to the server regardless of whether the field is empty or not.
1633 // This may be used to include empty fields in Patch requests.
1634 ForceSendFields []string `json:"-"`
1635
1636 // NullFields is a list of field names (e.g. "BuyerPauseReason") to
1637 // include in API requests with the JSON null value. By default, fields
1638 // with empty values are omitted from API requests. However, any field
1639 // with an empty value appearing in NullFields will be sent to the
1640 // server as null. It is an error if a field in this list has a
1641 // non-empty value. This may be used to include null fields in Patch
1642 // requests.
1643 NullFields []string `json:"-"`
1644 }
1645
1646 func (s *DealServingMetadataDealPauseStatus) MarshalJSON() ([]byte, error) {
1647 type NoMethod DealServingMetadataDealPauseStatus
1648 raw := NoMethod(*s)
1649 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
1650 }
1651
1652 type DealTerms struct {
1653 // BrandingType: Visibility of the URL in bid requests.
1654 BrandingType string `json:"brandingType,omitempty"`
1655
1656 // CrossListedExternalDealIdType: Indicates that this ExternalDealId
1657 // exists under at least two different AdxInventoryDeals. Currently, the
1658 // only case that the same ExternalDealId will exist is programmatic
1659 // cross sell case.
1660 CrossListedExternalDealIdType string `json:"crossListedExternalDealIdType,omitempty"`
1661
1662 // Description: Description for the proposed terms of the deal.
1663 Description string `json:"description,omitempty"`
1664
1665 // EstimatedGrossSpend: Non-binding estimate of the estimated gross
1666 // spend for this deal Can be set by buyer or seller.
1667 EstimatedGrossSpend *Price `json:"estimatedGrossSpend,omitempty"`
1668
1669 // EstimatedImpressionsPerDay: Non-binding estimate of the impressions
1670 // served per day Can be set by buyer or seller.
1671 EstimatedImpressionsPerDay int64 `json:"estimatedImpressionsPerDay,omitempty,string"`
1672
1673 // GuaranteedFixedPriceTerms: The terms for guaranteed fixed price
1674 // deals.
1675 GuaranteedFixedPriceTerms *DealTermsGuaranteedFixedPriceTerms `json:"guaranteedFixedPriceTerms,omitempty"`
1676
1677 // NonGuaranteedAuctionTerms: The terms for non-guaranteed auction
1678 // deals.
1679 NonGuaranteedAuctionTerms *DealTermsNonGuaranteedAuctionTerms `json:"nonGuaranteedAuctionTerms,omitempty"`
1680
1681 // NonGuaranteedFixedPriceTerms: The terms for non-guaranteed fixed
1682 // price deals.
1683 NonGuaranteedFixedPriceTerms *DealTermsNonGuaranteedFixedPriceTerms `json:"nonGuaranteedFixedPriceTerms,omitempty"`
1684
1685 // RubiconNonGuaranteedTerms: The terms for rubicon non-guaranteed
1686 // deals.
1687 RubiconNonGuaranteedTerms *DealTermsRubiconNonGuaranteedTerms `json:"rubiconNonGuaranteedTerms,omitempty"`
1688
1689 // SellerTimeZone: For deals with Cost Per Day billing, defines the
1690 // timezone used to mark the boundaries of a day (buyer-readonly)
1691 SellerTimeZone string `json:"sellerTimeZone,omitempty"`
1692
1693 // ForceSendFields is a list of field names (e.g. "BrandingType") to
1694 // unconditionally include in API requests. By default, fields with
1695 // empty or default values are omitted from API requests. However, any
1696 // non-pointer, non-interface field appearing in ForceSendFields will be
1697 // sent to the server regardless of whether the field is empty or not.
1698 // This may be used to include empty fields in Patch requests.
1699 ForceSendFields []string `json:"-"`
1700
1701 // NullFields is a list of field names (e.g. "BrandingType") to include
1702 // in API requests with the JSON null value. By default, fields with
1703 // empty values are omitted from API requests. However, any field with
1704 // an empty value appearing in NullFields will be sent to the server as
1705 // null. It is an error if a field in this list has a non-empty value.
1706 // This may be used to include null fields in Patch requests.
1707 NullFields []string `json:"-"`
1708 }
1709
1710 func (s *DealTerms) MarshalJSON() ([]byte, error) {
1711 type NoMethod DealTerms
1712 raw := NoMethod(*s)
1713 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
1714 }
1715
1716 type DealTermsGuaranteedFixedPriceTerms struct {
1717 // BillingInfo: External billing info for this Deal. This field is
1718 // relevant when external billing info such as price has a different
1719 // currency code than DFP/AdX.
1720 BillingInfo *DealTermsGuaranteedFixedPriceTermsBillingInfo `json:"billingInfo,omitempty"`
1721
1722 // FixedPrices: Fixed price for the specified buyer.
1723 FixedPrices []*PricePerBuyer `json:"fixedPrices,omitempty"`
1724
1725 // GuaranteedImpressions: Guaranteed impressions as a percentage. This
1726 // is the percentage of guaranteed looks that the buyer is guaranteeing
1727 // to buy.
1728 GuaranteedImpressions int64 `json:"guaranteedImpressions,omitempty,string"`
1729
1730 // GuaranteedLooks: Count of guaranteed looks. Required for deal,
1731 // optional for product. For CPD deals, buyer changes to
1732 // guaranteed_looks will be ignored.
1733 GuaranteedLooks int64 `json:"guaranteedLooks,omitempty,string"`
1734
1735 // MinimumDailyLooks: Count of minimum daily looks for a CPD deal. For
1736 // CPD deals, buyer should negotiate on this field instead of
1737 // guaranteed_looks.
1738 MinimumDailyLooks int64 `json:"minimumDailyLooks,omitempty,string"`
1739
1740 // ForceSendFields is a list of field names (e.g. "BillingInfo") to
1741 // unconditionally include in API requests. By default, fields with
1742 // empty or default values are omitted from API requests. However, any
1743 // non-pointer, non-interface field appearing in ForceSendFields will be
1744 // sent to the server regardless of whether the field is empty or not.
1745 // This may be used to include empty fields in Patch requests.
1746 ForceSendFields []string `json:"-"`
1747
1748 // NullFields is a list of field names (e.g. "BillingInfo") to include
1749 // in API requests with the JSON null value. By default, fields with
1750 // empty values are omitted from API requests. However, any field with
1751 // an empty value appearing in NullFields will be sent to the server as
1752 // null. It is an error if a field in this list has a non-empty value.
1753 // This may be used to include null fields in Patch requests.
1754 NullFields []string `json:"-"`
1755 }
1756
1757 func (s *DealTermsGuaranteedFixedPriceTerms) MarshalJSON() ([]byte, error) {
1758 type NoMethod DealTermsGuaranteedFixedPriceTerms
1759 raw := NoMethod(*s)
1760 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
1761 }
1762
1763 type DealTermsGuaranteedFixedPriceTermsBillingInfo struct {
1764 // CurrencyConversionTimeMs: The timestamp (in ms since epoch) when the
1765 // original reservation price for the deal was first converted to DFP
1766 // currency. This is used to convert the contracted price into buyer's
1767 // currency without discrepancy.
1768 CurrencyConversionTimeMs int64 `json:"currencyConversionTimeMs,omitempty,string"`
1769
1770 // DfpLineItemId: The DFP line item id associated with this deal. For
1771 // features like CPD, buyers can retrieve the DFP line item for billing
1772 // reconciliation.
1773 DfpLineItemId int64 `json:"dfpLineItemId,omitempty,string"`
1774
1775 // OriginalContractedQuantity: The original contracted quantity (#
1776 // impressions) for this deal. To ensure delivery, sometimes the
1777 // publisher will book the deal with a impression buffer, such that
1778 // guaranteed_looks is greater than the contracted quantity. However
1779 // clients are billed using the original contracted quantity.
1780 OriginalContractedQuantity int64 `json:"originalContractedQuantity,omitempty,string"`
1781
1782 // Price: The original reservation price for the deal, if the currency
1783 // code is different from the one used in negotiation.
1784 Price *Price `json:"price,omitempty"`
1785
1786 // ForceSendFields is a list of field names (e.g.
1787 // "CurrencyConversionTimeMs") to unconditionally include in API
1788 // requests. By default, fields with empty or default values are omitted
1789 // from API requests. However, any non-pointer, non-interface field
1790 // appearing in ForceSendFields will be sent to the server regardless of
1791 // whether the field is empty or not. This may be used to include empty
1792 // fields in Patch requests.
1793 ForceSendFields []string `json:"-"`
1794
1795 // NullFields is a list of field names (e.g. "CurrencyConversionTimeMs")
1796 // to include in API requests with the JSON null value. By default,
1797 // fields with empty values are omitted from API requests. However, any
1798 // field with an empty value appearing in NullFields will be sent to the
1799 // server as null. It is an error if a field in this list has a
1800 // non-empty value. This may be used to include null fields in Patch
1801 // requests.
1802 NullFields []string `json:"-"`
1803 }
1804
1805 func (s *DealTermsGuaranteedFixedPriceTermsBillingInfo) MarshalJSON() ([]byte, error) {
1806 type NoMethod DealTermsGuaranteedFixedPriceTermsBillingInfo
1807 raw := NoMethod(*s)
1808 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
1809 }
1810
1811 type DealTermsNonGuaranteedAuctionTerms struct {
1812 // AutoOptimizePrivateAuction: True if open auction buyers are allowed
1813 // to compete with invited buyers in this private auction
1814 // (buyer-readonly).
1815 AutoOptimizePrivateAuction bool `json:"autoOptimizePrivateAuction,omitempty"`
1816
1817 // ReservePricePerBuyers: Reserve price for the specified buyer.
1818 ReservePricePerBuyers []*PricePerBuyer `json:"reservePricePerBuyers,omitempty"`
1819
1820 // ForceSendFields is a list of field names (e.g.
1821 // "AutoOptimizePrivateAuction") to unconditionally include in API
1822 // requests. By default, fields with empty or default values are omitted
1823 // from API requests. However, any non-pointer, non-interface field
1824 // appearing in ForceSendFields will be sent to the server regardless of
1825 // whether the field is empty or not. This may be used to include empty
1826 // fields in Patch requests.
1827 ForceSendFields []string `json:"-"`
1828
1829 // NullFields is a list of field names (e.g.
1830 // "AutoOptimizePrivateAuction") to include in API requests with the
1831 // JSON null value. By default, fields with empty values are omitted
1832 // from API requests. However, any field with an empty value appearing
1833 // in NullFields will be sent to the server as null. It is an error if a
1834 // field in this list has a non-empty value. This may be used to include
1835 // null fields in Patch requests.
1836 NullFields []string `json:"-"`
1837 }
1838
1839 func (s *DealTermsNonGuaranteedAuctionTerms) MarshalJSON() ([]byte, error) {
1840 type NoMethod DealTermsNonGuaranteedAuctionTerms
1841 raw := NoMethod(*s)
1842 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
1843 }
1844
1845 type DealTermsNonGuaranteedFixedPriceTerms struct {
1846 // FixedPrices: Fixed price for the specified buyer.
1847 FixedPrices []*PricePerBuyer `json:"fixedPrices,omitempty"`
1848
1849 // ForceSendFields is a list of field names (e.g. "FixedPrices") to
1850 // unconditionally include in API requests. By default, fields with
1851 // empty or default values are omitted from API requests. However, any
1852 // non-pointer, non-interface field appearing in ForceSendFields will be
1853 // sent to the server regardless of whether the field is empty or not.
1854 // This may be used to include empty fields in Patch requests.
1855 ForceSendFields []string `json:"-"`
1856
1857 // NullFields is a list of field names (e.g. "FixedPrices") to include
1858 // in API requests with the JSON null value. By default, fields with
1859 // empty values are omitted from API requests. However, any field with
1860 // an empty value appearing in NullFields will be sent to the server as
1861 // null. It is an error if a field in this list has a non-empty value.
1862 // This may be used to include null fields in Patch requests.
1863 NullFields []string `json:"-"`
1864 }
1865
1866 func (s *DealTermsNonGuaranteedFixedPriceTerms) MarshalJSON() ([]byte, error) {
1867 type NoMethod DealTermsNonGuaranteedFixedPriceTerms
1868 raw := NoMethod(*s)
1869 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
1870 }
1871
1872 type DealTermsRubiconNonGuaranteedTerms struct {
1873 // PriorityPrice: Optional price for Rubicon priority access in the
1874 // auction.
1875 PriorityPrice *Price `json:"priorityPrice,omitempty"`
1876
1877 // StandardPrice: Optional price for Rubicon standard access in the
1878 // auction.
1879 StandardPrice *Price `json:"standardPrice,omitempty"`
1880
1881 // ForceSendFields is a list of field names (e.g. "PriorityPrice") to
1882 // unconditionally include in API requests. By default, fields with
1883 // empty or default values are omitted from API requests. However, any
1884 // non-pointer, non-interface field appearing in ForceSendFields will be
1885 // sent to the server regardless of whether the field is empty or not.
1886 // This may be used to include empty fields in Patch requests.
1887 ForceSendFields []string `json:"-"`
1888
1889 // NullFields is a list of field names (e.g. "PriorityPrice") to include
1890 // in API requests with the JSON null value. By default, fields with
1891 // empty values are omitted from API requests. However, any field with
1892 // an empty value appearing in NullFields will be sent to the server as
1893 // null. It is an error if a field in this list has a non-empty value.
1894 // This may be used to include null fields in Patch requests.
1895 NullFields []string `json:"-"`
1896 }
1897
1898 func (s *DealTermsRubiconNonGuaranteedTerms) MarshalJSON() ([]byte, error) {
1899 type NoMethod DealTermsRubiconNonGuaranteedTerms
1900 raw := NoMethod(*s)
1901 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
1902 }
1903
1904 type DeleteOrderDealsRequest struct {
1905 // DealIds: List of deals to delete for a given proposal
1906 DealIds []string `json:"dealIds,omitempty"`
1907
1908 // ProposalRevisionNumber: The last known proposal revision number.
1909 ProposalRevisionNumber int64 `json:"proposalRevisionNumber,omitempty,string"`
1910
1911 // UpdateAction: Indicates an optional action to take on the proposal
1912 UpdateAction string `json:"updateAction,omitempty"`
1913
1914 // ForceSendFields is a list of field names (e.g. "DealIds") to
1915 // unconditionally include in API requests. By default, fields with
1916 // empty or default values are omitted from API requests. However, any
1917 // non-pointer, non-interface field appearing in ForceSendFields will be
1918 // sent to the server regardless of whether the field is empty or not.
1919 // This may be used to include empty fields in Patch requests.
1920 ForceSendFields []string `json:"-"`
1921
1922 // NullFields is a list of field names (e.g. "DealIds") to include in
1923 // API requests with the JSON null value. By default, fields with empty
1924 // values are omitted from API requests. However, any field with an
1925 // empty value appearing in NullFields will be sent to the server as
1926 // null. It is an error if a field in this list has a non-empty value.
1927 // This may be used to include null fields in Patch requests.
1928 NullFields []string `json:"-"`
1929 }
1930
1931 func (s *DeleteOrderDealsRequest) MarshalJSON() ([]byte, error) {
1932 type NoMethod DeleteOrderDealsRequest
1933 raw := NoMethod(*s)
1934 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
1935 }
1936
1937 type DeleteOrderDealsResponse struct {
1938 // Deals: List of deals deleted (in the same proposal as passed in the
1939 // request)
1940 Deals []*MarketplaceDeal `json:"deals,omitempty"`
1941
1942 // ProposalRevisionNumber: The updated revision number for the proposal.
1943 ProposalRevisionNumber int64 `json:"proposalRevisionNumber,omitempty,string"`
1944
1945 // ServerResponse contains the HTTP response code and headers from the
1946 // server.
1947 googleapi.ServerResponse `json:"-"`
1948
1949 // ForceSendFields is a list of field names (e.g. "Deals") to
1950 // unconditionally include in API requests. By default, fields with
1951 // empty or default values are omitted from API requests. However, any
1952 // non-pointer, non-interface field appearing in ForceSendFields will be
1953 // sent to the server regardless of whether the field is empty or not.
1954 // This may be used to include empty fields in Patch requests.
1955 ForceSendFields []string `json:"-"`
1956
1957 // NullFields is a list of field names (e.g. "Deals") to include in API
1958 // requests with the JSON null value. By default, fields with empty
1959 // values are omitted from API requests. However, any field with an
1960 // empty value appearing in NullFields will be sent to the server as
1961 // null. It is an error if a field in this list has a non-empty value.
1962 // This may be used to include null fields in Patch requests.
1963 NullFields []string `json:"-"`
1964 }
1965
1966 func (s *DeleteOrderDealsResponse) MarshalJSON() ([]byte, error) {
1967 type NoMethod DeleteOrderDealsResponse
1968 raw := NoMethod(*s)
1969 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
1970 }
1971
1972 type DeliveryControl struct {
1973 CreativeBlockingLevel string `json:"creativeBlockingLevel,omitempty"`
1974
1975 DeliveryRateType string `json:"deliveryRateType,omitempty"`
1976
1977 FrequencyCaps []*DeliveryControlFrequencyCap `json:"frequencyCaps,omitempty"`
1978
1979 // ForceSendFields is a list of field names (e.g.
1980 // "CreativeBlockingLevel") to unconditionally include in API requests.
1981 // By default, fields with empty or default values are omitted from API
1982 // requests. However, any non-pointer, non-interface field appearing in
1983 // ForceSendFields will be sent to the server regardless of whether the
1984 // field is empty or not. This may be used to include empty fields in
1985 // Patch requests.
1986 ForceSendFields []string `json:"-"`
1987
1988 // NullFields is a list of field names (e.g. "CreativeBlockingLevel") to
1989 // include in API requests with the JSON null value. By default, fields
1990 // with empty values are omitted from API requests. However, any field
1991 // with an empty value appearing in NullFields will be sent to the
1992 // server as null. It is an error if a field in this list has a
1993 // non-empty value. This may be used to include null fields in Patch
1994 // requests.
1995 NullFields []string `json:"-"`
1996 }
1997
1998 func (s *DeliveryControl) MarshalJSON() ([]byte, error) {
1999 type NoMethod DeliveryControl
2000 raw := NoMethod(*s)
2001 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
2002 }
2003
2004 type DeliveryControlFrequencyCap struct {
2005 MaxImpressions int64 `json:"maxImpressions,omitempty"`
2006
2007 NumTimeUnits int64 `json:"numTimeUnits,omitempty"`
2008
2009 TimeUnitType string `json:"timeUnitType,omitempty"`
2010
2011 // ForceSendFields is a list of field names (e.g. "MaxImpressions") to
2012 // unconditionally include in API requests. By default, fields with
2013 // empty or default values are omitted from API requests. However, any
2014 // non-pointer, non-interface field appearing in ForceSendFields will be
2015 // sent to the server regardless of whether the field is empty or not.
2016 // This may be used to include empty fields in Patch requests.
2017 ForceSendFields []string `json:"-"`
2018
2019 // NullFields is a list of field names (e.g. "MaxImpressions") to
2020 // include in API requests with the JSON null value. By default, fields
2021 // with empty values are omitted from API requests. However, any field
2022 // with an empty value appearing in NullFields will be sent to the
2023 // server as null. It is an error if a field in this list has a
2024 // non-empty value. This may be used to include null fields in Patch
2025 // requests.
2026 NullFields []string `json:"-"`
2027 }
2028
2029 func (s *DeliveryControlFrequencyCap) MarshalJSON() ([]byte, error) {
2030 type NoMethod DeliveryControlFrequencyCap
2031 raw := NoMethod(*s)
2032 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
2033 }
2034
2035 // Dimension: This message carries publisher provided breakdown. E.g.
2036 // {dimension_type: 'COUNTRY', [{dimension_value: {id: 1, name: 'US'}},
2037 // {dimension_value: {id: 2, name: 'UK'}}]}
2038 type Dimension struct {
2039 DimensionType string `json:"dimensionType,omitempty"`
2040
2041 DimensionValues []*DimensionDimensionValue `json:"dimensionValues,omitempty"`
2042
2043 // ForceSendFields is a list of field names (e.g. "DimensionType") to
2044 // unconditionally include in API requests. By default, fields with
2045 // empty or default values are omitted from API requests. However, any
2046 // non-pointer, non-interface field appearing in ForceSendFields will be
2047 // sent to the server regardless of whether the field is empty or not.
2048 // This may be used to include empty fields in Patch requests.
2049 ForceSendFields []string `json:"-"`
2050
2051 // NullFields is a list of field names (e.g. "DimensionType") to include
2052 // in API requests with the JSON null value. By default, fields with
2053 // empty values are omitted from API requests. However, any field with
2054 // an empty value appearing in NullFields will be sent to the server as
2055 // null. It is an error if a field in this list has a non-empty value.
2056 // This may be used to include null fields in Patch requests.
2057 NullFields []string `json:"-"`
2058 }
2059
2060 func (s *Dimension) MarshalJSON() ([]byte, error) {
2061 type NoMethod Dimension
2062 raw := NoMethod(*s)
2063 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
2064 }
2065
2066 // DimensionDimensionValue: Value of the dimension.
2067 type DimensionDimensionValue struct {
2068 // Id: Id of the dimension.
2069 Id int64 `json:"id,omitempty"`
2070
2071 // Name: Name of the dimension mainly for debugging purposes, except for
2072 // the case of CREATIVE_SIZE. For CREATIVE_SIZE, strings are used
2073 // instead of ids.
2074 Name string `json:"name,omitempty"`
2075
2076 // Percentage: Percent of total impressions for a dimension type. e.g.
2077 // {dimension_type: 'GENDER', [{dimension_value: {id: 1, name: 'MALE',
2078 // percentage: 60}}]} Gender MALE is 60% of all impressions which have
2079 // gender.
2080 Percentage int64 `json:"percentage,omitempty"`
2081
2082 // ForceSendFields is a list of field names (e.g. "Id") to
2083 // unconditionally include in API requests. By default, fields with
2084 // empty or default values are omitted from API requests. However, any
2085 // non-pointer, non-interface field appearing in ForceSendFields will be
2086 // sent to the server regardless of whether the field is empty or not.
2087 // This may be used to include empty fields in Patch requests.
2088 ForceSendFields []string `json:"-"`
2089
2090 // NullFields is a list of field names (e.g. "Id") to include in API
2091 // requests with the JSON null value. By default, fields with empty
2092 // values are omitted from API requests. However, any field with an
2093 // empty value appearing in NullFields will be sent to the server as
2094 // null. It is an error if a field in this list has a non-empty value.
2095 // This may be used to include null fields in Patch requests.
2096 NullFields []string `json:"-"`
2097 }
2098
2099 func (s *DimensionDimensionValue) MarshalJSON() ([]byte, error) {
2100 type NoMethod DimensionDimensionValue
2101 raw := NoMethod(*s)
2102 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
2103 }
2104
2105 type EditAllOrderDealsRequest struct {
2106 // Deals: List of deals to edit. Service may perform 3 different
2107 // operations based on comparison of deals in this list vs deals already
2108 // persisted in database: 1. Add new deal to proposal If a deal in this
2109 // list does not exist in the proposal, the service will create a new
2110 // deal and add it to the proposal. Validation will follow
2111 // AddOrderDealsRequest. 2. Update existing deal in the proposal If a
2112 // deal in this list already exist in the proposal, the service will
2113 // update that existing deal to this new deal in the request. Validation
2114 // will follow UpdateOrderDealsRequest. 3. Delete deals from the
2115 // proposal (just need the id) If a existing deal in the proposal is not
2116 // present in this list, the service will delete that deal from the
2117 // proposal. Validation will follow DeleteOrderDealsRequest.
2118 Deals []*MarketplaceDeal `json:"deals,omitempty"`
2119
2120 // Proposal: If specified, also updates the proposal in the batch
2121 // transaction. This is useful when the proposal and the deals need to
2122 // be updated in one transaction.
2123 Proposal *Proposal `json:"proposal,omitempty"`
2124
2125 // ProposalRevisionNumber: The last known revision number for the
2126 // proposal.
2127 ProposalRevisionNumber int64 `json:"proposalRevisionNumber,omitempty,string"`
2128
2129 // UpdateAction: Indicates an optional action to take on the proposal
2130 UpdateAction string `json:"updateAction,omitempty"`
2131
2132 // ForceSendFields is a list of field names (e.g. "Deals") to
2133 // unconditionally include in API requests. By default, fields with
2134 // empty or default values are omitted from API requests. However, any
2135 // non-pointer, non-interface field appearing in ForceSendFields will be
2136 // sent to the server regardless of whether the field is empty or not.
2137 // This may be used to include empty fields in Patch requests.
2138 ForceSendFields []string `json:"-"`
2139
2140 // NullFields is a list of field names (e.g. "Deals") to include in API
2141 // requests with the JSON null value. By default, fields with empty
2142 // values are omitted from API requests. However, any field with an
2143 // empty value appearing in NullFields will be sent to the server as
2144 // null. It is an error if a field in this list has a non-empty value.
2145 // This may be used to include null fields in Patch requests.
2146 NullFields []string `json:"-"`
2147 }
2148
2149 func (s *EditAllOrderDealsRequest) MarshalJSON() ([]byte, error) {
2150 type NoMethod EditAllOrderDealsRequest
2151 raw := NoMethod(*s)
2152 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
2153 }
2154
2155 type EditAllOrderDealsResponse struct {
2156 // Deals: List of all deals in the proposal after edit.
2157 Deals []*MarketplaceDeal `json:"deals,omitempty"`
2158
2159 // OrderRevisionNumber: The latest revision number after the update has
2160 // been applied.
2161 OrderRevisionNumber int64 `json:"orderRevisionNumber,omitempty,string"`
2162
2163 // ServerResponse contains the HTTP response code and headers from the
2164 // server.
2165 googleapi.ServerResponse `json:"-"`
2166
2167 // ForceSendFields is a list of field names (e.g. "Deals") to
2168 // unconditionally include in API requests. By default, fields with
2169 // empty or default values are omitted from API requests. However, any
2170 // non-pointer, non-interface field appearing in ForceSendFields will be
2171 // sent to the server regardless of whether the field is empty or not.
2172 // This may be used to include empty fields in Patch requests.
2173 ForceSendFields []string `json:"-"`
2174
2175 // NullFields is a list of field names (e.g. "Deals") to include in API
2176 // requests with the JSON null value. By default, fields with empty
2177 // values are omitted from API requests. However, any field with an
2178 // empty value appearing in NullFields will be sent to the server as
2179 // null. It is an error if a field in this list has a non-empty value.
2180 // This may be used to include null fields in Patch requests.
2181 NullFields []string `json:"-"`
2182 }
2183
2184 func (s *EditAllOrderDealsResponse) MarshalJSON() ([]byte, error) {
2185 type NoMethod EditAllOrderDealsResponse
2186 raw := NoMethod(*s)
2187 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
2188 }
2189
2190 type GetOffersResponse struct {
2191 // Products: The returned list of products.
2192 Products []*Product `json:"products,omitempty"`
2193
2194 // ServerResponse contains the HTTP response code and headers from the
2195 // server.
2196 googleapi.ServerResponse `json:"-"`
2197
2198 // ForceSendFields is a list of field names (e.g. "Products") to
2199 // unconditionally include in API requests. By default, fields with
2200 // empty or default values are omitted from API requests. However, any
2201 // non-pointer, non-interface field appearing in ForceSendFields will be
2202 // sent to the server regardless of whether the field is empty or not.
2203 // This may be used to include empty fields in Patch requests.
2204 ForceSendFields []string `json:"-"`
2205
2206 // NullFields is a list of field names (e.g. "Products") to include in
2207 // API requests with the JSON null value. By default, fields with empty
2208 // values are omitted from API requests. However, any field with an
2209 // empty value appearing in NullFields will be sent to the server as
2210 // null. It is an error if a field in this list has a non-empty value.
2211 // This may be used to include null fields in Patch requests.
2212 NullFields []string `json:"-"`
2213 }
2214
2215 func (s *GetOffersResponse) MarshalJSON() ([]byte, error) {
2216 type NoMethod GetOffersResponse
2217 raw := NoMethod(*s)
2218 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
2219 }
2220
2221 type GetOrderDealsResponse struct {
2222 // Deals: List of deals for the proposal
2223 Deals []*MarketplaceDeal `json:"deals,omitempty"`
2224
2225 // ServerResponse contains the HTTP response code and headers from the
2226 // server.
2227 googleapi.ServerResponse `json:"-"`
2228
2229 // ForceSendFields is a list of field names (e.g. "Deals") to
2230 // unconditionally include in API requests. By default, fields with
2231 // empty or default values are omitted from API requests. However, any
2232 // non-pointer, non-interface field appearing in ForceSendFields will be
2233 // sent to the server regardless of whether the field is empty or not.
2234 // This may be used to include empty fields in Patch requests.
2235 ForceSendFields []string `json:"-"`
2236
2237 // NullFields is a list of field names (e.g. "Deals") to include in API
2238 // requests with the JSON null value. By default, fields with empty
2239 // values are omitted from API requests. However, any field with an
2240 // empty value appearing in NullFields will be sent to the server as
2241 // null. It is an error if a field in this list has a non-empty value.
2242 // This may be used to include null fields in Patch requests.
2243 NullFields []string `json:"-"`
2244 }
2245
2246 func (s *GetOrderDealsResponse) MarshalJSON() ([]byte, error) {
2247 type NoMethod GetOrderDealsResponse
2248 raw := NoMethod(*s)
2249 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
2250 }
2251
2252 type GetOrderNotesResponse struct {
2253 // Notes: The list of matching notes. The notes for a proposal are
2254 // ordered from oldest to newest. If the notes span multiple proposals,
2255 // they will be grouped by proposal, with the notes for the most
2256 // recently modified proposal appearing first.
2257 Notes []*MarketplaceNote `json:"notes,omitempty"`
2258
2259 // ServerResponse contains the HTTP response code and headers from the
2260 // server.
2261 googleapi.ServerResponse `json:"-"`
2262
2263 // ForceSendFields is a list of field names (e.g. "Notes") to
2264 // unconditionally include in API requests. By default, fields with
2265 // empty or default values are omitted from API requests. However, any
2266 // non-pointer, non-interface field appearing in ForceSendFields will be
2267 // sent to the server regardless of whether the field is empty or not.
2268 // This may be used to include empty fields in Patch requests.
2269 ForceSendFields []string `json:"-"`
2270
2271 // NullFields is a list of field names (e.g. "Notes") to include in API
2272 // requests with the JSON null value. By default, fields with empty
2273 // values are omitted from API requests. However, any field with an
2274 // empty value appearing in NullFields will be sent to the server as
2275 // null. It is an error if a field in this list has a non-empty value.
2276 // This may be used to include null fields in Patch requests.
2277 NullFields []string `json:"-"`
2278 }
2279
2280 func (s *GetOrderNotesResponse) MarshalJSON() ([]byte, error) {
2281 type NoMethod GetOrderNotesResponse
2282 raw := NoMethod(*s)
2283 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
2284 }
2285
2286 type GetOrdersResponse struct {
2287 // Proposals: The list of matching proposals.
2288 Proposals []*Proposal `json:"proposals,omitempty"`
2289
2290 // ServerResponse contains the HTTP response code and headers from the
2291 // server.
2292 googleapi.ServerResponse `json:"-"`
2293
2294 // ForceSendFields is a list of field names (e.g. "Proposals") to
2295 // unconditionally include in API requests. By default, fields with
2296 // empty or default values are omitted from API requests. However, any
2297 // non-pointer, non-interface field appearing in ForceSendFields will be
2298 // sent to the server regardless of whether the field is empty or not.
2299 // This may be used to include empty fields in Patch requests.
2300 ForceSendFields []string `json:"-"`
2301
2302 // NullFields is a list of field names (e.g. "Proposals") to include in
2303 // API requests with the JSON null value. By default, fields with empty
2304 // values are omitted from API requests. However, any field with an
2305 // empty value appearing in NullFields will be sent to the server as
2306 // null. It is an error if a field in this list has a non-empty value.
2307 // This may be used to include null fields in Patch requests.
2308 NullFields []string `json:"-"`
2309 }
2310
2311 func (s *GetOrdersResponse) MarshalJSON() ([]byte, error) {
2312 type NoMethod GetOrdersResponse
2313 raw := NoMethod(*s)
2314 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
2315 }
2316
2317 type GetPublisherProfilesByAccountIdResponse struct {
2318 // Profiles: Profiles for the requested publisher
2319 Profiles []*PublisherProfileApiProto `json:"profiles,omitempty"`
2320
2321 // ServerResponse contains the HTTP response code and headers from the
2322 // server.
2323 googleapi.ServerResponse `json:"-"`
2324
2325 // ForceSendFields is a list of field names (e.g. "Profiles") to
2326 // unconditionally include in API requests. By default, fields with
2327 // empty or default values are omitted from API requests. However, any
2328 // non-pointer, non-interface field appearing in ForceSendFields will be
2329 // sent to the server regardless of whether the field is empty or not.
2330 // This may be used to include empty fields in Patch requests.
2331 ForceSendFields []string `json:"-"`
2332
2333 // NullFields is a list of field names (e.g. "Profiles") to include in
2334 // API requests with the JSON null value. By default, fields with empty
2335 // values are omitted from API requests. However, any field with an
2336 // empty value appearing in NullFields will be sent to the server as
2337 // null. It is an error if a field in this list has a non-empty value.
2338 // This may be used to include null fields in Patch requests.
2339 NullFields []string `json:"-"`
2340 }
2341
2342 func (s *GetPublisherProfilesByAccountIdResponse) MarshalJSON() ([]byte, error) {
2343 type NoMethod GetPublisherProfilesByAccountIdResponse
2344 raw := NoMethod(*s)
2345 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
2346 }
2347
2348 // MarketplaceDeal: A proposal can contain multiple deals. A deal
2349 // contains the terms and targeting information that is used for
2350 // serving.
2351 type MarketplaceDeal struct {
2352 // BuyerPrivateData: Buyer private data (hidden from seller).
2353 BuyerPrivateData *PrivateData `json:"buyerPrivateData,omitempty"`
2354
2355 // CreationTimeMs: The time (ms since epoch) of the deal creation.
2356 // (readonly)
2357 CreationTimeMs int64 `json:"creationTimeMs,omitempty,string"`
2358
2359 // CreativePreApprovalPolicy: Specifies the creative pre-approval policy
2360 // (buyer-readonly)
2361 CreativePreApprovalPolicy string `json:"creativePreApprovalPolicy,omitempty"`
2362
2363 // CreativeSafeFrameCompatibility: Specifies whether the creative is
2364 // safeFrame compatible (buyer-readonly)
2365 CreativeSafeFrameCompatibility string `json:"creativeSafeFrameCompatibility,omitempty"`
2366
2367 // DealId: A unique deal-id for the deal (readonly).
2368 DealId string `json:"dealId,omitempty"`
2369
2370 // DealServingMetadata: Metadata about the serving status of this deal
2371 // (readonly, writes via custom actions)
2372 DealServingMetadata *DealServingMetadata `json:"dealServingMetadata,omitempty"`
2373
2374 // DeliveryControl: The set of fields around delivery control that are
2375 // interesting for a buyer to see but are non-negotiable. These are set
2376 // by the publisher. This message is assigned an id of 100 since some
2377 // day we would want to model this as a protobuf extension.
2378 DeliveryControl *DeliveryControl `json:"deliveryControl,omitempty"`
2379
2380 // ExternalDealId: The external deal id assigned to this deal once the
2381 // deal is finalized. This is the deal-id that shows up in
2382 // serving/reporting etc. (readonly)
2383 ExternalDealId string `json:"externalDealId,omitempty"`
2384
2385 // FlightEndTimeMs: Proposed flight end time of the deal (ms since
2386 // epoch) This will generally be stored in a granularity of a second.
2387 // (updatable)
2388 FlightEndTimeMs int64 `json:"flightEndTimeMs,omitempty,string"`
2389
2390 // FlightStartTimeMs: Proposed flight start time of the deal (ms since
2391 // epoch) This will generally be stored in a granularity of a second.
2392 // (updatable)
2393 FlightStartTimeMs int64 `json:"flightStartTimeMs,omitempty,string"`
2394
2395 // InventoryDescription: Description for the deal terms.
2396 // (buyer-readonly)
2397 InventoryDescription string `json:"inventoryDescription,omitempty"`
2398
2399 // IsRfpTemplate: Indicates whether the current deal is a RFP template.
2400 // RFP template is created by buyer and not based on seller created
2401 // products.
2402 IsRfpTemplate bool `json:"isRfpTemplate,omitempty"`
2403
2404 // IsSetupComplete: True, if the buyside inventory setup is complete for
2405 // this deal. (readonly, except via OrderSetupCompleted action)
2406 IsSetupComplete bool `json:"isSetupComplete,omitempty"`
2407
2408 // Kind: Identifies what kind of resource this is. Value: the fixed
2409 // string "adexchangebuyer#marketplaceDeal".
2410 Kind string `json:"kind,omitempty"`
2411
2412 // LastUpdateTimeMs: The time (ms since epoch) when the deal was last
2413 // updated. (readonly)
2414 LastUpdateTimeMs int64 `json:"lastUpdateTimeMs,omitempty,string"`
2415
2416 MakegoodRequestedReason string `json:"makegoodRequestedReason,omitempty"`
2417
2418 // Name: The name of the deal. (updatable)
2419 Name string `json:"name,omitempty"`
2420
2421 // ProductId: The product-id from which this deal was created.
2422 // (readonly, except on create)
2423 ProductId string `json:"productId,omitempty"`
2424
2425 // ProductRevisionNumber: The revision number of the product that the
2426 // deal was created from (readonly, except on create)
2427 ProductRevisionNumber int64 `json:"productRevisionNumber,omitempty,string"`
2428
2429 // ProgrammaticCreativeSource: Specifies the creative source for
2430 // programmatic deals, PUBLISHER means creative is provided by seller
2431 // and ADVERTISR means creative is provided by buyer. (buyer-readonly)
2432 ProgrammaticCreativeSource string `json:"programmaticCreativeSource,omitempty"`
2433
2434 ProposalId string `json:"proposalId,omitempty"`
2435
2436 // SellerContacts: Optional Seller contact information for the deal
2437 // (buyer-readonly)
2438 SellerContacts []*ContactInformation `json:"sellerContacts,omitempty"`
2439
2440 // SharedTargetings: The shared targeting visible to buyers and sellers.
2441 // Each shared targeting entity is AND'd together. (updatable)
2442 SharedTargetings []*SharedTargeting `json:"sharedTargetings,omitempty"`
2443
2444 // SyndicationProduct: The syndication product associated with the deal.
2445 // (readonly, except on create)
2446 SyndicationProduct string `json:"syndicationProduct,omitempty"`
2447
2448 // Terms: The negotiable terms of the deal. (updatable)
2449 Terms *DealTerms `json:"terms,omitempty"`
2450
2451 WebPropertyCode string `json:"webPropertyCode,omitempty"`
2452
2453 // ForceSendFields is a list of field names (e.g. "BuyerPrivateData") to
2454 // unconditionally include in API requests. By default, fields with
2455 // empty or default values are omitted from API requests. However, any
2456 // non-pointer, non-interface field appearing in ForceSendFields will be
2457 // sent to the server regardless of whether the field is empty or not.
2458 // This may be used to include empty fields in Patch requests.
2459 ForceSendFields []string `json:"-"`
2460
2461 // NullFields is a list of field names (e.g. "BuyerPrivateData") to
2462 // include in API requests with the JSON null value. By default, fields
2463 // with empty values are omitted from API requests. However, any field
2464 // with an empty value appearing in NullFields will be sent to the
2465 // server as null. It is an error if a field in this list has a
2466 // non-empty value. This may be used to include null fields in Patch
2467 // requests.
2468 NullFields []string `json:"-"`
2469 }
2470
2471 func (s *MarketplaceDeal) MarshalJSON() ([]byte, error) {
2472 type NoMethod MarketplaceDeal
2473 raw := NoMethod(*s)
2474 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
2475 }
2476
2477 type MarketplaceDealParty struct {
2478 // Buyer: The buyer/seller associated with the deal. One of buyer/seller
2479 // is specified for a deal-party.
2480 Buyer *Buyer `json:"buyer,omitempty"`
2481
2482 // Seller: The buyer/seller associated with the deal. One of
2483 // buyer/seller is specified for a deal party.
2484 Seller *Seller `json:"seller,omitempty"`
2485
2486 // ForceSendFields is a list of field names (e.g. "Buyer") to
2487 // unconditionally include in API requests. By default, fields with
2488 // empty or default values are omitted from API requests. However, any
2489 // non-pointer, non-interface field appearing in ForceSendFields will be
2490 // sent to the server regardless of whether the field is empty or not.
2491 // This may be used to include empty fields in Patch requests.
2492 ForceSendFields []string `json:"-"`
2493
2494 // NullFields is a list of field names (e.g. "Buyer") to include in API
2495 // requests with the JSON null value. By default, fields with empty
2496 // values are omitted from API requests. However, any field with an
2497 // empty value appearing in NullFields will be sent to the server as
2498 // null. It is an error if a field in this list has a non-empty value.
2499 // This may be used to include null fields in Patch requests.
2500 NullFields []string `json:"-"`
2501 }
2502
2503 func (s *MarketplaceDealParty) MarshalJSON() ([]byte, error) {
2504 type NoMethod MarketplaceDealParty
2505 raw := NoMethod(*s)
2506 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
2507 }
2508
2509 type MarketplaceLabel struct {
2510 // AccountId: The accountId of the party that created the label.
2511 AccountId string `json:"accountId,omitempty"`
2512
2513 // CreateTimeMs: The creation time (in ms since epoch) for the label.
2514 CreateTimeMs int64 `json:"createTimeMs,omitempty,string"`
2515
2516 // DeprecatedMarketplaceDealParty: Information about the party that
2517 // created the label.
2518 DeprecatedMarketplaceDealParty *MarketplaceDealParty `json:"deprecatedMarketplaceDealParty,omitempty"`
2519
2520 // Label: The label to use.
2521 Label string `json:"label,omitempty"`
2522
2523 // ForceSendFields is a list of field names (e.g. "AccountId") to
2524 // unconditionally include in API requests. By default, fields with
2525 // empty or default values are omitted from API requests. However, any
2526 // non-pointer, non-interface field appearing in ForceSendFields will be
2527 // sent to the server regardless of whether the field is empty or not.
2528 // This may be used to include empty fields in Patch requests.
2529 ForceSendFields []string `json:"-"`
2530
2531 // NullFields is a list of field names (e.g. "AccountId") to include in
2532 // API requests with the JSON null value. By default, fields with empty
2533 // values are omitted from API requests. However, any field with an
2534 // empty value appearing in NullFields will be sent to the server as
2535 // null. It is an error if a field in this list has a non-empty value.
2536 // This may be used to include null fields in Patch requests.
2537 NullFields []string `json:"-"`
2538 }
2539
2540 func (s *MarketplaceLabel) MarshalJSON() ([]byte, error) {
2541 type NoMethod MarketplaceLabel
2542 raw := NoMethod(*s)
2543 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
2544 }
2545
2546 // MarketplaceNote: A proposal is associated with a bunch of notes which
2547 // may optionally be associated with a deal and/or revision number.
2548 type MarketplaceNote struct {
2549 // CreatorRole: The role of the person (buyer/seller) creating the note.
2550 // (readonly)
2551 CreatorRole string `json:"creatorRole,omitempty"`
2552
2553 // DealId: Notes can optionally be associated with a deal. (readonly,
2554 // except on create)
2555 DealId string `json:"dealId,omitempty"`
2556
2557 // Kind: Identifies what kind of resource this is. Value: the fixed
2558 // string "adexchangebuyer#marketplaceNote".
2559 Kind string `json:"kind,omitempty"`
2560
2561 // Note: The actual note to attach. (readonly, except on create)
2562 Note string `json:"note,omitempty"`
2563
2564 // NoteId: The unique id for the note. (readonly)
2565 NoteId string `json:"noteId,omitempty"`
2566
2567 // ProposalId: The proposalId that a note is attached to. (readonly)
2568 ProposalId string `json:"proposalId,omitempty"`
2569
2570 // ProposalRevisionNumber: If the note is associated with a proposal
2571 // revision number, then store that here. (readonly, except on create)
2572 ProposalRevisionNumber int64 `json:"proposalRevisionNumber,omitempty,string"`
2573
2574 // TimestampMs: The timestamp (ms since epoch) that this note was
2575 // created. (readonly)
2576 TimestampMs int64 `json:"timestampMs,omitempty,string"`
2577
2578 // ForceSendFields is a list of field names (e.g. "CreatorRole") to
2579 // unconditionally include in API requests. By default, fields with
2580 // empty or default values are omitted from API requests. However, any
2581 // non-pointer, non-interface field appearing in ForceSendFields will be
2582 // sent to the server regardless of whether the field is empty or not.
2583 // This may be used to include empty fields in Patch requests.
2584 ForceSendFields []string `json:"-"`
2585
2586 // NullFields is a list of field names (e.g. "CreatorRole") to include
2587 // in API requests with the JSON null value. By default, fields with
2588 // empty values are omitted from API requests. However, any field with
2589 // an empty value appearing in NullFields will be sent to the server as
2590 // null. It is an error if a field in this list has a non-empty value.
2591 // This may be used to include null fields in Patch requests.
2592 NullFields []string `json:"-"`
2593 }
2594
2595 func (s *MarketplaceNote) MarshalJSON() ([]byte, error) {
2596 type NoMethod MarketplaceNote
2597 raw := NoMethod(*s)
2598 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
2599 }
2600
2601 type MobileApplication struct {
2602 AppStore string `json:"appStore,omitempty"`
2603
2604 ExternalAppId string `json:"externalAppId,omitempty"`
2605
2606 // ForceSendFields is a list of field names (e.g. "AppStore") to
2607 // unconditionally include in API requests. By default, fields with
2608 // empty or default values are omitted from API requests. However, any
2609 // non-pointer, non-interface field appearing in ForceSendFields will be
2610 // sent to the server regardless of whether the field is empty or not.
2611 // This may be used to include empty fields in Patch requests.
2612 ForceSendFields []string `json:"-"`
2613
2614 // NullFields is a list of field names (e.g. "AppStore") to include in
2615 // API requests with the JSON null value. By default, fields with empty
2616 // values are omitted from API requests. However, any field with an
2617 // empty value appearing in NullFields will be sent to the server as
2618 // null. It is an error if a field in this list has a non-empty value.
2619 // This may be used to include null fields in Patch requests.
2620 NullFields []string `json:"-"`
2621 }
2622
2623 func (s *MobileApplication) MarshalJSON() ([]byte, error) {
2624 type NoMethod MobileApplication
2625 raw := NoMethod(*s)
2626 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
2627 }
2628
2629 // PerformanceReport: The configuration data for an Ad Exchange
2630 // performance report list.
2631 type PerformanceReport struct {
2632 // BidRate: The number of bid responses with an ad.
2633 BidRate float64 `json:"bidRate,omitempty"`
2634
2635 // BidRequestRate: The number of bid requests sent to your bidder.
2636 BidRequestRate float64 `json:"bidRequestRate,omitempty"`
2637
2638 // CalloutStatusRate: Rate of various prefiltering statuses per match.
2639 // Please refer to the callout-status-codes.txt file for different
2640 // statuses.
2641 CalloutStatusRate []interface{} `json:"calloutStatusRate,omitempty"`
2642
2643 // CookieMatcherStatusRate: Average QPS for cookie matcher operations.
2644 CookieMatcherStatusRate []interface{} `json:"cookieMatcherStatusRate,omitempty"`
2645
2646 // CreativeStatusRate: Rate of ads with a given status. Please refer to
2647 // the creative-status-codes.txt file for different statuses.
2648 CreativeStatusRate []interface{} `json:"creativeStatusRate,omitempty"`
2649
2650 // FilteredBidRate: The number of bid responses that were filtered due
2651 // to a policy violation or other errors.
2652 FilteredBidRate float64 `json:"filteredBidRate,omitempty"`
2653
2654 // HostedMatchStatusRate: Average QPS for hosted match operations.
2655 HostedMatchStatusRate []interface{} `json:"hostedMatchStatusRate,omitempty"`
2656
2657 // InventoryMatchRate: The number of potential queries based on your
2658 // pretargeting settings.
2659 InventoryMatchRate float64 `json:"inventoryMatchRate,omitempty"`
2660
2661 // Kind: Resource type.
2662 Kind string `json:"kind,omitempty"`
2663
2664 // Latency50thPercentile: The 50th percentile round trip latency(ms) as
2665 // perceived from Google servers for the duration period covered by the
2666 // report.
2667 Latency50thPercentile float64 `json:"latency50thPercentile,omitempty"`
2668
2669 // Latency85thPercentile: The 85th percentile round trip latency(ms) as
2670 // perceived from Google servers for the duration period covered by the
2671 // report.
2672 Latency85thPercentile float64 `json:"latency85thPercentile,omitempty"`
2673
2674 // Latency95thPercentile: The 95th percentile round trip latency(ms) as
2675 // perceived from Google servers for the duration period covered by the
2676 // report.
2677 Latency95thPercentile float64 `json:"latency95thPercentile,omitempty"`
2678
2679 // NoQuotaInRegion: Rate of various quota account statuses per quota
2680 // check.
2681 NoQuotaInRegion float64 `json:"noQuotaInRegion,omitempty"`
2682
2683 // OutOfQuota: Rate of various quota account statuses per quota check.
2684 OutOfQuota float64 `json:"outOfQuota,omitempty"`
2685
2686 // PixelMatchRequests: Average QPS for pixel match requests from
2687 // clients.
2688 PixelMatchRequests float64 `json:"pixelMatchRequests,omitempty"`
2689
2690 // PixelMatchResponses: Average QPS for pixel match responses from
2691 // clients.
2692 PixelMatchResponses float64 `json:"pixelMatchResponses,omitempty"`
2693
2694 // QuotaConfiguredLimit: The configured quota limits for this account.
2695 QuotaConfiguredLimit float64 `json:"quotaConfiguredLimit,omitempty"`
2696
2697 // QuotaThrottledLimit: The throttled quota limits for this account.
2698 QuotaThrottledLimit float64 `json:"quotaThrottledLimit,omitempty"`
2699
2700 // Region: The trading location of this data.
2701 Region string `json:"region,omitempty"`
2702
2703 // SuccessfulRequestRate: The number of properly formed bid responses
2704 // received by our servers within the deadline.
2705 SuccessfulRequestRate float64 `json:"successfulRequestRate,omitempty"`
2706
2707 // Timestamp: The unix timestamp of the starting time of this
2708 // performance data.
2709 Timestamp int64 `json:"timestamp,omitempty,string"`
2710
2711 // UnsuccessfulRequestRate: The number of bid responses that were
2712 // unsuccessful due to timeouts, incorrect formatting, etc.
2713 UnsuccessfulRequestRate float64 `json:"unsuccessfulRequestRate,omitempty"`
2714
2715 // ForceSendFields is a list of field names (e.g. "BidRate") to
2716 // unconditionally include in API requests. By default, fields with
2717 // empty or default values are omitted from API requests. However, any
2718 // non-pointer, non-interface field appearing in ForceSendFields will be
2719 // sent to the server regardless of whether the field is empty or not.
2720 // This may be used to include empty fields in Patch requests.
2721 ForceSendFields []string `json:"-"`
2722
2723 // NullFields is a list of field names (e.g. "BidRate") to include in
2724 // API requests with the JSON null value. By default, fields with empty
2725 // values are omitted from API requests. However, any field with an
2726 // empty value appearing in NullFields will be sent to the server as
2727 // null. It is an error if a field in this list has a non-empty value.
2728 // This may be used to include null fields in Patch requests.
2729 NullFields []string `json:"-"`
2730 }
2731
2732 func (s *PerformanceReport) MarshalJSON() ([]byte, error) {
2733 type NoMethod PerformanceReport
2734 raw := NoMethod(*s)
2735 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
2736 }
2737
2738 func (s *PerformanceReport) UnmarshalJSON(data []byte) error {
2739 type NoMethod PerformanceReport
2740 var s1 struct {
2741 BidRate gensupport.JSONFloat64 `json:"bidRate"`
2742 BidRequestRate gensupport.JSONFloat64 `json:"bidRequestRate"`
2743 FilteredBidRate gensupport.JSONFloat64 `json:"filteredBidRate"`
2744 InventoryMatchRate gensupport.JSONFloat64 `json:"inventoryMatchRate"`
2745 Latency50thPercentile gensupport.JSONFloat64 `json:"latency50thPercentile"`
2746 Latency85thPercentile gensupport.JSONFloat64 `json:"latency85thPercentile"`
2747 Latency95thPercentile gensupport.JSONFloat64 `json:"latency95thPercentile"`
2748 NoQuotaInRegion gensupport.JSONFloat64 `json:"noQuotaInRegion"`
2749 OutOfQuota gensupport.JSONFloat64 `json:"outOfQuota"`
2750 PixelMatchRequests gensupport.JSONFloat64 `json:"pixelMatchRequests"`
2751 PixelMatchResponses gensupport.JSONFloat64 `json:"pixelMatchResponses"`
2752 QuotaConfiguredLimit gensupport.JSONFloat64 `json:"quotaConfiguredLimit"`
2753 QuotaThrottledLimit gensupport.JSONFloat64 `json:"quotaThrottledLimit"`
2754 SuccessfulRequestRate gensupport.JSONFloat64 `json:"successfulRequestRate"`
2755 UnsuccessfulRequestRate gensupport.JSONFloat64 `json:"unsuccessfulRequestRate"`
2756 *NoMethod
2757 }
2758 s1.NoMethod = (*NoMethod)(s)
2759 if err := json.Unmarshal(data, &s1); err != nil {
2760 return err
2761 }
2762 s.BidRate = float64(s1.BidRate)
2763 s.BidRequestRate = float64(s1.BidRequestRate)
2764 s.FilteredBidRate = float64(s1.FilteredBidRate)
2765 s.InventoryMatchRate = float64(s1.InventoryMatchRate)
2766 s.Latency50thPercentile = float64(s1.Latency50thPercentile)
2767 s.Latency85thPercentile = float64(s1.Latency85thPercentile)
2768 s.Latency95thPercentile = float64(s1.Latency95thPercentile)
2769 s.NoQuotaInRegion = float64(s1.NoQuotaInRegion)
2770 s.OutOfQuota = float64(s1.OutOfQuota)
2771 s.PixelMatchRequests = float64(s1.PixelMatchRequests)
2772 s.PixelMatchResponses = float64(s1.PixelMatchResponses)
2773 s.QuotaConfiguredLimit = float64(s1.QuotaConfiguredLimit)
2774 s.QuotaThrottledLimit = float64(s1.QuotaThrottledLimit)
2775 s.SuccessfulRequestRate = float64(s1.SuccessfulRequestRate)
2776 s.UnsuccessfulRequestRate = float64(s1.UnsuccessfulRequestRate)
2777 return nil
2778 }
2779
2780 // PerformanceReportList: The configuration data for an Ad Exchange
2781 // performance report list.
2782 type PerformanceReportList struct {
2783 // Kind: Resource type.
2784 Kind string `json:"kind,omitempty"`
2785
2786 // PerformanceReport: A list of performance reports relevant for the
2787 // account.
2788 PerformanceReport []*PerformanceReport `json:"performanceReport,omitempty"`
2789
2790 // ServerResponse contains the HTTP response code and headers from the
2791 // server.
2792 googleapi.ServerResponse `json:"-"`
2793
2794 // ForceSendFields is a list of field names (e.g. "Kind") to
2795 // unconditionally include in API requests. By default, fields with
2796 // empty or default values are omitted from API requests. However, any
2797 // non-pointer, non-interface field appearing in ForceSendFields will be
2798 // sent to the server regardless of whether the field is empty or not.
2799 // This may be used to include empty fields in Patch requests.
2800 ForceSendFields []string `json:"-"`
2801
2802 // NullFields is a list of field names (e.g. "Kind") to include in API
2803 // requests with the JSON null value. By default, fields with empty
2804 // values are omitted from API requests. However, any field with an
2805 // empty value appearing in NullFields will be sent to the server as
2806 // null. It is an error if a field in this list has a non-empty value.
2807 // This may be used to include null fields in Patch requests.
2808 NullFields []string `json:"-"`
2809 }
2810
2811 func (s *PerformanceReportList) MarshalJSON() ([]byte, error) {
2812 type NoMethod PerformanceReportList
2813 raw := NoMethod(*s)
2814 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
2815 }
2816
2817 type PretargetingConfig struct {
2818 // BillingId: The id for billing purposes, provided for reference. Leave
2819 // this field blank for insert requests; the id will be generated
2820 // automatically.
2821 BillingId int64 `json:"billingId,omitempty,string"`
2822
2823 // ConfigId: The config id; generated automatically. Leave this field
2824 // blank for insert requests.
2825 ConfigId int64 `json:"configId,omitempty,string"`
2826
2827 // ConfigName: The name of the config. Must be unique. Required for all
2828 // requests.
2829 ConfigName string `json:"configName,omitempty"`
2830
2831 // CreativeType: List must contain exactly one of
2832 // PRETARGETING_CREATIVE_TYPE_HTML or PRETARGETING_CREATIVE_TYPE_VIDEO.
2833 CreativeType []string `json:"creativeType,omitempty"`
2834
2835 // Dimensions: Requests which allow one of these (width, height) pairs
2836 // will match. All pairs must be supported ad dimensions.
2837 Dimensions []*PretargetingConfigDimensions `json:"dimensions,omitempty"`
2838
2839 // ExcludedContentLabels: Requests with any of these content labels will
2840 // not match. Values are from content-labels.txt in the downloadable
2841 // files section.
2842 ExcludedContentLabels googleapi.Int64s `json:"excludedContentLabels,omitempty"`
2843
2844 // ExcludedGeoCriteriaIds: Requests containing any of these geo criteria
2845 // ids will not match.
2846 ExcludedGeoCriteriaIds googleapi.Int64s `json:"excludedGeoCriteriaIds,omitempty"`
2847
2848 // ExcludedPlacements: Requests containing any of these placements will
2849 // not match.
2850 ExcludedPlacements []*PretargetingConfigExcludedPlacements `json:"excludedPlacements,omitempty"`
2851
2852 // ExcludedUserLists: Requests containing any of these users list ids
2853 // will not match.
2854 ExcludedUserLists googleapi.Int64s `json:"excludedUserLists,omitempty"`
2855
2856 // ExcludedVerticals: Requests containing any of these vertical ids will
2857 // not match. Values are from the publisher-verticals.txt file in the
2858 // downloadable files section.
2859 ExcludedVerticals googleapi.Int64s `json:"excludedVerticals,omitempty"`
2860
2861 // GeoCriteriaIds: Requests containing any of these geo criteria ids
2862 // will match.
2863 GeoCriteriaIds googleapi.Int64s `json:"geoCriteriaIds,omitempty"`
2864
2865 // IsActive: Whether this config is active. Required for all requests.
2866 IsActive bool `json:"isActive,omitempty"`
2867
2868 // Kind: The kind of the resource, i.e.
2869 // "adexchangebuyer#pretargetingConfig".
2870 Kind string `json:"kind,omitempty"`
2871
2872 // Languages: Request containing any of these language codes will match.
2873 Languages []string `json:"languages,omitempty"`
2874
2875 // MaximumQps: The maximum QPS allocated to this pretargeting
2876 // configuration, used for pretargeting-level QPS limits. By default,
2877 // this is not set, which indicates that there is no QPS limit at the
2878 // configuration level (a global or account-level limit may still be
2879 // imposed).
2880 MaximumQps int64 `json:"maximumQps,omitempty,string"`
2881
2882 // MinimumViewabilityDecile: Requests where the predicted viewability is
2883 // below the specified decile will not match. E.g. if the buyer sets
2884 // this value to 5, requests from slots where the predicted viewability
2885 // is below 50% will not match. If the predicted viewability is unknown
2886 // this field will be ignored.
2887 MinimumViewabilityDecile int64 `json:"minimumViewabilityDecile,omitempty"`
2888
2889 // MobileCarriers: Requests containing any of these mobile carrier ids
2890 // will match. Values are from mobile-carriers.csv in the downloadable
2891 // files section.
2892 MobileCarriers googleapi.Int64s `json:"mobileCarriers,omitempty"`
2893
2894 // MobileDevices: Requests containing any of these mobile device ids
2895 // will match. Values are from mobile-devices.csv in the downloadable
2896 // files section.
2897 MobileDevices googleapi.Int64s `json:"mobileDevices,omitempty"`
2898
2899 // MobileOperatingSystemVersions: Requests containing any of these
2900 // mobile operating system version ids will match. Values are from
2901 // mobile-os.csv in the downloadable files section.
2902 MobileOperatingSystemVersions googleapi.Int64s `json:"mobileOperatingSystemVersions,omitempty"`
2903
2904 // Placements: Requests containing any of these placements will match.
2905 Placements []*PretargetingConfigPlacements `json:"placements,omitempty"`
2906
2907 // Platforms: Requests matching any of these platforms will match.
2908 // Possible values are PRETARGETING_PLATFORM_MOBILE,
2909 // PRETARGETING_PLATFORM_DESKTOP, and PRETARGETING_PLATFORM_TABLET.
2910 Platforms []string `json:"platforms,omitempty"`
2911
2912 // SupportedCreativeAttributes: Creative attributes should be declared
2913 // here if all creatives corresponding to this pretargeting
2914 // configuration have that creative attribute. Values are from
2915 // pretargetable-creative-attributes.txt in the downloadable files
2916 // section.
2917 SupportedCreativeAttributes googleapi.Int64s `json:"supportedCreativeAttributes,omitempty"`
2918
2919 // UserIdentifierDataRequired: Requests containing the specified type of
2920 // user data will match. Possible values are HOSTED_MATCH_DATA, which
2921 // means the request is cookie-targetable and has a match in the buyer's
2922 // hosted match table, and COOKIE_OR_IDFA, which means the request has
2923 // either a targetable cookie or an iOS IDFA.
2924 UserIdentifierDataRequired []string `json:"userIdentifierDataRequired,omitempty"`
2925
2926 // UserLists: Requests containing any of these user list ids will match.
2927 UserLists googleapi.Int64s `json:"userLists,omitempty"`
2928
2929 // VendorTypes: Requests that allow any of these vendor ids will match.
2930 // Values are from vendors.txt in the downloadable files section.
2931 VendorTypes googleapi.Int64s `json:"vendorTypes,omitempty"`
2932
2933 // Verticals: Requests containing any of these vertical ids will match.
2934 Verticals googleapi.Int64s `json:"verticals,omitempty"`
2935
2936 // VideoPlayerSizes: Video requests satisfying any of these player size
2937 // constraints will match.
2938 VideoPlayerSizes []*PretargetingConfigVideoPlayerSizes `json:"videoPlayerSizes,omitempty"`
2939
2940 // ServerResponse contains the HTTP response code and headers from the
2941 // server.
2942 googleapi.ServerResponse `json:"-"`
2943
2944 // ForceSendFields is a list of field names (e.g. "BillingId") to
2945 // unconditionally include in API requests. By default, fields with
2946 // empty or default values are omitted from API requests. However, any
2947 // non-pointer, non-interface field appearing in ForceSendFields will be
2948 // sent to the server regardless of whether the field is empty or not.
2949 // This may be used to include empty fields in Patch requests.
2950 ForceSendFields []string `json:"-"`
2951
2952 // NullFields is a list of field names (e.g. "BillingId") to include in
2953 // API requests with the JSON null value. By default, fields with empty
2954 // values are omitted from API requests. However, any field with an
2955 // empty value appearing in NullFields will be sent to the server as
2956 // null. It is an error if a field in this list has a non-empty value.
2957 // This may be used to include null fields in Patch requests.
2958 NullFields []string `json:"-"`
2959 }
2960
2961 func (s *PretargetingConfig) MarshalJSON() ([]byte, error) {
2962 type NoMethod PretargetingConfig
2963 raw := NoMethod(*s)
2964 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
2965 }
2966
2967 type PretargetingConfigDimensions struct {
2968 // Height: Height in pixels.
2969 Height int64 `json:"height,omitempty,string"`
2970
2971 // Width: Width in pixels.
2972 Width int64 `json:"width,omitempty,string"`
2973
2974 // ForceSendFields is a list of field names (e.g. "Height") to
2975 // unconditionally include in API requests. By default, fields with
2976 // empty or default values are omitted from API requests. However, any
2977 // non-pointer, non-interface field appearing in ForceSendFields will be
2978 // sent to the server regardless of whether the field is empty or not.
2979 // This may be used to include empty fields in Patch requests.
2980 ForceSendFields []string `json:"-"`
2981
2982 // NullFields is a list of field names (e.g. "Height") to include in API
2983 // requests with the JSON null value. By default, fields with empty
2984 // values are omitted from API requests. However, any field with an
2985 // empty value appearing in NullFields will be sent to the server as
2986 // null. It is an error if a field in this list has a non-empty value.
2987 // This may be used to include null fields in Patch requests.
2988 NullFields []string `json:"-"`
2989 }
2990
2991 func (s *PretargetingConfigDimensions) MarshalJSON() ([]byte, error) {
2992 type NoMethod PretargetingConfigDimensions
2993 raw := NoMethod(*s)
2994 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
2995 }
2996
2997 type PretargetingConfigExcludedPlacements struct {
2998 // Token: The value of the placement. Interpretation depends on the
2999 // placement type, e.g. URL for a site placement, channel name for a
3000 // channel placement, app id for a mobile app placement.
3001 Token string `json:"token,omitempty"`
3002
3003 // Type: The type of the placement.
3004 Type string `json:"type,omitempty"`
3005
3006 // ForceSendFields is a list of field names (e.g. "Token") to
3007 // unconditionally include in API requests. By default, fields with
3008 // empty or default values are omitted from API requests. However, any
3009 // non-pointer, non-interface field appearing in ForceSendFields will be
3010 // sent to the server regardless of whether the field is empty or not.
3011 // This may be used to include empty fields in Patch requests.
3012 ForceSendFields []string `json:"-"`
3013
3014 // NullFields is a list of field names (e.g. "Token") to include in API
3015 // requests with the JSON null value. By default, fields with empty
3016 // values are omitted from API requests. However, any field with an
3017 // empty value appearing in NullFields will be sent to the server as
3018 // null. It is an error if a field in this list has a non-empty value.
3019 // This may be used to include null fields in Patch requests.
3020 NullFields []string `json:"-"`
3021 }
3022
3023 func (s *PretargetingConfigExcludedPlacements) MarshalJSON() ([]byte, error) {
3024 type NoMethod PretargetingConfigExcludedPlacements
3025 raw := NoMethod(*s)
3026 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
3027 }
3028
3029 type PretargetingConfigPlacements struct {
3030 // Token: The value of the placement. Interpretation depends on the
3031 // placement type, e.g. URL for a site placement, channel name for a
3032 // channel placement, app id for a mobile app placement.
3033 Token string `json:"token,omitempty"`
3034
3035 // Type: The type of the placement.
3036 Type string `json:"type,omitempty"`
3037
3038 // ForceSendFields is a list of field names (e.g. "Token") to
3039 // unconditionally include in API requests. By default, fields with
3040 // empty or default values are omitted from API requests. However, any
3041 // non-pointer, non-interface field appearing in ForceSendFields will be
3042 // sent to the server regardless of whether the field is empty or not.
3043 // This may be used to include empty fields in Patch requests.
3044 ForceSendFields []string `json:"-"`
3045
3046 // NullFields is a list of field names (e.g. "Token") to include in API
3047 // requests with the JSON null value. By default, fields with empty
3048 // values are omitted from API requests. However, any field with an
3049 // empty value appearing in NullFields will be sent to the server as
3050 // null. It is an error if a field in this list has a non-empty value.
3051 // This may be used to include null fields in Patch requests.
3052 NullFields []string `json:"-"`
3053 }
3054
3055 func (s *PretargetingConfigPlacements) MarshalJSON() ([]byte, error) {
3056 type NoMethod PretargetingConfigPlacements
3057 raw := NoMethod(*s)
3058 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
3059 }
3060
3061 type PretargetingConfigVideoPlayerSizes struct {
3062 // AspectRatio: The type of aspect ratio. Leave this field blank to
3063 // match all aspect ratios.
3064 AspectRatio string `json:"aspectRatio,omitempty"`
3065
3066 // MinHeight: The minimum player height in pixels. Leave this field
3067 // blank to match any player height.
3068 MinHeight int64 `json:"minHeight,omitempty,string"`
3069
3070 // MinWidth: The minimum player width in pixels. Leave this field blank
3071 // to match any player width.
3072 MinWidth int64 `json:"minWidth,omitempty,string"`
3073
3074 // ForceSendFields is a list of field names (e.g. "AspectRatio") to
3075 // unconditionally include in API requests. By default, fields with
3076 // empty or default values are omitted from API requests. However, any
3077 // non-pointer, non-interface field appearing in ForceSendFields will be
3078 // sent to the server regardless of whether the field is empty or not.
3079 // This may be used to include empty fields in Patch requests.
3080 ForceSendFields []string `json:"-"`
3081
3082 // NullFields is a list of field names (e.g. "AspectRatio") to include
3083 // in API requests with the JSON null value. By default, fields with
3084 // empty values are omitted from API requests. However, any field with
3085 // an empty value appearing in NullFields will be sent to the server as
3086 // null. It is an error if a field in this list has a non-empty value.
3087 // This may be used to include null fields in Patch requests.
3088 NullFields []string `json:"-"`
3089 }
3090
3091 func (s *PretargetingConfigVideoPlayerSizes) MarshalJSON() ([]byte, error) {
3092 type NoMethod PretargetingConfigVideoPlayerSizes
3093 raw := NoMethod(*s)
3094 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
3095 }
3096
3097 type PretargetingConfigList struct {
3098 // Items: A list of pretargeting configs
3099 Items []*PretargetingConfig `json:"items,omitempty"`
3100
3101 // Kind: Resource type.
3102 Kind string `json:"kind,omitempty"`
3103
3104 // ServerResponse contains the HTTP response code and headers from the
3105 // server.
3106 googleapi.ServerResponse `json:"-"`
3107
3108 // ForceSendFields is a list of field names (e.g. "Items") to
3109 // unconditionally include in API requests. By default, fields with
3110 // empty or default values are omitted from API requests. However, any
3111 // non-pointer, non-interface field appearing in ForceSendFields will be
3112 // sent to the server regardless of whether the field is empty or not.
3113 // This may be used to include empty fields in Patch requests.
3114 ForceSendFields []string `json:"-"`
3115
3116 // NullFields is a list of field names (e.g. "Items") to include in API
3117 // requests with the JSON null value. By default, fields with empty
3118 // values are omitted from API requests. However, any field with an
3119 // empty value appearing in NullFields will be sent to the server as
3120 // null. It is an error if a field in this list has a non-empty value.
3121 // This may be used to include null fields in Patch requests.
3122 NullFields []string `json:"-"`
3123 }
3124
3125 func (s *PretargetingConfigList) MarshalJSON() ([]byte, error) {
3126 type NoMethod PretargetingConfigList
3127 raw := NoMethod(*s)
3128 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
3129 }
3130
3131 type Price struct {
3132 // AmountMicros: The price value in micros.
3133 AmountMicros float64 `json:"amountMicros,omitempty"`
3134
3135 // CurrencyCode: The currency code for the price.
3136 CurrencyCode string `json:"currencyCode,omitempty"`
3137
3138 // ExpectedCpmMicros: In case of CPD deals, the expected CPM in micros.
3139 ExpectedCpmMicros float64 `json:"expectedCpmMicros,omitempty"`
3140
3141 // PricingType: The pricing type for the deal/product.
3142 PricingType string `json:"pricingType,omitempty"`
3143
3144 // ForceSendFields is a list of field names (e.g. "AmountMicros") to
3145 // unconditionally include in API requests. By default, fields with
3146 // empty or default values are omitted from API requests. However, any
3147 // non-pointer, non-interface field appearing in ForceSendFields will be
3148 // sent to the server regardless of whether the field is empty or not.
3149 // This may be used to include empty fields in Patch requests.
3150 ForceSendFields []string `json:"-"`
3151
3152 // NullFields is a list of field names (e.g. "AmountMicros") to include
3153 // in API requests with the JSON null value. By default, fields with
3154 // empty values are omitted from API requests. However, any field with
3155 // an empty value appearing in NullFields will be sent to the server as
3156 // null. It is an error if a field in this list has a non-empty value.
3157 // This may be used to include null fields in Patch requests.
3158 NullFields []string `json:"-"`
3159 }
3160
3161 func (s *Price) MarshalJSON() ([]byte, error) {
3162 type NoMethod Price
3163 raw := NoMethod(*s)
3164 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
3165 }
3166
3167 func (s *Price) UnmarshalJSON(data []byte) error {
3168 type NoMethod Price
3169 var s1 struct {
3170 AmountMicros gensupport.JSONFloat64 `json:"amountMicros"`
3171 ExpectedCpmMicros gensupport.JSONFloat64 `json:"expectedCpmMicros"`
3172 *NoMethod
3173 }
3174 s1.NoMethod = (*NoMethod)(s)
3175 if err := json.Unmarshal(data, &s1); err != nil {
3176 return err
3177 }
3178 s.AmountMicros = float64(s1.AmountMicros)
3179 s.ExpectedCpmMicros = float64(s1.ExpectedCpmMicros)
3180 return nil
3181 }
3182
3183 // PricePerBuyer: Used to specify pricing rules for buyers. Each
3184 // PricePerBuyer in a product can become [0,1] deals. To check if there
3185 // is a PricePerBuyer for a particular buyer we look for the most
3186 // specific matching rule - we first look for a rule matching the buyer
3187 // and otherwise look for a matching rule where no buyer is set.
3188 type PricePerBuyer struct {
3189 // AuctionTier: Optional access type for this buyer.
3190 AuctionTier string `json:"auctionTier,omitempty"`
3191
3192 // BilledBuyer: Reference to the buyer that will get billed.
3193 BilledBuyer *Buyer `json:"billedBuyer,omitempty"`
3194
3195 // Buyer: The buyer who will pay this price. If unset, all buyers can
3196 // pay this price (if the advertisers match, and there's no more
3197 // specific rule matching the buyer).
3198 Buyer *Buyer `json:"buyer,omitempty"`
3199
3200 // Price: The specified price
3201 Price *Price `json:"price,omitempty"`
3202
3203 // ForceSendFields is a list of field names (e.g. "AuctionTier") to
3204 // unconditionally include in API requests. By default, fields with
3205 // empty or default values are omitted from API requests. However, any
3206 // non-pointer, non-interface field appearing in ForceSendFields will be
3207 // sent to the server regardless of whether the field is empty or not.
3208 // This may be used to include empty fields in Patch requests.
3209 ForceSendFields []string `json:"-"`
3210
3211 // NullFields is a list of field names (e.g. "AuctionTier") to include
3212 // in API requests with the JSON null value. By default, fields with
3213 // empty values are omitted from API requests. However, any field with
3214 // an empty value appearing in NullFields will be sent to the server as
3215 // null. It is an error if a field in this list has a non-empty value.
3216 // This may be used to include null fields in Patch requests.
3217 NullFields []string `json:"-"`
3218 }
3219
3220 func (s *PricePerBuyer) MarshalJSON() ([]byte, error) {
3221 type NoMethod PricePerBuyer
3222 raw := NoMethod(*s)
3223 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
3224 }
3225
3226 type PrivateData struct {
3227 ReferenceId string `json:"referenceId,omitempty"`
3228
3229 ReferencePayload string `json:"referencePayload,omitempty"`
3230
3231 // ForceSendFields is a list of field names (e.g. "ReferenceId") to
3232 // unconditionally include in API requests. By default, fields with
3233 // empty or default values are omitted from API requests. However, any
3234 // non-pointer, non-interface field appearing in ForceSendFields will be
3235 // sent to the server regardless of whether the field is empty or not.
3236 // This may be used to include empty fields in Patch requests.
3237 ForceSendFields []string `json:"-"`
3238
3239 // NullFields is a list of field names (e.g. "ReferenceId") to include
3240 // in API requests with the JSON null value. By default, fields with
3241 // empty values are omitted from API requests. However, any field with
3242 // an empty value appearing in NullFields will be sent to the server as
3243 // null. It is an error if a field in this list has a non-empty value.
3244 // This may be used to include null fields in Patch requests.
3245 NullFields []string `json:"-"`
3246 }
3247
3248 func (s *PrivateData) MarshalJSON() ([]byte, error) {
3249 type NoMethod PrivateData
3250 raw := NoMethod(*s)
3251 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
3252 }
3253
3254 // Product: A product is segment of inventory that a seller wishes to
3255 // sell. It is associated with certain terms and targeting information
3256 // which helps buyer know more about the inventory. Each field in a
3257 // product can have one of the following setting:
3258 //
3259 // (readonly) - It is an error to try and set this field.
3260 // (buyer-readonly) - Only the seller can set this field.
3261 // (seller-readonly) - Only the buyer can set this field. (updatable) -
3262 // The field is updatable at all times by either buyer or the seller.
3263 type Product struct {
3264 // BilledBuyer: The billed buyer corresponding to the buyer that created
3265 // the offer. (readonly, except on create)
3266 BilledBuyer *Buyer `json:"billedBuyer,omitempty"`
3267
3268 // Buyer: The buyer that created the offer if this is a buyer initiated
3269 // offer (readonly, except on create)
3270 Buyer *Buyer `json:"buyer,omitempty"`
3271
3272 // CreationTimeMs: Creation time in ms. since epoch (readonly)
3273 CreationTimeMs int64 `json:"creationTimeMs,omitempty,string"`
3274
3275 // CreatorContacts: Optional contact information for the creator of this
3276 // product. (buyer-readonly)
3277 CreatorContacts []*ContactInformation `json:"creatorContacts,omitempty"`
3278
3279 // CreatorRole: The role that created the offer. Set to BUYER for buyer
3280 // initiated offers.
3281 CreatorRole string `json:"creatorRole,omitempty"`
3282
3283 // DeliveryControl: The set of fields around delivery control that are
3284 // interesting for a buyer to see but are non-negotiable. These are set
3285 // by the publisher. This message is assigned an id of 100 since some
3286 // day we would want to model this as a protobuf extension.
3287 DeliveryControl *DeliveryControl `json:"deliveryControl,omitempty"`
3288
3289 // FlightEndTimeMs: The proposed end time for the deal (ms since epoch)
3290 // (buyer-readonly)
3291 FlightEndTimeMs int64 `json:"flightEndTimeMs,omitempty,string"`
3292
3293 // FlightStartTimeMs: Inventory availability dates. (times are in ms
3294 // since epoch) The granularity is generally in the order of seconds.
3295 // (buyer-readonly)
3296 FlightStartTimeMs int64 `json:"flightStartTimeMs,omitempty,string"`
3297
3298 // HasCreatorSignedOff: If the creator has already signed off on the
3299 // product, then the buyer can finalize the deal by accepting the
3300 // product as is. When copying to a proposal, if any of the terms are
3301 // changed, then auto_finalize is automatically set to false.
3302 HasCreatorSignedOff bool `json:"hasCreatorSignedOff,omitempty"`
3303
3304 // InventorySource: What exchange will provide this inventory (readonly,
3305 // except on create).
3306 InventorySource string `json:"inventorySource,omitempty"`
3307
3308 // Kind: Identifies what kind of resource this is. Value: the fixed
3309 // string "adexchangebuyer#product".
3310 Kind string `json:"kind,omitempty"`
3311
3312 // Labels: Optional List of labels for the product (optional,
3313 // buyer-readonly).
3314 Labels []*MarketplaceLabel `json:"labels,omitempty"`
3315
3316 // LastUpdateTimeMs: Time of last update in ms. since epoch (readonly)
3317 LastUpdateTimeMs int64 `json:"lastUpdateTimeMs,omitempty,string"`
3318
3319 // LegacyOfferId: Optional legacy offer id if this offer is a preferred
3320 // deal offer.
3321 LegacyOfferId string `json:"legacyOfferId,omitempty"`
3322
3323 // MarketplacePublisherProfileId: Marketplace publisher profile Id. This
3324 // Id differs from the regular publisher_profile_id in that 1. This is a
3325 // new id, the old Id will be deprecated in 2017. 2. This id uniquely
3326 // identifies a publisher profile by itself.
3327 MarketplacePublisherProfileId string `json:"marketplacePublisherProfileId,omitempty"`
3328
3329 // Name: The name for this product as set by the seller.
3330 // (buyer-readonly)
3331 Name string `json:"name,omitempty"`
3332
3333 // PrivateAuctionId: Optional private auction id if this offer is a
3334 // private auction offer.
3335 PrivateAuctionId string `json:"privateAuctionId,omitempty"`
3336
3337 // ProductId: The unique id for the product (readonly)
3338 ProductId string `json:"productId,omitempty"`
3339
3340 // PublisherProfileId: Id of the publisher profile for a given seller. A
3341 // (seller.account_id, publisher_profile_id) pair uniquely identifies a
3342 // publisher profile. Buyers can call the PublisherProfiles::List
3343 // endpoint to get a list of publisher profiles for a given seller.
3344 PublisherProfileId string `json:"publisherProfileId,omitempty"`
3345
3346 // PublisherProvidedForecast: Publisher self-provided forecast
3347 // information.
3348 PublisherProvidedForecast *PublisherProvidedForecast `json:"publisherProvidedForecast,omitempty"`
3349
3350 // RevisionNumber: The revision number of the product. (readonly)
3351 RevisionNumber int64 `json:"revisionNumber,omitempty,string"`
3352
3353 // Seller: Information about the seller that created this product
3354 // (readonly, except on create)
3355 Seller *Seller `json:"seller,omitempty"`
3356
3357 // SharedTargetings: Targeting that is shared between the buyer and the
3358 // seller. Each targeting criteria has a specified key and for each key
3359 // there is a list of inclusion value or exclusion values.
3360 // (buyer-readonly)
3361 SharedTargetings []*SharedTargeting `json:"sharedTargetings,omitempty"`
3362
3363 // State: The state of the product. (buyer-readonly)
3364 State string `json:"state,omitempty"`
3365
3366 // SyndicationProduct: The syndication product associated with the deal.
3367 // (readonly, except on create)
3368 SyndicationProduct string `json:"syndicationProduct,omitempty"`
3369
3370 // Terms: The negotiable terms of the deal (buyer-readonly)
3371 Terms *DealTerms `json:"terms,omitempty"`
3372
3373 // WebPropertyCode: The web property code for the seller. This field is
3374 // meant to be copied over as is when creating deals.
3375 WebPropertyCode string `json:"webPropertyCode,omitempty"`
3376
3377 // ServerResponse contains the HTTP response code and headers from the
3378 // server.
3379 googleapi.ServerResponse `json:"-"`
3380
3381 // ForceSendFields is a list of field names (e.g. "BilledBuyer") to
3382 // unconditionally include in API requests. By default, fields with
3383 // empty or default values are omitted from API requests. However, any
3384 // non-pointer, non-interface field appearing in ForceSendFields will be
3385 // sent to the server regardless of whether the field is empty or not.
3386 // This may be used to include empty fields in Patch requests.
3387 ForceSendFields []string `json:"-"`
3388
3389 // NullFields is a list of field names (e.g. "BilledBuyer") to include
3390 // in API requests with the JSON null value. By default, fields with
3391 // empty values are omitted from API requests. However, any field with
3392 // an empty value appearing in NullFields will be sent to the server as
3393 // null. It is an error if a field in this list has a non-empty value.
3394 // This may be used to include null fields in Patch requests.
3395 NullFields []string `json:"-"`
3396 }
3397
3398 func (s *Product) MarshalJSON() ([]byte, error) {
3399 type NoMethod Product
3400 raw := NoMethod(*s)
3401 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
3402 }
3403
3404 // Proposal: Represents a proposal in the marketplace. A proposal is the
3405 // unit of negotiation between a seller and a buyer and contains deals
3406 // which are served. Each field in a proposal can have one of the
3407 // following setting:
3408 //
3409 // (readonly) - It is an error to try and set this field.
3410 // (buyer-readonly) - Only the seller can set this field.
3411 // (seller-readonly) - Only the buyer can set this field. (updatable) -
3412 // The field is updatable at all times by either buyer or the seller.
3413 type Proposal struct {
3414 // BilledBuyer: Reference to the buyer that will get billed for this
3415 // proposal. (readonly)
3416 BilledBuyer *Buyer `json:"billedBuyer,omitempty"`
3417
3418 // Buyer: Reference to the buyer on the proposal. (readonly, except on
3419 // create)
3420 Buyer *Buyer `json:"buyer,omitempty"`
3421
3422 // BuyerContacts: Optional contact information of the buyer.
3423 // (seller-readonly)
3424 BuyerContacts []*ContactInformation `json:"buyerContacts,omitempty"`
3425
3426 // BuyerPrivateData: Private data for buyer. (hidden from seller).
3427 BuyerPrivateData *PrivateData `json:"buyerPrivateData,omitempty"`
3428
3429 // DbmAdvertiserIds: IDs of DBM advertisers permission to this proposal.
3430 DbmAdvertiserIds []string `json:"dbmAdvertiserIds,omitempty"`
3431
3432 // HasBuyerSignedOff: When an proposal is in an accepted state,
3433 // indicates whether the buyer has signed off. Once both sides have
3434 // signed off on a deal, the proposal can be finalized by the seller.
3435 // (seller-readonly)
3436 HasBuyerSignedOff bool `json:"hasBuyerSignedOff,omitempty"`
3437
3438 // HasSellerSignedOff: When an proposal is in an accepted state,
3439 // indicates whether the buyer has signed off Once both sides have
3440 // signed off on a deal, the proposal can be finalized by the seller.
3441 // (buyer-readonly)
3442 HasSellerSignedOff bool `json:"hasSellerSignedOff,omitempty"`
3443
3444 // InventorySource: What exchange will provide this inventory (readonly,
3445 // except on create).
3446 InventorySource string `json:"inventorySource,omitempty"`
3447
3448 // IsRenegotiating: True if the proposal is being renegotiated
3449 // (readonly).
3450 IsRenegotiating bool `json:"isRenegotiating,omitempty"`
3451
3452 // IsSetupComplete: True, if the buyside inventory setup is complete for
3453 // this proposal. (readonly, except via OrderSetupCompleted action)
3454 // Deprecated in favor of deal level setup complete flag.
3455 IsSetupComplete bool `json:"isSetupComplete,omitempty"`
3456
3457 // Kind: Identifies what kind of resource this is. Value: the fixed
3458 // string "adexchangebuyer#proposal".
3459 Kind string `json:"kind,omitempty"`
3460
3461 // Labels: List of labels associated with the proposal. (readonly)
3462 Labels []*MarketplaceLabel `json:"labels,omitempty"`
3463
3464 // LastUpdaterOrCommentorRole: The role of the last user that either
3465 // updated the proposal or left a comment. (readonly)
3466 LastUpdaterOrCommentorRole string `json:"lastUpdaterOrCommentorRole,omitempty"`
3467
3468 // Name: The name for the proposal (updatable)
3469 Name string `json:"name,omitempty"`
3470
3471 // NegotiationId: Optional negotiation id if this proposal is a
3472 // preferred deal proposal.
3473 NegotiationId string `json:"negotiationId,omitempty"`
3474
3475 // OriginatorRole: Indicates whether the buyer/seller created the
3476 // proposal.(readonly)
3477 OriginatorRole string `json:"originatorRole,omitempty"`
3478
3479 // PrivateAuctionId: Optional private auction id if this proposal is a
3480 // private auction proposal.
3481 PrivateAuctionId string `json:"privateAuctionId,omitempty"`
3482
3483 // ProposalId: The unique id of the proposal. (readonly).
3484 ProposalId string `json:"proposalId,omitempty"`
3485
3486 // ProposalState: The current state of the proposal. (readonly)
3487 ProposalState string `json:"proposalState,omitempty"`
3488
3489 // RevisionNumber: The revision number for the proposal (readonly).
3490 RevisionNumber int64 `json:"revisionNumber,omitempty,string"`
3491
3492 // RevisionTimeMs: The time (ms since epoch) when the proposal was last
3493 // revised (readonly).
3494 RevisionTimeMs int64 `json:"revisionTimeMs,omitempty,string"`
3495
3496 // Seller: Reference to the seller on the proposal. (readonly, except on
3497 // create)
3498 Seller *Seller `json:"seller,omitempty"`
3499
3500 // SellerContacts: Optional contact information of the seller
3501 // (buyer-readonly).
3502 SellerContacts []*ContactInformation `json:"sellerContacts,omitempty"`
3503
3504 // ServerResponse contains the HTTP response code and headers from the
3505 // server.
3506 googleapi.ServerResponse `json:"-"`
3507
3508 // ForceSendFields is a list of field names (e.g. "BilledBuyer") to
3509 // unconditionally include in API requests. By default, fields with
3510 // empty or default values are omitted from API requests. However, any
3511 // non-pointer, non-interface field appearing in ForceSendFields will be
3512 // sent to the server regardless of whether the field is empty or not.
3513 // This may be used to include empty fields in Patch requests.
3514 ForceSendFields []string `json:"-"`
3515
3516 // NullFields is a list of field names (e.g. "BilledBuyer") to include
3517 // in API requests with the JSON null value. By default, fields with
3518 // empty values are omitted from API requests. However, any field with
3519 // an empty value appearing in NullFields will be sent to the server as
3520 // null. It is an error if a field in this list has a non-empty value.
3521 // This may be used to include null fields in Patch requests.
3522 NullFields []string `json:"-"`
3523 }
3524
3525 func (s *Proposal) MarshalJSON() ([]byte, error) {
3526 type NoMethod Proposal
3527 raw := NoMethod(*s)
3528 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
3529 }
3530
3531 type PublisherProfileApiProto struct {
3532 // Audience: Publisher provided info on its audience.
3533 Audience string `json:"audience,omitempty"`
3534
3535 // BuyerPitchStatement: A pitch statement for the buyer
3536 BuyerPitchStatement string `json:"buyerPitchStatement,omitempty"`
3537
3538 // DirectContact: Direct contact for the publisher profile.
3539 DirectContact string `json:"directContact,omitempty"`
3540
3541 // Exchange: Exchange where this publisher profile is from. E.g. AdX,
3542 // Rubicon etc...
3543 Exchange string `json:"exchange,omitempty"`
3544
3545 ForecastInventory string `json:"forecastInventory,omitempty"`
3546
3547 // GooglePlusLink: Link to publisher's Google+ page.
3548 GooglePlusLink string `json:"googlePlusLink,omitempty"`
3549
3550 // IsParent: True, if this is the parent profile, which represents all
3551 // domains owned by the publisher.
3552 IsParent bool `json:"isParent,omitempty"`
3553
3554 // IsPublished: True, if this profile is published. Deprecated for
3555 // state.
3556 IsPublished bool `json:"isPublished,omitempty"`
3557
3558 // Kind: Identifies what kind of resource this is. Value: the fixed
3559 // string "adexchangebuyer#publisherProfileApiProto".
3560 Kind string `json:"kind,omitempty"`
3561
3562 // LogoUrl: The url to the logo for the publisher.
3563 LogoUrl string `json:"logoUrl,omitempty"`
3564
3565 // MediaKitLink: The url for additional marketing and sales materials.
3566 MediaKitLink string `json:"mediaKitLink,omitempty"`
3567
3568 Name string `json:"name,omitempty"`
3569
3570 // Overview: Publisher provided overview.
3571 Overview string `json:"overview,omitempty"`
3572
3573 // ProfileId: The pair of (seller.account_id, profile_id) uniquely
3574 // identifies a publisher profile for a given publisher.
3575 ProfileId int64 `json:"profileId,omitempty"`
3576
3577 // ProgrammaticContact: Programmatic contact for the publisher profile.
3578 ProgrammaticContact string `json:"programmaticContact,omitempty"`
3579
3580 // PublisherAppIds: The list of app IDs represented in this publisher
3581 // profile. Empty if this is a parent profile. Deprecated in favor of
3582 // publisher_app.
3583 PublisherAppIds googleapi.Int64s `json:"publisherAppIds,omitempty"`
3584
3585 // PublisherApps: The list of apps represented in this publisher
3586 // profile. Empty if this is a parent profile.
3587 PublisherApps []*MobileApplication `json:"publisherApps,omitempty"`
3588
3589 // PublisherDomains: The list of domains represented in this publisher
3590 // profile. Empty if this is a parent profile.
3591 PublisherDomains []string `json:"publisherDomains,omitempty"`
3592
3593 // PublisherProfileId: Unique Id for publisher profile.
3594 PublisherProfileId string `json:"publisherProfileId,omitempty"`
3595
3596 // PublisherProvidedForecast: Publisher provided forecasting
3597 // information.
3598 PublisherProvidedForecast *PublisherProvidedForecast `json:"publisherProvidedForecast,omitempty"`
3599
3600 // RateCardInfoLink: Link to publisher rate card
3601 RateCardInfoLink string `json:"rateCardInfoLink,omitempty"`
3602
3603 // SamplePageLink: Link for a sample content page.
3604 SamplePageLink string `json:"samplePageLink,omitempty"`
3605
3606 // Seller: Seller of the publisher profile.
3607 Seller *Seller `json:"seller,omitempty"`
3608
3609 // State: State of the publisher profile.
3610 State string `json:"state,omitempty"`
3611
3612 // TopHeadlines: Publisher provided key metrics and rankings.
3613 TopHeadlines []string `json:"topHeadlines,omitempty"`
3614
3615 // ForceSendFields is a list of field names (e.g. "Audience") to
3616 // unconditionally include in API requests. By default, fields with
3617 // empty or default values are omitted from API requests. However, any
3618 // non-pointer, non-interface field appearing in ForceSendFields will be
3619 // sent to the server regardless of whether the field is empty or not.
3620 // This may be used to include empty fields in Patch requests.
3621 ForceSendFields []string `json:"-"`
3622
3623 // NullFields is a list of field names (e.g. "Audience") to include in
3624 // API requests with the JSON null value. By default, fields with empty
3625 // values are omitted from API requests. However, any field with an
3626 // empty value appearing in NullFields will be sent to the server as
3627 // null. It is an error if a field in this list has a non-empty value.
3628 // This may be used to include null fields in Patch requests.
3629 NullFields []string `json:"-"`
3630 }
3631
3632 func (s *PublisherProfileApiProto) MarshalJSON() ([]byte, error) {
3633 type NoMethod PublisherProfileApiProto
3634 raw := NoMethod(*s)
3635 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
3636 }
3637
3638 // PublisherProvidedForecast: This message carries publisher provided
3639 // forecasting information.
3640 type PublisherProvidedForecast struct {
3641 // Dimensions: Publisher provided dimensions. E.g. geo, sizes etc...
3642 Dimensions []*Dimension `json:"dimensions,omitempty"`
3643
3644 // WeeklyImpressions: Publisher provided weekly impressions.
3645 WeeklyImpressions int64 `json:"weeklyImpressions,omitempty,string"`
3646
3647 // WeeklyUniques: Publisher provided weekly uniques.
3648 WeeklyUniques int64 `json:"weeklyUniques,omitempty,string"`
3649
3650 // ForceSendFields is a list of field names (e.g. "Dimensions") to
3651 // unconditionally include in API requests. By default, fields with
3652 // empty or default values are omitted from API requests. However, any
3653 // non-pointer, non-interface field appearing in ForceSendFields will be
3654 // sent to the server regardless of whether the field is empty or not.
3655 // This may be used to include empty fields in Patch requests.
3656 ForceSendFields []string `json:"-"`
3657
3658 // NullFields is a list of field names (e.g. "Dimensions") to include in
3659 // API requests with the JSON null value. By default, fields with empty
3660 // values are omitted from API requests. However, any field with an
3661 // empty value appearing in NullFields will be sent to the server as
3662 // null. It is an error if a field in this list has a non-empty value.
3663 // This may be used to include null fields in Patch requests.
3664 NullFields []string `json:"-"`
3665 }
3666
3667 func (s *PublisherProvidedForecast) MarshalJSON() ([]byte, error) {
3668 type NoMethod PublisherProvidedForecast
3669 raw := NoMethod(*s)
3670 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
3671 }
3672
3673 type Seller struct {
3674 // AccountId: The unique id for the seller. The seller fills in this
3675 // field. The seller account id is then available to buyer in the
3676 // product.
3677 AccountId string `json:"accountId,omitempty"`
3678
3679 // SubAccountId: Optional sub-account id for the seller.
3680 SubAccountId string `json:"subAccountId,omitempty"`
3681
3682 // ForceSendFields is a list of field names (e.g. "AccountId") to
3683 // unconditionally include in API requests. By default, fields with
3684 // empty or default values are omitted from API requests. However, any
3685 // non-pointer, non-interface field appearing in ForceSendFields will be
3686 // sent to the server regardless of whether the field is empty or not.
3687 // This may be used to include empty fields in Patch requests.
3688 ForceSendFields []string `json:"-"`
3689
3690 // NullFields is a list of field names (e.g. "AccountId") to include in
3691 // API requests with the JSON null value. By default, fields with empty
3692 // values are omitted from API requests. However, any field with an
3693 // empty value appearing in NullFields will be sent to the server as
3694 // null. It is an error if a field in this list has a non-empty value.
3695 // This may be used to include null fields in Patch requests.
3696 NullFields []string `json:"-"`
3697 }
3698
3699 func (s *Seller) MarshalJSON() ([]byte, error) {
3700 type NoMethod Seller
3701 raw := NoMethod(*s)
3702 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
3703 }
3704
3705 type SharedTargeting struct {
3706 // Exclusions: The list of values to exclude from targeting. Each value
3707 // is AND'd together.
3708 Exclusions []*TargetingValue `json:"exclusions,omitempty"`
3709
3710 // Inclusions: The list of value to include as part of the targeting.
3711 // Each value is OR'd together.
3712 Inclusions []*TargetingValue `json:"inclusions,omitempty"`
3713
3714 // Key: The key representing the shared targeting criterion.
3715 Key string `json:"key,omitempty"`
3716
3717 // ForceSendFields is a list of field names (e.g. "Exclusions") to
3718 // unconditionally include in API requests. By default, fields with
3719 // empty or default values are omitted from API requests. However, any
3720 // non-pointer, non-interface field appearing in ForceSendFields will be
3721 // sent to the server regardless of whether the field is empty or not.
3722 // This may be used to include empty fields in Patch requests.
3723 ForceSendFields []string `json:"-"`
3724
3725 // NullFields is a list of field names (e.g. "Exclusions") to include in
3726 // API requests with the JSON null value. By default, fields with empty
3727 // values are omitted from API requests. However, any field with an
3728 // empty value appearing in NullFields will be sent to the server as
3729 // null. It is an error if a field in this list has a non-empty value.
3730 // This may be used to include null fields in Patch requests.
3731 NullFields []string `json:"-"`
3732 }
3733
3734 func (s *SharedTargeting) MarshalJSON() ([]byte, error) {
3735 type NoMethod SharedTargeting
3736 raw := NoMethod(*s)
3737 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
3738 }
3739
3740 type TargetingValue struct {
3741 // CreativeSizeValue: The creative size value to exclude/include.
3742 CreativeSizeValue *TargetingValueCreativeSize `json:"creativeSizeValue,omitempty"`
3743
3744 // DayPartTargetingValue: The daypart targeting to include / exclude.
3745 // Filled in when the key is GOOG_DAYPART_TARGETING.
3746 DayPartTargetingValue *TargetingValueDayPartTargeting `json:"dayPartTargetingValue,omitempty"`
3747
3748 DemogAgeCriteriaValue *TargetingValueDemogAgeCriteria `json:"demogAgeCriteriaValue,omitempty"`
3749
3750 DemogGenderCriteriaValue *TargetingValueDemogGenderCriteria `json:"demogGenderCriteriaValue,omitempty"`
3751
3752 // LongValue: The long value to exclude/include.
3753 LongValue int64 `json:"longValue,omitempty,string"`
3754
3755 RequestPlatformTargetingValue *TargetingValueRequestPlatformTargeting `json:"requestPlatformTargetingValue,omitempty"`
3756
3757 // StringValue: The string value to exclude/include.
3758 StringValue string `json:"stringValue,omitempty"`
3759
3760 // ForceSendFields is a list of field names (e.g. "CreativeSizeValue")
3761 // to unconditionally include in API requests. By default, fields with
3762 // empty or default values are omitted from API requests. However, any
3763 // non-pointer, non-interface field appearing in ForceSendFields will be
3764 // sent to the server regardless of whether the field is empty or not.
3765 // This may be used to include empty fields in Patch requests.
3766 ForceSendFields []string `json:"-"`
3767
3768 // NullFields is a list of field names (e.g. "CreativeSizeValue") to
3769 // include in API requests with the JSON null value. By default, fields
3770 // with empty values are omitted from API requests. However, any field
3771 // with an empty value appearing in NullFields will be sent to the
3772 // server as null. It is an error if a field in this list has a
3773 // non-empty value. This may be used to include null fields in Patch
3774 // requests.
3775 NullFields []string `json:"-"`
3776 }
3777
3778 func (s *TargetingValue) MarshalJSON() ([]byte, error) {
3779 type NoMethod TargetingValue
3780 raw := NoMethod(*s)
3781 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
3782 }
3783
3784 // TargetingValueCreativeSize: Next Id: 7
3785 type TargetingValueCreativeSize struct {
3786 // AllowedFormats: The formats allowed by the publisher.
3787 AllowedFormats []string `json:"allowedFormats,omitempty"`
3788
3789 // CompanionSizes: For video size type, the list of companion sizes.
3790 CompanionSizes []*TargetingValueSize `json:"companionSizes,omitempty"`
3791
3792 // CreativeSizeType: The Creative size type.
3793 CreativeSizeType string `json:"creativeSizeType,omitempty"`
3794
3795 // NativeTemplate: The native template for native ad.
3796 NativeTemplate string `json:"nativeTemplate,omitempty"`
3797
3798 // Size: For regular or video creative size type, specifies the size of
3799 // the creative.
3800 Size *TargetingValueSize `json:"size,omitempty"`
3801
3802 // SkippableAdType: The skippable ad type for video size.
3803 SkippableAdType string `json:"skippableAdType,omitempty"`
3804
3805 // ForceSendFields is a list of field names (e.g. "AllowedFormats") to
3806 // unconditionally include in API requests. By default, fields with
3807 // empty or default values are omitted from API requests. However, any
3808 // non-pointer, non-interface field appearing in ForceSendFields will be
3809 // sent to the server regardless of whether the field is empty or not.
3810 // This may be used to include empty fields in Patch requests.
3811 ForceSendFields []string `json:"-"`
3812
3813 // NullFields is a list of field names (e.g. "AllowedFormats") to
3814 // include in API requests with the JSON null value. By default, fields
3815 // with empty values are omitted from API requests. However, any field
3816 // with an empty value appearing in NullFields will be sent to the
3817 // server as null. It is an error if a field in this list has a
3818 // non-empty value. This may be used to include null fields in Patch
3819 // requests.
3820 NullFields []string `json:"-"`
3821 }
3822
3823 func (s *TargetingValueCreativeSize) MarshalJSON() ([]byte, error) {
3824 type NoMethod TargetingValueCreativeSize
3825 raw := NoMethod(*s)
3826 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
3827 }
3828
3829 type TargetingValueDayPartTargeting struct {
3830 DayParts []*TargetingValueDayPartTargetingDayPart `json:"dayParts,omitempty"`
3831
3832 TimeZoneType string `json:"timeZoneType,omitempty"`
3833
3834 // ForceSendFields is a list of field names (e.g. "DayParts") to
3835 // unconditionally include in API requests. By default, fields with
3836 // empty or default values are omitted from API requests. However, any
3837 // non-pointer, non-interface field appearing in ForceSendFields will be
3838 // sent to the server regardless of whether the field is empty or not.
3839 // This may be used to include empty fields in Patch requests.
3840 ForceSendFields []string `json:"-"`
3841
3842 // NullFields is a list of field names (e.g. "DayParts") to include in
3843 // API requests with the JSON null value. By default, fields with empty
3844 // values are omitted from API requests. However, any field with an
3845 // empty value appearing in NullFields will be sent to the server as
3846 // null. It is an error if a field in this list has a non-empty value.
3847 // This may be used to include null fields in Patch requests.
3848 NullFields []string `json:"-"`
3849 }
3850
3851 func (s *TargetingValueDayPartTargeting) MarshalJSON() ([]byte, error) {
3852 type NoMethod TargetingValueDayPartTargeting
3853 raw := NoMethod(*s)
3854 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
3855 }
3856
3857 type TargetingValueDayPartTargetingDayPart struct {
3858 DayOfWeek string `json:"dayOfWeek,omitempty"`
3859
3860 EndHour int64 `json:"endHour,omitempty"`
3861
3862 EndMinute int64 `json:"endMinute,omitempty"`
3863
3864 StartHour int64 `json:"startHour,omitempty"`
3865
3866 StartMinute int64 `json:"startMinute,omitempty"`
3867
3868 // ForceSendFields is a list of field names (e.g. "DayOfWeek") to
3869 // unconditionally include in API requests. By default, fields with
3870 // empty or default values are omitted from API requests. However, any
3871 // non-pointer, non-interface field appearing in ForceSendFields will be
3872 // sent to the server regardless of whether the field is empty or not.
3873 // This may be used to include empty fields in Patch requests.
3874 ForceSendFields []string `json:"-"`
3875
3876 // NullFields is a list of field names (e.g. "DayOfWeek") to include in
3877 // API requests with the JSON null value. By default, fields with empty
3878 // values are omitted from API requests. However, any field with an
3879 // empty value appearing in NullFields will be sent to the server as
3880 // null. It is an error if a field in this list has a non-empty value.
3881 // This may be used to include null fields in Patch requests.
3882 NullFields []string `json:"-"`
3883 }
3884
3885 func (s *TargetingValueDayPartTargetingDayPart) MarshalJSON() ([]byte, error) {
3886 type NoMethod TargetingValueDayPartTargetingDayPart
3887 raw := NoMethod(*s)
3888 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
3889 }
3890
3891 type TargetingValueDemogAgeCriteria struct {
3892 DemogAgeCriteriaIds []string `json:"demogAgeCriteriaIds,omitempty"`
3893
3894 // ForceSendFields is a list of field names (e.g. "DemogAgeCriteriaIds")
3895 // to unconditionally include in API requests. By default, fields with
3896 // empty or default values are omitted from API requests. However, any
3897 // non-pointer, non-interface field appearing in ForceSendFields will be
3898 // sent to the server regardless of whether the field is empty or not.
3899 // This may be used to include empty fields in Patch requests.
3900 ForceSendFields []string `json:"-"`
3901
3902 // NullFields is a list of field names (e.g. "DemogAgeCriteriaIds") to
3903 // include in API requests with the JSON null value. By default, fields
3904 // with empty values are omitted from API requests. However, any field
3905 // with an empty value appearing in NullFields will be sent to the
3906 // server as null. It is an error if a field in this list has a
3907 // non-empty value. This may be used to include null fields in Patch
3908 // requests.
3909 NullFields []string `json:"-"`
3910 }
3911
3912 func (s *TargetingValueDemogAgeCriteria) MarshalJSON() ([]byte, error) {
3913 type NoMethod TargetingValueDemogAgeCriteria
3914 raw := NoMethod(*s)
3915 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
3916 }
3917
3918 type TargetingValueDemogGenderCriteria struct {
3919 DemogGenderCriteriaIds []string `json:"demogGenderCriteriaIds,omitempty"`
3920
3921 // ForceSendFields is a list of field names (e.g.
3922 // "DemogGenderCriteriaIds") to unconditionally include in API requests.
3923 // By default, fields with empty or default values are omitted from API
3924 // requests. However, any non-pointer, non-interface field appearing in
3925 // ForceSendFields will be sent to the server regardless of whether the
3926 // field is empty or not. This may be used to include empty fields in
3927 // Patch requests.
3928 ForceSendFields []string `json:"-"`
3929
3930 // NullFields is a list of field names (e.g. "DemogGenderCriteriaIds")
3931 // to include in API requests with the JSON null value. By default,
3932 // fields with empty values are omitted from API requests. However, any
3933 // field with an empty value appearing in NullFields will be sent to the
3934 // server as null. It is an error if a field in this list has a
3935 // non-empty value. This may be used to include null fields in Patch
3936 // requests.
3937 NullFields []string `json:"-"`
3938 }
3939
3940 func (s *TargetingValueDemogGenderCriteria) MarshalJSON() ([]byte, error) {
3941 type NoMethod TargetingValueDemogGenderCriteria
3942 raw := NoMethod(*s)
3943 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
3944 }
3945
3946 type TargetingValueRequestPlatformTargeting struct {
3947 RequestPlatforms []string `json:"requestPlatforms,omitempty"`
3948
3949 // ForceSendFields is a list of field names (e.g. "RequestPlatforms") to
3950 // unconditionally include in API requests. By default, fields with
3951 // empty or default values are omitted from API requests. However, any
3952 // non-pointer, non-interface field appearing in ForceSendFields will be
3953 // sent to the server regardless of whether the field is empty or not.
3954 // This may be used to include empty fields in Patch requests.
3955 ForceSendFields []string `json:"-"`
3956
3957 // NullFields is a list of field names (e.g. "RequestPlatforms") to
3958 // include in API requests with the JSON null value. By default, fields
3959 // with empty values are omitted from API requests. However, any field
3960 // with an empty value appearing in NullFields will be sent to the
3961 // server as null. It is an error if a field in this list has a
3962 // non-empty value. This may be used to include null fields in Patch
3963 // requests.
3964 NullFields []string `json:"-"`
3965 }
3966
3967 func (s *TargetingValueRequestPlatformTargeting) MarshalJSON() ([]byte, error) {
3968 type NoMethod TargetingValueRequestPlatformTargeting
3969 raw := NoMethod(*s)
3970 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
3971 }
3972
3973 type TargetingValueSize struct {
3974 // Height: The height of the creative.
3975 Height int64 `json:"height,omitempty"`
3976
3977 // Width: The width of the creative.
3978 Width int64 `json:"width,omitempty"`
3979
3980 // ForceSendFields is a list of field names (e.g. "Height") to
3981 // unconditionally include in API requests. By default, fields with
3982 // empty or default values are omitted from API requests. However, any
3983 // non-pointer, non-interface field appearing in ForceSendFields will be
3984 // sent to the server regardless of whether the field is empty or not.
3985 // This may be used to include empty fields in Patch requests.
3986 ForceSendFields []string `json:"-"`
3987
3988 // NullFields is a list of field names (e.g. "Height") to include in API
3989 // requests with the JSON null value. By default, fields with empty
3990 // values are omitted from API requests. However, any field with an
3991 // empty value appearing in NullFields will be sent to the server as
3992 // null. It is an error if a field in this list has a non-empty value.
3993 // This may be used to include null fields in Patch requests.
3994 NullFields []string `json:"-"`
3995 }
3996
3997 func (s *TargetingValueSize) MarshalJSON() ([]byte, error) {
3998 type NoMethod TargetingValueSize
3999 raw := NoMethod(*s)
4000 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
4001 }
4002
4003 type UpdatePrivateAuctionProposalRequest struct {
4004 // ExternalDealId: The externalDealId of the deal to be updated.
4005 ExternalDealId string `json:"externalDealId,omitempty"`
4006
4007 // Note: Optional note to be added.
4008 Note *MarketplaceNote `json:"note,omitempty"`
4009
4010 // ProposalRevisionNumber: The current revision number of the proposal
4011 // to be updated.
4012 ProposalRevisionNumber int64 `json:"proposalRevisionNumber,omitempty,string"`
4013
4014 // UpdateAction: The proposed action on the private auction proposal.
4015 UpdateAction string `json:"updateAction,omitempty"`
4016
4017 // ForceSendFields is a list of field names (e.g. "ExternalDealId") to
4018 // unconditionally include in API requests. By default, fields with
4019 // empty or default values are omitted from API requests. However, any
4020 // non-pointer, non-interface field appearing in ForceSendFields will be
4021 // sent to the server regardless of whether the field is empty or not.
4022 // This may be used to include empty fields in Patch requests.
4023 ForceSendFields []string `json:"-"`
4024
4025 // NullFields is a list of field names (e.g. "ExternalDealId") to
4026 // include in API requests with the JSON null value. By default, fields
4027 // with empty values are omitted from API requests. However, any field
4028 // with an empty value appearing in NullFields will be sent to the
4029 // server as null. It is an error if a field in this list has a
4030 // non-empty value. This may be used to include null fields in Patch
4031 // requests.
4032 NullFields []string `json:"-"`
4033 }
4034
4035 func (s *UpdatePrivateAuctionProposalRequest) MarshalJSON() ([]byte, error) {
4036 type NoMethod UpdatePrivateAuctionProposalRequest
4037 raw := NoMethod(*s)
4038 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
4039 }
4040
4041 // method id "adexchangebuyer.accounts.get":
4042
4043 type AccountsGetCall struct {
4044 s *Service
4045 id int64
4046 urlParams_ gensupport.URLParams
4047 ifNoneMatch_ string
4048 ctx_ context.Context
4049 header_ http.Header
4050 }
4051
4052 // Get: Gets one account by ID.
4053 //
4054 // - id: The account id.
4055 func (r *AccountsService) Get(id int64) *AccountsGetCall {
4056 c := &AccountsGetCall{s: r.s, urlParams_: make(gensupport.URLParams)}
4057 c.id = id
4058 return c
4059 }
4060
4061 // Fields allows partial responses to be retrieved. See
4062 // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
4063 // for more information.
4064 func (c *AccountsGetCall) Fields(s ...googleapi.Field) *AccountsGetCall {
4065 c.urlParams_.Set("fields", googleapi.CombineFields(s))
4066 return c
4067 }
4068
4069 // IfNoneMatch sets the optional parameter which makes the operation
4070 // fail if the object's ETag matches the given value. This is useful for
4071 // getting updates only after the object has changed since the last
4072 // request. Use googleapi.IsNotModified to check whether the response
4073 // error from Do is the result of In-None-Match.
4074 func (c *AccountsGetCall) IfNoneMatch(entityTag string) *AccountsGetCall {
4075 c.ifNoneMatch_ = entityTag
4076 return c
4077 }
4078
4079 // Context sets the context to be used in this call's Do method. Any
4080 // pending HTTP request will be aborted if the provided context is
4081 // canceled.
4082 func (c *AccountsGetCall) Context(ctx context.Context) *AccountsGetCall {
4083 c.ctx_ = ctx
4084 return c
4085 }
4086
4087 // Header returns an http.Header that can be modified by the caller to
4088 // add HTTP headers to the request.
4089 func (c *AccountsGetCall) Header() http.Header {
4090 if c.header_ == nil {
4091 c.header_ = make(http.Header)
4092 }
4093 return c.header_
4094 }
4095
4096 func (c *AccountsGetCall) doRequest(alt string) (*http.Response, error) {
4097 reqHeaders := make(http.Header)
4098 reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/20210819")
4099 for k, v := range c.header_ {
4100 reqHeaders[k] = v
4101 }
4102 reqHeaders.Set("User-Agent", c.s.userAgent())
4103 if c.ifNoneMatch_ != "" {
4104 reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
4105 }
4106 var body io.Reader = nil
4107 c.urlParams_.Set("alt", alt)
4108 c.urlParams_.Set("prettyPrint", "false")
4109 urls := googleapi.ResolveRelative(c.s.BasePath, "accounts/{id}")
4110 urls += "?" + c.urlParams_.Encode()
4111 req, err := http.NewRequest("GET", urls, body)
4112 if err != nil {
4113 return nil, err
4114 }
4115 req.Header = reqHeaders
4116 googleapi.Expand(req.URL, map[string]string{
4117 "id": strconv.FormatInt(c.id, 10),
4118 })
4119 return gensupport.SendRequest(c.ctx_, c.s.client, req)
4120 }
4121
4122 // Do executes the "adexchangebuyer.accounts.get" call.
4123 // Exactly one of *Account or error will be non-nil. Any non-2xx status
4124 // code is an error. Response headers are in either
4125 // *Account.ServerResponse.Header or (if a response was returned at all)
4126 // in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to
4127 // check whether the returned error was because http.StatusNotModified
4128 // was returned.
4129 func (c *AccountsGetCall) Do(opts ...googleapi.CallOption) (*Account, error) {
4130 gensupport.SetOptions(c.urlParams_, opts...)
4131 res, err := c.doRequest("json")
4132 if res != nil && res.StatusCode == http.StatusNotModified {
4133 if res.Body != nil {
4134 res.Body.Close()
4135 }
4136 return nil, &googleapi.Error{
4137 Code: res.StatusCode,
4138 Header: res.Header,
4139 }
4140 }
4141 if err != nil {
4142 return nil, err
4143 }
4144 defer googleapi.CloseBody(res)
4145 if err := googleapi.CheckResponse(res); err != nil {
4146 return nil, err
4147 }
4148 ret := &Account{
4149 ServerResponse: googleapi.ServerResponse{
4150 Header: res.Header,
4151 HTTPStatusCode: res.StatusCode,
4152 },
4153 }
4154 target := &ret
4155 if err := gensupport.DecodeResponse(target, res); err != nil {
4156 return nil, err
4157 }
4158 return ret, nil
4159 // {
4160 // "description": "Gets one account by ID.",
4161 // "httpMethod": "GET",
4162 // "id": "adexchangebuyer.accounts.get",
4163 // "parameterOrder": [
4164 // "id"
4165 // ],
4166 // "parameters": {
4167 // "id": {
4168 // "description": "The account id",
4169 // "format": "int32",
4170 // "location": "path",
4171 // "required": true,
4172 // "type": "integer"
4173 // }
4174 // },
4175 // "path": "accounts/{id}",
4176 // "response": {
4177 // "$ref": "Account"
4178 // },
4179 // "scopes": [
4180 // "https://www.googleapis.com/auth/adexchange.buyer"
4181 // ]
4182 // }
4183
4184 }
4185
4186 // method id "adexchangebuyer.accounts.list":
4187
4188 type AccountsListCall struct {
4189 s *Service
4190 urlParams_ gensupport.URLParams
4191 ifNoneMatch_ string
4192 ctx_ context.Context
4193 header_ http.Header
4194 }
4195
4196 // List: Retrieves the authenticated user's list of accounts.
4197 func (r *AccountsService) List() *AccountsListCall {
4198 c := &AccountsListCall{s: r.s, urlParams_: make(gensupport.URLParams)}
4199 return c
4200 }
4201
4202 // Fields allows partial responses to be retrieved. See
4203 // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
4204 // for more information.
4205 func (c *AccountsListCall) Fields(s ...googleapi.Field) *AccountsListCall {
4206 c.urlParams_.Set("fields", googleapi.CombineFields(s))
4207 return c
4208 }
4209
4210 // IfNoneMatch sets the optional parameter which makes the operation
4211 // fail if the object's ETag matches the given value. This is useful for
4212 // getting updates only after the object has changed since the last
4213 // request. Use googleapi.IsNotModified to check whether the response
4214 // error from Do is the result of In-None-Match.
4215 func (c *AccountsListCall) IfNoneMatch(entityTag string) *AccountsListCall {
4216 c.ifNoneMatch_ = entityTag
4217 return c
4218 }
4219
4220 // Context sets the context to be used in this call's Do method. Any
4221 // pending HTTP request will be aborted if the provided context is
4222 // canceled.
4223 func (c *AccountsListCall) Context(ctx context.Context) *AccountsListCall {
4224 c.ctx_ = ctx
4225 return c
4226 }
4227
4228 // Header returns an http.Header that can be modified by the caller to
4229 // add HTTP headers to the request.
4230 func (c *AccountsListCall) Header() http.Header {
4231 if c.header_ == nil {
4232 c.header_ = make(http.Header)
4233 }
4234 return c.header_
4235 }
4236
4237 func (c *AccountsListCall) doRequest(alt string) (*http.Response, error) {
4238 reqHeaders := make(http.Header)
4239 reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/20210819")
4240 for k, v := range c.header_ {
4241 reqHeaders[k] = v
4242 }
4243 reqHeaders.Set("User-Agent", c.s.userAgent())
4244 if c.ifNoneMatch_ != "" {
4245 reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
4246 }
4247 var body io.Reader = nil
4248 c.urlParams_.Set("alt", alt)
4249 c.urlParams_.Set("prettyPrint", "false")
4250 urls := googleapi.ResolveRelative(c.s.BasePath, "accounts")
4251 urls += "?" + c.urlParams_.Encode()
4252 req, err := http.NewRequest("GET", urls, body)
4253 if err != nil {
4254 return nil, err
4255 }
4256 req.Header = reqHeaders
4257 return gensupport.SendRequest(c.ctx_, c.s.client, req)
4258 }
4259
4260 // Do executes the "adexchangebuyer.accounts.list" call.
4261 // Exactly one of *AccountsList or error will be non-nil. Any non-2xx
4262 // status code is an error. Response headers are in either
4263 // *AccountsList.ServerResponse.Header or (if a response was returned at
4264 // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
4265 // to check whether the returned error was because
4266 // http.StatusNotModified was returned.
4267 func (c *AccountsListCall) Do(opts ...googleapi.CallOption) (*AccountsList, error) {
4268 gensupport.SetOptions(c.urlParams_, opts...)
4269 res, err := c.doRequest("json")
4270 if res != nil && res.StatusCode == http.StatusNotModified {
4271 if res.Body != nil {
4272 res.Body.Close()
4273 }
4274 return nil, &googleapi.Error{
4275 Code: res.StatusCode,
4276 Header: res.Header,
4277 }
4278 }
4279 if err != nil {
4280 return nil, err
4281 }
4282 defer googleapi.CloseBody(res)
4283 if err := googleapi.CheckResponse(res); err != nil {
4284 return nil, err
4285 }
4286 ret := &AccountsList{
4287 ServerResponse: googleapi.ServerResponse{
4288 Header: res.Header,
4289 HTTPStatusCode: res.StatusCode,
4290 },
4291 }
4292 target := &ret
4293 if err := gensupport.DecodeResponse(target, res); err != nil {
4294 return nil, err
4295 }
4296 return ret, nil
4297 // {
4298 // "description": "Retrieves the authenticated user's list of accounts.",
4299 // "httpMethod": "GET",
4300 // "id": "adexchangebuyer.accounts.list",
4301 // "path": "accounts",
4302 // "response": {
4303 // "$ref": "AccountsList"
4304 // },
4305 // "scopes": [
4306 // "https://www.googleapis.com/auth/adexchange.buyer"
4307 // ]
4308 // }
4309
4310 }
4311
4312 // method id "adexchangebuyer.accounts.patch":
4313
4314 type AccountsPatchCall struct {
4315 s *Service
4316 id int64
4317 account *Account
4318 urlParams_ gensupport.URLParams
4319 ctx_ context.Context
4320 header_ http.Header
4321 }
4322
4323 // Patch: Updates an existing account. This method supports patch
4324 // semantics.
4325 //
4326 // - id: The account id.
4327 func (r *AccountsService) Patch(id int64, account *Account) *AccountsPatchCall {
4328 c := &AccountsPatchCall{s: r.s, urlParams_: make(gensupport.URLParams)}
4329 c.id = id
4330 c.account = account
4331 return c
4332 }
4333
4334 // ConfirmUnsafeAccountChange sets the optional parameter
4335 // "confirmUnsafeAccountChange": Confirmation for erasing bidder and
4336 // cookie matching urls.
4337 func (c *AccountsPatchCall) ConfirmUnsafeAccountChange(confirmUnsafeAccountChange bool) *AccountsPatchCall {
4338 c.urlParams_.Set("confirmUnsafeAccountChange", fmt.Sprint(confirmUnsafeAccountChange))
4339 return c
4340 }
4341
4342 // Fields allows partial responses to be retrieved. See
4343 // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
4344 // for more information.
4345 func (c *AccountsPatchCall) Fields(s ...googleapi.Field) *AccountsPatchCall {
4346 c.urlParams_.Set("fields", googleapi.CombineFields(s))
4347 return c
4348 }
4349
4350 // Context sets the context to be used in this call's Do method. Any
4351 // pending HTTP request will be aborted if the provided context is
4352 // canceled.
4353 func (c *AccountsPatchCall) Context(ctx context.Context) *AccountsPatchCall {
4354 c.ctx_ = ctx
4355 return c
4356 }
4357
4358 // Header returns an http.Header that can be modified by the caller to
4359 // add HTTP headers to the request.
4360 func (c *AccountsPatchCall) Header() http.Header {
4361 if c.header_ == nil {
4362 c.header_ = make(http.Header)
4363 }
4364 return c.header_
4365 }
4366
4367 func (c *AccountsPatchCall) doRequest(alt string) (*http.Response, error) {
4368 reqHeaders := make(http.Header)
4369 reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/20210819")
4370 for k, v := range c.header_ {
4371 reqHeaders[k] = v
4372 }
4373 reqHeaders.Set("User-Agent", c.s.userAgent())
4374 var body io.Reader = nil
4375 body, err := googleapi.WithoutDataWrapper.JSONReader(c.account)
4376 if err != nil {
4377 return nil, err
4378 }
4379 reqHeaders.Set("Content-Type", "application/json")
4380 c.urlParams_.Set("alt", alt)
4381 c.urlParams_.Set("prettyPrint", "false")
4382 urls := googleapi.ResolveRelative(c.s.BasePath, "accounts/{id}")
4383 urls += "?" + c.urlParams_.Encode()
4384 req, err := http.NewRequest("PATCH", urls, body)
4385 if err != nil {
4386 return nil, err
4387 }
4388 req.Header = reqHeaders
4389 googleapi.Expand(req.URL, map[string]string{
4390 "id": strconv.FormatInt(c.id, 10),
4391 })
4392 return gensupport.SendRequest(c.ctx_, c.s.client, req)
4393 }
4394
4395 // Do executes the "adexchangebuyer.accounts.patch" call.
4396 // Exactly one of *Account or error will be non-nil. Any non-2xx status
4397 // code is an error. Response headers are in either
4398 // *Account.ServerResponse.Header or (if a response was returned at all)
4399 // in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to
4400 // check whether the returned error was because http.StatusNotModified
4401 // was returned.
4402 func (c *AccountsPatchCall) Do(opts ...googleapi.CallOption) (*Account, error) {
4403 gensupport.SetOptions(c.urlParams_, opts...)
4404 res, err := c.doRequest("json")
4405 if res != nil && res.StatusCode == http.StatusNotModified {
4406 if res.Body != nil {
4407 res.Body.Close()
4408 }
4409 return nil, &googleapi.Error{
4410 Code: res.StatusCode,
4411 Header: res.Header,
4412 }
4413 }
4414 if err != nil {
4415 return nil, err
4416 }
4417 defer googleapi.CloseBody(res)
4418 if err := googleapi.CheckResponse(res); err != nil {
4419 return nil, err
4420 }
4421 ret := &Account{
4422 ServerResponse: googleapi.ServerResponse{
4423 Header: res.Header,
4424 HTTPStatusCode: res.StatusCode,
4425 },
4426 }
4427 target := &ret
4428 if err := gensupport.DecodeResponse(target, res); err != nil {
4429 return nil, err
4430 }
4431 return ret, nil
4432 // {
4433 // "description": "Updates an existing account. This method supports patch semantics.",
4434 // "httpMethod": "PATCH",
4435 // "id": "adexchangebuyer.accounts.patch",
4436 // "parameterOrder": [
4437 // "id"
4438 // ],
4439 // "parameters": {
4440 // "confirmUnsafeAccountChange": {
4441 // "description": "Confirmation for erasing bidder and cookie matching urls.",
4442 // "location": "query",
4443 // "type": "boolean"
4444 // },
4445 // "id": {
4446 // "description": "The account id",
4447 // "format": "int32",
4448 // "location": "path",
4449 // "required": true,
4450 // "type": "integer"
4451 // }
4452 // },
4453 // "path": "accounts/{id}",
4454 // "request": {
4455 // "$ref": "Account"
4456 // },
4457 // "response": {
4458 // "$ref": "Account"
4459 // },
4460 // "scopes": [
4461 // "https://www.googleapis.com/auth/adexchange.buyer"
4462 // ]
4463 // }
4464
4465 }
4466
4467 // method id "adexchangebuyer.accounts.update":
4468
4469 type AccountsUpdateCall struct {
4470 s *Service
4471 id int64
4472 account *Account
4473 urlParams_ gensupport.URLParams
4474 ctx_ context.Context
4475 header_ http.Header
4476 }
4477
4478 // Update: Updates an existing account.
4479 //
4480 // - id: The account id.
4481 func (r *AccountsService) Update(id int64, account *Account) *AccountsUpdateCall {
4482 c := &AccountsUpdateCall{s: r.s, urlParams_: make(gensupport.URLParams)}
4483 c.id = id
4484 c.account = account
4485 return c
4486 }
4487
4488 // ConfirmUnsafeAccountChange sets the optional parameter
4489 // "confirmUnsafeAccountChange": Confirmation for erasing bidder and
4490 // cookie matching urls.
4491 func (c *AccountsUpdateCall) ConfirmUnsafeAccountChange(confirmUnsafeAccountChange bool) *AccountsUpdateCall {
4492 c.urlParams_.Set("confirmUnsafeAccountChange", fmt.Sprint(confirmUnsafeAccountChange))
4493 return c
4494 }
4495
4496 // Fields allows partial responses to be retrieved. See
4497 // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
4498 // for more information.
4499 func (c *AccountsUpdateCall) Fields(s ...googleapi.Field) *AccountsUpdateCall {
4500 c.urlParams_.Set("fields", googleapi.CombineFields(s))
4501 return c
4502 }
4503
4504 // Context sets the context to be used in this call's Do method. Any
4505 // pending HTTP request will be aborted if the provided context is
4506 // canceled.
4507 func (c *AccountsUpdateCall) Context(ctx context.Context) *AccountsUpdateCall {
4508 c.ctx_ = ctx
4509 return c
4510 }
4511
4512 // Header returns an http.Header that can be modified by the caller to
4513 // add HTTP headers to the request.
4514 func (c *AccountsUpdateCall) Header() http.Header {
4515 if c.header_ == nil {
4516 c.header_ = make(http.Header)
4517 }
4518 return c.header_
4519 }
4520
4521 func (c *AccountsUpdateCall) doRequest(alt string) (*http.Response, error) {
4522 reqHeaders := make(http.Header)
4523 reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/20210819")
4524 for k, v := range c.header_ {
4525 reqHeaders[k] = v
4526 }
4527 reqHeaders.Set("User-Agent", c.s.userAgent())
4528 var body io.Reader = nil
4529 body, err := googleapi.WithoutDataWrapper.JSONReader(c.account)
4530 if err != nil {
4531 return nil, err
4532 }
4533 reqHeaders.Set("Content-Type", "application/json")
4534 c.urlParams_.Set("alt", alt)
4535 c.urlParams_.Set("prettyPrint", "false")
4536 urls := googleapi.ResolveRelative(c.s.BasePath, "accounts/{id}")
4537 urls += "?" + c.urlParams_.Encode()
4538 req, err := http.NewRequest("PUT", urls, body)
4539 if err != nil {
4540 return nil, err
4541 }
4542 req.Header = reqHeaders
4543 googleapi.Expand(req.URL, map[string]string{
4544 "id": strconv.FormatInt(c.id, 10),
4545 })
4546 return gensupport.SendRequest(c.ctx_, c.s.client, req)
4547 }
4548
4549 // Do executes the "adexchangebuyer.accounts.update" call.
4550 // Exactly one of *Account or error will be non-nil. Any non-2xx status
4551 // code is an error. Response headers are in either
4552 // *Account.ServerResponse.Header or (if a response was returned at all)
4553 // in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to
4554 // check whether the returned error was because http.StatusNotModified
4555 // was returned.
4556 func (c *AccountsUpdateCall) Do(opts ...googleapi.CallOption) (*Account, error) {
4557 gensupport.SetOptions(c.urlParams_, opts...)
4558 res, err := c.doRequest("json")
4559 if res != nil && res.StatusCode == http.StatusNotModified {
4560 if res.Body != nil {
4561 res.Body.Close()
4562 }
4563 return nil, &googleapi.Error{
4564 Code: res.StatusCode,
4565 Header: res.Header,
4566 }
4567 }
4568 if err != nil {
4569 return nil, err
4570 }
4571 defer googleapi.CloseBody(res)
4572 if err := googleapi.CheckResponse(res); err != nil {
4573 return nil, err
4574 }
4575 ret := &Account{
4576 ServerResponse: googleapi.ServerResponse{
4577 Header: res.Header,
4578 HTTPStatusCode: res.StatusCode,
4579 },
4580 }
4581 target := &ret
4582 if err := gensupport.DecodeResponse(target, res); err != nil {
4583 return nil, err
4584 }
4585 return ret, nil
4586 // {
4587 // "description": "Updates an existing account.",
4588 // "httpMethod": "PUT",
4589 // "id": "adexchangebuyer.accounts.update",
4590 // "parameterOrder": [
4591 // "id"
4592 // ],
4593 // "parameters": {
4594 // "confirmUnsafeAccountChange": {
4595 // "description": "Confirmation for erasing bidder and cookie matching urls.",
4596 // "location": "query",
4597 // "type": "boolean"
4598 // },
4599 // "id": {
4600 // "description": "The account id",
4601 // "format": "int32",
4602 // "location": "path",
4603 // "required": true,
4604 // "type": "integer"
4605 // }
4606 // },
4607 // "path": "accounts/{id}",
4608 // "request": {
4609 // "$ref": "Account"
4610 // },
4611 // "response": {
4612 // "$ref": "Account"
4613 // },
4614 // "scopes": [
4615 // "https://www.googleapis.com/auth/adexchange.buyer"
4616 // ]
4617 // }
4618
4619 }
4620
4621 // method id "adexchangebuyer.billingInfo.get":
4622
4623 type BillingInfoGetCall struct {
4624 s *Service
4625 accountId int64
4626 urlParams_ gensupport.URLParams
4627 ifNoneMatch_ string
4628 ctx_ context.Context
4629 header_ http.Header
4630 }
4631
4632 // Get: Returns the billing information for one account specified by
4633 // account ID.
4634 //
4635 // - accountId: The account id.
4636 func (r *BillingInfoService) Get(accountId int64) *BillingInfoGetCall {
4637 c := &BillingInfoGetCall{s: r.s, urlParams_: make(gensupport.URLParams)}
4638 c.accountId = accountId
4639 return c
4640 }
4641
4642 // Fields allows partial responses to be retrieved. See
4643 // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
4644 // for more information.
4645 func (c *BillingInfoGetCall) Fields(s ...googleapi.Field) *BillingInfoGetCall {
4646 c.urlParams_.Set("fields", googleapi.CombineFields(s))
4647 return c
4648 }
4649
4650 // IfNoneMatch sets the optional parameter which makes the operation
4651 // fail if the object's ETag matches the given value. This is useful for
4652 // getting updates only after the object has changed since the last
4653 // request. Use googleapi.IsNotModified to check whether the response
4654 // error from Do is the result of In-None-Match.
4655 func (c *BillingInfoGetCall) IfNoneMatch(entityTag string) *BillingInfoGetCall {
4656 c.ifNoneMatch_ = entityTag
4657 return c
4658 }
4659
4660 // Context sets the context to be used in this call's Do method. Any
4661 // pending HTTP request will be aborted if the provided context is
4662 // canceled.
4663 func (c *BillingInfoGetCall) Context(ctx context.Context) *BillingInfoGetCall {
4664 c.ctx_ = ctx
4665 return c
4666 }
4667
4668 // Header returns an http.Header that can be modified by the caller to
4669 // add HTTP headers to the request.
4670 func (c *BillingInfoGetCall) Header() http.Header {
4671 if c.header_ == nil {
4672 c.header_ = make(http.Header)
4673 }
4674 return c.header_
4675 }
4676
4677 func (c *BillingInfoGetCall) doRequest(alt string) (*http.Response, error) {
4678 reqHeaders := make(http.Header)
4679 reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/20210819")
4680 for k, v := range c.header_ {
4681 reqHeaders[k] = v
4682 }
4683 reqHeaders.Set("User-Agent", c.s.userAgent())
4684 if c.ifNoneMatch_ != "" {
4685 reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
4686 }
4687 var body io.Reader = nil
4688 c.urlParams_.Set("alt", alt)
4689 c.urlParams_.Set("prettyPrint", "false")
4690 urls := googleapi.ResolveRelative(c.s.BasePath, "billinginfo/{accountId}")
4691 urls += "?" + c.urlParams_.Encode()
4692 req, err := http.NewRequest("GET", urls, body)
4693 if err != nil {
4694 return nil, err
4695 }
4696 req.Header = reqHeaders
4697 googleapi.Expand(req.URL, map[string]string{
4698 "accountId": strconv.FormatInt(c.accountId, 10),
4699 })
4700 return gensupport.SendRequest(c.ctx_, c.s.client, req)
4701 }
4702
4703 // Do executes the "adexchangebuyer.billingInfo.get" call.
4704 // Exactly one of *BillingInfo or error will be non-nil. Any non-2xx
4705 // status code is an error. Response headers are in either
4706 // *BillingInfo.ServerResponse.Header or (if a response was returned at
4707 // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
4708 // to check whether the returned error was because
4709 // http.StatusNotModified was returned.
4710 func (c *BillingInfoGetCall) Do(opts ...googleapi.CallOption) (*BillingInfo, error) {
4711 gensupport.SetOptions(c.urlParams_, opts...)
4712 res, err := c.doRequest("json")
4713 if res != nil && res.StatusCode == http.StatusNotModified {
4714 if res.Body != nil {
4715 res.Body.Close()
4716 }
4717 return nil, &googleapi.Error{
4718 Code: res.StatusCode,
4719 Header: res.Header,
4720 }
4721 }
4722 if err != nil {
4723 return nil, err
4724 }
4725 defer googleapi.CloseBody(res)
4726 if err := googleapi.CheckResponse(res); err != nil {
4727 return nil, err
4728 }
4729 ret := &BillingInfo{
4730 ServerResponse: googleapi.ServerResponse{
4731 Header: res.Header,
4732 HTTPStatusCode: res.StatusCode,
4733 },
4734 }
4735 target := &ret
4736 if err := gensupport.DecodeResponse(target, res); err != nil {
4737 return nil, err
4738 }
4739 return ret, nil
4740 // {
4741 // "description": "Returns the billing information for one account specified by account ID.",
4742 // "httpMethod": "GET",
4743 // "id": "adexchangebuyer.billingInfo.get",
4744 // "parameterOrder": [
4745 // "accountId"
4746 // ],
4747 // "parameters": {
4748 // "accountId": {
4749 // "description": "The account id.",
4750 // "format": "int32",
4751 // "location": "path",
4752 // "required": true,
4753 // "type": "integer"
4754 // }
4755 // },
4756 // "path": "billinginfo/{accountId}",
4757 // "response": {
4758 // "$ref": "BillingInfo"
4759 // },
4760 // "scopes": [
4761 // "https://www.googleapis.com/auth/adexchange.buyer"
4762 // ]
4763 // }
4764
4765 }
4766
4767 // method id "adexchangebuyer.billingInfo.list":
4768
4769 type BillingInfoListCall struct {
4770 s *Service
4771 urlParams_ gensupport.URLParams
4772 ifNoneMatch_ string
4773 ctx_ context.Context
4774 header_ http.Header
4775 }
4776
4777 // List: Retrieves a list of billing information for all accounts of the
4778 // authenticated user.
4779 func (r *BillingInfoService) List() *BillingInfoListCall {
4780 c := &BillingInfoListCall{s: r.s, urlParams_: make(gensupport.URLParams)}
4781 return c
4782 }
4783
4784 // Fields allows partial responses to be retrieved. See
4785 // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
4786 // for more information.
4787 func (c *BillingInfoListCall) Fields(s ...googleapi.Field) *BillingInfoListCall {
4788 c.urlParams_.Set("fields", googleapi.CombineFields(s))
4789 return c
4790 }
4791
4792 // IfNoneMatch sets the optional parameter which makes the operation
4793 // fail if the object's ETag matches the given value. This is useful for
4794 // getting updates only after the object has changed since the last
4795 // request. Use googleapi.IsNotModified to check whether the response
4796 // error from Do is the result of In-None-Match.
4797 func (c *BillingInfoListCall) IfNoneMatch(entityTag string) *BillingInfoListCall {
4798 c.ifNoneMatch_ = entityTag
4799 return c
4800 }
4801
4802 // Context sets the context to be used in this call's Do method. Any
4803 // pending HTTP request will be aborted if the provided context is
4804 // canceled.
4805 func (c *BillingInfoListCall) Context(ctx context.Context) *BillingInfoListCall {
4806 c.ctx_ = ctx
4807 return c
4808 }
4809
4810 // Header returns an http.Header that can be modified by the caller to
4811 // add HTTP headers to the request.
4812 func (c *BillingInfoListCall) Header() http.Header {
4813 if c.header_ == nil {
4814 c.header_ = make(http.Header)
4815 }
4816 return c.header_
4817 }
4818
4819 func (c *BillingInfoListCall) doRequest(alt string) (*http.Response, error) {
4820 reqHeaders := make(http.Header)
4821 reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/20210819")
4822 for k, v := range c.header_ {
4823 reqHeaders[k] = v
4824 }
4825 reqHeaders.Set("User-Agent", c.s.userAgent())
4826 if c.ifNoneMatch_ != "" {
4827 reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
4828 }
4829 var body io.Reader = nil
4830 c.urlParams_.Set("alt", alt)
4831 c.urlParams_.Set("prettyPrint", "false")
4832 urls := googleapi.ResolveRelative(c.s.BasePath, "billinginfo")
4833 urls += "?" + c.urlParams_.Encode()
4834 req, err := http.NewRequest("GET", urls, body)
4835 if err != nil {
4836 return nil, err
4837 }
4838 req.Header = reqHeaders
4839 return gensupport.SendRequest(c.ctx_, c.s.client, req)
4840 }
4841
4842 // Do executes the "adexchangebuyer.billingInfo.list" call.
4843 // Exactly one of *BillingInfoList or error will be non-nil. Any non-2xx
4844 // status code is an error. Response headers are in either
4845 // *BillingInfoList.ServerResponse.Header or (if a response was returned
4846 // at all) in error.(*googleapi.Error).Header. Use
4847 // googleapi.IsNotModified to check whether the returned error was
4848 // because http.StatusNotModified was returned.
4849 func (c *BillingInfoListCall) Do(opts ...googleapi.CallOption) (*BillingInfoList, error) {
4850 gensupport.SetOptions(c.urlParams_, opts...)
4851 res, err := c.doRequest("json")
4852 if res != nil && res.StatusCode == http.StatusNotModified {
4853 if res.Body != nil {
4854 res.Body.Close()
4855 }
4856 return nil, &googleapi.Error{
4857 Code: res.StatusCode,
4858 Header: res.Header,
4859 }
4860 }
4861 if err != nil {
4862 return nil, err
4863 }
4864 defer googleapi.CloseBody(res)
4865 if err := googleapi.CheckResponse(res); err != nil {
4866 return nil, err
4867 }
4868 ret := &BillingInfoList{
4869 ServerResponse: googleapi.ServerResponse{
4870 Header: res.Header,
4871 HTTPStatusCode: res.StatusCode,
4872 },
4873 }
4874 target := &ret
4875 if err := gensupport.DecodeResponse(target, res); err != nil {
4876 return nil, err
4877 }
4878 return ret, nil
4879 // {
4880 // "description": "Retrieves a list of billing information for all accounts of the authenticated user.",
4881 // "httpMethod": "GET",
4882 // "id": "adexchangebuyer.billingInfo.list",
4883 // "path": "billinginfo",
4884 // "response": {
4885 // "$ref": "BillingInfoList"
4886 // },
4887 // "scopes": [
4888 // "https://www.googleapis.com/auth/adexchange.buyer"
4889 // ]
4890 // }
4891
4892 }
4893
4894 // method id "adexchangebuyer.budget.get":
4895
4896 type BudgetGetCall struct {
4897 s *Service
4898 accountId int64
4899 billingId int64
4900 urlParams_ gensupport.URLParams
4901 ifNoneMatch_ string
4902 ctx_ context.Context
4903 header_ http.Header
4904 }
4905
4906 // Get: Returns the budget information for the adgroup specified by the
4907 // accountId and billingId.
4908 //
4909 // - accountId: The account id to get the budget information for.
4910 // - billingId: The billing id to get the budget information for.
4911 func (r *BudgetService) Get(accountId int64, billingId int64) *BudgetGetCall {
4912 c := &BudgetGetCall{s: r.s, urlParams_: make(gensupport.URLParams)}
4913 c.accountId = accountId
4914 c.billingId = billingId
4915 return c
4916 }
4917
4918 // Fields allows partial responses to be retrieved. See
4919 // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
4920 // for more information.
4921 func (c *BudgetGetCall) Fields(s ...googleapi.Field) *BudgetGetCall {
4922 c.urlParams_.Set("fields", googleapi.CombineFields(s))
4923 return c
4924 }
4925
4926 // IfNoneMatch sets the optional parameter which makes the operation
4927 // fail if the object's ETag matches the given value. This is useful for
4928 // getting updates only after the object has changed since the last
4929 // request. Use googleapi.IsNotModified to check whether the response
4930 // error from Do is the result of In-None-Match.
4931 func (c *BudgetGetCall) IfNoneMatch(entityTag string) *BudgetGetCall {
4932 c.ifNoneMatch_ = entityTag
4933 return c
4934 }
4935
4936 // Context sets the context to be used in this call's Do method. Any
4937 // pending HTTP request will be aborted if the provided context is
4938 // canceled.
4939 func (c *BudgetGetCall) Context(ctx context.Context) *BudgetGetCall {
4940 c.ctx_ = ctx
4941 return c
4942 }
4943
4944 // Header returns an http.Header that can be modified by the caller to
4945 // add HTTP headers to the request.
4946 func (c *BudgetGetCall) Header() http.Header {
4947 if c.header_ == nil {
4948 c.header_ = make(http.Header)
4949 }
4950 return c.header_
4951 }
4952
4953 func (c *BudgetGetCall) doRequest(alt string) (*http.Response, error) {
4954 reqHeaders := make(http.Header)
4955 reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/20210819")
4956 for k, v := range c.header_ {
4957 reqHeaders[k] = v
4958 }
4959 reqHeaders.Set("User-Agent", c.s.userAgent())
4960 if c.ifNoneMatch_ != "" {
4961 reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
4962 }
4963 var body io.Reader = nil
4964 c.urlParams_.Set("alt", alt)
4965 c.urlParams_.Set("prettyPrint", "false")
4966 urls := googleapi.ResolveRelative(c.s.BasePath, "billinginfo/{accountId}/{billingId}")
4967 urls += "?" + c.urlParams_.Encode()
4968 req, err := http.NewRequest("GET", urls, body)
4969 if err != nil {
4970 return nil, err
4971 }
4972 req.Header = reqHeaders
4973 googleapi.Expand(req.URL, map[string]string{
4974 "accountId": strconv.FormatInt(c.accountId, 10),
4975 "billingId": strconv.FormatInt(c.billingId, 10),
4976 })
4977 return gensupport.SendRequest(c.ctx_, c.s.client, req)
4978 }
4979
4980 // Do executes the "adexchangebuyer.budget.get" call.
4981 // Exactly one of *Budget or error will be non-nil. Any non-2xx status
4982 // code is an error. Response headers are in either
4983 // *Budget.ServerResponse.Header or (if a response was returned at all)
4984 // in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to
4985 // check whether the returned error was because http.StatusNotModified
4986 // was returned.
4987 func (c *BudgetGetCall) Do(opts ...googleapi.CallOption) (*Budget, error) {
4988 gensupport.SetOptions(c.urlParams_, opts...)
4989 res, err := c.doRequest("json")
4990 if res != nil && res.StatusCode == http.StatusNotModified {
4991 if res.Body != nil {
4992 res.Body.Close()
4993 }
4994 return nil, &googleapi.Error{
4995 Code: res.StatusCode,
4996 Header: res.Header,
4997 }
4998 }
4999 if err != nil {
5000 return nil, err
5001 }
5002 defer googleapi.CloseBody(res)
5003 if err := googleapi.CheckResponse(res); err != nil {
5004 return nil, err
5005 }
5006 ret := &Budget{
5007 ServerResponse: googleapi.ServerResponse{
5008 Header: res.Header,
5009 HTTPStatusCode: res.StatusCode,
5010 },
5011 }
5012 target := &ret
5013 if err := gensupport.DecodeResponse(target, res); err != nil {
5014 return nil, err
5015 }
5016 return ret, nil
5017 // {
5018 // "description": "Returns the budget information for the adgroup specified by the accountId and billingId.",
5019 // "httpMethod": "GET",
5020 // "id": "adexchangebuyer.budget.get",
5021 // "parameterOrder": [
5022 // "accountId",
5023 // "billingId"
5024 // ],
5025 // "parameters": {
5026 // "accountId": {
5027 // "description": "The account id to get the budget information for.",
5028 // "format": "int64",
5029 // "location": "path",
5030 // "required": true,
5031 // "type": "string"
5032 // },
5033 // "billingId": {
5034 // "description": "The billing id to get the budget information for.",
5035 // "format": "int64",
5036 // "location": "path",
5037 // "required": true,
5038 // "type": "string"
5039 // }
5040 // },
5041 // "path": "billinginfo/{accountId}/{billingId}",
5042 // "response": {
5043 // "$ref": "Budget"
5044 // },
5045 // "scopes": [
5046 // "https://www.googleapis.com/auth/adexchange.buyer"
5047 // ]
5048 // }
5049
5050 }
5051
5052 // method id "adexchangebuyer.budget.patch":
5053
5054 type BudgetPatchCall struct {
5055 s *Service
5056 accountId int64
5057 billingId int64
5058 budget *Budget
5059 urlParams_ gensupport.URLParams
5060 ctx_ context.Context
5061 header_ http.Header
5062 }
5063
5064 // Patch: Updates the budget amount for the budget of the adgroup
5065 // specified by the accountId and billingId, with the budget amount in
5066 // the request. This method supports patch semantics.
5067 //
5068 // - accountId: The account id associated with the budget being updated.
5069 // - billingId: The billing id associated with the budget being updated.
5070 func (r *BudgetService) Patch(accountId int64, billingId int64, budget *Budget) *BudgetPatchCall {
5071 c := &BudgetPatchCall{s: r.s, urlParams_: make(gensupport.URLParams)}
5072 c.accountId = accountId
5073 c.billingId = billingId
5074 c.budget = budget
5075 return c
5076 }
5077
5078 // Fields allows partial responses to be retrieved. See
5079 // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
5080 // for more information.
5081 func (c *BudgetPatchCall) Fields(s ...googleapi.Field) *BudgetPatchCall {
5082 c.urlParams_.Set("fields", googleapi.CombineFields(s))
5083 return c
5084 }
5085
5086 // Context sets the context to be used in this call's Do method. Any
5087 // pending HTTP request will be aborted if the provided context is
5088 // canceled.
5089 func (c *BudgetPatchCall) Context(ctx context.Context) *BudgetPatchCall {
5090 c.ctx_ = ctx
5091 return c
5092 }
5093
5094 // Header returns an http.Header that can be modified by the caller to
5095 // add HTTP headers to the request.
5096 func (c *BudgetPatchCall) Header() http.Header {
5097 if c.header_ == nil {
5098 c.header_ = make(http.Header)
5099 }
5100 return c.header_
5101 }
5102
5103 func (c *BudgetPatchCall) doRequest(alt string) (*http.Response, error) {
5104 reqHeaders := make(http.Header)
5105 reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/20210819")
5106 for k, v := range c.header_ {
5107 reqHeaders[k] = v
5108 }
5109 reqHeaders.Set("User-Agent", c.s.userAgent())
5110 var body io.Reader = nil
5111 body, err := googleapi.WithoutDataWrapper.JSONReader(c.budget)
5112 if err != nil {
5113 return nil, err
5114 }
5115 reqHeaders.Set("Content-Type", "application/json")
5116 c.urlParams_.Set("alt", alt)
5117 c.urlParams_.Set("prettyPrint", "false")
5118 urls := googleapi.ResolveRelative(c.s.BasePath, "billinginfo/{accountId}/{billingId}")
5119 urls += "?" + c.urlParams_.Encode()
5120 req, err := http.NewRequest("PATCH", urls, body)
5121 if err != nil {
5122 return nil, err
5123 }
5124 req.Header = reqHeaders
5125 googleapi.Expand(req.URL, map[string]string{
5126 "accountId": strconv.FormatInt(c.accountId, 10),
5127 "billingId": strconv.FormatInt(c.billingId, 10),
5128 })
5129 return gensupport.SendRequest(c.ctx_, c.s.client, req)
5130 }
5131
5132 // Do executes the "adexchangebuyer.budget.patch" call.
5133 // Exactly one of *Budget or error will be non-nil. Any non-2xx status
5134 // code is an error. Response headers are in either
5135 // *Budget.ServerResponse.Header or (if a response was returned at all)
5136 // in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to
5137 // check whether the returned error was because http.StatusNotModified
5138 // was returned.
5139 func (c *BudgetPatchCall) Do(opts ...googleapi.CallOption) (*Budget, error) {
5140 gensupport.SetOptions(c.urlParams_, opts...)
5141 res, err := c.doRequest("json")
5142 if res != nil && res.StatusCode == http.StatusNotModified {
5143 if res.Body != nil {
5144 res.Body.Close()
5145 }
5146 return nil, &googleapi.Error{
5147 Code: res.StatusCode,
5148 Header: res.Header,
5149 }
5150 }
5151 if err != nil {
5152 return nil, err
5153 }
5154 defer googleapi.CloseBody(res)
5155 if err := googleapi.CheckResponse(res); err != nil {
5156 return nil, err
5157 }
5158 ret := &Budget{
5159 ServerResponse: googleapi.ServerResponse{
5160 Header: res.Header,
5161 HTTPStatusCode: res.StatusCode,
5162 },
5163 }
5164 target := &ret
5165 if err := gensupport.DecodeResponse(target, res); err != nil {
5166 return nil, err
5167 }
5168 return ret, nil
5169 // {
5170 // "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.",
5171 // "httpMethod": "PATCH",
5172 // "id": "adexchangebuyer.budget.patch",
5173 // "parameterOrder": [
5174 // "accountId",
5175 // "billingId"
5176 // ],
5177 // "parameters": {
5178 // "accountId": {
5179 // "description": "The account id associated with the budget being updated.",
5180 // "format": "int64",
5181 // "location": "path",
5182 // "required": true,
5183 // "type": "string"
5184 // },
5185 // "billingId": {
5186 // "description": "The billing id associated with the budget being updated.",
5187 // "format": "int64",
5188 // "location": "path",
5189 // "required": true,
5190 // "type": "string"
5191 // }
5192 // },
5193 // "path": "billinginfo/{accountId}/{billingId}",
5194 // "request": {
5195 // "$ref": "Budget"
5196 // },
5197 // "response": {
5198 // "$ref": "Budget"
5199 // },
5200 // "scopes": [
5201 // "https://www.googleapis.com/auth/adexchange.buyer"
5202 // ]
5203 // }
5204
5205 }
5206
5207 // method id "adexchangebuyer.budget.update":
5208
5209 type BudgetUpdateCall struct {
5210 s *Service
5211 accountId int64
5212 billingId int64
5213 budget *Budget
5214 urlParams_ gensupport.URLParams
5215 ctx_ context.Context
5216 header_ http.Header
5217 }
5218
5219 // Update: Updates the budget amount for the budget of the adgroup
5220 // specified by the accountId and billingId, with the budget amount in
5221 // the request.
5222 //
5223 // - accountId: The account id associated with the budget being updated.
5224 // - billingId: The billing id associated with the budget being updated.
5225 func (r *BudgetService) Update(accountId int64, billingId int64, budget *Budget) *BudgetUpdateCall {
5226 c := &BudgetUpdateCall{s: r.s, urlParams_: make(gensupport.URLParams)}
5227 c.accountId = accountId
5228 c.billingId = billingId
5229 c.budget = budget
5230 return c
5231 }
5232
5233 // Fields allows partial responses to be retrieved. See
5234 // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
5235 // for more information.
5236 func (c *BudgetUpdateCall) Fields(s ...googleapi.Field) *BudgetUpdateCall {
5237 c.urlParams_.Set("fields", googleapi.CombineFields(s))
5238 return c
5239 }
5240
5241 // Context sets the context to be used in this call's Do method. Any
5242 // pending HTTP request will be aborted if the provided context is
5243 // canceled.
5244 func (c *BudgetUpdateCall) Context(ctx context.Context) *BudgetUpdateCall {
5245 c.ctx_ = ctx
5246 return c
5247 }
5248
5249 // Header returns an http.Header that can be modified by the caller to
5250 // add HTTP headers to the request.
5251 func (c *BudgetUpdateCall) Header() http.Header {
5252 if c.header_ == nil {
5253 c.header_ = make(http.Header)
5254 }
5255 return c.header_
5256 }
5257
5258 func (c *BudgetUpdateCall) doRequest(alt string) (*http.Response, error) {
5259 reqHeaders := make(http.Header)
5260 reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/20210819")
5261 for k, v := range c.header_ {
5262 reqHeaders[k] = v
5263 }
5264 reqHeaders.Set("User-Agent", c.s.userAgent())
5265 var body io.Reader = nil
5266 body, err := googleapi.WithoutDataWrapper.JSONReader(c.budget)
5267 if err != nil {
5268 return nil, err
5269 }
5270 reqHeaders.Set("Content-Type", "application/json")
5271 c.urlParams_.Set("alt", alt)
5272 c.urlParams_.Set("prettyPrint", "false")
5273 urls := googleapi.ResolveRelative(c.s.BasePath, "billinginfo/{accountId}/{billingId}")
5274 urls += "?" + c.urlParams_.Encode()
5275 req, err := http.NewRequest("PUT", urls, body)
5276 if err != nil {
5277 return nil, err
5278 }
5279 req.Header = reqHeaders
5280 googleapi.Expand(req.URL, map[string]string{
5281 "accountId": strconv.FormatInt(c.accountId, 10),
5282 "billingId": strconv.FormatInt(c.billingId, 10),
5283 })
5284 return gensupport.SendRequest(c.ctx_, c.s.client, req)
5285 }
5286
5287 // Do executes the "adexchangebuyer.budget.update" call.
5288 // Exactly one of *Budget or error will be non-nil. Any non-2xx status
5289 // code is an error. Response headers are in either
5290 // *Budget.ServerResponse.Header or (if a response was returned at all)
5291 // in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to
5292 // check whether the returned error was because http.StatusNotModified
5293 // was returned.
5294 func (c *BudgetUpdateCall) Do(opts ...googleapi.CallOption) (*Budget, error) {
5295 gensupport.SetOptions(c.urlParams_, opts...)
5296 res, err := c.doRequest("json")
5297 if res != nil && res.StatusCode == http.StatusNotModified {
5298 if res.Body != nil {
5299 res.Body.Close()
5300 }
5301 return nil, &googleapi.Error{
5302 Code: res.StatusCode,
5303 Header: res.Header,
5304 }
5305 }
5306 if err != nil {
5307 return nil, err
5308 }
5309 defer googleapi.CloseBody(res)
5310 if err := googleapi.CheckResponse(res); err != nil {
5311 return nil, err
5312 }
5313 ret := &Budget{
5314 ServerResponse: googleapi.ServerResponse{
5315 Header: res.Header,
5316 HTTPStatusCode: res.StatusCode,
5317 },
5318 }
5319 target := &ret
5320 if err := gensupport.DecodeResponse(target, res); err != nil {
5321 return nil, err
5322 }
5323 return ret, nil
5324 // {
5325 // "description": "Updates the budget amount for the budget of the adgroup specified by the accountId and billingId, with the budget amount in the request.",
5326 // "httpMethod": "PUT",
5327 // "id": "adexchangebuyer.budget.update",
5328 // "parameterOrder": [
5329 // "accountId",
5330 // "billingId"
5331 // ],
5332 // "parameters": {
5333 // "accountId": {
5334 // "description": "The account id associated with the budget being updated.",
5335 // "format": "int64",
5336 // "location": "path",
5337 // "required": true,
5338 // "type": "string"
5339 // },
5340 // "billingId": {
5341 // "description": "The billing id associated with the budget being updated.",
5342 // "format": "int64",
5343 // "location": "path",
5344 // "required": true,
5345 // "type": "string"
5346 // }
5347 // },
5348 // "path": "billinginfo/{accountId}/{billingId}",
5349 // "request": {
5350 // "$ref": "Budget"
5351 // },
5352 // "response": {
5353 // "$ref": "Budget"
5354 // },
5355 // "scopes": [
5356 // "https://www.googleapis.com/auth/adexchange.buyer"
5357 // ]
5358 // }
5359
5360 }
5361
5362 // method id "adexchangebuyer.creatives.addDeal":
5363
5364 type CreativesAddDealCall struct {
5365 s *Service
5366 accountId int64
5367 buyerCreativeId string
5368 dealId int64
5369 urlParams_ gensupport.URLParams
5370 ctx_ context.Context
5371 header_ http.Header
5372 }
5373
5374 // AddDeal: Add a deal id association for the creative.
5375 //
5376 // - accountId: The id for the account that will serve this creative.
5377 // - buyerCreativeId: The buyer-specific id for this creative.
5378 // - dealId: The id of the deal id to associate with this creative.
5379 func (r *CreativesService) AddDeal(accountId int64, buyerCreativeId string, dealId int64) *CreativesAddDealCall {
5380 c := &CreativesAddDealCall{s: r.s, urlParams_: make(gensupport.URLParams)}
5381 c.accountId = accountId
5382 c.buyerCreativeId = buyerCreativeId
5383 c.dealId = dealId
5384 return c
5385 }
5386
5387 // Fields allows partial responses to be retrieved. See
5388 // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
5389 // for more information.
5390 func (c *CreativesAddDealCall) Fields(s ...googleapi.Field) *CreativesAddDealCall {
5391 c.urlParams_.Set("fields", googleapi.CombineFields(s))
5392 return c
5393 }
5394
5395 // Context sets the context to be used in this call's Do method. Any
5396 // pending HTTP request will be aborted if the provided context is
5397 // canceled.
5398 func (c *CreativesAddDealCall) Context(ctx context.Context) *CreativesAddDealCall {
5399 c.ctx_ = ctx
5400 return c
5401 }
5402
5403 // Header returns an http.Header that can be modified by the caller to
5404 // add HTTP headers to the request.
5405 func (c *CreativesAddDealCall) Header() http.Header {
5406 if c.header_ == nil {
5407 c.header_ = make(http.Header)
5408 }
5409 return c.header_
5410 }
5411
5412 func (c *CreativesAddDealCall) doRequest(alt string) (*http.Response, error) {
5413 reqHeaders := make(http.Header)
5414 reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/20210819")
5415 for k, v := range c.header_ {
5416 reqHeaders[k] = v
5417 }
5418 reqHeaders.Set("User-Agent", c.s.userAgent())
5419 var body io.Reader = nil
5420 c.urlParams_.Set("alt", alt)
5421 c.urlParams_.Set("prettyPrint", "false")
5422 urls := googleapi.ResolveRelative(c.s.BasePath, "creatives/{accountId}/{buyerCreativeId}/addDeal/{dealId}")
5423 urls += "?" + c.urlParams_.Encode()
5424 req, err := http.NewRequest("POST", urls, body)
5425 if err != nil {
5426 return nil, err
5427 }
5428 req.Header = reqHeaders
5429 googleapi.Expand(req.URL, map[string]string{
5430 "accountId": strconv.FormatInt(c.accountId, 10),
5431 "buyerCreativeId": c.buyerCreativeId,
5432 "dealId": strconv.FormatInt(c.dealId, 10),
5433 })
5434 return gensupport.SendRequest(c.ctx_, c.s.client, req)
5435 }
5436
5437 // Do executes the "adexchangebuyer.creatives.addDeal" call.
5438 func (c *CreativesAddDealCall) Do(opts ...googleapi.CallOption) error {
5439 gensupport.SetOptions(c.urlParams_, opts...)
5440 res, err := c.doRequest("json")
5441 if err != nil {
5442 return err
5443 }
5444 defer googleapi.CloseBody(res)
5445 if err := googleapi.CheckResponse(res); err != nil {
5446 return err
5447 }
5448 return nil
5449 // {
5450 // "description": "Add a deal id association for the creative.",
5451 // "httpMethod": "POST",
5452 // "id": "adexchangebuyer.creatives.addDeal",
5453 // "parameterOrder": [
5454 // "accountId",
5455 // "buyerCreativeId",
5456 // "dealId"
5457 // ],
5458 // "parameters": {
5459 // "accountId": {
5460 // "description": "The id for the account that will serve this creative.",
5461 // "format": "int32",
5462 // "location": "path",
5463 // "required": true,
5464 // "type": "integer"
5465 // },
5466 // "buyerCreativeId": {
5467 // "description": "The buyer-specific id for this creative.",
5468 // "location": "path",
5469 // "required": true,
5470 // "type": "string"
5471 // },
5472 // "dealId": {
5473 // "description": "The id of the deal id to associate with this creative.",
5474 // "format": "int64",
5475 // "location": "path",
5476 // "required": true,
5477 // "type": "string"
5478 // }
5479 // },
5480 // "path": "creatives/{accountId}/{buyerCreativeId}/addDeal/{dealId}",
5481 // "scopes": [
5482 // "https://www.googleapis.com/auth/adexchange.buyer"
5483 // ]
5484 // }
5485
5486 }
5487
5488 // method id "adexchangebuyer.creatives.get":
5489
5490 type CreativesGetCall struct {
5491 s *Service
5492 accountId int64
5493 buyerCreativeId string
5494 urlParams_ gensupport.URLParams
5495 ifNoneMatch_ string
5496 ctx_ context.Context
5497 header_ http.Header
5498 }
5499
5500 // Get: Gets the status for a single creative. A creative will be
5501 // available 30-40 minutes after submission.
5502 //
5503 // - accountId: The id for the account that will serve this creative.
5504 // - buyerCreativeId: The buyer-specific id for this creative.
5505 func (r *CreativesService) Get(accountId int64, buyerCreativeId string) *CreativesGetCall {
5506 c := &CreativesGetCall{s: r.s, urlParams_: make(gensupport.URLParams)}
5507 c.accountId = accountId
5508 c.buyerCreativeId = buyerCreativeId
5509 return c
5510 }
5511
5512 // Fields allows partial responses to be retrieved. See
5513 // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
5514 // for more information.
5515 func (c *CreativesGetCall) Fields(s ...googleapi.Field) *CreativesGetCall {
5516 c.urlParams_.Set("fields", googleapi.CombineFields(s))
5517 return c
5518 }
5519
5520 // IfNoneMatch sets the optional parameter which makes the operation
5521 // fail if the object's ETag matches the given value. This is useful for
5522 // getting updates only after the object has changed since the last
5523 // request. Use googleapi.IsNotModified to check whether the response
5524 // error from Do is the result of In-None-Match.
5525 func (c *CreativesGetCall) IfNoneMatch(entityTag string) *CreativesGetCall {
5526 c.ifNoneMatch_ = entityTag
5527 return c
5528 }
5529
5530 // Context sets the context to be used in this call's Do method. Any
5531 // pending HTTP request will be aborted if the provided context is
5532 // canceled.
5533 func (c *CreativesGetCall) Context(ctx context.Context) *CreativesGetCall {
5534 c.ctx_ = ctx
5535 return c
5536 }
5537
5538 // Header returns an http.Header that can be modified by the caller to
5539 // add HTTP headers to the request.
5540 func (c *CreativesGetCall) Header() http.Header {
5541 if c.header_ == nil {
5542 c.header_ = make(http.Header)
5543 }
5544 return c.header_
5545 }
5546
5547 func (c *CreativesGetCall) doRequest(alt string) (*http.Response, error) {
5548 reqHeaders := make(http.Header)
5549 reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/20210819")
5550 for k, v := range c.header_ {
5551 reqHeaders[k] = v
5552 }
5553 reqHeaders.Set("User-Agent", c.s.userAgent())
5554 if c.ifNoneMatch_ != "" {
5555 reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
5556 }
5557 var body io.Reader = nil
5558 c.urlParams_.Set("alt", alt)
5559 c.urlParams_.Set("prettyPrint", "false")
5560 urls := googleapi.ResolveRelative(c.s.BasePath, "creatives/{accountId}/{buyerCreativeId}")
5561 urls += "?" + c.urlParams_.Encode()
5562 req, err := http.NewRequest("GET", urls, body)
5563 if err != nil {
5564 return nil, err
5565 }
5566 req.Header = reqHeaders
5567 googleapi.Expand(req.URL, map[string]string{
5568 "accountId": strconv.FormatInt(c.accountId, 10),
5569 "buyerCreativeId": c.buyerCreativeId,
5570 })
5571 return gensupport.SendRequest(c.ctx_, c.s.client, req)
5572 }
5573
5574 // Do executes the "adexchangebuyer.creatives.get" call.
5575 // Exactly one of *Creative or error will be non-nil. Any non-2xx status
5576 // code is an error. Response headers are in either
5577 // *Creative.ServerResponse.Header or (if a response was returned at
5578 // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
5579 // to check whether the returned error was because
5580 // http.StatusNotModified was returned.
5581 func (c *CreativesGetCall) Do(opts ...googleapi.CallOption) (*Creative, error) {
5582 gensupport.SetOptions(c.urlParams_, opts...)
5583 res, err := c.doRequest("json")
5584 if res != nil && res.StatusCode == http.StatusNotModified {
5585 if res.Body != nil {
5586 res.Body.Close()
5587 }
5588 return nil, &googleapi.Error{
5589 Code: res.StatusCode,
5590 Header: res.Header,
5591 }
5592 }
5593 if err != nil {
5594 return nil, err
5595 }
5596 defer googleapi.CloseBody(res)
5597 if err := googleapi.CheckResponse(res); err != nil {
5598 return nil, err
5599 }
5600 ret := &Creative{
5601 ServerResponse: googleapi.ServerResponse{
5602 Header: res.Header,
5603 HTTPStatusCode: res.StatusCode,
5604 },
5605 }
5606 target := &ret
5607 if err := gensupport.DecodeResponse(target, res); err != nil {
5608 return nil, err
5609 }
5610 return ret, nil
5611 // {
5612 // "description": "Gets the status for a single creative. A creative will be available 30-40 minutes after submission.",
5613 // "httpMethod": "GET",
5614 // "id": "adexchangebuyer.creatives.get",
5615 // "parameterOrder": [
5616 // "accountId",
5617 // "buyerCreativeId"
5618 // ],
5619 // "parameters": {
5620 // "accountId": {
5621 // "description": "The id for the account that will serve this creative.",
5622 // "format": "int32",
5623 // "location": "path",
5624 // "required": true,
5625 // "type": "integer"
5626 // },
5627 // "buyerCreativeId": {
5628 // "description": "The buyer-specific id for this creative.",
5629 // "location": "path",
5630 // "required": true,
5631 // "type": "string"
5632 // }
5633 // },
5634 // "path": "creatives/{accountId}/{buyerCreativeId}",
5635 // "response": {
5636 // "$ref": "Creative"
5637 // },
5638 // "scopes": [
5639 // "https://www.googleapis.com/auth/adexchange.buyer"
5640 // ]
5641 // }
5642
5643 }
5644
5645 // method id "adexchangebuyer.creatives.insert":
5646
5647 type CreativesInsertCall struct {
5648 s *Service
5649 creative *Creative
5650 urlParams_ gensupport.URLParams
5651 ctx_ context.Context
5652 header_ http.Header
5653 }
5654
5655 // Insert: Submit a new creative.
5656 func (r *CreativesService) Insert(creative *Creative) *CreativesInsertCall {
5657 c := &CreativesInsertCall{s: r.s, urlParams_: make(gensupport.URLParams)}
5658 c.creative = creative
5659 return c
5660 }
5661
5662 // Fields allows partial responses to be retrieved. See
5663 // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
5664 // for more information.
5665 func (c *CreativesInsertCall) Fields(s ...googleapi.Field) *CreativesInsertCall {
5666 c.urlParams_.Set("fields", googleapi.CombineFields(s))
5667 return c
5668 }
5669
5670 // Context sets the context to be used in this call's Do method. Any
5671 // pending HTTP request will be aborted if the provided context is
5672 // canceled.
5673 func (c *CreativesInsertCall) Context(ctx context.Context) *CreativesInsertCall {
5674 c.ctx_ = ctx
5675 return c
5676 }
5677
5678 // Header returns an http.Header that can be modified by the caller to
5679 // add HTTP headers to the request.
5680 func (c *CreativesInsertCall) Header() http.Header {
5681 if c.header_ == nil {
5682 c.header_ = make(http.Header)
5683 }
5684 return c.header_
5685 }
5686
5687 func (c *CreativesInsertCall) doRequest(alt string) (*http.Response, error) {
5688 reqHeaders := make(http.Header)
5689 reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/20210819")
5690 for k, v := range c.header_ {
5691 reqHeaders[k] = v
5692 }
5693 reqHeaders.Set("User-Agent", c.s.userAgent())
5694 var body io.Reader = nil
5695 body, err := googleapi.WithoutDataWrapper.JSONReader(c.creative)
5696 if err != nil {
5697 return nil, err
5698 }
5699 reqHeaders.Set("Content-Type", "application/json")
5700 c.urlParams_.Set("alt", alt)
5701 c.urlParams_.Set("prettyPrint", "false")
5702 urls := googleapi.ResolveRelative(c.s.BasePath, "creatives")
5703 urls += "?" + c.urlParams_.Encode()
5704 req, err := http.NewRequest("POST", urls, body)
5705 if err != nil {
5706 return nil, err
5707 }
5708 req.Header = reqHeaders
5709 return gensupport.SendRequest(c.ctx_, c.s.client, req)
5710 }
5711
5712 // Do executes the "adexchangebuyer.creatives.insert" call.
5713 // Exactly one of *Creative or error will be non-nil. Any non-2xx status
5714 // code is an error. Response headers are in either
5715 // *Creative.ServerResponse.Header or (if a response was returned at
5716 // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
5717 // to check whether the returned error was because
5718 // http.StatusNotModified was returned.
5719 func (c *CreativesInsertCall) Do(opts ...googleapi.CallOption) (*Creative, error) {
5720 gensupport.SetOptions(c.urlParams_, opts...)
5721 res, err := c.doRequest("json")
5722 if res != nil && res.StatusCode == http.StatusNotModified {
5723 if res.Body != nil {
5724 res.Body.Close()
5725 }
5726 return nil, &googleapi.Error{
5727 Code: res.StatusCode,
5728 Header: res.Header,
5729 }
5730 }
5731 if err != nil {
5732 return nil, err
5733 }
5734 defer googleapi.CloseBody(res)
5735 if err := googleapi.CheckResponse(res); err != nil {
5736 return nil, err
5737 }
5738 ret := &Creative{
5739 ServerResponse: googleapi.ServerResponse{
5740 Header: res.Header,
5741 HTTPStatusCode: res.StatusCode,
5742 },
5743 }
5744 target := &ret
5745 if err := gensupport.DecodeResponse(target, res); err != nil {
5746 return nil, err
5747 }
5748 return ret, nil
5749 // {
5750 // "description": "Submit a new creative.",
5751 // "httpMethod": "POST",
5752 // "id": "adexchangebuyer.creatives.insert",
5753 // "path": "creatives",
5754 // "request": {
5755 // "$ref": "Creative"
5756 // },
5757 // "response": {
5758 // "$ref": "Creative"
5759 // },
5760 // "scopes": [
5761 // "https://www.googleapis.com/auth/adexchange.buyer"
5762 // ]
5763 // }
5764
5765 }
5766
5767 // method id "adexchangebuyer.creatives.list":
5768
5769 type CreativesListCall struct {
5770 s *Service
5771 urlParams_ gensupport.URLParams
5772 ifNoneMatch_ string
5773 ctx_ context.Context
5774 header_ http.Header
5775 }
5776
5777 // List: Retrieves a list of the authenticated user's active creatives.
5778 // A creative will be available 30-40 minutes after submission.
5779 func (r *CreativesService) List() *CreativesListCall {
5780 c := &CreativesListCall{s: r.s, urlParams_: make(gensupport.URLParams)}
5781 return c
5782 }
5783
5784 // AccountId sets the optional parameter "accountId": When specified,
5785 // only creatives for the given account ids are returned.
5786 func (c *CreativesListCall) AccountId(accountId ...int64) *CreativesListCall {
5787 var accountId_ []string
5788 for _, v := range accountId {
5789 accountId_ = append(accountId_, fmt.Sprint(v))
5790 }
5791 c.urlParams_.SetMulti("accountId", accountId_)
5792 return c
5793 }
5794
5795 // BuyerCreativeId sets the optional parameter "buyerCreativeId": When
5796 // specified, only creatives for the given buyer creative ids are
5797 // returned.
5798 func (c *CreativesListCall) BuyerCreativeId(buyerCreativeId ...string) *CreativesListCall {
5799 c.urlParams_.SetMulti("buyerCreativeId", append([]string{}, buyerCreativeId...))
5800 return c
5801 }
5802
5803 // DealsStatusFilter sets the optional parameter "dealsStatusFilter":
5804 // When specified, only creatives having the given deals status are
5805 // returned.
5806 //
5807 // Possible values:
5808 //
5809 // "approved" - Creatives which have been approved for serving on
5810 //
5811 // deals.
5812 //
5813 // "conditionally_approved" - Creatives which have been conditionally
5814 //
5815 // approved for serving on deals.
5816 //
5817 // "disapproved" - Creatives which have been disapproved for serving
5818 //
5819 // on deals.
5820 //
5821 // "not_checked" - Creatives whose deals status is not yet checked.
5822 func (c *CreativesListCall) DealsStatusFilter(dealsStatusFilter string) *CreativesListCall {
5823 c.urlParams_.Set("dealsStatusFilter", dealsStatusFilter)
5824 return c
5825 }
5826
5827 // MaxResults sets the optional parameter "maxResults": Maximum number
5828 // of entries returned on one result page. If not set, the default is
5829 // 100.
5830 func (c *CreativesListCall) MaxResults(maxResults int64) *CreativesListCall {
5831 c.urlParams_.Set("maxResults", fmt.Sprint(maxResults))
5832 return c
5833 }
5834
5835 // OpenAuctionStatusFilter sets the optional parameter
5836 // "openAuctionStatusFilter": When specified, only creatives having the
5837 // given open auction status are returned.
5838 //
5839 // Possible values:
5840 //
5841 // "approved" - Creatives which have been approved for serving on the
5842 //
5843 // open auction.
5844 //
5845 // "conditionally_approved" - Creatives which have been conditionally
5846 //
5847 // approved for serving on the open auction.
5848 //
5849 // "disapproved" - Creatives which have been disapproved for serving
5850 //
5851 // on the open auction.
5852 //
5853 // "not_checked" - Creatives whose open auction status is not yet
5854 //
5855 // checked.
5856 func (c *CreativesListCall) OpenAuctionStatusFilter(openAuctionStatusFilter string) *CreativesListCall {
5857 c.urlParams_.Set("openAuctionStatusFilter", openAuctionStatusFilter)
5858 return c
5859 }
5860
5861 // PageToken sets the optional parameter "pageToken": A continuation
5862 // token, used to page through ad clients. To retrieve the next page,
5863 // set this parameter to the value of "nextPageToken" from the previous
5864 // response.
5865 func (c *CreativesListCall) PageToken(pageToken string) *CreativesListCall {
5866 c.urlParams_.Set("pageToken", pageToken)
5867 return c
5868 }
5869
5870 // Fields allows partial responses to be retrieved. See
5871 // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
5872 // for more information.
5873 func (c *CreativesListCall) Fields(s ...googleapi.Field) *CreativesListCall {
5874 c.urlParams_.Set("fields", googleapi.CombineFields(s))
5875 return c
5876 }
5877
5878 // IfNoneMatch sets the optional parameter which makes the operation
5879 // fail if the object's ETag matches the given value. This is useful for
5880 // getting updates only after the object has changed since the last
5881 // request. Use googleapi.IsNotModified to check whether the response
5882 // error from Do is the result of In-None-Match.
5883 func (c *CreativesListCall) IfNoneMatch(entityTag string) *CreativesListCall {
5884 c.ifNoneMatch_ = entityTag
5885 return c
5886 }
5887
5888 // Context sets the context to be used in this call's Do method. Any
5889 // pending HTTP request will be aborted if the provided context is
5890 // canceled.
5891 func (c *CreativesListCall) Context(ctx context.Context) *CreativesListCall {
5892 c.ctx_ = ctx
5893 return c
5894 }
5895
5896 // Header returns an http.Header that can be modified by the caller to
5897 // add HTTP headers to the request.
5898 func (c *CreativesListCall) Header() http.Header {
5899 if c.header_ == nil {
5900 c.header_ = make(http.Header)
5901 }
5902 return c.header_
5903 }
5904
5905 func (c *CreativesListCall) doRequest(alt string) (*http.Response, error) {
5906 reqHeaders := make(http.Header)
5907 reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/20210819")
5908 for k, v := range c.header_ {
5909 reqHeaders[k] = v
5910 }
5911 reqHeaders.Set("User-Agent", c.s.userAgent())
5912 if c.ifNoneMatch_ != "" {
5913 reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
5914 }
5915 var body io.Reader = nil
5916 c.urlParams_.Set("alt", alt)
5917 c.urlParams_.Set("prettyPrint", "false")
5918 urls := googleapi.ResolveRelative(c.s.BasePath, "creatives")
5919 urls += "?" + c.urlParams_.Encode()
5920 req, err := http.NewRequest("GET", urls, body)
5921 if err != nil {
5922 return nil, err
5923 }
5924 req.Header = reqHeaders
5925 return gensupport.SendRequest(c.ctx_, c.s.client, req)
5926 }
5927
5928 // Do executes the "adexchangebuyer.creatives.list" call.
5929 // Exactly one of *CreativesList or error will be non-nil. Any non-2xx
5930 // status code is an error. Response headers are in either
5931 // *CreativesList.ServerResponse.Header or (if a response was returned
5932 // at all) in error.(*googleapi.Error).Header. Use
5933 // googleapi.IsNotModified to check whether the returned error was
5934 // because http.StatusNotModified was returned.
5935 func (c *CreativesListCall) Do(opts ...googleapi.CallOption) (*CreativesList, error) {
5936 gensupport.SetOptions(c.urlParams_, opts...)
5937 res, err := c.doRequest("json")
5938 if res != nil && res.StatusCode == http.StatusNotModified {
5939 if res.Body != nil {
5940 res.Body.Close()
5941 }
5942 return nil, &googleapi.Error{
5943 Code: res.StatusCode,
5944 Header: res.Header,
5945 }
5946 }
5947 if err != nil {
5948 return nil, err
5949 }
5950 defer googleapi.CloseBody(res)
5951 if err := googleapi.CheckResponse(res); err != nil {
5952 return nil, err
5953 }
5954 ret := &CreativesList{
5955 ServerResponse: googleapi.ServerResponse{
5956 Header: res.Header,
5957 HTTPStatusCode: res.StatusCode,
5958 },
5959 }
5960 target := &ret
5961 if err := gensupport.DecodeResponse(target, res); err != nil {
5962 return nil, err
5963 }
5964 return ret, nil
5965 // {
5966 // "description": "Retrieves a list of the authenticated user's active creatives. A creative will be available 30-40 minutes after submission.",
5967 // "httpMethod": "GET",
5968 // "id": "adexchangebuyer.creatives.list",
5969 // "parameters": {
5970 // "accountId": {
5971 // "description": "When specified, only creatives for the given account ids are returned.",
5972 // "format": "int32",
5973 // "location": "query",
5974 // "repeated": true,
5975 // "type": "integer"
5976 // },
5977 // "buyerCreativeId": {
5978 // "description": "When specified, only creatives for the given buyer creative ids are returned.",
5979 // "location": "query",
5980 // "repeated": true,
5981 // "type": "string"
5982 // },
5983 // "dealsStatusFilter": {
5984 // "description": "When specified, only creatives having the given deals status are returned.",
5985 // "enum": [
5986 // "approved",
5987 // "conditionally_approved",
5988 // "disapproved",
5989 // "not_checked"
5990 // ],
5991 // "enumDescriptions": [
5992 // "Creatives which have been approved for serving on deals.",
5993 // "Creatives which have been conditionally approved for serving on deals.",
5994 // "Creatives which have been disapproved for serving on deals.",
5995 // "Creatives whose deals status is not yet checked."
5996 // ],
5997 // "location": "query",
5998 // "type": "string"
5999 // },
6000 // "maxResults": {
6001 // "description": "Maximum number of entries returned on one result page. If not set, the default is 100. Optional.",
6002 // "format": "uint32",
6003 // "location": "query",
6004 // "maximum": "1000",
6005 // "minimum": "1",
6006 // "type": "integer"
6007 // },
6008 // "openAuctionStatusFilter": {
6009 // "description": "When specified, only creatives having the given open auction status are returned.",
6010 // "enum": [
6011 // "approved",
6012 // "conditionally_approved",
6013 // "disapproved",
6014 // "not_checked"
6015 // ],
6016 // "enumDescriptions": [
6017 // "Creatives which have been approved for serving on the open auction.",
6018 // "Creatives which have been conditionally approved for serving on the open auction.",
6019 // "Creatives which have been disapproved for serving on the open auction.",
6020 // "Creatives whose open auction status is not yet checked."
6021 // ],
6022 // "location": "query",
6023 // "type": "string"
6024 // },
6025 // "pageToken": {
6026 // "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.",
6027 // "location": "query",
6028 // "type": "string"
6029 // }
6030 // },
6031 // "path": "creatives",
6032 // "response": {
6033 // "$ref": "CreativesList"
6034 // },
6035 // "scopes": [
6036 // "https://www.googleapis.com/auth/adexchange.buyer"
6037 // ]
6038 // }
6039
6040 }
6041
6042 // Pages invokes f for each page of results.
6043 // A non-nil error returned from f will halt the iteration.
6044 // The provided context supersedes any context provided to the Context method.
6045 func (c *CreativesListCall) Pages(ctx context.Context, f func(*CreativesList) error) error {
6046 c.ctx_ = ctx
6047 defer c.PageToken(c.urlParams_.Get("pageToken")) // reset paging to original point
6048 for {
6049 x, err := c.Do()
6050 if err != nil {
6051 return err
6052 }
6053 if err := f(x); err != nil {
6054 return err
6055 }
6056 if x.NextPageToken == "" {
6057 return nil
6058 }
6059 c.PageToken(x.NextPageToken)
6060 }
6061 }
6062
6063 // method id "adexchangebuyer.creatives.listDeals":
6064
6065 type CreativesListDealsCall struct {
6066 s *Service
6067 accountId int64
6068 buyerCreativeId string
6069 urlParams_ gensupport.URLParams
6070 ifNoneMatch_ string
6071 ctx_ context.Context
6072 header_ http.Header
6073 }
6074
6075 // ListDeals: Lists the external deal ids associated with the creative.
6076 //
6077 // - accountId: The id for the account that will serve this creative.
6078 // - buyerCreativeId: The buyer-specific id for this creative.
6079 func (r *CreativesService) ListDeals(accountId int64, buyerCreativeId string) *CreativesListDealsCall {
6080 c := &CreativesListDealsCall{s: r.s, urlParams_: make(gensupport.URLParams)}
6081 c.accountId = accountId
6082 c.buyerCreativeId = buyerCreativeId
6083 return c
6084 }
6085
6086 // Fields allows partial responses to be retrieved. See
6087 // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
6088 // for more information.
6089 func (c *CreativesListDealsCall) Fields(s ...googleapi.Field) *CreativesListDealsCall {
6090 c.urlParams_.Set("fields", googleapi.CombineFields(s))
6091 return c
6092 }
6093
6094 // IfNoneMatch sets the optional parameter which makes the operation
6095 // fail if the object's ETag matches the given value. This is useful for
6096 // getting updates only after the object has changed since the last
6097 // request. Use googleapi.IsNotModified to check whether the response
6098 // error from Do is the result of In-None-Match.
6099 func (c *CreativesListDealsCall) IfNoneMatch(entityTag string) *CreativesListDealsCall {
6100 c.ifNoneMatch_ = entityTag
6101 return c
6102 }
6103
6104 // Context sets the context to be used in this call's Do method. Any
6105 // pending HTTP request will be aborted if the provided context is
6106 // canceled.
6107 func (c *CreativesListDealsCall) Context(ctx context.Context) *CreativesListDealsCall {
6108 c.ctx_ = ctx
6109 return c
6110 }
6111
6112 // Header returns an http.Header that can be modified by the caller to
6113 // add HTTP headers to the request.
6114 func (c *CreativesListDealsCall) Header() http.Header {
6115 if c.header_ == nil {
6116 c.header_ = make(http.Header)
6117 }
6118 return c.header_
6119 }
6120
6121 func (c *CreativesListDealsCall) doRequest(alt string) (*http.Response, error) {
6122 reqHeaders := make(http.Header)
6123 reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/20210819")
6124 for k, v := range c.header_ {
6125 reqHeaders[k] = v
6126 }
6127 reqHeaders.Set("User-Agent", c.s.userAgent())
6128 if c.ifNoneMatch_ != "" {
6129 reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
6130 }
6131 var body io.Reader = nil
6132 c.urlParams_.Set("alt", alt)
6133 c.urlParams_.Set("prettyPrint", "false")
6134 urls := googleapi.ResolveRelative(c.s.BasePath, "creatives/{accountId}/{buyerCreativeId}/listDeals")
6135 urls += "?" + c.urlParams_.Encode()
6136 req, err := http.NewRequest("GET", urls, body)
6137 if err != nil {
6138 return nil, err
6139 }
6140 req.Header = reqHeaders
6141 googleapi.Expand(req.URL, map[string]string{
6142 "accountId": strconv.FormatInt(c.accountId, 10),
6143 "buyerCreativeId": c.buyerCreativeId,
6144 })
6145 return gensupport.SendRequest(c.ctx_, c.s.client, req)
6146 }
6147
6148 // Do executes the "adexchangebuyer.creatives.listDeals" call.
6149 // Exactly one of *CreativeDealIds or error will be non-nil. Any non-2xx
6150 // status code is an error. Response headers are in either
6151 // *CreativeDealIds.ServerResponse.Header or (if a response was returned
6152 // at all) in error.(*googleapi.Error).Header. Use
6153 // googleapi.IsNotModified to check whether the returned error was
6154 // because http.StatusNotModified was returned.
6155 func (c *CreativesListDealsCall) Do(opts ...googleapi.CallOption) (*CreativeDealIds, error) {
6156 gensupport.SetOptions(c.urlParams_, opts...)
6157 res, err := c.doRequest("json")
6158 if res != nil && res.StatusCode == http.StatusNotModified {
6159 if res.Body != nil {
6160 res.Body.Close()
6161 }
6162 return nil, &googleapi.Error{
6163 Code: res.StatusCode,
6164 Header: res.Header,
6165 }
6166 }
6167 if err != nil {
6168 return nil, err
6169 }
6170 defer googleapi.CloseBody(res)
6171 if err := googleapi.CheckResponse(res); err != nil {
6172 return nil, err
6173 }
6174 ret := &CreativeDealIds{
6175 ServerResponse: googleapi.ServerResponse{
6176 Header: res.Header,
6177 HTTPStatusCode: res.StatusCode,
6178 },
6179 }
6180 target := &ret
6181 if err := gensupport.DecodeResponse(target, res); err != nil {
6182 return nil, err
6183 }
6184 return ret, nil
6185 // {
6186 // "description": "Lists the external deal ids associated with the creative.",
6187 // "httpMethod": "GET",
6188 // "id": "adexchangebuyer.creatives.listDeals",
6189 // "parameterOrder": [
6190 // "accountId",
6191 // "buyerCreativeId"
6192 // ],
6193 // "parameters": {
6194 // "accountId": {
6195 // "description": "The id for the account that will serve this creative.",
6196 // "format": "int32",
6197 // "location": "path",
6198 // "required": true,
6199 // "type": "integer"
6200 // },
6201 // "buyerCreativeId": {
6202 // "description": "The buyer-specific id for this creative.",
6203 // "location": "path",
6204 // "required": true,
6205 // "type": "string"
6206 // }
6207 // },
6208 // "path": "creatives/{accountId}/{buyerCreativeId}/listDeals",
6209 // "response": {
6210 // "$ref": "CreativeDealIds"
6211 // },
6212 // "scopes": [
6213 // "https://www.googleapis.com/auth/adexchange.buyer"
6214 // ]
6215 // }
6216
6217 }
6218
6219 // method id "adexchangebuyer.creatives.removeDeal":
6220
6221 type CreativesRemoveDealCall struct {
6222 s *Service
6223 accountId int64
6224 buyerCreativeId string
6225 dealId int64
6226 urlParams_ gensupport.URLParams
6227 ctx_ context.Context
6228 header_ http.Header
6229 }
6230
6231 // RemoveDeal: Remove a deal id associated with the creative.
6232 //
6233 // - accountId: The id for the account that will serve this creative.
6234 // - buyerCreativeId: The buyer-specific id for this creative.
6235 // - dealId: The id of the deal id to disassociate with this creative.
6236 func (r *CreativesService) RemoveDeal(accountId int64, buyerCreativeId string, dealId int64) *CreativesRemoveDealCall {
6237 c := &CreativesRemoveDealCall{s: r.s, urlParams_: make(gensupport.URLParams)}
6238 c.accountId = accountId
6239 c.buyerCreativeId = buyerCreativeId
6240 c.dealId = dealId
6241 return c
6242 }
6243
6244 // Fields allows partial responses to be retrieved. See
6245 // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
6246 // for more information.
6247 func (c *CreativesRemoveDealCall) Fields(s ...googleapi.Field) *CreativesRemoveDealCall {
6248 c.urlParams_.Set("fields", googleapi.CombineFields(s))
6249 return c
6250 }
6251
6252 // Context sets the context to be used in this call's Do method. Any
6253 // pending HTTP request will be aborted if the provided context is
6254 // canceled.
6255 func (c *CreativesRemoveDealCall) Context(ctx context.Context) *CreativesRemoveDealCall {
6256 c.ctx_ = ctx
6257 return c
6258 }
6259
6260 // Header returns an http.Header that can be modified by the caller to
6261 // add HTTP headers to the request.
6262 func (c *CreativesRemoveDealCall) Header() http.Header {
6263 if c.header_ == nil {
6264 c.header_ = make(http.Header)
6265 }
6266 return c.header_
6267 }
6268
6269 func (c *CreativesRemoveDealCall) doRequest(alt string) (*http.Response, error) {
6270 reqHeaders := make(http.Header)
6271 reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/20210819")
6272 for k, v := range c.header_ {
6273 reqHeaders[k] = v
6274 }
6275 reqHeaders.Set("User-Agent", c.s.userAgent())
6276 var body io.Reader = nil
6277 c.urlParams_.Set("alt", alt)
6278 c.urlParams_.Set("prettyPrint", "false")
6279 urls := googleapi.ResolveRelative(c.s.BasePath, "creatives/{accountId}/{buyerCreativeId}/removeDeal/{dealId}")
6280 urls += "?" + c.urlParams_.Encode()
6281 req, err := http.NewRequest("POST", urls, body)
6282 if err != nil {
6283 return nil, err
6284 }
6285 req.Header = reqHeaders
6286 googleapi.Expand(req.URL, map[string]string{
6287 "accountId": strconv.FormatInt(c.accountId, 10),
6288 "buyerCreativeId": c.buyerCreativeId,
6289 "dealId": strconv.FormatInt(c.dealId, 10),
6290 })
6291 return gensupport.SendRequest(c.ctx_, c.s.client, req)
6292 }
6293
6294 // Do executes the "adexchangebuyer.creatives.removeDeal" call.
6295 func (c *CreativesRemoveDealCall) Do(opts ...googleapi.CallOption) error {
6296 gensupport.SetOptions(c.urlParams_, opts...)
6297 res, err := c.doRequest("json")
6298 if err != nil {
6299 return err
6300 }
6301 defer googleapi.CloseBody(res)
6302 if err := googleapi.CheckResponse(res); err != nil {
6303 return err
6304 }
6305 return nil
6306 // {
6307 // "description": "Remove a deal id associated with the creative.",
6308 // "httpMethod": "POST",
6309 // "id": "adexchangebuyer.creatives.removeDeal",
6310 // "parameterOrder": [
6311 // "accountId",
6312 // "buyerCreativeId",
6313 // "dealId"
6314 // ],
6315 // "parameters": {
6316 // "accountId": {
6317 // "description": "The id for the account that will serve this creative.",
6318 // "format": "int32",
6319 // "location": "path",
6320 // "required": true,
6321 // "type": "integer"
6322 // },
6323 // "buyerCreativeId": {
6324 // "description": "The buyer-specific id for this creative.",
6325 // "location": "path",
6326 // "required": true,
6327 // "type": "string"
6328 // },
6329 // "dealId": {
6330 // "description": "The id of the deal id to disassociate with this creative.",
6331 // "format": "int64",
6332 // "location": "path",
6333 // "required": true,
6334 // "type": "string"
6335 // }
6336 // },
6337 // "path": "creatives/{accountId}/{buyerCreativeId}/removeDeal/{dealId}",
6338 // "scopes": [
6339 // "https://www.googleapis.com/auth/adexchange.buyer"
6340 // ]
6341 // }
6342
6343 }
6344
6345 // method id "adexchangebuyer.marketplacedeals.delete":
6346
6347 type MarketplacedealsDeleteCall struct {
6348 s *Service
6349 proposalId string
6350 deleteorderdealsrequest *DeleteOrderDealsRequest
6351 urlParams_ gensupport.URLParams
6352 ctx_ context.Context
6353 header_ http.Header
6354 }
6355
6356 // Delete: Delete the specified deals from the proposal
6357 //
6358 // - proposalId: The proposalId to delete deals from.
6359 func (r *MarketplacedealsService) Delete(proposalId string, deleteorderdealsrequest *DeleteOrderDealsRequest) *MarketplacedealsDeleteCall {
6360 c := &MarketplacedealsDeleteCall{s: r.s, urlParams_: make(gensupport.URLParams)}
6361 c.proposalId = proposalId
6362 c.deleteorderdealsrequest = deleteorderdealsrequest
6363 return c
6364 }
6365
6366 // Fields allows partial responses to be retrieved. See
6367 // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
6368 // for more information.
6369 func (c *MarketplacedealsDeleteCall) Fields(s ...googleapi.Field) *MarketplacedealsDeleteCall {
6370 c.urlParams_.Set("fields", googleapi.CombineFields(s))
6371 return c
6372 }
6373
6374 // Context sets the context to be used in this call's Do method. Any
6375 // pending HTTP request will be aborted if the provided context is
6376 // canceled.
6377 func (c *MarketplacedealsDeleteCall) Context(ctx context.Context) *MarketplacedealsDeleteCall {
6378 c.ctx_ = ctx
6379 return c
6380 }
6381
6382 // Header returns an http.Header that can be modified by the caller to
6383 // add HTTP headers to the request.
6384 func (c *MarketplacedealsDeleteCall) Header() http.Header {
6385 if c.header_ == nil {
6386 c.header_ = make(http.Header)
6387 }
6388 return c.header_
6389 }
6390
6391 func (c *MarketplacedealsDeleteCall) doRequest(alt string) (*http.Response, error) {
6392 reqHeaders := make(http.Header)
6393 reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/20210819")
6394 for k, v := range c.header_ {
6395 reqHeaders[k] = v
6396 }
6397 reqHeaders.Set("User-Agent", c.s.userAgent())
6398 var body io.Reader = nil
6399 body, err := googleapi.WithoutDataWrapper.JSONReader(c.deleteorderdealsrequest)
6400 if err != nil {
6401 return nil, err
6402 }
6403 reqHeaders.Set("Content-Type", "application/json")
6404 c.urlParams_.Set("alt", alt)
6405 c.urlParams_.Set("prettyPrint", "false")
6406 urls := googleapi.ResolveRelative(c.s.BasePath, "proposals/{proposalId}/deals/delete")
6407 urls += "?" + c.urlParams_.Encode()
6408 req, err := http.NewRequest("POST", urls, body)
6409 if err != nil {
6410 return nil, err
6411 }
6412 req.Header = reqHeaders
6413 googleapi.Expand(req.URL, map[string]string{
6414 "proposalId": c.proposalId,
6415 })
6416 return gensupport.SendRequest(c.ctx_, c.s.client, req)
6417 }
6418
6419 // Do executes the "adexchangebuyer.marketplacedeals.delete" call.
6420 // Exactly one of *DeleteOrderDealsResponse or error will be non-nil.
6421 // Any non-2xx status code is an error. Response headers are in either
6422 // *DeleteOrderDealsResponse.ServerResponse.Header or (if a response was
6423 // returned at all) in error.(*googleapi.Error).Header. Use
6424 // googleapi.IsNotModified to check whether the returned error was
6425 // because http.StatusNotModified was returned.
6426 func (c *MarketplacedealsDeleteCall) Do(opts ...googleapi.CallOption) (*DeleteOrderDealsResponse, error) {
6427 gensupport.SetOptions(c.urlParams_, opts...)
6428 res, err := c.doRequest("json")
6429 if res != nil && res.StatusCode == http.StatusNotModified {
6430 if res.Body != nil {
6431 res.Body.Close()
6432 }
6433 return nil, &googleapi.Error{
6434 Code: res.StatusCode,
6435 Header: res.Header,
6436 }
6437 }
6438 if err != nil {
6439 return nil, err
6440 }
6441 defer googleapi.CloseBody(res)
6442 if err := googleapi.CheckResponse(res); err != nil {
6443 return nil, err
6444 }
6445 ret := &DeleteOrderDealsResponse{
6446 ServerResponse: googleapi.ServerResponse{
6447 Header: res.Header,
6448 HTTPStatusCode: res.StatusCode,
6449 },
6450 }
6451 target := &ret
6452 if err := gensupport.DecodeResponse(target, res); err != nil {
6453 return nil, err
6454 }
6455 return ret, nil
6456 // {
6457 // "description": "Delete the specified deals from the proposal",
6458 // "httpMethod": "POST",
6459 // "id": "adexchangebuyer.marketplacedeals.delete",
6460 // "parameterOrder": [
6461 // "proposalId"
6462 // ],
6463 // "parameters": {
6464 // "proposalId": {
6465 // "description": "The proposalId to delete deals from.",
6466 // "location": "path",
6467 // "required": true,
6468 // "type": "string"
6469 // }
6470 // },
6471 // "path": "proposals/{proposalId}/deals/delete",
6472 // "request": {
6473 // "$ref": "DeleteOrderDealsRequest"
6474 // },
6475 // "response": {
6476 // "$ref": "DeleteOrderDealsResponse"
6477 // },
6478 // "scopes": [
6479 // "https://www.googleapis.com/auth/adexchange.buyer"
6480 // ]
6481 // }
6482
6483 }
6484
6485 // method id "adexchangebuyer.marketplacedeals.insert":
6486
6487 type MarketplacedealsInsertCall struct {
6488 s *Service
6489 proposalId string
6490 addorderdealsrequest *AddOrderDealsRequest
6491 urlParams_ gensupport.URLParams
6492 ctx_ context.Context
6493 header_ http.Header
6494 }
6495
6496 // Insert: Add new deals for the specified proposal
6497 //
6498 // - proposalId: proposalId for which deals need to be added.
6499 func (r *MarketplacedealsService) Insert(proposalId string, addorderdealsrequest *AddOrderDealsRequest) *MarketplacedealsInsertCall {
6500 c := &MarketplacedealsInsertCall{s: r.s, urlParams_: make(gensupport.URLParams)}
6501 c.proposalId = proposalId
6502 c.addorderdealsrequest = addorderdealsrequest
6503 return c
6504 }
6505
6506 // Fields allows partial responses to be retrieved. See
6507 // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
6508 // for more information.
6509 func (c *MarketplacedealsInsertCall) Fields(s ...googleapi.Field) *MarketplacedealsInsertCall {
6510 c.urlParams_.Set("fields", googleapi.CombineFields(s))
6511 return c
6512 }
6513
6514 // Context sets the context to be used in this call's Do method. Any
6515 // pending HTTP request will be aborted if the provided context is
6516 // canceled.
6517 func (c *MarketplacedealsInsertCall) Context(ctx context.Context) *MarketplacedealsInsertCall {
6518 c.ctx_ = ctx
6519 return c
6520 }
6521
6522 // Header returns an http.Header that can be modified by the caller to
6523 // add HTTP headers to the request.
6524 func (c *MarketplacedealsInsertCall) Header() http.Header {
6525 if c.header_ == nil {
6526 c.header_ = make(http.Header)
6527 }
6528 return c.header_
6529 }
6530
6531 func (c *MarketplacedealsInsertCall) doRequest(alt string) (*http.Response, error) {
6532 reqHeaders := make(http.Header)
6533 reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/20210819")
6534 for k, v := range c.header_ {
6535 reqHeaders[k] = v
6536 }
6537 reqHeaders.Set("User-Agent", c.s.userAgent())
6538 var body io.Reader = nil
6539 body, err := googleapi.WithoutDataWrapper.JSONReader(c.addorderdealsrequest)
6540 if err != nil {
6541 return nil, err
6542 }
6543 reqHeaders.Set("Content-Type", "application/json")
6544 c.urlParams_.Set("alt", alt)
6545 c.urlParams_.Set("prettyPrint", "false")
6546 urls := googleapi.ResolveRelative(c.s.BasePath, "proposals/{proposalId}/deals/insert")
6547 urls += "?" + c.urlParams_.Encode()
6548 req, err := http.NewRequest("POST", urls, body)
6549 if err != nil {
6550 return nil, err
6551 }
6552 req.Header = reqHeaders
6553 googleapi.Expand(req.URL, map[string]string{
6554 "proposalId": c.proposalId,
6555 })
6556 return gensupport.SendRequest(c.ctx_, c.s.client, req)
6557 }
6558
6559 // Do executes the "adexchangebuyer.marketplacedeals.insert" call.
6560 // Exactly one of *AddOrderDealsResponse or error will be non-nil. Any
6561 // non-2xx status code is an error. Response headers are in either
6562 // *AddOrderDealsResponse.ServerResponse.Header or (if a response was
6563 // returned at all) in error.(*googleapi.Error).Header. Use
6564 // googleapi.IsNotModified to check whether the returned error was
6565 // because http.StatusNotModified was returned.
6566 func (c *MarketplacedealsInsertCall) Do(opts ...googleapi.CallOption) (*AddOrderDealsResponse, error) {
6567 gensupport.SetOptions(c.urlParams_, opts...)
6568 res, err := c.doRequest("json")
6569 if res != nil && res.StatusCode == http.StatusNotModified {
6570 if res.Body != nil {
6571 res.Body.Close()
6572 }
6573 return nil, &googleapi.Error{
6574 Code: res.StatusCode,
6575 Header: res.Header,
6576 }
6577 }
6578 if err != nil {
6579 return nil, err
6580 }
6581 defer googleapi.CloseBody(res)
6582 if err := googleapi.CheckResponse(res); err != nil {
6583 return nil, err
6584 }
6585 ret := &AddOrderDealsResponse{
6586 ServerResponse: googleapi.ServerResponse{
6587 Header: res.Header,
6588 HTTPStatusCode: res.StatusCode,
6589 },
6590 }
6591 target := &ret
6592 if err := gensupport.DecodeResponse(target, res); err != nil {
6593 return nil, err
6594 }
6595 return ret, nil
6596 // {
6597 // "description": "Add new deals for the specified proposal",
6598 // "httpMethod": "POST",
6599 // "id": "adexchangebuyer.marketplacedeals.insert",
6600 // "parameterOrder": [
6601 // "proposalId"
6602 // ],
6603 // "parameters": {
6604 // "proposalId": {
6605 // "description": "proposalId for which deals need to be added.",
6606 // "location": "path",
6607 // "required": true,
6608 // "type": "string"
6609 // }
6610 // },
6611 // "path": "proposals/{proposalId}/deals/insert",
6612 // "request": {
6613 // "$ref": "AddOrderDealsRequest"
6614 // },
6615 // "response": {
6616 // "$ref": "AddOrderDealsResponse"
6617 // },
6618 // "scopes": [
6619 // "https://www.googleapis.com/auth/adexchange.buyer"
6620 // ]
6621 // }
6622
6623 }
6624
6625 // method id "adexchangebuyer.marketplacedeals.list":
6626
6627 type MarketplacedealsListCall struct {
6628 s *Service
6629 proposalId string
6630 urlParams_ gensupport.URLParams
6631 ifNoneMatch_ string
6632 ctx_ context.Context
6633 header_ http.Header
6634 }
6635
6636 // List: List all the deals for a given proposal
6637 //
6638 // - proposalId: The proposalId to get deals for. To search across all
6639 // proposals specify order_id = '-' as part of the URL.
6640 func (r *MarketplacedealsService) List(proposalId string) *MarketplacedealsListCall {
6641 c := &MarketplacedealsListCall{s: r.s, urlParams_: make(gensupport.URLParams)}
6642 c.proposalId = proposalId
6643 return c
6644 }
6645
6646 // PqlQuery sets the optional parameter "pqlQuery": Query string to
6647 // retrieve specific deals.
6648 func (c *MarketplacedealsListCall) PqlQuery(pqlQuery string) *MarketplacedealsListCall {
6649 c.urlParams_.Set("pqlQuery", pqlQuery)
6650 return c
6651 }
6652
6653 // Fields allows partial responses to be retrieved. See
6654 // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
6655 // for more information.
6656 func (c *MarketplacedealsListCall) Fields(s ...googleapi.Field) *MarketplacedealsListCall {
6657 c.urlParams_.Set("fields", googleapi.CombineFields(s))
6658 return c
6659 }
6660
6661 // IfNoneMatch sets the optional parameter which makes the operation
6662 // fail if the object's ETag matches the given value. This is useful for
6663 // getting updates only after the object has changed since the last
6664 // request. Use googleapi.IsNotModified to check whether the response
6665 // error from Do is the result of In-None-Match.
6666 func (c *MarketplacedealsListCall) IfNoneMatch(entityTag string) *MarketplacedealsListCall {
6667 c.ifNoneMatch_ = entityTag
6668 return c
6669 }
6670
6671 // Context sets the context to be used in this call's Do method. Any
6672 // pending HTTP request will be aborted if the provided context is
6673 // canceled.
6674 func (c *MarketplacedealsListCall) Context(ctx context.Context) *MarketplacedealsListCall {
6675 c.ctx_ = ctx
6676 return c
6677 }
6678
6679 // Header returns an http.Header that can be modified by the caller to
6680 // add HTTP headers to the request.
6681 func (c *MarketplacedealsListCall) Header() http.Header {
6682 if c.header_ == nil {
6683 c.header_ = make(http.Header)
6684 }
6685 return c.header_
6686 }
6687
6688 func (c *MarketplacedealsListCall) doRequest(alt string) (*http.Response, error) {
6689 reqHeaders := make(http.Header)
6690 reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/20210819")
6691 for k, v := range c.header_ {
6692 reqHeaders[k] = v
6693 }
6694 reqHeaders.Set("User-Agent", c.s.userAgent())
6695 if c.ifNoneMatch_ != "" {
6696 reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
6697 }
6698 var body io.Reader = nil
6699 c.urlParams_.Set("alt", alt)
6700 c.urlParams_.Set("prettyPrint", "false")
6701 urls := googleapi.ResolveRelative(c.s.BasePath, "proposals/{proposalId}/deals")
6702 urls += "?" + c.urlParams_.Encode()
6703 req, err := http.NewRequest("GET", urls, body)
6704 if err != nil {
6705 return nil, err
6706 }
6707 req.Header = reqHeaders
6708 googleapi.Expand(req.URL, map[string]string{
6709 "proposalId": c.proposalId,
6710 })
6711 return gensupport.SendRequest(c.ctx_, c.s.client, req)
6712 }
6713
6714 // Do executes the "adexchangebuyer.marketplacedeals.list" call.
6715 // Exactly one of *GetOrderDealsResponse or error will be non-nil. Any
6716 // non-2xx status code is an error. Response headers are in either
6717 // *GetOrderDealsResponse.ServerResponse.Header or (if a response was
6718 // returned at all) in error.(*googleapi.Error).Header. Use
6719 // googleapi.IsNotModified to check whether the returned error was
6720 // because http.StatusNotModified was returned.
6721 func (c *MarketplacedealsListCall) Do(opts ...googleapi.CallOption) (*GetOrderDealsResponse, error) {
6722 gensupport.SetOptions(c.urlParams_, opts...)
6723 res, err := c.doRequest("json")
6724 if res != nil && res.StatusCode == http.StatusNotModified {
6725 if res.Body != nil {
6726 res.Body.Close()
6727 }
6728 return nil, &googleapi.Error{
6729 Code: res.StatusCode,
6730 Header: res.Header,
6731 }
6732 }
6733 if err != nil {
6734 return nil, err
6735 }
6736 defer googleapi.CloseBody(res)
6737 if err := googleapi.CheckResponse(res); err != nil {
6738 return nil, err
6739 }
6740 ret := &GetOrderDealsResponse{
6741 ServerResponse: googleapi.ServerResponse{
6742 Header: res.Header,
6743 HTTPStatusCode: res.StatusCode,
6744 },
6745 }
6746 target := &ret
6747 if err := gensupport.DecodeResponse(target, res); err != nil {
6748 return nil, err
6749 }
6750 return ret, nil
6751 // {
6752 // "description": "List all the deals for a given proposal",
6753 // "httpMethod": "GET",
6754 // "id": "adexchangebuyer.marketplacedeals.list",
6755 // "parameterOrder": [
6756 // "proposalId"
6757 // ],
6758 // "parameters": {
6759 // "pqlQuery": {
6760 // "description": "Query string to retrieve specific deals.",
6761 // "location": "query",
6762 // "type": "string"
6763 // },
6764 // "proposalId": {
6765 // "description": "The proposalId to get deals for. To search across all proposals specify order_id = '-' as part of the URL.",
6766 // "location": "path",
6767 // "required": true,
6768 // "type": "string"
6769 // }
6770 // },
6771 // "path": "proposals/{proposalId}/deals",
6772 // "response": {
6773 // "$ref": "GetOrderDealsResponse"
6774 // },
6775 // "scopes": [
6776 // "https://www.googleapis.com/auth/adexchange.buyer"
6777 // ]
6778 // }
6779
6780 }
6781
6782 // method id "adexchangebuyer.marketplacedeals.update":
6783
6784 type MarketplacedealsUpdateCall struct {
6785 s *Service
6786 proposalId string
6787 editallorderdealsrequest *EditAllOrderDealsRequest
6788 urlParams_ gensupport.URLParams
6789 ctx_ context.Context
6790 header_ http.Header
6791 }
6792
6793 // Update: Replaces all the deals in the proposal with the passed in
6794 // deals
6795 //
6796 // - proposalId: The proposalId to edit deals on.
6797 func (r *MarketplacedealsService) Update(proposalId string, editallorderdealsrequest *EditAllOrderDealsRequest) *MarketplacedealsUpdateCall {
6798 c := &MarketplacedealsUpdateCall{s: r.s, urlParams_: make(gensupport.URLParams)}
6799 c.proposalId = proposalId
6800 c.editallorderdealsrequest = editallorderdealsrequest
6801 return c
6802 }
6803
6804 // Fields allows partial responses to be retrieved. See
6805 // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
6806 // for more information.
6807 func (c *MarketplacedealsUpdateCall) Fields(s ...googleapi.Field) *MarketplacedealsUpdateCall {
6808 c.urlParams_.Set("fields", googleapi.CombineFields(s))
6809 return c
6810 }
6811
6812 // Context sets the context to be used in this call's Do method. Any
6813 // pending HTTP request will be aborted if the provided context is
6814 // canceled.
6815 func (c *MarketplacedealsUpdateCall) Context(ctx context.Context) *MarketplacedealsUpdateCall {
6816 c.ctx_ = ctx
6817 return c
6818 }
6819
6820 // Header returns an http.Header that can be modified by the caller to
6821 // add HTTP headers to the request.
6822 func (c *MarketplacedealsUpdateCall) Header() http.Header {
6823 if c.header_ == nil {
6824 c.header_ = make(http.Header)
6825 }
6826 return c.header_
6827 }
6828
6829 func (c *MarketplacedealsUpdateCall) doRequest(alt string) (*http.Response, error) {
6830 reqHeaders := make(http.Header)
6831 reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/20210819")
6832 for k, v := range c.header_ {
6833 reqHeaders[k] = v
6834 }
6835 reqHeaders.Set("User-Agent", c.s.userAgent())
6836 var body io.Reader = nil
6837 body, err := googleapi.WithoutDataWrapper.JSONReader(c.editallorderdealsrequest)
6838 if err != nil {
6839 return nil, err
6840 }
6841 reqHeaders.Set("Content-Type", "application/json")
6842 c.urlParams_.Set("alt", alt)
6843 c.urlParams_.Set("prettyPrint", "false")
6844 urls := googleapi.ResolveRelative(c.s.BasePath, "proposals/{proposalId}/deals/update")
6845 urls += "?" + c.urlParams_.Encode()
6846 req, err := http.NewRequest("POST", urls, body)
6847 if err != nil {
6848 return nil, err
6849 }
6850 req.Header = reqHeaders
6851 googleapi.Expand(req.URL, map[string]string{
6852 "proposalId": c.proposalId,
6853 })
6854 return gensupport.SendRequest(c.ctx_, c.s.client, req)
6855 }
6856
6857 // Do executes the "adexchangebuyer.marketplacedeals.update" call.
6858 // Exactly one of *EditAllOrderDealsResponse or error will be non-nil.
6859 // Any non-2xx status code is an error. Response headers are in either
6860 // *EditAllOrderDealsResponse.ServerResponse.Header or (if a response
6861 // was returned at all) in error.(*googleapi.Error).Header. Use
6862 // googleapi.IsNotModified to check whether the returned error was
6863 // because http.StatusNotModified was returned.
6864 func (c *MarketplacedealsUpdateCall) Do(opts ...googleapi.CallOption) (*EditAllOrderDealsResponse, error) {
6865 gensupport.SetOptions(c.urlParams_, opts...)
6866 res, err := c.doRequest("json")
6867 if res != nil && res.StatusCode == http.StatusNotModified {
6868 if res.Body != nil {
6869 res.Body.Close()
6870 }
6871 return nil, &googleapi.Error{
6872 Code: res.StatusCode,
6873 Header: res.Header,
6874 }
6875 }
6876 if err != nil {
6877 return nil, err
6878 }
6879 defer googleapi.CloseBody(res)
6880 if err := googleapi.CheckResponse(res); err != nil {
6881 return nil, err
6882 }
6883 ret := &EditAllOrderDealsResponse{
6884 ServerResponse: googleapi.ServerResponse{
6885 Header: res.Header,
6886 HTTPStatusCode: res.StatusCode,
6887 },
6888 }
6889 target := &ret
6890 if err := gensupport.DecodeResponse(target, res); err != nil {
6891 return nil, err
6892 }
6893 return ret, nil
6894 // {
6895 // "description": "Replaces all the deals in the proposal with the passed in deals",
6896 // "httpMethod": "POST",
6897 // "id": "adexchangebuyer.marketplacedeals.update",
6898 // "parameterOrder": [
6899 // "proposalId"
6900 // ],
6901 // "parameters": {
6902 // "proposalId": {
6903 // "description": "The proposalId to edit deals on.",
6904 // "location": "path",
6905 // "required": true,
6906 // "type": "string"
6907 // }
6908 // },
6909 // "path": "proposals/{proposalId}/deals/update",
6910 // "request": {
6911 // "$ref": "EditAllOrderDealsRequest"
6912 // },
6913 // "response": {
6914 // "$ref": "EditAllOrderDealsResponse"
6915 // },
6916 // "scopes": [
6917 // "https://www.googleapis.com/auth/adexchange.buyer"
6918 // ]
6919 // }
6920
6921 }
6922
6923 // method id "adexchangebuyer.marketplacenotes.insert":
6924
6925 type MarketplacenotesInsertCall struct {
6926 s *Service
6927 proposalId string
6928 addordernotesrequest *AddOrderNotesRequest
6929 urlParams_ gensupport.URLParams
6930 ctx_ context.Context
6931 header_ http.Header
6932 }
6933
6934 // Insert: Add notes to the proposal
6935 //
6936 // - proposalId: The proposalId to add notes for.
6937 func (r *MarketplacenotesService) Insert(proposalId string, addordernotesrequest *AddOrderNotesRequest) *MarketplacenotesInsertCall {
6938 c := &MarketplacenotesInsertCall{s: r.s, urlParams_: make(gensupport.URLParams)}
6939 c.proposalId = proposalId
6940 c.addordernotesrequest = addordernotesrequest
6941 return c
6942 }
6943
6944 // Fields allows partial responses to be retrieved. See
6945 // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
6946 // for more information.
6947 func (c *MarketplacenotesInsertCall) Fields(s ...googleapi.Field) *MarketplacenotesInsertCall {
6948 c.urlParams_.Set("fields", googleapi.CombineFields(s))
6949 return c
6950 }
6951
6952 // Context sets the context to be used in this call's Do method. Any
6953 // pending HTTP request will be aborted if the provided context is
6954 // canceled.
6955 func (c *MarketplacenotesInsertCall) Context(ctx context.Context) *MarketplacenotesInsertCall {
6956 c.ctx_ = ctx
6957 return c
6958 }
6959
6960 // Header returns an http.Header that can be modified by the caller to
6961 // add HTTP headers to the request.
6962 func (c *MarketplacenotesInsertCall) Header() http.Header {
6963 if c.header_ == nil {
6964 c.header_ = make(http.Header)
6965 }
6966 return c.header_
6967 }
6968
6969 func (c *MarketplacenotesInsertCall) doRequest(alt string) (*http.Response, error) {
6970 reqHeaders := make(http.Header)
6971 reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/20210819")
6972 for k, v := range c.header_ {
6973 reqHeaders[k] = v
6974 }
6975 reqHeaders.Set("User-Agent", c.s.userAgent())
6976 var body io.Reader = nil
6977 body, err := googleapi.WithoutDataWrapper.JSONReader(c.addordernotesrequest)
6978 if err != nil {
6979 return nil, err
6980 }
6981 reqHeaders.Set("Content-Type", "application/json")
6982 c.urlParams_.Set("alt", alt)
6983 c.urlParams_.Set("prettyPrint", "false")
6984 urls := googleapi.ResolveRelative(c.s.BasePath, "proposals/{proposalId}/notes/insert")
6985 urls += "?" + c.urlParams_.Encode()
6986 req, err := http.NewRequest("POST", urls, body)
6987 if err != nil {
6988 return nil, err
6989 }
6990 req.Header = reqHeaders
6991 googleapi.Expand(req.URL, map[string]string{
6992 "proposalId": c.proposalId,
6993 })
6994 return gensupport.SendRequest(c.ctx_, c.s.client, req)
6995 }
6996
6997 // Do executes the "adexchangebuyer.marketplacenotes.insert" call.
6998 // Exactly one of *AddOrderNotesResponse or error will be non-nil. Any
6999 // non-2xx status code is an error. Response headers are in either
7000 // *AddOrderNotesResponse.ServerResponse.Header or (if a response was
7001 // returned at all) in error.(*googleapi.Error).Header. Use
7002 // googleapi.IsNotModified to check whether the returned error was
7003 // because http.StatusNotModified was returned.
7004 func (c *MarketplacenotesInsertCall) Do(opts ...googleapi.CallOption) (*AddOrderNotesResponse, error) {
7005 gensupport.SetOptions(c.urlParams_, opts...)
7006 res, err := c.doRequest("json")
7007 if res != nil && res.StatusCode == http.StatusNotModified {
7008 if res.Body != nil {
7009 res.Body.Close()
7010 }
7011 return nil, &googleapi.Error{
7012 Code: res.StatusCode,
7013 Header: res.Header,
7014 }
7015 }
7016 if err != nil {
7017 return nil, err
7018 }
7019 defer googleapi.CloseBody(res)
7020 if err := googleapi.CheckResponse(res); err != nil {
7021 return nil, err
7022 }
7023 ret := &AddOrderNotesResponse{
7024 ServerResponse: googleapi.ServerResponse{
7025 Header: res.Header,
7026 HTTPStatusCode: res.StatusCode,
7027 },
7028 }
7029 target := &ret
7030 if err := gensupport.DecodeResponse(target, res); err != nil {
7031 return nil, err
7032 }
7033 return ret, nil
7034 // {
7035 // "description": "Add notes to the proposal",
7036 // "httpMethod": "POST",
7037 // "id": "adexchangebuyer.marketplacenotes.insert",
7038 // "parameterOrder": [
7039 // "proposalId"
7040 // ],
7041 // "parameters": {
7042 // "proposalId": {
7043 // "description": "The proposalId to add notes for.",
7044 // "location": "path",
7045 // "required": true,
7046 // "type": "string"
7047 // }
7048 // },
7049 // "path": "proposals/{proposalId}/notes/insert",
7050 // "request": {
7051 // "$ref": "AddOrderNotesRequest"
7052 // },
7053 // "response": {
7054 // "$ref": "AddOrderNotesResponse"
7055 // },
7056 // "scopes": [
7057 // "https://www.googleapis.com/auth/adexchange.buyer"
7058 // ]
7059 // }
7060
7061 }
7062
7063 // method id "adexchangebuyer.marketplacenotes.list":
7064
7065 type MarketplacenotesListCall struct {
7066 s *Service
7067 proposalId string
7068 urlParams_ gensupport.URLParams
7069 ifNoneMatch_ string
7070 ctx_ context.Context
7071 header_ http.Header
7072 }
7073
7074 // List: Get all the notes associated with a proposal
7075 //
7076 // - proposalId: The proposalId to get notes for. To search across all
7077 // proposals specify order_id = '-' as part of the URL.
7078 func (r *MarketplacenotesService) List(proposalId string) *MarketplacenotesListCall {
7079 c := &MarketplacenotesListCall{s: r.s, urlParams_: make(gensupport.URLParams)}
7080 c.proposalId = proposalId
7081 return c
7082 }
7083
7084 // PqlQuery sets the optional parameter "pqlQuery": Query string to
7085 // retrieve specific notes. To search the text contents of notes, please
7086 // use syntax like "WHERE note.note = "foo" or "WHERE note.note LIKE
7087 // "%bar%"
7088 func (c *MarketplacenotesListCall) PqlQuery(pqlQuery string) *MarketplacenotesListCall {
7089 c.urlParams_.Set("pqlQuery", pqlQuery)
7090 return c
7091 }
7092
7093 // Fields allows partial responses to be retrieved. See
7094 // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
7095 // for more information.
7096 func (c *MarketplacenotesListCall) Fields(s ...googleapi.Field) *MarketplacenotesListCall {
7097 c.urlParams_.Set("fields", googleapi.CombineFields(s))
7098 return c
7099 }
7100
7101 // IfNoneMatch sets the optional parameter which makes the operation
7102 // fail if the object's ETag matches the given value. This is useful for
7103 // getting updates only after the object has changed since the last
7104 // request. Use googleapi.IsNotModified to check whether the response
7105 // error from Do is the result of In-None-Match.
7106 func (c *MarketplacenotesListCall) IfNoneMatch(entityTag string) *MarketplacenotesListCall {
7107 c.ifNoneMatch_ = entityTag
7108 return c
7109 }
7110
7111 // Context sets the context to be used in this call's Do method. Any
7112 // pending HTTP request will be aborted if the provided context is
7113 // canceled.
7114 func (c *MarketplacenotesListCall) Context(ctx context.Context) *MarketplacenotesListCall {
7115 c.ctx_ = ctx
7116 return c
7117 }
7118
7119 // Header returns an http.Header that can be modified by the caller to
7120 // add HTTP headers to the request.
7121 func (c *MarketplacenotesListCall) Header() http.Header {
7122 if c.header_ == nil {
7123 c.header_ = make(http.Header)
7124 }
7125 return c.header_
7126 }
7127
7128 func (c *MarketplacenotesListCall) doRequest(alt string) (*http.Response, error) {
7129 reqHeaders := make(http.Header)
7130 reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/20210819")
7131 for k, v := range c.header_ {
7132 reqHeaders[k] = v
7133 }
7134 reqHeaders.Set("User-Agent", c.s.userAgent())
7135 if c.ifNoneMatch_ != "" {
7136 reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
7137 }
7138 var body io.Reader = nil
7139 c.urlParams_.Set("alt", alt)
7140 c.urlParams_.Set("prettyPrint", "false")
7141 urls := googleapi.ResolveRelative(c.s.BasePath, "proposals/{proposalId}/notes")
7142 urls += "?" + c.urlParams_.Encode()
7143 req, err := http.NewRequest("GET", urls, body)
7144 if err != nil {
7145 return nil, err
7146 }
7147 req.Header = reqHeaders
7148 googleapi.Expand(req.URL, map[string]string{
7149 "proposalId": c.proposalId,
7150 })
7151 return gensupport.SendRequest(c.ctx_, c.s.client, req)
7152 }
7153
7154 // Do executes the "adexchangebuyer.marketplacenotes.list" call.
7155 // Exactly one of *GetOrderNotesResponse or error will be non-nil. Any
7156 // non-2xx status code is an error. Response headers are in either
7157 // *GetOrderNotesResponse.ServerResponse.Header or (if a response was
7158 // returned at all) in error.(*googleapi.Error).Header. Use
7159 // googleapi.IsNotModified to check whether the returned error was
7160 // because http.StatusNotModified was returned.
7161 func (c *MarketplacenotesListCall) Do(opts ...googleapi.CallOption) (*GetOrderNotesResponse, error) {
7162 gensupport.SetOptions(c.urlParams_, opts...)
7163 res, err := c.doRequest("json")
7164 if res != nil && res.StatusCode == http.StatusNotModified {
7165 if res.Body != nil {
7166 res.Body.Close()
7167 }
7168 return nil, &googleapi.Error{
7169 Code: res.StatusCode,
7170 Header: res.Header,
7171 }
7172 }
7173 if err != nil {
7174 return nil, err
7175 }
7176 defer googleapi.CloseBody(res)
7177 if err := googleapi.CheckResponse(res); err != nil {
7178 return nil, err
7179 }
7180 ret := &GetOrderNotesResponse{
7181 ServerResponse: googleapi.ServerResponse{
7182 Header: res.Header,
7183 HTTPStatusCode: res.StatusCode,
7184 },
7185 }
7186 target := &ret
7187 if err := gensupport.DecodeResponse(target, res); err != nil {
7188 return nil, err
7189 }
7190 return ret, nil
7191 // {
7192 // "description": "Get all the notes associated with a proposal",
7193 // "httpMethod": "GET",
7194 // "id": "adexchangebuyer.marketplacenotes.list",
7195 // "parameterOrder": [
7196 // "proposalId"
7197 // ],
7198 // "parameters": {
7199 // "pqlQuery": {
7200 // "description": "Query string to retrieve specific notes. To search the text contents of notes, please use syntax like \"WHERE note.note = \"foo\" or \"WHERE note.note LIKE \"%bar%\"",
7201 // "location": "query",
7202 // "type": "string"
7203 // },
7204 // "proposalId": {
7205 // "description": "The proposalId to get notes for. To search across all proposals specify order_id = '-' as part of the URL.",
7206 // "location": "path",
7207 // "required": true,
7208 // "type": "string"
7209 // }
7210 // },
7211 // "path": "proposals/{proposalId}/notes",
7212 // "response": {
7213 // "$ref": "GetOrderNotesResponse"
7214 // },
7215 // "scopes": [
7216 // "https://www.googleapis.com/auth/adexchange.buyer"
7217 // ]
7218 // }
7219
7220 }
7221
7222 // method id "adexchangebuyer.marketplaceprivateauction.updateproposal":
7223
7224 type MarketplaceprivateauctionUpdateproposalCall struct {
7225 s *Service
7226 privateAuctionId string
7227 updateprivateauctionproposalrequest *UpdatePrivateAuctionProposalRequest
7228 urlParams_ gensupport.URLParams
7229 ctx_ context.Context
7230 header_ http.Header
7231 }
7232
7233 // Updateproposal: Update a given private auction proposal
7234 //
7235 // - privateAuctionId: The private auction id to be updated.
7236 func (r *MarketplaceprivateauctionService) Updateproposal(privateAuctionId string, updateprivateauctionproposalrequest *UpdatePrivateAuctionProposalRequest) *MarketplaceprivateauctionUpdateproposalCall {
7237 c := &MarketplaceprivateauctionUpdateproposalCall{s: r.s, urlParams_: make(gensupport.URLParams)}
7238 c.privateAuctionId = privateAuctionId
7239 c.updateprivateauctionproposalrequest = updateprivateauctionproposalrequest
7240 return c
7241 }
7242
7243 // Fields allows partial responses to be retrieved. See
7244 // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
7245 // for more information.
7246 func (c *MarketplaceprivateauctionUpdateproposalCall) Fields(s ...googleapi.Field) *MarketplaceprivateauctionUpdateproposalCall {
7247 c.urlParams_.Set("fields", googleapi.CombineFields(s))
7248 return c
7249 }
7250
7251 // Context sets the context to be used in this call's Do method. Any
7252 // pending HTTP request will be aborted if the provided context is
7253 // canceled.
7254 func (c *MarketplaceprivateauctionUpdateproposalCall) Context(ctx context.Context) *MarketplaceprivateauctionUpdateproposalCall {
7255 c.ctx_ = ctx
7256 return c
7257 }
7258
7259 // Header returns an http.Header that can be modified by the caller to
7260 // add HTTP headers to the request.
7261 func (c *MarketplaceprivateauctionUpdateproposalCall) Header() http.Header {
7262 if c.header_ == nil {
7263 c.header_ = make(http.Header)
7264 }
7265 return c.header_
7266 }
7267
7268 func (c *MarketplaceprivateauctionUpdateproposalCall) doRequest(alt string) (*http.Response, error) {
7269 reqHeaders := make(http.Header)
7270 reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/20210819")
7271 for k, v := range c.header_ {
7272 reqHeaders[k] = v
7273 }
7274 reqHeaders.Set("User-Agent", c.s.userAgent())
7275 var body io.Reader = nil
7276 body, err := googleapi.WithoutDataWrapper.JSONReader(c.updateprivateauctionproposalrequest)
7277 if err != nil {
7278 return nil, err
7279 }
7280 reqHeaders.Set("Content-Type", "application/json")
7281 c.urlParams_.Set("alt", alt)
7282 c.urlParams_.Set("prettyPrint", "false")
7283 urls := googleapi.ResolveRelative(c.s.BasePath, "privateauction/{privateAuctionId}/updateproposal")
7284 urls += "?" + c.urlParams_.Encode()
7285 req, err := http.NewRequest("POST", urls, body)
7286 if err != nil {
7287 return nil, err
7288 }
7289 req.Header = reqHeaders
7290 googleapi.Expand(req.URL, map[string]string{
7291 "privateAuctionId": c.privateAuctionId,
7292 })
7293 return gensupport.SendRequest(c.ctx_, c.s.client, req)
7294 }
7295
7296 // Do executes the "adexchangebuyer.marketplaceprivateauction.updateproposal" call.
7297 func (c *MarketplaceprivateauctionUpdateproposalCall) Do(opts ...googleapi.CallOption) error {
7298 gensupport.SetOptions(c.urlParams_, opts...)
7299 res, err := c.doRequest("json")
7300 if err != nil {
7301 return err
7302 }
7303 defer googleapi.CloseBody(res)
7304 if err := googleapi.CheckResponse(res); err != nil {
7305 return err
7306 }
7307 return nil
7308 // {
7309 // "description": "Update a given private auction proposal",
7310 // "httpMethod": "POST",
7311 // "id": "adexchangebuyer.marketplaceprivateauction.updateproposal",
7312 // "parameterOrder": [
7313 // "privateAuctionId"
7314 // ],
7315 // "parameters": {
7316 // "privateAuctionId": {
7317 // "description": "The private auction id to be updated.",
7318 // "location": "path",
7319 // "required": true,
7320 // "type": "string"
7321 // }
7322 // },
7323 // "path": "privateauction/{privateAuctionId}/updateproposal",
7324 // "request": {
7325 // "$ref": "UpdatePrivateAuctionProposalRequest"
7326 // },
7327 // "scopes": [
7328 // "https://www.googleapis.com/auth/adexchange.buyer"
7329 // ]
7330 // }
7331
7332 }
7333
7334 // method id "adexchangebuyer.performanceReport.list":
7335
7336 type PerformanceReportListCall struct {
7337 s *Service
7338 urlParams_ gensupport.URLParams
7339 ifNoneMatch_ string
7340 ctx_ context.Context
7341 header_ http.Header
7342 }
7343
7344 // List: Retrieves the authenticated user's list of performance metrics.
7345 //
7346 // - accountId: The account id to get the reports.
7347 // - endDateTime: The end time of the report in ISO 8601 timestamp
7348 // format using UTC.
7349 // - startDateTime: The start time of the report in ISO 8601 timestamp
7350 // format using UTC.
7351 func (r *PerformanceReportService) List(accountId int64, endDateTime string, startDateTime string) *PerformanceReportListCall {
7352 c := &PerformanceReportListCall{s: r.s, urlParams_: make(gensupport.URLParams)}
7353 c.urlParams_.Set("accountId", fmt.Sprint(accountId))
7354 c.urlParams_.Set("endDateTime", endDateTime)
7355 c.urlParams_.Set("startDateTime", startDateTime)
7356 return c
7357 }
7358
7359 // MaxResults sets the optional parameter "maxResults": Maximum number
7360 // of entries returned on one result page. If not set, the default is
7361 // 100.
7362 func (c *PerformanceReportListCall) MaxResults(maxResults int64) *PerformanceReportListCall {
7363 c.urlParams_.Set("maxResults", fmt.Sprint(maxResults))
7364 return c
7365 }
7366
7367 // PageToken sets the optional parameter "pageToken": A continuation
7368 // token, used to page through performance reports. To retrieve the next
7369 // page, set this parameter to the value of "nextPageToken" from the
7370 // previous response.
7371 func (c *PerformanceReportListCall) PageToken(pageToken string) *PerformanceReportListCall {
7372 c.urlParams_.Set("pageToken", pageToken)
7373 return c
7374 }
7375
7376 // Fields allows partial responses to be retrieved. See
7377 // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
7378 // for more information.
7379 func (c *PerformanceReportListCall) Fields(s ...googleapi.Field) *PerformanceReportListCall {
7380 c.urlParams_.Set("fields", googleapi.CombineFields(s))
7381 return c
7382 }
7383
7384 // IfNoneMatch sets the optional parameter which makes the operation
7385 // fail if the object's ETag matches the given value. This is useful for
7386 // getting updates only after the object has changed since the last
7387 // request. Use googleapi.IsNotModified to check whether the response
7388 // error from Do is the result of In-None-Match.
7389 func (c *PerformanceReportListCall) IfNoneMatch(entityTag string) *PerformanceReportListCall {
7390 c.ifNoneMatch_ = entityTag
7391 return c
7392 }
7393
7394 // Context sets the context to be used in this call's Do method. Any
7395 // pending HTTP request will be aborted if the provided context is
7396 // canceled.
7397 func (c *PerformanceReportListCall) Context(ctx context.Context) *PerformanceReportListCall {
7398 c.ctx_ = ctx
7399 return c
7400 }
7401
7402 // Header returns an http.Header that can be modified by the caller to
7403 // add HTTP headers to the request.
7404 func (c *PerformanceReportListCall) Header() http.Header {
7405 if c.header_ == nil {
7406 c.header_ = make(http.Header)
7407 }
7408 return c.header_
7409 }
7410
7411 func (c *PerformanceReportListCall) doRequest(alt string) (*http.Response, error) {
7412 reqHeaders := make(http.Header)
7413 reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/20210819")
7414 for k, v := range c.header_ {
7415 reqHeaders[k] = v
7416 }
7417 reqHeaders.Set("User-Agent", c.s.userAgent())
7418 if c.ifNoneMatch_ != "" {
7419 reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
7420 }
7421 var body io.Reader = nil
7422 c.urlParams_.Set("alt", alt)
7423 c.urlParams_.Set("prettyPrint", "false")
7424 urls := googleapi.ResolveRelative(c.s.BasePath, "performancereport")
7425 urls += "?" + c.urlParams_.Encode()
7426 req, err := http.NewRequest("GET", urls, body)
7427 if err != nil {
7428 return nil, err
7429 }
7430 req.Header = reqHeaders
7431 return gensupport.SendRequest(c.ctx_, c.s.client, req)
7432 }
7433
7434 // Do executes the "adexchangebuyer.performanceReport.list" call.
7435 // Exactly one of *PerformanceReportList or error will be non-nil. Any
7436 // non-2xx status code is an error. Response headers are in either
7437 // *PerformanceReportList.ServerResponse.Header or (if a response was
7438 // returned at all) in error.(*googleapi.Error).Header. Use
7439 // googleapi.IsNotModified to check whether the returned error was
7440 // because http.StatusNotModified was returned.
7441 func (c *PerformanceReportListCall) Do(opts ...googleapi.CallOption) (*PerformanceReportList, error) {
7442 gensupport.SetOptions(c.urlParams_, opts...)
7443 res, err := c.doRequest("json")
7444 if res != nil && res.StatusCode == http.StatusNotModified {
7445 if res.Body != nil {
7446 res.Body.Close()
7447 }
7448 return nil, &googleapi.Error{
7449 Code: res.StatusCode,
7450 Header: res.Header,
7451 }
7452 }
7453 if err != nil {
7454 return nil, err
7455 }
7456 defer googleapi.CloseBody(res)
7457 if err := googleapi.CheckResponse(res); err != nil {
7458 return nil, err
7459 }
7460 ret := &PerformanceReportList{
7461 ServerResponse: googleapi.ServerResponse{
7462 Header: res.Header,
7463 HTTPStatusCode: res.StatusCode,
7464 },
7465 }
7466 target := &ret
7467 if err := gensupport.DecodeResponse(target, res); err != nil {
7468 return nil, err
7469 }
7470 return ret, nil
7471 // {
7472 // "description": "Retrieves the authenticated user's list of performance metrics.",
7473 // "httpMethod": "GET",
7474 // "id": "adexchangebuyer.performanceReport.list",
7475 // "parameterOrder": [
7476 // "accountId",
7477 // "endDateTime",
7478 // "startDateTime"
7479 // ],
7480 // "parameters": {
7481 // "accountId": {
7482 // "description": "The account id to get the reports.",
7483 // "format": "int64",
7484 // "location": "query",
7485 // "required": true,
7486 // "type": "string"
7487 // },
7488 // "endDateTime": {
7489 // "description": "The end time of the report in ISO 8601 timestamp format using UTC.",
7490 // "location": "query",
7491 // "required": true,
7492 // "type": "string"
7493 // },
7494 // "maxResults": {
7495 // "description": "Maximum number of entries returned on one result page. If not set, the default is 100. Optional.",
7496 // "format": "uint32",
7497 // "location": "query",
7498 // "maximum": "1000",
7499 // "minimum": "1",
7500 // "type": "integer"
7501 // },
7502 // "pageToken": {
7503 // "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.",
7504 // "location": "query",
7505 // "type": "string"
7506 // },
7507 // "startDateTime": {
7508 // "description": "The start time of the report in ISO 8601 timestamp format using UTC.",
7509 // "location": "query",
7510 // "required": true,
7511 // "type": "string"
7512 // }
7513 // },
7514 // "path": "performancereport",
7515 // "response": {
7516 // "$ref": "PerformanceReportList"
7517 // },
7518 // "scopes": [
7519 // "https://www.googleapis.com/auth/adexchange.buyer"
7520 // ]
7521 // }
7522
7523 }
7524
7525 // method id "adexchangebuyer.pretargetingConfig.delete":
7526
7527 type PretargetingConfigDeleteCall struct {
7528 s *Service
7529 accountId int64
7530 configId int64
7531 urlParams_ gensupport.URLParams
7532 ctx_ context.Context
7533 header_ http.Header
7534 }
7535
7536 // Delete: Deletes an existing pretargeting config.
7537 //
7538 // - accountId: The account id to delete the pretargeting config for.
7539 // - configId: The specific id of the configuration to delete.
7540 func (r *PretargetingConfigService) Delete(accountId int64, configId int64) *PretargetingConfigDeleteCall {
7541 c := &PretargetingConfigDeleteCall{s: r.s, urlParams_: make(gensupport.URLParams)}
7542 c.accountId = accountId
7543 c.configId = configId
7544 return c
7545 }
7546
7547 // Fields allows partial responses to be retrieved. See
7548 // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
7549 // for more information.
7550 func (c *PretargetingConfigDeleteCall) Fields(s ...googleapi.Field) *PretargetingConfigDeleteCall {
7551 c.urlParams_.Set("fields", googleapi.CombineFields(s))
7552 return c
7553 }
7554
7555 // Context sets the context to be used in this call's Do method. Any
7556 // pending HTTP request will be aborted if the provided context is
7557 // canceled.
7558 func (c *PretargetingConfigDeleteCall) Context(ctx context.Context) *PretargetingConfigDeleteCall {
7559 c.ctx_ = ctx
7560 return c
7561 }
7562
7563 // Header returns an http.Header that can be modified by the caller to
7564 // add HTTP headers to the request.
7565 func (c *PretargetingConfigDeleteCall) Header() http.Header {
7566 if c.header_ == nil {
7567 c.header_ = make(http.Header)
7568 }
7569 return c.header_
7570 }
7571
7572 func (c *PretargetingConfigDeleteCall) doRequest(alt string) (*http.Response, error) {
7573 reqHeaders := make(http.Header)
7574 reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/20210819")
7575 for k, v := range c.header_ {
7576 reqHeaders[k] = v
7577 }
7578 reqHeaders.Set("User-Agent", c.s.userAgent())
7579 var body io.Reader = nil
7580 c.urlParams_.Set("alt", alt)
7581 c.urlParams_.Set("prettyPrint", "false")
7582 urls := googleapi.ResolveRelative(c.s.BasePath, "pretargetingconfigs/{accountId}/{configId}")
7583 urls += "?" + c.urlParams_.Encode()
7584 req, err := http.NewRequest("DELETE", urls, body)
7585 if err != nil {
7586 return nil, err
7587 }
7588 req.Header = reqHeaders
7589 googleapi.Expand(req.URL, map[string]string{
7590 "accountId": strconv.FormatInt(c.accountId, 10),
7591 "configId": strconv.FormatInt(c.configId, 10),
7592 })
7593 return gensupport.SendRequest(c.ctx_, c.s.client, req)
7594 }
7595
7596 // Do executes the "adexchangebuyer.pretargetingConfig.delete" call.
7597 func (c *PretargetingConfigDeleteCall) Do(opts ...googleapi.CallOption) error {
7598 gensupport.SetOptions(c.urlParams_, opts...)
7599 res, err := c.doRequest("json")
7600 if err != nil {
7601 return err
7602 }
7603 defer googleapi.CloseBody(res)
7604 if err := googleapi.CheckResponse(res); err != nil {
7605 return err
7606 }
7607 return nil
7608 // {
7609 // "description": "Deletes an existing pretargeting config.",
7610 // "httpMethod": "DELETE",
7611 // "id": "adexchangebuyer.pretargetingConfig.delete",
7612 // "parameterOrder": [
7613 // "accountId",
7614 // "configId"
7615 // ],
7616 // "parameters": {
7617 // "accountId": {
7618 // "description": "The account id to delete the pretargeting config for.",
7619 // "format": "int64",
7620 // "location": "path",
7621 // "required": true,
7622 // "type": "string"
7623 // },
7624 // "configId": {
7625 // "description": "The specific id of the configuration to delete.",
7626 // "format": "int64",
7627 // "location": "path",
7628 // "required": true,
7629 // "type": "string"
7630 // }
7631 // },
7632 // "path": "pretargetingconfigs/{accountId}/{configId}",
7633 // "scopes": [
7634 // "https://www.googleapis.com/auth/adexchange.buyer"
7635 // ]
7636 // }
7637
7638 }
7639
7640 // method id "adexchangebuyer.pretargetingConfig.get":
7641
7642 type PretargetingConfigGetCall struct {
7643 s *Service
7644 accountId int64
7645 configId int64
7646 urlParams_ gensupport.URLParams
7647 ifNoneMatch_ string
7648 ctx_ context.Context
7649 header_ http.Header
7650 }
7651
7652 // Get: Gets a specific pretargeting configuration
7653 //
7654 // - accountId: The account id to get the pretargeting config for.
7655 // - configId: The specific id of the configuration to retrieve.
7656 func (r *PretargetingConfigService) Get(accountId int64, configId int64) *PretargetingConfigGetCall {
7657 c := &PretargetingConfigGetCall{s: r.s, urlParams_: make(gensupport.URLParams)}
7658 c.accountId = accountId
7659 c.configId = configId
7660 return c
7661 }
7662
7663 // Fields allows partial responses to be retrieved. See
7664 // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
7665 // for more information.
7666 func (c *PretargetingConfigGetCall) Fields(s ...googleapi.Field) *PretargetingConfigGetCall {
7667 c.urlParams_.Set("fields", googleapi.CombineFields(s))
7668 return c
7669 }
7670
7671 // IfNoneMatch sets the optional parameter which makes the operation
7672 // fail if the object's ETag matches the given value. This is useful for
7673 // getting updates only after the object has changed since the last
7674 // request. Use googleapi.IsNotModified to check whether the response
7675 // error from Do is the result of In-None-Match.
7676 func (c *PretargetingConfigGetCall) IfNoneMatch(entityTag string) *PretargetingConfigGetCall {
7677 c.ifNoneMatch_ = entityTag
7678 return c
7679 }
7680
7681 // Context sets the context to be used in this call's Do method. Any
7682 // pending HTTP request will be aborted if the provided context is
7683 // canceled.
7684 func (c *PretargetingConfigGetCall) Context(ctx context.Context) *PretargetingConfigGetCall {
7685 c.ctx_ = ctx
7686 return c
7687 }
7688
7689 // Header returns an http.Header that can be modified by the caller to
7690 // add HTTP headers to the request.
7691 func (c *PretargetingConfigGetCall) Header() http.Header {
7692 if c.header_ == nil {
7693 c.header_ = make(http.Header)
7694 }
7695 return c.header_
7696 }
7697
7698 func (c *PretargetingConfigGetCall) doRequest(alt string) (*http.Response, error) {
7699 reqHeaders := make(http.Header)
7700 reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/20210819")
7701 for k, v := range c.header_ {
7702 reqHeaders[k] = v
7703 }
7704 reqHeaders.Set("User-Agent", c.s.userAgent())
7705 if c.ifNoneMatch_ != "" {
7706 reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
7707 }
7708 var body io.Reader = nil
7709 c.urlParams_.Set("alt", alt)
7710 c.urlParams_.Set("prettyPrint", "false")
7711 urls := googleapi.ResolveRelative(c.s.BasePath, "pretargetingconfigs/{accountId}/{configId}")
7712 urls += "?" + c.urlParams_.Encode()
7713 req, err := http.NewRequest("GET", urls, body)
7714 if err != nil {
7715 return nil, err
7716 }
7717 req.Header = reqHeaders
7718 googleapi.Expand(req.URL, map[string]string{
7719 "accountId": strconv.FormatInt(c.accountId, 10),
7720 "configId": strconv.FormatInt(c.configId, 10),
7721 })
7722 return gensupport.SendRequest(c.ctx_, c.s.client, req)
7723 }
7724
7725 // Do executes the "adexchangebuyer.pretargetingConfig.get" call.
7726 // Exactly one of *PretargetingConfig or error will be non-nil. Any
7727 // non-2xx status code is an error. Response headers are in either
7728 // *PretargetingConfig.ServerResponse.Header or (if a response was
7729 // returned at all) in error.(*googleapi.Error).Header. Use
7730 // googleapi.IsNotModified to check whether the returned error was
7731 // because http.StatusNotModified was returned.
7732 func (c *PretargetingConfigGetCall) Do(opts ...googleapi.CallOption) (*PretargetingConfig, error) {
7733 gensupport.SetOptions(c.urlParams_, opts...)
7734 res, err := c.doRequest("json")
7735 if res != nil && res.StatusCode == http.StatusNotModified {
7736 if res.Body != nil {
7737 res.Body.Close()
7738 }
7739 return nil, &googleapi.Error{
7740 Code: res.StatusCode,
7741 Header: res.Header,
7742 }
7743 }
7744 if err != nil {
7745 return nil, err
7746 }
7747 defer googleapi.CloseBody(res)
7748 if err := googleapi.CheckResponse(res); err != nil {
7749 return nil, err
7750 }
7751 ret := &PretargetingConfig{
7752 ServerResponse: googleapi.ServerResponse{
7753 Header: res.Header,
7754 HTTPStatusCode: res.StatusCode,
7755 },
7756 }
7757 target := &ret
7758 if err := gensupport.DecodeResponse(target, res); err != nil {
7759 return nil, err
7760 }
7761 return ret, nil
7762 // {
7763 // "description": "Gets a specific pretargeting configuration",
7764 // "httpMethod": "GET",
7765 // "id": "adexchangebuyer.pretargetingConfig.get",
7766 // "parameterOrder": [
7767 // "accountId",
7768 // "configId"
7769 // ],
7770 // "parameters": {
7771 // "accountId": {
7772 // "description": "The account id to get the pretargeting config for.",
7773 // "format": "int64",
7774 // "location": "path",
7775 // "required": true,
7776 // "type": "string"
7777 // },
7778 // "configId": {
7779 // "description": "The specific id of the configuration to retrieve.",
7780 // "format": "int64",
7781 // "location": "path",
7782 // "required": true,
7783 // "type": "string"
7784 // }
7785 // },
7786 // "path": "pretargetingconfigs/{accountId}/{configId}",
7787 // "response": {
7788 // "$ref": "PretargetingConfig"
7789 // },
7790 // "scopes": [
7791 // "https://www.googleapis.com/auth/adexchange.buyer"
7792 // ]
7793 // }
7794
7795 }
7796
7797 // method id "adexchangebuyer.pretargetingConfig.insert":
7798
7799 type PretargetingConfigInsertCall struct {
7800 s *Service
7801 accountId int64
7802 pretargetingconfig *PretargetingConfig
7803 urlParams_ gensupport.URLParams
7804 ctx_ context.Context
7805 header_ http.Header
7806 }
7807
7808 // Insert: Inserts a new pretargeting configuration.
7809 //
7810 // - accountId: The account id to insert the pretargeting config for.
7811 func (r *PretargetingConfigService) Insert(accountId int64, pretargetingconfig *PretargetingConfig) *PretargetingConfigInsertCall {
7812 c := &PretargetingConfigInsertCall{s: r.s, urlParams_: make(gensupport.URLParams)}
7813 c.accountId = accountId
7814 c.pretargetingconfig = pretargetingconfig
7815 return c
7816 }
7817
7818 // Fields allows partial responses to be retrieved. See
7819 // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
7820 // for more information.
7821 func (c *PretargetingConfigInsertCall) Fields(s ...googleapi.Field) *PretargetingConfigInsertCall {
7822 c.urlParams_.Set("fields", googleapi.CombineFields(s))
7823 return c
7824 }
7825
7826 // Context sets the context to be used in this call's Do method. Any
7827 // pending HTTP request will be aborted if the provided context is
7828 // canceled.
7829 func (c *PretargetingConfigInsertCall) Context(ctx context.Context) *PretargetingConfigInsertCall {
7830 c.ctx_ = ctx
7831 return c
7832 }
7833
7834 // Header returns an http.Header that can be modified by the caller to
7835 // add HTTP headers to the request.
7836 func (c *PretargetingConfigInsertCall) Header() http.Header {
7837 if c.header_ == nil {
7838 c.header_ = make(http.Header)
7839 }
7840 return c.header_
7841 }
7842
7843 func (c *PretargetingConfigInsertCall) doRequest(alt string) (*http.Response, error) {
7844 reqHeaders := make(http.Header)
7845 reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/20210819")
7846 for k, v := range c.header_ {
7847 reqHeaders[k] = v
7848 }
7849 reqHeaders.Set("User-Agent", c.s.userAgent())
7850 var body io.Reader = nil
7851 body, err := googleapi.WithoutDataWrapper.JSONReader(c.pretargetingconfig)
7852 if err != nil {
7853 return nil, err
7854 }
7855 reqHeaders.Set("Content-Type", "application/json")
7856 c.urlParams_.Set("alt", alt)
7857 c.urlParams_.Set("prettyPrint", "false")
7858 urls := googleapi.ResolveRelative(c.s.BasePath, "pretargetingconfigs/{accountId}")
7859 urls += "?" + c.urlParams_.Encode()
7860 req, err := http.NewRequest("POST", urls, body)
7861 if err != nil {
7862 return nil, err
7863 }
7864 req.Header = reqHeaders
7865 googleapi.Expand(req.URL, map[string]string{
7866 "accountId": strconv.FormatInt(c.accountId, 10),
7867 })
7868 return gensupport.SendRequest(c.ctx_, c.s.client, req)
7869 }
7870
7871 // Do executes the "adexchangebuyer.pretargetingConfig.insert" call.
7872 // Exactly one of *PretargetingConfig or error will be non-nil. Any
7873 // non-2xx status code is an error. Response headers are in either
7874 // *PretargetingConfig.ServerResponse.Header or (if a response was
7875 // returned at all) in error.(*googleapi.Error).Header. Use
7876 // googleapi.IsNotModified to check whether the returned error was
7877 // because http.StatusNotModified was returned.
7878 func (c *PretargetingConfigInsertCall) Do(opts ...googleapi.CallOption) (*PretargetingConfig, error) {
7879 gensupport.SetOptions(c.urlParams_, opts...)
7880 res, err := c.doRequest("json")
7881 if res != nil && res.StatusCode == http.StatusNotModified {
7882 if res.Body != nil {
7883 res.Body.Close()
7884 }
7885 return nil, &googleapi.Error{
7886 Code: res.StatusCode,
7887 Header: res.Header,
7888 }
7889 }
7890 if err != nil {
7891 return nil, err
7892 }
7893 defer googleapi.CloseBody(res)
7894 if err := googleapi.CheckResponse(res); err != nil {
7895 return nil, err
7896 }
7897 ret := &PretargetingConfig{
7898 ServerResponse: googleapi.ServerResponse{
7899 Header: res.Header,
7900 HTTPStatusCode: res.StatusCode,
7901 },
7902 }
7903 target := &ret
7904 if err := gensupport.DecodeResponse(target, res); err != nil {
7905 return nil, err
7906 }
7907 return ret, nil
7908 // {
7909 // "description": "Inserts a new pretargeting configuration.",
7910 // "httpMethod": "POST",
7911 // "id": "adexchangebuyer.pretargetingConfig.insert",
7912 // "parameterOrder": [
7913 // "accountId"
7914 // ],
7915 // "parameters": {
7916 // "accountId": {
7917 // "description": "The account id to insert the pretargeting config for.",
7918 // "format": "int64",
7919 // "location": "path",
7920 // "required": true,
7921 // "type": "string"
7922 // }
7923 // },
7924 // "path": "pretargetingconfigs/{accountId}",
7925 // "request": {
7926 // "$ref": "PretargetingConfig"
7927 // },
7928 // "response": {
7929 // "$ref": "PretargetingConfig"
7930 // },
7931 // "scopes": [
7932 // "https://www.googleapis.com/auth/adexchange.buyer"
7933 // ]
7934 // }
7935
7936 }
7937
7938 // method id "adexchangebuyer.pretargetingConfig.list":
7939
7940 type PretargetingConfigListCall struct {
7941 s *Service
7942 accountId int64
7943 urlParams_ gensupport.URLParams
7944 ifNoneMatch_ string
7945 ctx_ context.Context
7946 header_ http.Header
7947 }
7948
7949 // List: Retrieves a list of the authenticated user's pretargeting
7950 // configurations.
7951 //
7952 // - accountId: The account id to get the pretargeting configs for.
7953 func (r *PretargetingConfigService) List(accountId int64) *PretargetingConfigListCall {
7954 c := &PretargetingConfigListCall{s: r.s, urlParams_: make(gensupport.URLParams)}
7955 c.accountId = accountId
7956 return c
7957 }
7958
7959 // Fields allows partial responses to be retrieved. See
7960 // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
7961 // for more information.
7962 func (c *PretargetingConfigListCall) Fields(s ...googleapi.Field) *PretargetingConfigListCall {
7963 c.urlParams_.Set("fields", googleapi.CombineFields(s))
7964 return c
7965 }
7966
7967 // IfNoneMatch sets the optional parameter which makes the operation
7968 // fail if the object's ETag matches the given value. This is useful for
7969 // getting updates only after the object has changed since the last
7970 // request. Use googleapi.IsNotModified to check whether the response
7971 // error from Do is the result of In-None-Match.
7972 func (c *PretargetingConfigListCall) IfNoneMatch(entityTag string) *PretargetingConfigListCall {
7973 c.ifNoneMatch_ = entityTag
7974 return c
7975 }
7976
7977 // Context sets the context to be used in this call's Do method. Any
7978 // pending HTTP request will be aborted if the provided context is
7979 // canceled.
7980 func (c *PretargetingConfigListCall) Context(ctx context.Context) *PretargetingConfigListCall {
7981 c.ctx_ = ctx
7982 return c
7983 }
7984
7985 // Header returns an http.Header that can be modified by the caller to
7986 // add HTTP headers to the request.
7987 func (c *PretargetingConfigListCall) Header() http.Header {
7988 if c.header_ == nil {
7989 c.header_ = make(http.Header)
7990 }
7991 return c.header_
7992 }
7993
7994 func (c *PretargetingConfigListCall) doRequest(alt string) (*http.Response, error) {
7995 reqHeaders := make(http.Header)
7996 reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/20210819")
7997 for k, v := range c.header_ {
7998 reqHeaders[k] = v
7999 }
8000 reqHeaders.Set("User-Agent", c.s.userAgent())
8001 if c.ifNoneMatch_ != "" {
8002 reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
8003 }
8004 var body io.Reader = nil
8005 c.urlParams_.Set("alt", alt)
8006 c.urlParams_.Set("prettyPrint", "false")
8007 urls := googleapi.ResolveRelative(c.s.BasePath, "pretargetingconfigs/{accountId}")
8008 urls += "?" + c.urlParams_.Encode()
8009 req, err := http.NewRequest("GET", urls, body)
8010 if err != nil {
8011 return nil, err
8012 }
8013 req.Header = reqHeaders
8014 googleapi.Expand(req.URL, map[string]string{
8015 "accountId": strconv.FormatInt(c.accountId, 10),
8016 })
8017 return gensupport.SendRequest(c.ctx_, c.s.client, req)
8018 }
8019
8020 // Do executes the "adexchangebuyer.pretargetingConfig.list" call.
8021 // Exactly one of *PretargetingConfigList or error will be non-nil. Any
8022 // non-2xx status code is an error. Response headers are in either
8023 // *PretargetingConfigList.ServerResponse.Header or (if a response was
8024 // returned at all) in error.(*googleapi.Error).Header. Use
8025 // googleapi.IsNotModified to check whether the returned error was
8026 // because http.StatusNotModified was returned.
8027 func (c *PretargetingConfigListCall) Do(opts ...googleapi.CallOption) (*PretargetingConfigList, error) {
8028 gensupport.SetOptions(c.urlParams_, opts...)
8029 res, err := c.doRequest("json")
8030 if res != nil && res.StatusCode == http.StatusNotModified {
8031 if res.Body != nil {
8032 res.Body.Close()
8033 }
8034 return nil, &googleapi.Error{
8035 Code: res.StatusCode,
8036 Header: res.Header,
8037 }
8038 }
8039 if err != nil {
8040 return nil, err
8041 }
8042 defer googleapi.CloseBody(res)
8043 if err := googleapi.CheckResponse(res); err != nil {
8044 return nil, err
8045 }
8046 ret := &PretargetingConfigList{
8047 ServerResponse: googleapi.ServerResponse{
8048 Header: res.Header,
8049 HTTPStatusCode: res.StatusCode,
8050 },
8051 }
8052 target := &ret
8053 if err := gensupport.DecodeResponse(target, res); err != nil {
8054 return nil, err
8055 }
8056 return ret, nil
8057 // {
8058 // "description": "Retrieves a list of the authenticated user's pretargeting configurations.",
8059 // "httpMethod": "GET",
8060 // "id": "adexchangebuyer.pretargetingConfig.list",
8061 // "parameterOrder": [
8062 // "accountId"
8063 // ],
8064 // "parameters": {
8065 // "accountId": {
8066 // "description": "The account id to get the pretargeting configs for.",
8067 // "format": "int64",
8068 // "location": "path",
8069 // "required": true,
8070 // "type": "string"
8071 // }
8072 // },
8073 // "path": "pretargetingconfigs/{accountId}",
8074 // "response": {
8075 // "$ref": "PretargetingConfigList"
8076 // },
8077 // "scopes": [
8078 // "https://www.googleapis.com/auth/adexchange.buyer"
8079 // ]
8080 // }
8081
8082 }
8083
8084 // method id "adexchangebuyer.pretargetingConfig.patch":
8085
8086 type PretargetingConfigPatchCall struct {
8087 s *Service
8088 accountId int64
8089 configId int64
8090 pretargetingconfig *PretargetingConfig
8091 urlParams_ gensupport.URLParams
8092 ctx_ context.Context
8093 header_ http.Header
8094 }
8095
8096 // Patch: Updates an existing pretargeting config. This method supports
8097 // patch semantics.
8098 //
8099 // - accountId: The account id to update the pretargeting config for.
8100 // - configId: The specific id of the configuration to update.
8101 func (r *PretargetingConfigService) Patch(accountId int64, configId int64, pretargetingconfig *PretargetingConfig) *PretargetingConfigPatchCall {
8102 c := &PretargetingConfigPatchCall{s: r.s, urlParams_: make(gensupport.URLParams)}
8103 c.accountId = accountId
8104 c.configId = configId
8105 c.pretargetingconfig = pretargetingconfig
8106 return c
8107 }
8108
8109 // Fields allows partial responses to be retrieved. See
8110 // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
8111 // for more information.
8112 func (c *PretargetingConfigPatchCall) Fields(s ...googleapi.Field) *PretargetingConfigPatchCall {
8113 c.urlParams_.Set("fields", googleapi.CombineFields(s))
8114 return c
8115 }
8116
8117 // Context sets the context to be used in this call's Do method. Any
8118 // pending HTTP request will be aborted if the provided context is
8119 // canceled.
8120 func (c *PretargetingConfigPatchCall) Context(ctx context.Context) *PretargetingConfigPatchCall {
8121 c.ctx_ = ctx
8122 return c
8123 }
8124
8125 // Header returns an http.Header that can be modified by the caller to
8126 // add HTTP headers to the request.
8127 func (c *PretargetingConfigPatchCall) Header() http.Header {
8128 if c.header_ == nil {
8129 c.header_ = make(http.Header)
8130 }
8131 return c.header_
8132 }
8133
8134 func (c *PretargetingConfigPatchCall) doRequest(alt string) (*http.Response, error) {
8135 reqHeaders := make(http.Header)
8136 reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/20210819")
8137 for k, v := range c.header_ {
8138 reqHeaders[k] = v
8139 }
8140 reqHeaders.Set("User-Agent", c.s.userAgent())
8141 var body io.Reader = nil
8142 body, err := googleapi.WithoutDataWrapper.JSONReader(c.pretargetingconfig)
8143 if err != nil {
8144 return nil, err
8145 }
8146 reqHeaders.Set("Content-Type", "application/json")
8147 c.urlParams_.Set("alt", alt)
8148 c.urlParams_.Set("prettyPrint", "false")
8149 urls := googleapi.ResolveRelative(c.s.BasePath, "pretargetingconfigs/{accountId}/{configId}")
8150 urls += "?" + c.urlParams_.Encode()
8151 req, err := http.NewRequest("PATCH", urls, body)
8152 if err != nil {
8153 return nil, err
8154 }
8155 req.Header = reqHeaders
8156 googleapi.Expand(req.URL, map[string]string{
8157 "accountId": strconv.FormatInt(c.accountId, 10),
8158 "configId": strconv.FormatInt(c.configId, 10),
8159 })
8160 return gensupport.SendRequest(c.ctx_, c.s.client, req)
8161 }
8162
8163 // Do executes the "adexchangebuyer.pretargetingConfig.patch" call.
8164 // Exactly one of *PretargetingConfig or error will be non-nil. Any
8165 // non-2xx status code is an error. Response headers are in either
8166 // *PretargetingConfig.ServerResponse.Header or (if a response was
8167 // returned at all) in error.(*googleapi.Error).Header. Use
8168 // googleapi.IsNotModified to check whether the returned error was
8169 // because http.StatusNotModified was returned.
8170 func (c *PretargetingConfigPatchCall) Do(opts ...googleapi.CallOption) (*PretargetingConfig, error) {
8171 gensupport.SetOptions(c.urlParams_, opts...)
8172 res, err := c.doRequest("json")
8173 if res != nil && res.StatusCode == http.StatusNotModified {
8174 if res.Body != nil {
8175 res.Body.Close()
8176 }
8177 return nil, &googleapi.Error{
8178 Code: res.StatusCode,
8179 Header: res.Header,
8180 }
8181 }
8182 if err != nil {
8183 return nil, err
8184 }
8185 defer googleapi.CloseBody(res)
8186 if err := googleapi.CheckResponse(res); err != nil {
8187 return nil, err
8188 }
8189 ret := &PretargetingConfig{
8190 ServerResponse: googleapi.ServerResponse{
8191 Header: res.Header,
8192 HTTPStatusCode: res.StatusCode,
8193 },
8194 }
8195 target := &ret
8196 if err := gensupport.DecodeResponse(target, res); err != nil {
8197 return nil, err
8198 }
8199 return ret, nil
8200 // {
8201 // "description": "Updates an existing pretargeting config. This method supports patch semantics.",
8202 // "httpMethod": "PATCH",
8203 // "id": "adexchangebuyer.pretargetingConfig.patch",
8204 // "parameterOrder": [
8205 // "accountId",
8206 // "configId"
8207 // ],
8208 // "parameters": {
8209 // "accountId": {
8210 // "description": "The account id to update the pretargeting config for.",
8211 // "format": "int64",
8212 // "location": "path",
8213 // "required": true,
8214 // "type": "string"
8215 // },
8216 // "configId": {
8217 // "description": "The specific id of the configuration to update.",
8218 // "format": "int64",
8219 // "location": "path",
8220 // "required": true,
8221 // "type": "string"
8222 // }
8223 // },
8224 // "path": "pretargetingconfigs/{accountId}/{configId}",
8225 // "request": {
8226 // "$ref": "PretargetingConfig"
8227 // },
8228 // "response": {
8229 // "$ref": "PretargetingConfig"
8230 // },
8231 // "scopes": [
8232 // "https://www.googleapis.com/auth/adexchange.buyer"
8233 // ]
8234 // }
8235
8236 }
8237
8238 // method id "adexchangebuyer.pretargetingConfig.update":
8239
8240 type PretargetingConfigUpdateCall struct {
8241 s *Service
8242 accountId int64
8243 configId int64
8244 pretargetingconfig *PretargetingConfig
8245 urlParams_ gensupport.URLParams
8246 ctx_ context.Context
8247 header_ http.Header
8248 }
8249
8250 // Update: Updates an existing pretargeting config.
8251 //
8252 // - accountId: The account id to update the pretargeting config for.
8253 // - configId: The specific id of the configuration to update.
8254 func (r *PretargetingConfigService) Update(accountId int64, configId int64, pretargetingconfig *PretargetingConfig) *PretargetingConfigUpdateCall {
8255 c := &PretargetingConfigUpdateCall{s: r.s, urlParams_: make(gensupport.URLParams)}
8256 c.accountId = accountId
8257 c.configId = configId
8258 c.pretargetingconfig = pretargetingconfig
8259 return c
8260 }
8261
8262 // Fields allows partial responses to be retrieved. See
8263 // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
8264 // for more information.
8265 func (c *PretargetingConfigUpdateCall) Fields(s ...googleapi.Field) *PretargetingConfigUpdateCall {
8266 c.urlParams_.Set("fields", googleapi.CombineFields(s))
8267 return c
8268 }
8269
8270 // Context sets the context to be used in this call's Do method. Any
8271 // pending HTTP request will be aborted if the provided context is
8272 // canceled.
8273 func (c *PretargetingConfigUpdateCall) Context(ctx context.Context) *PretargetingConfigUpdateCall {
8274 c.ctx_ = ctx
8275 return c
8276 }
8277
8278 // Header returns an http.Header that can be modified by the caller to
8279 // add HTTP headers to the request.
8280 func (c *PretargetingConfigUpdateCall) Header() http.Header {
8281 if c.header_ == nil {
8282 c.header_ = make(http.Header)
8283 }
8284 return c.header_
8285 }
8286
8287 func (c *PretargetingConfigUpdateCall) doRequest(alt string) (*http.Response, error) {
8288 reqHeaders := make(http.Header)
8289 reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/20210819")
8290 for k, v := range c.header_ {
8291 reqHeaders[k] = v
8292 }
8293 reqHeaders.Set("User-Agent", c.s.userAgent())
8294 var body io.Reader = nil
8295 body, err := googleapi.WithoutDataWrapper.JSONReader(c.pretargetingconfig)
8296 if err != nil {
8297 return nil, err
8298 }
8299 reqHeaders.Set("Content-Type", "application/json")
8300 c.urlParams_.Set("alt", alt)
8301 c.urlParams_.Set("prettyPrint", "false")
8302 urls := googleapi.ResolveRelative(c.s.BasePath, "pretargetingconfigs/{accountId}/{configId}")
8303 urls += "?" + c.urlParams_.Encode()
8304 req, err := http.NewRequest("PUT", urls, body)
8305 if err != nil {
8306 return nil, err
8307 }
8308 req.Header = reqHeaders
8309 googleapi.Expand(req.URL, map[string]string{
8310 "accountId": strconv.FormatInt(c.accountId, 10),
8311 "configId": strconv.FormatInt(c.configId, 10),
8312 })
8313 return gensupport.SendRequest(c.ctx_, c.s.client, req)
8314 }
8315
8316 // Do executes the "adexchangebuyer.pretargetingConfig.update" call.
8317 // Exactly one of *PretargetingConfig or error will be non-nil. Any
8318 // non-2xx status code is an error. Response headers are in either
8319 // *PretargetingConfig.ServerResponse.Header or (if a response was
8320 // returned at all) in error.(*googleapi.Error).Header. Use
8321 // googleapi.IsNotModified to check whether the returned error was
8322 // because http.StatusNotModified was returned.
8323 func (c *PretargetingConfigUpdateCall) Do(opts ...googleapi.CallOption) (*PretargetingConfig, error) {
8324 gensupport.SetOptions(c.urlParams_, opts...)
8325 res, err := c.doRequest("json")
8326 if res != nil && res.StatusCode == http.StatusNotModified {
8327 if res.Body != nil {
8328 res.Body.Close()
8329 }
8330 return nil, &googleapi.Error{
8331 Code: res.StatusCode,
8332 Header: res.Header,
8333 }
8334 }
8335 if err != nil {
8336 return nil, err
8337 }
8338 defer googleapi.CloseBody(res)
8339 if err := googleapi.CheckResponse(res); err != nil {
8340 return nil, err
8341 }
8342 ret := &PretargetingConfig{
8343 ServerResponse: googleapi.ServerResponse{
8344 Header: res.Header,
8345 HTTPStatusCode: res.StatusCode,
8346 },
8347 }
8348 target := &ret
8349 if err := gensupport.DecodeResponse(target, res); err != nil {
8350 return nil, err
8351 }
8352 return ret, nil
8353 // {
8354 // "description": "Updates an existing pretargeting config.",
8355 // "httpMethod": "PUT",
8356 // "id": "adexchangebuyer.pretargetingConfig.update",
8357 // "parameterOrder": [
8358 // "accountId",
8359 // "configId"
8360 // ],
8361 // "parameters": {
8362 // "accountId": {
8363 // "description": "The account id to update the pretargeting config for.",
8364 // "format": "int64",
8365 // "location": "path",
8366 // "required": true,
8367 // "type": "string"
8368 // },
8369 // "configId": {
8370 // "description": "The specific id of the configuration to update.",
8371 // "format": "int64",
8372 // "location": "path",
8373 // "required": true,
8374 // "type": "string"
8375 // }
8376 // },
8377 // "path": "pretargetingconfigs/{accountId}/{configId}",
8378 // "request": {
8379 // "$ref": "PretargetingConfig"
8380 // },
8381 // "response": {
8382 // "$ref": "PretargetingConfig"
8383 // },
8384 // "scopes": [
8385 // "https://www.googleapis.com/auth/adexchange.buyer"
8386 // ]
8387 // }
8388
8389 }
8390
8391 // method id "adexchangebuyer.products.get":
8392
8393 type ProductsGetCall struct {
8394 s *Service
8395 productId string
8396 urlParams_ gensupport.URLParams
8397 ifNoneMatch_ string
8398 ctx_ context.Context
8399 header_ http.Header
8400 }
8401
8402 // Get: Gets the requested product by id.
8403 //
8404 // - productId: The id for the product to get the head revision for.
8405 func (r *ProductsService) Get(productId string) *ProductsGetCall {
8406 c := &ProductsGetCall{s: r.s, urlParams_: make(gensupport.URLParams)}
8407 c.productId = productId
8408 return c
8409 }
8410
8411 // Fields allows partial responses to be retrieved. See
8412 // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
8413 // for more information.
8414 func (c *ProductsGetCall) Fields(s ...googleapi.Field) *ProductsGetCall {
8415 c.urlParams_.Set("fields", googleapi.CombineFields(s))
8416 return c
8417 }
8418
8419 // IfNoneMatch sets the optional parameter which makes the operation
8420 // fail if the object's ETag matches the given value. This is useful for
8421 // getting updates only after the object has changed since the last
8422 // request. Use googleapi.IsNotModified to check whether the response
8423 // error from Do is the result of In-None-Match.
8424 func (c *ProductsGetCall) IfNoneMatch(entityTag string) *ProductsGetCall {
8425 c.ifNoneMatch_ = entityTag
8426 return c
8427 }
8428
8429 // Context sets the context to be used in this call's Do method. Any
8430 // pending HTTP request will be aborted if the provided context is
8431 // canceled.
8432 func (c *ProductsGetCall) Context(ctx context.Context) *ProductsGetCall {
8433 c.ctx_ = ctx
8434 return c
8435 }
8436
8437 // Header returns an http.Header that can be modified by the caller to
8438 // add HTTP headers to the request.
8439 func (c *ProductsGetCall) Header() http.Header {
8440 if c.header_ == nil {
8441 c.header_ = make(http.Header)
8442 }
8443 return c.header_
8444 }
8445
8446 func (c *ProductsGetCall) doRequest(alt string) (*http.Response, error) {
8447 reqHeaders := make(http.Header)
8448 reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/20210819")
8449 for k, v := range c.header_ {
8450 reqHeaders[k] = v
8451 }
8452 reqHeaders.Set("User-Agent", c.s.userAgent())
8453 if c.ifNoneMatch_ != "" {
8454 reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
8455 }
8456 var body io.Reader = nil
8457 c.urlParams_.Set("alt", alt)
8458 c.urlParams_.Set("prettyPrint", "false")
8459 urls := googleapi.ResolveRelative(c.s.BasePath, "products/{productId}")
8460 urls += "?" + c.urlParams_.Encode()
8461 req, err := http.NewRequest("GET", urls, body)
8462 if err != nil {
8463 return nil, err
8464 }
8465 req.Header = reqHeaders
8466 googleapi.Expand(req.URL, map[string]string{
8467 "productId": c.productId,
8468 })
8469 return gensupport.SendRequest(c.ctx_, c.s.client, req)
8470 }
8471
8472 // Do executes the "adexchangebuyer.products.get" call.
8473 // Exactly one of *Product or error will be non-nil. Any non-2xx status
8474 // code is an error. Response headers are in either
8475 // *Product.ServerResponse.Header or (if a response was returned at all)
8476 // in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to
8477 // check whether the returned error was because http.StatusNotModified
8478 // was returned.
8479 func (c *ProductsGetCall) Do(opts ...googleapi.CallOption) (*Product, error) {
8480 gensupport.SetOptions(c.urlParams_, opts...)
8481 res, err := c.doRequest("json")
8482 if res != nil && res.StatusCode == http.StatusNotModified {
8483 if res.Body != nil {
8484 res.Body.Close()
8485 }
8486 return nil, &googleapi.Error{
8487 Code: res.StatusCode,
8488 Header: res.Header,
8489 }
8490 }
8491 if err != nil {
8492 return nil, err
8493 }
8494 defer googleapi.CloseBody(res)
8495 if err := googleapi.CheckResponse(res); err != nil {
8496 return nil, err
8497 }
8498 ret := &Product{
8499 ServerResponse: googleapi.ServerResponse{
8500 Header: res.Header,
8501 HTTPStatusCode: res.StatusCode,
8502 },
8503 }
8504 target := &ret
8505 if err := gensupport.DecodeResponse(target, res); err != nil {
8506 return nil, err
8507 }
8508 return ret, nil
8509 // {
8510 // "description": "Gets the requested product by id.",
8511 // "httpMethod": "GET",
8512 // "id": "adexchangebuyer.products.get",
8513 // "parameterOrder": [
8514 // "productId"
8515 // ],
8516 // "parameters": {
8517 // "productId": {
8518 // "description": "The id for the product to get the head revision for.",
8519 // "location": "path",
8520 // "required": true,
8521 // "type": "string"
8522 // }
8523 // },
8524 // "path": "products/{productId}",
8525 // "response": {
8526 // "$ref": "Product"
8527 // },
8528 // "scopes": [
8529 // "https://www.googleapis.com/auth/adexchange.buyer"
8530 // ]
8531 // }
8532
8533 }
8534
8535 // method id "adexchangebuyer.products.search":
8536
8537 type ProductsSearchCall struct {
8538 s *Service
8539 urlParams_ gensupport.URLParams
8540 ifNoneMatch_ string
8541 ctx_ context.Context
8542 header_ http.Header
8543 }
8544
8545 // Search: Gets the requested product.
8546 func (r *ProductsService) Search() *ProductsSearchCall {
8547 c := &ProductsSearchCall{s: r.s, urlParams_: make(gensupport.URLParams)}
8548 return c
8549 }
8550
8551 // PqlQuery sets the optional parameter "pqlQuery": The pql query used
8552 // to query for products.
8553 func (c *ProductsSearchCall) PqlQuery(pqlQuery string) *ProductsSearchCall {
8554 c.urlParams_.Set("pqlQuery", pqlQuery)
8555 return c
8556 }
8557
8558 // Fields allows partial responses to be retrieved. See
8559 // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
8560 // for more information.
8561 func (c *ProductsSearchCall) Fields(s ...googleapi.Field) *ProductsSearchCall {
8562 c.urlParams_.Set("fields", googleapi.CombineFields(s))
8563 return c
8564 }
8565
8566 // IfNoneMatch sets the optional parameter which makes the operation
8567 // fail if the object's ETag matches the given value. This is useful for
8568 // getting updates only after the object has changed since the last
8569 // request. Use googleapi.IsNotModified to check whether the response
8570 // error from Do is the result of In-None-Match.
8571 func (c *ProductsSearchCall) IfNoneMatch(entityTag string) *ProductsSearchCall {
8572 c.ifNoneMatch_ = entityTag
8573 return c
8574 }
8575
8576 // Context sets the context to be used in this call's Do method. Any
8577 // pending HTTP request will be aborted if the provided context is
8578 // canceled.
8579 func (c *ProductsSearchCall) Context(ctx context.Context) *ProductsSearchCall {
8580 c.ctx_ = ctx
8581 return c
8582 }
8583
8584 // Header returns an http.Header that can be modified by the caller to
8585 // add HTTP headers to the request.
8586 func (c *ProductsSearchCall) Header() http.Header {
8587 if c.header_ == nil {
8588 c.header_ = make(http.Header)
8589 }
8590 return c.header_
8591 }
8592
8593 func (c *ProductsSearchCall) doRequest(alt string) (*http.Response, error) {
8594 reqHeaders := make(http.Header)
8595 reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/20210819")
8596 for k, v := range c.header_ {
8597 reqHeaders[k] = v
8598 }
8599 reqHeaders.Set("User-Agent", c.s.userAgent())
8600 if c.ifNoneMatch_ != "" {
8601 reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
8602 }
8603 var body io.Reader = nil
8604 c.urlParams_.Set("alt", alt)
8605 c.urlParams_.Set("prettyPrint", "false")
8606 urls := googleapi.ResolveRelative(c.s.BasePath, "products/search")
8607 urls += "?" + c.urlParams_.Encode()
8608 req, err := http.NewRequest("GET", urls, body)
8609 if err != nil {
8610 return nil, err
8611 }
8612 req.Header = reqHeaders
8613 return gensupport.SendRequest(c.ctx_, c.s.client, req)
8614 }
8615
8616 // Do executes the "adexchangebuyer.products.search" call.
8617 // Exactly one of *GetOffersResponse or error will be non-nil. Any
8618 // non-2xx status code is an error. Response headers are in either
8619 // *GetOffersResponse.ServerResponse.Header or (if a response was
8620 // returned at all) in error.(*googleapi.Error).Header. Use
8621 // googleapi.IsNotModified to check whether the returned error was
8622 // because http.StatusNotModified was returned.
8623 func (c *ProductsSearchCall) Do(opts ...googleapi.CallOption) (*GetOffersResponse, error) {
8624 gensupport.SetOptions(c.urlParams_, opts...)
8625 res, err := c.doRequest("json")
8626 if res != nil && res.StatusCode == http.StatusNotModified {
8627 if res.Body != nil {
8628 res.Body.Close()
8629 }
8630 return nil, &googleapi.Error{
8631 Code: res.StatusCode,
8632 Header: res.Header,
8633 }
8634 }
8635 if err != nil {
8636 return nil, err
8637 }
8638 defer googleapi.CloseBody(res)
8639 if err := googleapi.CheckResponse(res); err != nil {
8640 return nil, err
8641 }
8642 ret := &GetOffersResponse{
8643 ServerResponse: googleapi.ServerResponse{
8644 Header: res.Header,
8645 HTTPStatusCode: res.StatusCode,
8646 },
8647 }
8648 target := &ret
8649 if err := gensupport.DecodeResponse(target, res); err != nil {
8650 return nil, err
8651 }
8652 return ret, nil
8653 // {
8654 // "description": "Gets the requested product.",
8655 // "httpMethod": "GET",
8656 // "id": "adexchangebuyer.products.search",
8657 // "parameters": {
8658 // "pqlQuery": {
8659 // "description": "The pql query used to query for products.",
8660 // "location": "query",
8661 // "type": "string"
8662 // }
8663 // },
8664 // "path": "products/search",
8665 // "response": {
8666 // "$ref": "GetOffersResponse"
8667 // },
8668 // "scopes": [
8669 // "https://www.googleapis.com/auth/adexchange.buyer"
8670 // ]
8671 // }
8672
8673 }
8674
8675 // method id "adexchangebuyer.proposals.get":
8676
8677 type ProposalsGetCall struct {
8678 s *Service
8679 proposalId string
8680 urlParams_ gensupport.URLParams
8681 ifNoneMatch_ string
8682 ctx_ context.Context
8683 header_ http.Header
8684 }
8685
8686 // Get: Get a proposal given its id
8687 //
8688 // - proposalId: Id of the proposal to retrieve.
8689 func (r *ProposalsService) Get(proposalId string) *ProposalsGetCall {
8690 c := &ProposalsGetCall{s: r.s, urlParams_: make(gensupport.URLParams)}
8691 c.proposalId = proposalId
8692 return c
8693 }
8694
8695 // Fields allows partial responses to be retrieved. See
8696 // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
8697 // for more information.
8698 func (c *ProposalsGetCall) Fields(s ...googleapi.Field) *ProposalsGetCall {
8699 c.urlParams_.Set("fields", googleapi.CombineFields(s))
8700 return c
8701 }
8702
8703 // IfNoneMatch sets the optional parameter which makes the operation
8704 // fail if the object's ETag matches the given value. This is useful for
8705 // getting updates only after the object has changed since the last
8706 // request. Use googleapi.IsNotModified to check whether the response
8707 // error from Do is the result of In-None-Match.
8708 func (c *ProposalsGetCall) IfNoneMatch(entityTag string) *ProposalsGetCall {
8709 c.ifNoneMatch_ = entityTag
8710 return c
8711 }
8712
8713 // Context sets the context to be used in this call's Do method. Any
8714 // pending HTTP request will be aborted if the provided context is
8715 // canceled.
8716 func (c *ProposalsGetCall) Context(ctx context.Context) *ProposalsGetCall {
8717 c.ctx_ = ctx
8718 return c
8719 }
8720
8721 // Header returns an http.Header that can be modified by the caller to
8722 // add HTTP headers to the request.
8723 func (c *ProposalsGetCall) Header() http.Header {
8724 if c.header_ == nil {
8725 c.header_ = make(http.Header)
8726 }
8727 return c.header_
8728 }
8729
8730 func (c *ProposalsGetCall) doRequest(alt string) (*http.Response, error) {
8731 reqHeaders := make(http.Header)
8732 reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/20210819")
8733 for k, v := range c.header_ {
8734 reqHeaders[k] = v
8735 }
8736 reqHeaders.Set("User-Agent", c.s.userAgent())
8737 if c.ifNoneMatch_ != "" {
8738 reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
8739 }
8740 var body io.Reader = nil
8741 c.urlParams_.Set("alt", alt)
8742 c.urlParams_.Set("prettyPrint", "false")
8743 urls := googleapi.ResolveRelative(c.s.BasePath, "proposals/{proposalId}")
8744 urls += "?" + c.urlParams_.Encode()
8745 req, err := http.NewRequest("GET", urls, body)
8746 if err != nil {
8747 return nil, err
8748 }
8749 req.Header = reqHeaders
8750 googleapi.Expand(req.URL, map[string]string{
8751 "proposalId": c.proposalId,
8752 })
8753 return gensupport.SendRequest(c.ctx_, c.s.client, req)
8754 }
8755
8756 // Do executes the "adexchangebuyer.proposals.get" call.
8757 // Exactly one of *Proposal or error will be non-nil. Any non-2xx status
8758 // code is an error. Response headers are in either
8759 // *Proposal.ServerResponse.Header or (if a response was returned at
8760 // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
8761 // to check whether the returned error was because
8762 // http.StatusNotModified was returned.
8763 func (c *ProposalsGetCall) Do(opts ...googleapi.CallOption) (*Proposal, error) {
8764 gensupport.SetOptions(c.urlParams_, opts...)
8765 res, err := c.doRequest("json")
8766 if res != nil && res.StatusCode == http.StatusNotModified {
8767 if res.Body != nil {
8768 res.Body.Close()
8769 }
8770 return nil, &googleapi.Error{
8771 Code: res.StatusCode,
8772 Header: res.Header,
8773 }
8774 }
8775 if err != nil {
8776 return nil, err
8777 }
8778 defer googleapi.CloseBody(res)
8779 if err := googleapi.CheckResponse(res); err != nil {
8780 return nil, err
8781 }
8782 ret := &Proposal{
8783 ServerResponse: googleapi.ServerResponse{
8784 Header: res.Header,
8785 HTTPStatusCode: res.StatusCode,
8786 },
8787 }
8788 target := &ret
8789 if err := gensupport.DecodeResponse(target, res); err != nil {
8790 return nil, err
8791 }
8792 return ret, nil
8793 // {
8794 // "description": "Get a proposal given its id",
8795 // "httpMethod": "GET",
8796 // "id": "adexchangebuyer.proposals.get",
8797 // "parameterOrder": [
8798 // "proposalId"
8799 // ],
8800 // "parameters": {
8801 // "proposalId": {
8802 // "description": "Id of the proposal to retrieve.",
8803 // "location": "path",
8804 // "required": true,
8805 // "type": "string"
8806 // }
8807 // },
8808 // "path": "proposals/{proposalId}",
8809 // "response": {
8810 // "$ref": "Proposal"
8811 // },
8812 // "scopes": [
8813 // "https://www.googleapis.com/auth/adexchange.buyer"
8814 // ]
8815 // }
8816
8817 }
8818
8819 // method id "adexchangebuyer.proposals.insert":
8820
8821 type ProposalsInsertCall struct {
8822 s *Service
8823 createordersrequest *CreateOrdersRequest
8824 urlParams_ gensupport.URLParams
8825 ctx_ context.Context
8826 header_ http.Header
8827 }
8828
8829 // Insert: Create the given list of proposals
8830 func (r *ProposalsService) Insert(createordersrequest *CreateOrdersRequest) *ProposalsInsertCall {
8831 c := &ProposalsInsertCall{s: r.s, urlParams_: make(gensupport.URLParams)}
8832 c.createordersrequest = createordersrequest
8833 return c
8834 }
8835
8836 // Fields allows partial responses to be retrieved. See
8837 // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
8838 // for more information.
8839 func (c *ProposalsInsertCall) Fields(s ...googleapi.Field) *ProposalsInsertCall {
8840 c.urlParams_.Set("fields", googleapi.CombineFields(s))
8841 return c
8842 }
8843
8844 // Context sets the context to be used in this call's Do method. Any
8845 // pending HTTP request will be aborted if the provided context is
8846 // canceled.
8847 func (c *ProposalsInsertCall) Context(ctx context.Context) *ProposalsInsertCall {
8848 c.ctx_ = ctx
8849 return c
8850 }
8851
8852 // Header returns an http.Header that can be modified by the caller to
8853 // add HTTP headers to the request.
8854 func (c *ProposalsInsertCall) Header() http.Header {
8855 if c.header_ == nil {
8856 c.header_ = make(http.Header)
8857 }
8858 return c.header_
8859 }
8860
8861 func (c *ProposalsInsertCall) doRequest(alt string) (*http.Response, error) {
8862 reqHeaders := make(http.Header)
8863 reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/20210819")
8864 for k, v := range c.header_ {
8865 reqHeaders[k] = v
8866 }
8867 reqHeaders.Set("User-Agent", c.s.userAgent())
8868 var body io.Reader = nil
8869 body, err := googleapi.WithoutDataWrapper.JSONReader(c.createordersrequest)
8870 if err != nil {
8871 return nil, err
8872 }
8873 reqHeaders.Set("Content-Type", "application/json")
8874 c.urlParams_.Set("alt", alt)
8875 c.urlParams_.Set("prettyPrint", "false")
8876 urls := googleapi.ResolveRelative(c.s.BasePath, "proposals/insert")
8877 urls += "?" + c.urlParams_.Encode()
8878 req, err := http.NewRequest("POST", urls, body)
8879 if err != nil {
8880 return nil, err
8881 }
8882 req.Header = reqHeaders
8883 return gensupport.SendRequest(c.ctx_, c.s.client, req)
8884 }
8885
8886 // Do executes the "adexchangebuyer.proposals.insert" call.
8887 // Exactly one of *CreateOrdersResponse or error will be non-nil. Any
8888 // non-2xx status code is an error. Response headers are in either
8889 // *CreateOrdersResponse.ServerResponse.Header or (if a response was
8890 // returned at all) in error.(*googleapi.Error).Header. Use
8891 // googleapi.IsNotModified to check whether the returned error was
8892 // because http.StatusNotModified was returned.
8893 func (c *ProposalsInsertCall) Do(opts ...googleapi.CallOption) (*CreateOrdersResponse, error) {
8894 gensupport.SetOptions(c.urlParams_, opts...)
8895 res, err := c.doRequest("json")
8896 if res != nil && res.StatusCode == http.StatusNotModified {
8897 if res.Body != nil {
8898 res.Body.Close()
8899 }
8900 return nil, &googleapi.Error{
8901 Code: res.StatusCode,
8902 Header: res.Header,
8903 }
8904 }
8905 if err != nil {
8906 return nil, err
8907 }
8908 defer googleapi.CloseBody(res)
8909 if err := googleapi.CheckResponse(res); err != nil {
8910 return nil, err
8911 }
8912 ret := &CreateOrdersResponse{
8913 ServerResponse: googleapi.ServerResponse{
8914 Header: res.Header,
8915 HTTPStatusCode: res.StatusCode,
8916 },
8917 }
8918 target := &ret
8919 if err := gensupport.DecodeResponse(target, res); err != nil {
8920 return nil, err
8921 }
8922 return ret, nil
8923 // {
8924 // "description": "Create the given list of proposals",
8925 // "httpMethod": "POST",
8926 // "id": "adexchangebuyer.proposals.insert",
8927 // "path": "proposals/insert",
8928 // "request": {
8929 // "$ref": "CreateOrdersRequest"
8930 // },
8931 // "response": {
8932 // "$ref": "CreateOrdersResponse"
8933 // },
8934 // "scopes": [
8935 // "https://www.googleapis.com/auth/adexchange.buyer"
8936 // ]
8937 // }
8938
8939 }
8940
8941 // method id "adexchangebuyer.proposals.patch":
8942
8943 type ProposalsPatchCall struct {
8944 s *Service
8945 proposalId string
8946 revisionNumber int64
8947 updateAction string
8948 proposal *Proposal
8949 urlParams_ gensupport.URLParams
8950 ctx_ context.Context
8951 header_ http.Header
8952 }
8953
8954 // Patch: Update the given proposal. This method supports patch
8955 // semantics.
8956 //
8957 // - proposalId: The proposal id to update.
8958 // - revisionNumber: The last known revision number to update. If the
8959 // head revision in the marketplace database has since changed, an
8960 // error will be thrown. The caller should then fetch the latest
8961 // proposal at head revision and retry the update at that revision.
8962 // - updateAction: The proposed action to take on the proposal. This
8963 // field is required and it must be set when updating a proposal.
8964 func (r *ProposalsService) Patch(proposalId string, revisionNumber int64, updateAction string, proposal *Proposal) *ProposalsPatchCall {
8965 c := &ProposalsPatchCall{s: r.s, urlParams_: make(gensupport.URLParams)}
8966 c.proposalId = proposalId
8967 c.revisionNumber = revisionNumber
8968 c.updateAction = updateAction
8969 c.proposal = proposal
8970 return c
8971 }
8972
8973 // Fields allows partial responses to be retrieved. See
8974 // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
8975 // for more information.
8976 func (c *ProposalsPatchCall) Fields(s ...googleapi.Field) *ProposalsPatchCall {
8977 c.urlParams_.Set("fields", googleapi.CombineFields(s))
8978 return c
8979 }
8980
8981 // Context sets the context to be used in this call's Do method. Any
8982 // pending HTTP request will be aborted if the provided context is
8983 // canceled.
8984 func (c *ProposalsPatchCall) Context(ctx context.Context) *ProposalsPatchCall {
8985 c.ctx_ = ctx
8986 return c
8987 }
8988
8989 // Header returns an http.Header that can be modified by the caller to
8990 // add HTTP headers to the request.
8991 func (c *ProposalsPatchCall) Header() http.Header {
8992 if c.header_ == nil {
8993 c.header_ = make(http.Header)
8994 }
8995 return c.header_
8996 }
8997
8998 func (c *ProposalsPatchCall) doRequest(alt string) (*http.Response, error) {
8999 reqHeaders := make(http.Header)
9000 reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/20210819")
9001 for k, v := range c.header_ {
9002 reqHeaders[k] = v
9003 }
9004 reqHeaders.Set("User-Agent", c.s.userAgent())
9005 var body io.Reader = nil
9006 body, err := googleapi.WithoutDataWrapper.JSONReader(c.proposal)
9007 if err != nil {
9008 return nil, err
9009 }
9010 reqHeaders.Set("Content-Type", "application/json")
9011 c.urlParams_.Set("alt", alt)
9012 c.urlParams_.Set("prettyPrint", "false")
9013 urls := googleapi.ResolveRelative(c.s.BasePath, "proposals/{proposalId}/{revisionNumber}/{updateAction}")
9014 urls += "?" + c.urlParams_.Encode()
9015 req, err := http.NewRequest("PATCH", urls, body)
9016 if err != nil {
9017 return nil, err
9018 }
9019 req.Header = reqHeaders
9020 googleapi.Expand(req.URL, map[string]string{
9021 "proposalId": c.proposalId,
9022 "revisionNumber": strconv.FormatInt(c.revisionNumber, 10),
9023 "updateAction": c.updateAction,
9024 })
9025 return gensupport.SendRequest(c.ctx_, c.s.client, req)
9026 }
9027
9028 // Do executes the "adexchangebuyer.proposals.patch" call.
9029 // Exactly one of *Proposal or error will be non-nil. Any non-2xx status
9030 // code is an error. Response headers are in either
9031 // *Proposal.ServerResponse.Header or (if a response was returned at
9032 // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
9033 // to check whether the returned error was because
9034 // http.StatusNotModified was returned.
9035 func (c *ProposalsPatchCall) Do(opts ...googleapi.CallOption) (*Proposal, error) {
9036 gensupport.SetOptions(c.urlParams_, opts...)
9037 res, err := c.doRequest("json")
9038 if res != nil && res.StatusCode == http.StatusNotModified {
9039 if res.Body != nil {
9040 res.Body.Close()
9041 }
9042 return nil, &googleapi.Error{
9043 Code: res.StatusCode,
9044 Header: res.Header,
9045 }
9046 }
9047 if err != nil {
9048 return nil, err
9049 }
9050 defer googleapi.CloseBody(res)
9051 if err := googleapi.CheckResponse(res); err != nil {
9052 return nil, err
9053 }
9054 ret := &Proposal{
9055 ServerResponse: googleapi.ServerResponse{
9056 Header: res.Header,
9057 HTTPStatusCode: res.StatusCode,
9058 },
9059 }
9060 target := &ret
9061 if err := gensupport.DecodeResponse(target, res); err != nil {
9062 return nil, err
9063 }
9064 return ret, nil
9065 // {
9066 // "description": "Update the given proposal. This method supports patch semantics.",
9067 // "httpMethod": "PATCH",
9068 // "id": "adexchangebuyer.proposals.patch",
9069 // "parameterOrder": [
9070 // "proposalId",
9071 // "revisionNumber",
9072 // "updateAction"
9073 // ],
9074 // "parameters": {
9075 // "proposalId": {
9076 // "description": "The proposal id to update.",
9077 // "location": "path",
9078 // "required": true,
9079 // "type": "string"
9080 // },
9081 // "revisionNumber": {
9082 // "description": "The last known revision number to update. If the head revision in the marketplace database has since changed, an error will be thrown. The caller should then fetch the latest proposal at head revision and retry the update at that revision.",
9083 // "format": "int64",
9084 // "location": "path",
9085 // "required": true,
9086 // "type": "string"
9087 // },
9088 // "updateAction": {
9089 // "description": "The proposed action to take on the proposal. This field is required and it must be set when updating a proposal.",
9090 // "enum": [
9091 // "accept",
9092 // "cancel",
9093 // "propose",
9094 // "proposeAndAccept",
9095 // "unknownAction",
9096 // "updateNonTerms"
9097 // ],
9098 // "enumDescriptions": [
9099 // "",
9100 // "",
9101 // "",
9102 // "",
9103 // "",
9104 // ""
9105 // ],
9106 // "location": "path",
9107 // "required": true,
9108 // "type": "string"
9109 // }
9110 // },
9111 // "path": "proposals/{proposalId}/{revisionNumber}/{updateAction}",
9112 // "request": {
9113 // "$ref": "Proposal"
9114 // },
9115 // "response": {
9116 // "$ref": "Proposal"
9117 // },
9118 // "scopes": [
9119 // "https://www.googleapis.com/auth/adexchange.buyer"
9120 // ]
9121 // }
9122
9123 }
9124
9125 // method id "adexchangebuyer.proposals.search":
9126
9127 type ProposalsSearchCall struct {
9128 s *Service
9129 urlParams_ gensupport.URLParams
9130 ifNoneMatch_ string
9131 ctx_ context.Context
9132 header_ http.Header
9133 }
9134
9135 // Search: Search for proposals using pql query
9136 func (r *ProposalsService) Search() *ProposalsSearchCall {
9137 c := &ProposalsSearchCall{s: r.s, urlParams_: make(gensupport.URLParams)}
9138 return c
9139 }
9140
9141 // PqlQuery sets the optional parameter "pqlQuery": Query string to
9142 // retrieve specific proposals.
9143 func (c *ProposalsSearchCall) PqlQuery(pqlQuery string) *ProposalsSearchCall {
9144 c.urlParams_.Set("pqlQuery", pqlQuery)
9145 return c
9146 }
9147
9148 // Fields allows partial responses to be retrieved. See
9149 // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
9150 // for more information.
9151 func (c *ProposalsSearchCall) Fields(s ...googleapi.Field) *ProposalsSearchCall {
9152 c.urlParams_.Set("fields", googleapi.CombineFields(s))
9153 return c
9154 }
9155
9156 // IfNoneMatch sets the optional parameter which makes the operation
9157 // fail if the object's ETag matches the given value. This is useful for
9158 // getting updates only after the object has changed since the last
9159 // request. Use googleapi.IsNotModified to check whether the response
9160 // error from Do is the result of In-None-Match.
9161 func (c *ProposalsSearchCall) IfNoneMatch(entityTag string) *ProposalsSearchCall {
9162 c.ifNoneMatch_ = entityTag
9163 return c
9164 }
9165
9166 // Context sets the context to be used in this call's Do method. Any
9167 // pending HTTP request will be aborted if the provided context is
9168 // canceled.
9169 func (c *ProposalsSearchCall) Context(ctx context.Context) *ProposalsSearchCall {
9170 c.ctx_ = ctx
9171 return c
9172 }
9173
9174 // Header returns an http.Header that can be modified by the caller to
9175 // add HTTP headers to the request.
9176 func (c *ProposalsSearchCall) Header() http.Header {
9177 if c.header_ == nil {
9178 c.header_ = make(http.Header)
9179 }
9180 return c.header_
9181 }
9182
9183 func (c *ProposalsSearchCall) doRequest(alt string) (*http.Response, error) {
9184 reqHeaders := make(http.Header)
9185 reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/20210819")
9186 for k, v := range c.header_ {
9187 reqHeaders[k] = v
9188 }
9189 reqHeaders.Set("User-Agent", c.s.userAgent())
9190 if c.ifNoneMatch_ != "" {
9191 reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
9192 }
9193 var body io.Reader = nil
9194 c.urlParams_.Set("alt", alt)
9195 c.urlParams_.Set("prettyPrint", "false")
9196 urls := googleapi.ResolveRelative(c.s.BasePath, "proposals/search")
9197 urls += "?" + c.urlParams_.Encode()
9198 req, err := http.NewRequest("GET", urls, body)
9199 if err != nil {
9200 return nil, err
9201 }
9202 req.Header = reqHeaders
9203 return gensupport.SendRequest(c.ctx_, c.s.client, req)
9204 }
9205
9206 // Do executes the "adexchangebuyer.proposals.search" call.
9207 // Exactly one of *GetOrdersResponse or error will be non-nil. Any
9208 // non-2xx status code is an error. Response headers are in either
9209 // *GetOrdersResponse.ServerResponse.Header or (if a response was
9210 // returned at all) in error.(*googleapi.Error).Header. Use
9211 // googleapi.IsNotModified to check whether the returned error was
9212 // because http.StatusNotModified was returned.
9213 func (c *ProposalsSearchCall) Do(opts ...googleapi.CallOption) (*GetOrdersResponse, error) {
9214 gensupport.SetOptions(c.urlParams_, opts...)
9215 res, err := c.doRequest("json")
9216 if res != nil && res.StatusCode == http.StatusNotModified {
9217 if res.Body != nil {
9218 res.Body.Close()
9219 }
9220 return nil, &googleapi.Error{
9221 Code: res.StatusCode,
9222 Header: res.Header,
9223 }
9224 }
9225 if err != nil {
9226 return nil, err
9227 }
9228 defer googleapi.CloseBody(res)
9229 if err := googleapi.CheckResponse(res); err != nil {
9230 return nil, err
9231 }
9232 ret := &GetOrdersResponse{
9233 ServerResponse: googleapi.ServerResponse{
9234 Header: res.Header,
9235 HTTPStatusCode: res.StatusCode,
9236 },
9237 }
9238 target := &ret
9239 if err := gensupport.DecodeResponse(target, res); err != nil {
9240 return nil, err
9241 }
9242 return ret, nil
9243 // {
9244 // "description": "Search for proposals using pql query",
9245 // "httpMethod": "GET",
9246 // "id": "adexchangebuyer.proposals.search",
9247 // "parameters": {
9248 // "pqlQuery": {
9249 // "description": "Query string to retrieve specific proposals.",
9250 // "location": "query",
9251 // "type": "string"
9252 // }
9253 // },
9254 // "path": "proposals/search",
9255 // "response": {
9256 // "$ref": "GetOrdersResponse"
9257 // },
9258 // "scopes": [
9259 // "https://www.googleapis.com/auth/adexchange.buyer"
9260 // ]
9261 // }
9262
9263 }
9264
9265 // method id "adexchangebuyer.proposals.setupcomplete":
9266
9267 type ProposalsSetupcompleteCall struct {
9268 s *Service
9269 proposalId string
9270 urlParams_ gensupport.URLParams
9271 ctx_ context.Context
9272 header_ http.Header
9273 }
9274
9275 // Setupcomplete: Update the given proposal to indicate that setup has
9276 // been completed.
9277 //
9278 // - proposalId: The proposal id for which the setup is complete.
9279 func (r *ProposalsService) Setupcomplete(proposalId string) *ProposalsSetupcompleteCall {
9280 c := &ProposalsSetupcompleteCall{s: r.s, urlParams_: make(gensupport.URLParams)}
9281 c.proposalId = proposalId
9282 return c
9283 }
9284
9285 // Fields allows partial responses to be retrieved. See
9286 // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
9287 // for more information.
9288 func (c *ProposalsSetupcompleteCall) Fields(s ...googleapi.Field) *ProposalsSetupcompleteCall {
9289 c.urlParams_.Set("fields", googleapi.CombineFields(s))
9290 return c
9291 }
9292
9293 // Context sets the context to be used in this call's Do method. Any
9294 // pending HTTP request will be aborted if the provided context is
9295 // canceled.
9296 func (c *ProposalsSetupcompleteCall) Context(ctx context.Context) *ProposalsSetupcompleteCall {
9297 c.ctx_ = ctx
9298 return c
9299 }
9300
9301 // Header returns an http.Header that can be modified by the caller to
9302 // add HTTP headers to the request.
9303 func (c *ProposalsSetupcompleteCall) Header() http.Header {
9304 if c.header_ == nil {
9305 c.header_ = make(http.Header)
9306 }
9307 return c.header_
9308 }
9309
9310 func (c *ProposalsSetupcompleteCall) doRequest(alt string) (*http.Response, error) {
9311 reqHeaders := make(http.Header)
9312 reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/20210819")
9313 for k, v := range c.header_ {
9314 reqHeaders[k] = v
9315 }
9316 reqHeaders.Set("User-Agent", c.s.userAgent())
9317 var body io.Reader = nil
9318 c.urlParams_.Set("alt", alt)
9319 c.urlParams_.Set("prettyPrint", "false")
9320 urls := googleapi.ResolveRelative(c.s.BasePath, "proposals/{proposalId}/setupcomplete")
9321 urls += "?" + c.urlParams_.Encode()
9322 req, err := http.NewRequest("POST", urls, body)
9323 if err != nil {
9324 return nil, err
9325 }
9326 req.Header = reqHeaders
9327 googleapi.Expand(req.URL, map[string]string{
9328 "proposalId": c.proposalId,
9329 })
9330 return gensupport.SendRequest(c.ctx_, c.s.client, req)
9331 }
9332
9333 // Do executes the "adexchangebuyer.proposals.setupcomplete" call.
9334 func (c *ProposalsSetupcompleteCall) Do(opts ...googleapi.CallOption) error {
9335 gensupport.SetOptions(c.urlParams_, opts...)
9336 res, err := c.doRequest("json")
9337 if err != nil {
9338 return err
9339 }
9340 defer googleapi.CloseBody(res)
9341 if err := googleapi.CheckResponse(res); err != nil {
9342 return err
9343 }
9344 return nil
9345 // {
9346 // "description": "Update the given proposal to indicate that setup has been completed.",
9347 // "httpMethod": "POST",
9348 // "id": "adexchangebuyer.proposals.setupcomplete",
9349 // "parameterOrder": [
9350 // "proposalId"
9351 // ],
9352 // "parameters": {
9353 // "proposalId": {
9354 // "description": "The proposal id for which the setup is complete",
9355 // "location": "path",
9356 // "required": true,
9357 // "type": "string"
9358 // }
9359 // },
9360 // "path": "proposals/{proposalId}/setupcomplete",
9361 // "scopes": [
9362 // "https://www.googleapis.com/auth/adexchange.buyer"
9363 // ]
9364 // }
9365
9366 }
9367
9368 // method id "adexchangebuyer.proposals.update":
9369
9370 type ProposalsUpdateCall struct {
9371 s *Service
9372 proposalId string
9373 revisionNumber int64
9374 updateAction string
9375 proposal *Proposal
9376 urlParams_ gensupport.URLParams
9377 ctx_ context.Context
9378 header_ http.Header
9379 }
9380
9381 // Update: Update the given proposal
9382 //
9383 // - proposalId: The proposal id to update.
9384 // - revisionNumber: The last known revision number to update. If the
9385 // head revision in the marketplace database has since changed, an
9386 // error will be thrown. The caller should then fetch the latest
9387 // proposal at head revision and retry the update at that revision.
9388 // - updateAction: The proposed action to take on the proposal. This
9389 // field is required and it must be set when updating a proposal.
9390 func (r *ProposalsService) Update(proposalId string, revisionNumber int64, updateAction string, proposal *Proposal) *ProposalsUpdateCall {
9391 c := &ProposalsUpdateCall{s: r.s, urlParams_: make(gensupport.URLParams)}
9392 c.proposalId = proposalId
9393 c.revisionNumber = revisionNumber
9394 c.updateAction = updateAction
9395 c.proposal = proposal
9396 return c
9397 }
9398
9399 // Fields allows partial responses to be retrieved. See
9400 // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
9401 // for more information.
9402 func (c *ProposalsUpdateCall) Fields(s ...googleapi.Field) *ProposalsUpdateCall {
9403 c.urlParams_.Set("fields", googleapi.CombineFields(s))
9404 return c
9405 }
9406
9407 // Context sets the context to be used in this call's Do method. Any
9408 // pending HTTP request will be aborted if the provided context is
9409 // canceled.
9410 func (c *ProposalsUpdateCall) Context(ctx context.Context) *ProposalsUpdateCall {
9411 c.ctx_ = ctx
9412 return c
9413 }
9414
9415 // Header returns an http.Header that can be modified by the caller to
9416 // add HTTP headers to the request.
9417 func (c *ProposalsUpdateCall) Header() http.Header {
9418 if c.header_ == nil {
9419 c.header_ = make(http.Header)
9420 }
9421 return c.header_
9422 }
9423
9424 func (c *ProposalsUpdateCall) doRequest(alt string) (*http.Response, error) {
9425 reqHeaders := make(http.Header)
9426 reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/20210819")
9427 for k, v := range c.header_ {
9428 reqHeaders[k] = v
9429 }
9430 reqHeaders.Set("User-Agent", c.s.userAgent())
9431 var body io.Reader = nil
9432 body, err := googleapi.WithoutDataWrapper.JSONReader(c.proposal)
9433 if err != nil {
9434 return nil, err
9435 }
9436 reqHeaders.Set("Content-Type", "application/json")
9437 c.urlParams_.Set("alt", alt)
9438 c.urlParams_.Set("prettyPrint", "false")
9439 urls := googleapi.ResolveRelative(c.s.BasePath, "proposals/{proposalId}/{revisionNumber}/{updateAction}")
9440 urls += "?" + c.urlParams_.Encode()
9441 req, err := http.NewRequest("PUT", urls, body)
9442 if err != nil {
9443 return nil, err
9444 }
9445 req.Header = reqHeaders
9446 googleapi.Expand(req.URL, map[string]string{
9447 "proposalId": c.proposalId,
9448 "revisionNumber": strconv.FormatInt(c.revisionNumber, 10),
9449 "updateAction": c.updateAction,
9450 })
9451 return gensupport.SendRequest(c.ctx_, c.s.client, req)
9452 }
9453
9454 // Do executes the "adexchangebuyer.proposals.update" call.
9455 // Exactly one of *Proposal or error will be non-nil. Any non-2xx status
9456 // code is an error. Response headers are in either
9457 // *Proposal.ServerResponse.Header or (if a response was returned at
9458 // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
9459 // to check whether the returned error was because
9460 // http.StatusNotModified was returned.
9461 func (c *ProposalsUpdateCall) Do(opts ...googleapi.CallOption) (*Proposal, error) {
9462 gensupport.SetOptions(c.urlParams_, opts...)
9463 res, err := c.doRequest("json")
9464 if res != nil && res.StatusCode == http.StatusNotModified {
9465 if res.Body != nil {
9466 res.Body.Close()
9467 }
9468 return nil, &googleapi.Error{
9469 Code: res.StatusCode,
9470 Header: res.Header,
9471 }
9472 }
9473 if err != nil {
9474 return nil, err
9475 }
9476 defer googleapi.CloseBody(res)
9477 if err := googleapi.CheckResponse(res); err != nil {
9478 return nil, err
9479 }
9480 ret := &Proposal{
9481 ServerResponse: googleapi.ServerResponse{
9482 Header: res.Header,
9483 HTTPStatusCode: res.StatusCode,
9484 },
9485 }
9486 target := &ret
9487 if err := gensupport.DecodeResponse(target, res); err != nil {
9488 return nil, err
9489 }
9490 return ret, nil
9491 // {
9492 // "description": "Update the given proposal",
9493 // "httpMethod": "PUT",
9494 // "id": "adexchangebuyer.proposals.update",
9495 // "parameterOrder": [
9496 // "proposalId",
9497 // "revisionNumber",
9498 // "updateAction"
9499 // ],
9500 // "parameters": {
9501 // "proposalId": {
9502 // "description": "The proposal id to update.",
9503 // "location": "path",
9504 // "required": true,
9505 // "type": "string"
9506 // },
9507 // "revisionNumber": {
9508 // "description": "The last known revision number to update. If the head revision in the marketplace database has since changed, an error will be thrown. The caller should then fetch the latest proposal at head revision and retry the update at that revision.",
9509 // "format": "int64",
9510 // "location": "path",
9511 // "required": true,
9512 // "type": "string"
9513 // },
9514 // "updateAction": {
9515 // "description": "The proposed action to take on the proposal. This field is required and it must be set when updating a proposal.",
9516 // "enum": [
9517 // "accept",
9518 // "cancel",
9519 // "propose",
9520 // "proposeAndAccept",
9521 // "unknownAction",
9522 // "updateNonTerms"
9523 // ],
9524 // "enumDescriptions": [
9525 // "",
9526 // "",
9527 // "",
9528 // "",
9529 // "",
9530 // ""
9531 // ],
9532 // "location": "path",
9533 // "required": true,
9534 // "type": "string"
9535 // }
9536 // },
9537 // "path": "proposals/{proposalId}/{revisionNumber}/{updateAction}",
9538 // "request": {
9539 // "$ref": "Proposal"
9540 // },
9541 // "response": {
9542 // "$ref": "Proposal"
9543 // },
9544 // "scopes": [
9545 // "https://www.googleapis.com/auth/adexchange.buyer"
9546 // ]
9547 // }
9548
9549 }
9550
9551 // method id "adexchangebuyer.pubprofiles.list":
9552
9553 type PubprofilesListCall struct {
9554 s *Service
9555 accountId int64
9556 urlParams_ gensupport.URLParams
9557 ifNoneMatch_ string
9558 ctx_ context.Context
9559 header_ http.Header
9560 }
9561
9562 // List: Gets the requested publisher profile(s) by publisher accountId.
9563 //
9564 // - accountId: The accountId of the publisher to get profiles for.
9565 func (r *PubprofilesService) List(accountId int64) *PubprofilesListCall {
9566 c := &PubprofilesListCall{s: r.s, urlParams_: make(gensupport.URLParams)}
9567 c.accountId = accountId
9568 return c
9569 }
9570
9571 // Fields allows partial responses to be retrieved. See
9572 // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
9573 // for more information.
9574 func (c *PubprofilesListCall) Fields(s ...googleapi.Field) *PubprofilesListCall {
9575 c.urlParams_.Set("fields", googleapi.CombineFields(s))
9576 return c
9577 }
9578
9579 // IfNoneMatch sets the optional parameter which makes the operation
9580 // fail if the object's ETag matches the given value. This is useful for
9581 // getting updates only after the object has changed since the last
9582 // request. Use googleapi.IsNotModified to check whether the response
9583 // error from Do is the result of In-None-Match.
9584 func (c *PubprofilesListCall) IfNoneMatch(entityTag string) *PubprofilesListCall {
9585 c.ifNoneMatch_ = entityTag
9586 return c
9587 }
9588
9589 // Context sets the context to be used in this call's Do method. Any
9590 // pending HTTP request will be aborted if the provided context is
9591 // canceled.
9592 func (c *PubprofilesListCall) Context(ctx context.Context) *PubprofilesListCall {
9593 c.ctx_ = ctx
9594 return c
9595 }
9596
9597 // Header returns an http.Header that can be modified by the caller to
9598 // add HTTP headers to the request.
9599 func (c *PubprofilesListCall) Header() http.Header {
9600 if c.header_ == nil {
9601 c.header_ = make(http.Header)
9602 }
9603 return c.header_
9604 }
9605
9606 func (c *PubprofilesListCall) doRequest(alt string) (*http.Response, error) {
9607 reqHeaders := make(http.Header)
9608 reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/20210819")
9609 for k, v := range c.header_ {
9610 reqHeaders[k] = v
9611 }
9612 reqHeaders.Set("User-Agent", c.s.userAgent())
9613 if c.ifNoneMatch_ != "" {
9614 reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
9615 }
9616 var body io.Reader = nil
9617 c.urlParams_.Set("alt", alt)
9618 c.urlParams_.Set("prettyPrint", "false")
9619 urls := googleapi.ResolveRelative(c.s.BasePath, "publisher/{accountId}/profiles")
9620 urls += "?" + c.urlParams_.Encode()
9621 req, err := http.NewRequest("GET", urls, body)
9622 if err != nil {
9623 return nil, err
9624 }
9625 req.Header = reqHeaders
9626 googleapi.Expand(req.URL, map[string]string{
9627 "accountId": strconv.FormatInt(c.accountId, 10),
9628 })
9629 return gensupport.SendRequest(c.ctx_, c.s.client, req)
9630 }
9631
9632 // Do executes the "adexchangebuyer.pubprofiles.list" call.
9633 // Exactly one of *GetPublisherProfilesByAccountIdResponse or error will
9634 // be non-nil. Any non-2xx status code is an error. Response headers are
9635 // in either
9636 // *GetPublisherProfilesByAccountIdResponse.ServerResponse.Header or (if
9637 // a response was returned at all) in error.(*googleapi.Error).Header.
9638 // Use googleapi.IsNotModified to check whether the returned error was
9639 // because http.StatusNotModified was returned.
9640 func (c *PubprofilesListCall) Do(opts ...googleapi.CallOption) (*GetPublisherProfilesByAccountIdResponse, error) {
9641 gensupport.SetOptions(c.urlParams_, opts...)
9642 res, err := c.doRequest("json")
9643 if res != nil && res.StatusCode == http.StatusNotModified {
9644 if res.Body != nil {
9645 res.Body.Close()
9646 }
9647 return nil, &googleapi.Error{
9648 Code: res.StatusCode,
9649 Header: res.Header,
9650 }
9651 }
9652 if err != nil {
9653 return nil, err
9654 }
9655 defer googleapi.CloseBody(res)
9656 if err := googleapi.CheckResponse(res); err != nil {
9657 return nil, err
9658 }
9659 ret := &GetPublisherProfilesByAccountIdResponse{
9660 ServerResponse: googleapi.ServerResponse{
9661 Header: res.Header,
9662 HTTPStatusCode: res.StatusCode,
9663 },
9664 }
9665 target := &ret
9666 if err := gensupport.DecodeResponse(target, res); err != nil {
9667 return nil, err
9668 }
9669 return ret, nil
9670 // {
9671 // "description": "Gets the requested publisher profile(s) by publisher accountId.",
9672 // "httpMethod": "GET",
9673 // "id": "adexchangebuyer.pubprofiles.list",
9674 // "parameterOrder": [
9675 // "accountId"
9676 // ],
9677 // "parameters": {
9678 // "accountId": {
9679 // "description": "The accountId of the publisher to get profiles for.",
9680 // "format": "int32",
9681 // "location": "path",
9682 // "required": true,
9683 // "type": "integer"
9684 // }
9685 // },
9686 // "path": "publisher/{accountId}/profiles",
9687 // "response": {
9688 // "$ref": "GetPublisherProfilesByAccountIdResponse"
9689 // },
9690 // "scopes": [
9691 // "https://www.googleapis.com/auth/adexchange.buyer"
9692 // ]
9693 // }
9694
9695 }