Debian Codegraph @

authorizedbuyersmarketplace/v1alpha/authorizedbuyersmarketplace-gen.go

raw
1 // Copyright 2026 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 authorizedbuyersmarketplace provides access to the Authorized Buyers Marketplace API.
8 //
9 // For product documentation, see: https://developers.google.com/authorized-buyers/apis/marketplace/reference/rest/
10 //
11 // # Library status
12 //
13 // These client libraries are officially supported by Google. However, this
14 // library is considered complete and is in maintenance mode. This means
15 // that we will address critical bugs and security issues but will not add
16 // any new features.
17 //
18 // When possible, we recommend using our newer
19 // [Cloud Client Libraries for Go](https://pkg.go.dev/cloud.google.com/go)
20 // that are still actively being worked and iterated on.
21 //
22 // # Creating a client
23 //
24 // Usage example:
25 //
26 // import "google.golang.org/api/authorizedbuyersmarketplace/v1alpha"
27 // ...
28 // ctx := context.Background()
29 // authorizedbuyersmarketplaceService, err := authorizedbuyersmarketplace.NewService(ctx)
30 //
31 // In this example, Google Application Default Credentials are used for
32 // authentication. For information on how to create and obtain Application
33 // Default Credentials, see https://developers.google.com/identity/protocols/application-default-credentials.
34 //
35 // # Other authentication options
36 //
37 // To use an API key for authentication (note: some APIs do not support API
38 // keys), use [google.golang.org/api/option.WithAPIKey]:
39 //
40 // authorizedbuyersmarketplaceService, err := authorizedbuyersmarketplace.NewService(ctx, option.WithAPIKey("AIza..."))
41 //
42 // To use an OAuth token (e.g., a user token obtained via a three-legged OAuth
43 // flow, use [google.golang.org/api/option.WithTokenSource]:
44 //
45 // config := &oauth2.Config{...}
46 // // ...
47 // token, err := config.Exchange(ctx, ...)
48 // authorizedbuyersmarketplaceService, err := authorizedbuyersmarketplace.NewService(ctx, option.WithTokenSource(config.TokenSource(ctx, token)))
49 //
50 // See [google.golang.org/api/option.ClientOption] for details on options.
51 package authorizedbuyersmarketplace // import "google.golang.org/api/authorizedbuyersmarketplace/v1alpha"
52
53 import (
54 "bytes"
55 "context"
56 "encoding/json"
57 "errors"
58 "fmt"
59 "io"
60 "log/slog"
61 "net/http"
62 "net/url"
63 "strconv"
64 "strings"
65
66 "github.com/googleapis/gax-go/v2/internallog"
67 googleapi "google.golang.org/api/googleapi"
68 internal "google.golang.org/api/internal"
69 gensupport "google.golang.org/api/internal/gensupport"
70 option "google.golang.org/api/option"
71 internaloption "google.golang.org/api/option/internaloption"
72 htransport "google.golang.org/api/transport/http"
73 )
74
75 // Always reference these packages, just in case the auto-generated code
76 // below doesn't.
77 var _ = bytes.NewBuffer
78 var _ = strconv.Itoa
79 var _ = fmt.Sprintf
80 var _ = json.NewDecoder
81 var _ = io.Copy
82 var _ = url.Parse
83 var _ = gensupport.MarshalJSON
84 var _ = googleapi.Version
85 var _ = errors.New
86 var _ = strings.Replace
87 var _ = context.Canceled
88 var _ = internaloption.WithDefaultEndpoint
89 var _ = internal.Version
90 var _ = internallog.New
91
92 const apiId = "authorizedbuyersmarketplace:v1alpha"
93 const apiName = "authorizedbuyersmarketplace"
94 const apiVersion = "v1alpha"
95 const basePath = "https://authorizedbuyersmarketplace.googleapis.com/"
96 const basePathTemplate = "https://authorizedbuyersmarketplace.UNIVERSE_DOMAIN/"
97 const mtlsBasePath = "https://authorizedbuyersmarketplace.mtls.googleapis.com/"
98
99 // OAuth2 scopes used by this API.
100 const (
101 // See, create, edit, and delete your Authorized Buyers Marketplace entities.
102 AuthorizedBuyersMarketplaceScope = "https://www.googleapis.com/auth/authorized-buyers-marketplace"
103 )
104
105 // NewService creates a new Service.
106 func NewService(ctx context.Context, opts ...option.ClientOption) (*Service, error) {
107 scopesOption := internaloption.WithDefaultScopes(
108 "https://www.googleapis.com/auth/authorized-buyers-marketplace",
109 )
110 // NOTE: prepend, so we don't override user-specified scopes.
111 opts = append([]option.ClientOption{scopesOption}, opts...)
112 opts = append(opts, internaloption.WithDefaultEndpoint(basePath))
113 opts = append(opts, internaloption.WithDefaultEndpointTemplate(basePathTemplate))
114 opts = append(opts, internaloption.WithDefaultMTLSEndpoint(mtlsBasePath))
115 opts = append(opts, internaloption.EnableNewAuthLibrary())
116 client, endpoint, err := htransport.NewClient(ctx, opts...)
117 if err != nil {
118 return nil, err
119 }
120 s := &Service{client: client, BasePath: basePath, logger: internaloption.GetLogger(opts)}
121 s.Bidders = NewBiddersService(s)
122 s.Buyers = NewBuyersService(s)
123 s.Curators = NewCuratorsService(s)
124 s.MediaPlanners = NewMediaPlannersService(s)
125 if endpoint != "" {
126 s.BasePath = endpoint
127 }
128 return s, nil
129 }
130
131 // New creates a new Service. It uses the provided http.Client for requests.
132 //
133 // Deprecated: please use NewService instead.
134 // To provide a custom HTTP client, use option.WithHTTPClient.
135 // If you are using google.golang.org/api/googleapis/transport.APIKey, use option.WithAPIKey with NewService instead.
136 func New(client *http.Client) (*Service, error) {
137 if client == nil {
138 return nil, errors.New("client is nil")
139 }
140 return NewService(context.TODO(), option.WithHTTPClient(client))
141 }
142
143 type Service struct {
144 client *http.Client
145 logger *slog.Logger
146 BasePath string // API endpoint base URL
147 UserAgent string // optional additional User-Agent fragment
148
149 Bidders *BiddersService
150
151 Buyers *BuyersService
152
153 Curators *CuratorsService
154
155 MediaPlanners *MediaPlannersService
156 }
157
158 func (s *Service) userAgent() string {
159 if s.UserAgent == "" {
160 return googleapi.UserAgent
161 }
162 return googleapi.UserAgent + " " + s.UserAgent
163 }
164
165 func NewBiddersService(s *Service) *BiddersService {
166 rs := &BiddersService{s: s}
167 rs.AuctionPackages = NewBiddersAuctionPackagesService(s)
168 rs.FinalizedDeals = NewBiddersFinalizedDealsService(s)
169 return rs
170 }
171
172 type BiddersService struct {
173 s *Service
174
175 AuctionPackages *BiddersAuctionPackagesService
176
177 FinalizedDeals *BiddersFinalizedDealsService
178 }
179
180 func NewBiddersAuctionPackagesService(s *Service) *BiddersAuctionPackagesService {
181 rs := &BiddersAuctionPackagesService{s: s}
182 return rs
183 }
184
185 type BiddersAuctionPackagesService struct {
186 s *Service
187 }
188
189 func NewBiddersFinalizedDealsService(s *Service) *BiddersFinalizedDealsService {
190 rs := &BiddersFinalizedDealsService{s: s}
191 return rs
192 }
193
194 type BiddersFinalizedDealsService struct {
195 s *Service
196 }
197
198 func NewBuyersService(s *Service) *BuyersService {
199 rs := &BuyersService{s: s}
200 rs.AuctionPackages = NewBuyersAuctionPackagesService(s)
201 rs.Clients = NewBuyersClientsService(s)
202 rs.DataSegments = NewBuyersDataSegmentsService(s)
203 rs.FinalizedDeals = NewBuyersFinalizedDealsService(s)
204 rs.Proposals = NewBuyersProposalsService(s)
205 rs.PublisherProfiles = NewBuyersPublisherProfilesService(s)
206 return rs
207 }
208
209 type BuyersService struct {
210 s *Service
211
212 AuctionPackages *BuyersAuctionPackagesService
213
214 Clients *BuyersClientsService
215
216 DataSegments *BuyersDataSegmentsService
217
218 FinalizedDeals *BuyersFinalizedDealsService
219
220 Proposals *BuyersProposalsService
221
222 PublisherProfiles *BuyersPublisherProfilesService
223 }
224
225 func NewBuyersAuctionPackagesService(s *Service) *BuyersAuctionPackagesService {
226 rs := &BuyersAuctionPackagesService{s: s}
227 return rs
228 }
229
230 type BuyersAuctionPackagesService struct {
231 s *Service
232 }
233
234 func NewBuyersClientsService(s *Service) *BuyersClientsService {
235 rs := &BuyersClientsService{s: s}
236 rs.Users = NewBuyersClientsUsersService(s)
237 return rs
238 }
239
240 type BuyersClientsService struct {
241 s *Service
242
243 Users *BuyersClientsUsersService
244 }
245
246 func NewBuyersClientsUsersService(s *Service) *BuyersClientsUsersService {
247 rs := &BuyersClientsUsersService{s: s}
248 return rs
249 }
250
251 type BuyersClientsUsersService struct {
252 s *Service
253 }
254
255 func NewBuyersDataSegmentsService(s *Service) *BuyersDataSegmentsService {
256 rs := &BuyersDataSegmentsService{s: s}
257 return rs
258 }
259
260 type BuyersDataSegmentsService struct {
261 s *Service
262 }
263
264 func NewBuyersFinalizedDealsService(s *Service) *BuyersFinalizedDealsService {
265 rs := &BuyersFinalizedDealsService{s: s}
266 return rs
267 }
268
269 type BuyersFinalizedDealsService struct {
270 s *Service
271 }
272
273 func NewBuyersProposalsService(s *Service) *BuyersProposalsService {
274 rs := &BuyersProposalsService{s: s}
275 rs.Deals = NewBuyersProposalsDealsService(s)
276 return rs
277 }
278
279 type BuyersProposalsService struct {
280 s *Service
281
282 Deals *BuyersProposalsDealsService
283 }
284
285 func NewBuyersProposalsDealsService(s *Service) *BuyersProposalsDealsService {
286 rs := &BuyersProposalsDealsService{s: s}
287 return rs
288 }
289
290 type BuyersProposalsDealsService struct {
291 s *Service
292 }
293
294 func NewBuyersPublisherProfilesService(s *Service) *BuyersPublisherProfilesService {
295 rs := &BuyersPublisherProfilesService{s: s}
296 return rs
297 }
298
299 type BuyersPublisherProfilesService struct {
300 s *Service
301 }
302
303 func NewCuratorsService(s *Service) *CuratorsService {
304 rs := &CuratorsService{s: s}
305 rs.CuratedPackages = NewCuratorsCuratedPackagesService(s)
306 return rs
307 }
308
309 type CuratorsService struct {
310 s *Service
311
312 CuratedPackages *CuratorsCuratedPackagesService
313 }
314
315 func NewCuratorsCuratedPackagesService(s *Service) *CuratorsCuratedPackagesService {
316 rs := &CuratorsCuratedPackagesService{s: s}
317 return rs
318 }
319
320 type CuratorsCuratedPackagesService struct {
321 s *Service
322 }
323
324 func NewMediaPlannersService(s *Service) *MediaPlannersService {
325 rs := &MediaPlannersService{s: s}
326 return rs
327 }
328
329 type MediaPlannersService struct {
330 s *Service
331 }
332
333 // AcceptProposalRequest: Request to accept a proposal. Accepting a proposal
334 // implies acceptance of the publisher terms_and_conditions, if any.
335 type AcceptProposalRequest struct {
336 // ProposalRevision: The last known client revision number of the proposal.
337 ProposalRevision int64 `json:"proposalRevision,omitempty,string"`
338 // ForceSendFields is a list of field names (e.g. "ProposalRevision") to
339 // unconditionally include in API requests. By default, fields with empty or
340 // default values are omitted from API requests. See
341 // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more
342 // details.
343 ForceSendFields []string `json:"-"`
344 // NullFields is a list of field names (e.g. "ProposalRevision") to include in
345 // API requests with the JSON null value. By default, fields with empty values
346 // are omitted from API requests. See
347 // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details.
348 NullFields []string `json:"-"`
349 }
350
351 func (s AcceptProposalRequest) MarshalJSON() ([]byte, error) {
352 type NoMethod AcceptProposalRequest
353 return gensupport.MarshalJSON(NoMethod(s), s.ForceSendFields, s.NullFields)
354 }
355
356 // AccessControlSettings: Settings for controlling access to a curated package.
357 type AccessControlSettings struct {
358 // AllowlistedMediaPlanners: Required. Immutable. The list of media planners
359 // that are explicitly granted access to the curated package. Eligible media
360 // planners can be found in the mediaPlanners.list method. Only a single media
361 // planner may be allowlisted at this time. Format:
362 // `mediaPlanners/{mediaPlannerAccountId}`
363 AllowlistedMediaPlanners []string `json:"allowlistedMediaPlanners,omitempty"`
364 // ForceSendFields is a list of field names (e.g. "AllowlistedMediaPlanners")
365 // to unconditionally include in API requests. By default, fields with empty or
366 // default values are omitted from API requests. See
367 // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more
368 // details.
369 ForceSendFields []string `json:"-"`
370 // NullFields is a list of field names (e.g. "AllowlistedMediaPlanners") to
371 // include in API requests with the JSON null value. By default, fields with
372 // empty values are omitted from API requests. See
373 // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details.
374 NullFields []string `json:"-"`
375 }
376
377 func (s AccessControlSettings) MarshalJSON() ([]byte, error) {
378 type NoMethod AccessControlSettings
379 return gensupport.MarshalJSON(NoMethod(s), s.ForceSendFields, s.NullFields)
380 }
381
382 // ActivateClientRequest: Request message for activating a client.
383 type ActivateClientRequest struct {
384 }
385
386 // ActivateClientUserRequest: Request message for activating a client user.
387 type ActivateClientUserRequest struct {
388 }
389
390 // ActivateCuratedPackageRequest: Request message for ActivateCuratedPackage.
391 type ActivateCuratedPackageRequest struct {
392 }
393
394 // ActivateDataSegmentRequest: Request message for activating a data segment
395 type ActivateDataSegmentRequest struct {
396 }
397
398 // AdSize: Represents size of a single ad slot, or a creative.
399 type AdSize struct {
400 // Height: The height of the ad slot in pixels. This field will be present only
401 // when size type is `PIXEL`.
402 Height int64 `json:"height,omitempty,string"`
403 // Type: The type of the ad slot size.
404 //
405 // Possible values:
406 // "TYPE_UNSPECIFIED" - A placeholder for an undefined size type.
407 // "PIXEL" - Ad slot with size specified by height and width in pixels.
408 // "INTERSTITIAL" - Special size to describe an interstitial ad slot.
409 // "NATIVE" - Native (mobile) ads rendered by the publisher.
410 // "FLUID" - Fluid size (responsive size) can be resized automatically with
411 // the change of outside environment.
412 Type string `json:"type,omitempty"`
413 // Width: The width of the ad slot in pixels. This field will be present only
414 // when size type is `PIXEL`.
415 Width int64 `json:"width,omitempty,string"`
416 // ForceSendFields is a list of field names (e.g. "Height") to unconditionally
417 // include in API requests. By default, fields with empty or default values are
418 // omitted from API requests. See
419 // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more
420 // details.
421 ForceSendFields []string `json:"-"`
422 // NullFields is a list of field names (e.g. "Height") to include in API
423 // requests with the JSON null value. By default, fields with empty values are
424 // omitted from API requests. See
425 // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details.
426 NullFields []string `json:"-"`
427 }
428
429 func (s AdSize) MarshalJSON() ([]byte, error) {
430 type NoMethod AdSize
431 return gensupport.MarshalJSON(NoMethod(s), s.ForceSendFields, s.NullFields)
432 }
433
434 // AddCreativeRequest: Request message for adding creative to be used in the
435 // bidding process for the finalized deal.
436 type AddCreativeRequest struct {
437 // Creative: Name of the creative to add to the finalized deal, in the format
438 // `buyers/{buyerAccountId}/creatives/{creativeId}`. See creative.name.
439 Creative string `json:"creative,omitempty"`
440 // ForceSendFields is a list of field names (e.g. "Creative") to
441 // unconditionally include in API requests. By default, fields with empty or
442 // default values are omitted from API requests. See
443 // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more
444 // details.
445 ForceSendFields []string `json:"-"`
446 // NullFields is a list of field names (e.g. "Creative") to include in API
447 // requests with the JSON null value. By default, fields with empty values are
448 // omitted from API requests. See
449 // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details.
450 NullFields []string `json:"-"`
451 }
452
453 func (s AddCreativeRequest) MarshalJSON() ([]byte, error) {
454 type NoMethod AddCreativeRequest
455 return gensupport.MarshalJSON(NoMethod(s), s.ForceSendFields, s.NullFields)
456 }
457
458 // AddNoteRequest: Request to add a note.
459 type AddNoteRequest struct {
460 // Note: The note to add.
461 Note *Note `json:"note,omitempty"`
462 // ForceSendFields is a list of field names (e.g. "Note") to unconditionally
463 // include in API requests. By default, fields with empty or default values are
464 // omitted from API requests. See
465 // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more
466 // details.
467 ForceSendFields []string `json:"-"`
468 // NullFields is a list of field names (e.g. "Note") to include in API requests
469 // with the JSON null value. By default, fields with empty values are omitted
470 // from API requests. See
471 // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details.
472 NullFields []string `json:"-"`
473 }
474
475 func (s AddNoteRequest) MarshalJSON() ([]byte, error) {
476 type NoMethod AddNoteRequest
477 return gensupport.MarshalJSON(NoMethod(s), s.ForceSendFields, s.NullFields)
478 }
479
480 // AuctionPackage: Defines a segment of inventory that buyer wants to buy. It's
481 // created by buyer and could be shared with multiple buyers.
482 type AuctionPackage struct {
483 // CreateTime: Output only. Time the auction package was created.
484 CreateTime string `json:"createTime,omitempty"`
485 // Creator: Output only. The buyer that created this auction package. Format:
486 // `buyers/{buyerAccountId}`
487 Creator string `json:"creator,omitempty"`
488 // DealOwnerSeatId: Output only. If set, this field contains the DSP specific
489 // seat id set by the media planner account that is considered the owner of
490 // this deal. The seat ID is in the calling DSP's namespace.
491 DealOwnerSeatId string `json:"dealOwnerSeatId,omitempty"`
492 // Description: Output only. A description of the auction package.
493 Description string `json:"description,omitempty"`
494 // DisplayName: The display_name assigned to the auction package.
495 DisplayName string `json:"displayName,omitempty"`
496 // EligibleSeatIds: Output only. If set, this field identifies a seat that the
497 // media planner selected as the owner of this auction package. This is a seat
498 // ID in the DSP's namespace that was provided to the media planner.
499 EligibleSeatIds []string `json:"eligibleSeatIds,omitempty"`
500 // FloorPriceCpm: Output only. The minimum price a buyer has to bid to compete
501 // in this auction package. If this is field is not populated, there is no
502 // floor price.
503 FloorPriceCpm *Money `json:"floorPriceCpm,omitempty"`
504 // Name: Immutable. The unique identifier for the auction package. Format:
505 // `buyers/{accountId}/auctionPackages/{auctionPackageId}` The
506 // auction_package_id part of name is sent in the BidRequest to all RTB bidders
507 // and is returned as deal_id by the bidder in the BidResponse.
508 Name string `json:"name,omitempty"`
509 // SubscribedBuyers: Output only. The list of buyers that are subscribed to the
510 // AuctionPackage. This field is only populated when calling as a bidder.
511 // Format: `buyers/{buyerAccountId}`
512 SubscribedBuyers []string `json:"subscribedBuyers,omitempty"`
513 // SubscribedClients: Output only. When calling as a buyer, the list of clients
514 // of the current buyer that are subscribed to the AuctionPackage. When calling
515 // as a bidder, the list of clients that are subscribed to the AuctionPackage
516 // owned by the bidder or its buyers. Format:
517 // `buyers/{buyerAccountId}/clients/{clientAccountId}`
518 SubscribedClients []string `json:"subscribedClients,omitempty"`
519 // SubscribedMediaPlanners: Output only. The list of media planners that are
520 // subscribed to the AuctionPackage. This field is only populated when calling
521 // as a bidder.
522 SubscribedMediaPlanners []*MediaPlanner `json:"subscribedMediaPlanners,omitempty"`
523 // UpdateTime: Output only. Time the auction package was last updated. This
524 // value is only increased when this auction package is updated but never when
525 // a buyer subscribed.
526 UpdateTime string `json:"updateTime,omitempty"`
527
528 // ServerResponse contains the HTTP response code and headers from the server.
529 googleapi.ServerResponse `json:"-"`
530 // ForceSendFields is a list of field names (e.g. "CreateTime") to
531 // unconditionally include in API requests. By default, fields with empty or
532 // default values are omitted from API requests. See
533 // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more
534 // details.
535 ForceSendFields []string `json:"-"`
536 // NullFields is a list of field names (e.g. "CreateTime") to include in API
537 // requests with the JSON null value. By default, fields with empty values are
538 // omitted from API requests. See
539 // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details.
540 NullFields []string `json:"-"`
541 }
542
543 func (s AuctionPackage) MarshalJSON() ([]byte, error) {
544 type NoMethod AuctionPackage
545 return gensupport.MarshalJSON(NoMethod(s), s.ForceSendFields, s.NullFields)
546 }
547
548 // BatchUpdateDealsRequest: Request message for batch updating deals.
549 type BatchUpdateDealsRequest struct {
550 // Requests: Required. List of request messages to update deals.
551 Requests []*UpdateDealRequest `json:"requests,omitempty"`
552 // ForceSendFields is a list of field names (e.g. "Requests") to
553 // unconditionally include in API requests. By default, fields with empty or
554 // default values are omitted from API requests. See
555 // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more
556 // details.
557 ForceSendFields []string `json:"-"`
558 // NullFields is a list of field names (e.g. "Requests") to include in API
559 // requests with the JSON null value. By default, fields with empty values are
560 // omitted from API requests. See
561 // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details.
562 NullFields []string `json:"-"`
563 }
564
565 func (s BatchUpdateDealsRequest) MarshalJSON() ([]byte, error) {
566 type NoMethod BatchUpdateDealsRequest
567 return gensupport.MarshalJSON(NoMethod(s), s.ForceSendFields, s.NullFields)
568 }
569
570 // BatchUpdateDealsResponse: Response message for batch updating deals.
571 type BatchUpdateDealsResponse struct {
572 // Deals: Deals updated.
573 Deals []*Deal `json:"deals,omitempty"`
574
575 // ServerResponse contains the HTTP response code and headers from the server.
576 googleapi.ServerResponse `json:"-"`
577 // ForceSendFields is a list of field names (e.g. "Deals") to unconditionally
578 // include in API requests. By default, fields with empty or default values are
579 // omitted from API requests. See
580 // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more
581 // details.
582 ForceSendFields []string `json:"-"`
583 // NullFields is a list of field names (e.g. "Deals") to include in API
584 // requests with the JSON null value. By default, fields with empty values are
585 // omitted from API requests. See
586 // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details.
587 NullFields []string `json:"-"`
588 }
589
590 func (s BatchUpdateDealsResponse) MarshalJSON() ([]byte, error) {
591 type NoMethod BatchUpdateDealsResponse
592 return gensupport.MarshalJSON(NoMethod(s), s.ForceSendFields, s.NullFields)
593 }
594
595 // CancelNegotiationRequest: Request to cancel an ongoing negotiation.
596 type CancelNegotiationRequest struct {
597 }
598
599 // Client: A client represents an agency, a brand, or an advertiser customer of
600 // the buyer. Based on the client's role, its client users will have varying
601 // levels of restricted access to the Marketplace and certain other sections of
602 // the Authorized Buyers UI.
603 type Client struct {
604 // DisplayName: Required. Display name shown to publishers. Must be unique for
605 // clients without partnerClientId specified. Maximum length of 255 characters
606 // is allowed.
607 DisplayName string `json:"displayName,omitempty"`
608 // Name: Output only. The resource name of the client. Format:
609 // `buyers/{accountId}/clients/{clientAccountId}`
610 Name string `json:"name,omitempty"`
611 // PartnerClientId: Arbitrary unique identifier provided by the buyer. This
612 // field can be used to associate a client with an identifier in the namespace
613 // of the buyer, lookup clients by that identifier and verify whether an
614 // Authorized Buyers account of the client already exists. If present, must be
615 // unique across all the clients.
616 PartnerClientId string `json:"partnerClientId,omitempty"`
617 // Role: Required. The role assigned to the client. Each role implies a set of
618 // permissions granted to the client.
619 //
620 // Possible values:
621 // "CLIENT_ROLE_UNSPECIFIED" - A placeholder for an undefined client role.
622 // This value should never be specified in user input for create or update
623 // method, otherwise an error will be returned.
624 // "CLIENT_DEAL_VIEWER" - Users associated with this client role can only
625 // view proposals and deals in the Marketplace UI. They cannot negotiate or
626 // approve proposals and deals sent from publishers or send RFP to publishers.
627 // "CLIENT_DEAL_NEGOTIATOR" - Users associated with this client role can view
628 // and negotiate on the proposals and deals in the Marketplace UI sent from
629 // publishers and send RFP to publishers, but cannot approve the proposals and
630 // deals by themselves. The buyer can approve the proposals and deals on behalf
631 // of the client.
632 // "CLIENT_DEAL_APPROVER" - Users associated with this client role can view,
633 // negotiate and approve proposals and deals in the Marketplace UI and send RFP
634 // to publishers.
635 Role string `json:"role,omitempty"`
636 // SellerVisible: Whether the client will be visible to sellers.
637 SellerVisible bool `json:"sellerVisible,omitempty"`
638 // State: Output only. The state of the client.
639 //
640 // Possible values:
641 // "STATE_UNSPECIFIED" - A placeholder for an undefined client state. Should
642 // not be used.
643 // "ACTIVE" - A client that is currently active and allowed to access the
644 // Authorized Buyers UI.
645 // "INACTIVE" - A client that is currently inactive and not allowed to access
646 // the Authorized Buyers UI.
647 State string `json:"state,omitempty"`
648
649 // ServerResponse contains the HTTP response code and headers from the server.
650 googleapi.ServerResponse `json:"-"`
651 // ForceSendFields is a list of field names (e.g. "DisplayName") to
652 // unconditionally include in API requests. By default, fields with empty or
653 // default values are omitted from API requests. See
654 // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more
655 // details.
656 ForceSendFields []string `json:"-"`
657 // NullFields is a list of field names (e.g. "DisplayName") to include in API
658 // requests with the JSON null value. By default, fields with empty values are
659 // omitted from API requests. See
660 // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details.
661 NullFields []string `json:"-"`
662 }
663
664 func (s Client) MarshalJSON() ([]byte, error) {
665 type NoMethod Client
666 return gensupport.MarshalJSON(NoMethod(s), s.ForceSendFields, s.NullFields)
667 }
668
669 // ClientUser: A user of a client who has restricted access to the Marketplace
670 // and certain other sections of the Authorized Buyers UI based on the role
671 // granted to the associated client.
672 type ClientUser struct {
673 // Email: Required. The client user's email address that has to be unique
674 // across all users for the same client.
675 Email string `json:"email,omitempty"`
676 // Name: Output only. The resource name of the client user. Format:
677 // `buyers/{accountId}/clients/{clientAccountId}/users/{userId}`
678 Name string `json:"name,omitempty"`
679 // State: Output only. The state of the client user.
680 //
681 // Possible values:
682 // "STATE_UNSPECIFIED" - A placeholder for an undefined user state.
683 // "INVITED" - A user who was created but hasn't accepted the invitation yet,
684 // not allowed to access the Authorized Buyers UI.
685 // "ACTIVE" - A user that is currently active and allowed to access the
686 // Authorized Buyers UI.
687 // "INACTIVE" - A user that is currently inactive and not allowed to access
688 // the Authorized Buyers UI.
689 State string `json:"state,omitempty"`
690
691 // ServerResponse contains the HTTP response code and headers from the server.
692 googleapi.ServerResponse `json:"-"`
693 // ForceSendFields is a list of field names (e.g. "Email") to unconditionally
694 // include in API requests. By default, fields with empty or default values are
695 // omitted from API requests. See
696 // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more
697 // details.
698 ForceSendFields []string `json:"-"`
699 // NullFields is a list of field names (e.g. "Email") to include in API
700 // requests with the JSON null value. By default, fields with empty values are
701 // omitted from API requests. See
702 // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details.
703 NullFields []string `json:"-"`
704 }
705
706 func (s ClientUser) MarshalJSON() ([]byte, error) {
707 type NoMethod ClientUser
708 return gensupport.MarshalJSON(NoMethod(s), s.ForceSendFields, s.NullFields)
709 }
710
711 // Contact: Contains information on how a buyer or seller can be reached.
712 type Contact struct {
713 // DisplayName: The display_name of the contact.
714 DisplayName string `json:"displayName,omitempty"`
715 // Email: Email address for the contact.
716 Email string `json:"email,omitempty"`
717 // ForceSendFields is a list of field names (e.g. "DisplayName") to
718 // unconditionally include in API requests. By default, fields with empty or
719 // default values are omitted from API requests. See
720 // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more
721 // details.
722 ForceSendFields []string `json:"-"`
723 // NullFields is a list of field names (e.g. "DisplayName") to include in API
724 // requests with the JSON null value. By default, fields with empty values are
725 // omitted from API requests. See
726 // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details.
727 NullFields []string `json:"-"`
728 }
729
730 func (s Contact) MarshalJSON() ([]byte, error) {
731 type NoMethod Contact
732 return gensupport.MarshalJSON(NoMethod(s), s.ForceSendFields, s.NullFields)
733 }
734
735 // CreativeRequirements: Message captures data about the creatives in the deal.
736 type CreativeRequirements struct {
737 // CreativeFormat: Output only. The format of the creative, only applicable for
738 // programmatic guaranteed and preferred deals.
739 //
740 // Possible values:
741 // "CREATIVE_FORMAT_UNSPECIFIED" - A placeholder for an unspecified creative
742 // format.
743 // "DISPLAY" - Banner creatives such as image or HTML5 assets.
744 // "VIDEO" - Video creatives that can be played in a video player.
745 // "AUDIO" - Audio creatives that can play during audio content or point to a
746 // third party ad server.
747 CreativeFormat string `json:"creativeFormat,omitempty"`
748 // CreativePreApprovalPolicy: Output only. Specifies the creative pre-approval
749 // policy.
750 //
751 // Possible values:
752 // "CREATIVE_PRE_APPROVAL_POLICY_UNSPECIFIED" - A placeholder for an
753 // undefined creative pre-approval policy.
754 // "SELLER_PRE_APPROVAL_REQUIRED" - The seller needs to approve each creative
755 // before it can serve.
756 // "SELLER_PRE_APPROVAL_NOT_REQUIRED" - The seller does not need to approve
757 // each creative before it can serve.
758 CreativePreApprovalPolicy string `json:"creativePreApprovalPolicy,omitempty"`
759 // CreativeSafeFrameCompatibility: Output only. Specifies whether the creative
760 // is safeFrame compatible.
761 //
762 // Possible values:
763 // "CREATIVE_SAFE_FRAME_COMPATIBILITY_UNSPECIFIED" - A placeholder for an
764 // undefined creative safe-frame compatibility.
765 // "COMPATIBLE" - The creatives need to be compatible with the safe frame
766 // option.
767 // "INCOMPATIBLE" - The creatives can be incompatible with the safe frame
768 // option.
769 CreativeSafeFrameCompatibility string `json:"creativeSafeFrameCompatibility,omitempty"`
770 // MaxAdDurationMs: Output only. The max duration of the video creative in
771 // milliseconds. only applicable for deals with video creatives.
772 MaxAdDurationMs int64 `json:"maxAdDurationMs,omitempty,string"`
773 // ProgrammaticCreativeSource: Output only. Specifies the creative source for
774 // programmatic deals. PUBLISHER means creative is provided by seller and
775 // ADVERTISER means creative is provided by the buyer.
776 //
777 // Possible values:
778 // "PROGRAMMATIC_CREATIVE_SOURCE_UNSPECIFIED" - A placeholder for an
779 // undefined programmatic creative source.
780 // "ADVERTISER" - The advertiser provides the creatives.
781 // "PUBLISHER" - The publisher provides the creatives to be served.
782 ProgrammaticCreativeSource string `json:"programmaticCreativeSource,omitempty"`
783 // SkippableAdType: Output only. Skippable video ads allow viewers to skip ads
784 // after 5 seconds. Only applicable for deals with video creatives.
785 //
786 // Possible values:
787 // "SKIPPABLE_AD_TYPE_UNSPECIFIED" - A placeholder for an unspecified
788 // skippable ad type.
789 // "SKIPPABLE" - Video ad that can be skipped after 5 seconds. This value
790 // will appear in RTB bid requests as
791 // SkippableBidRequestType::REQUIRE_SKIPPABLE.
792 // "INSTREAM_SELECT" - Video ad that can be skipped after 5 seconds, and is
793 // counted as engaged view after 30 seconds. The creative is hosted on YouTube
794 // only, and viewcount of the YouTube video increments after the engaged view.
795 // This value will appear in RTB bid requests as
796 // SkippableBidRequestType::REQUIRE_SKIPPABLE.
797 // "NOT_SKIPPABLE" - This video ad is not skippable. This value will appear
798 // in RTB bid requests as SkippableBidRequestType::BLOCK_SKIPPABLE.
799 // "ANY" - This video ad can be skipped after 5 seconds or not-skippable.
800 // This value will appear in RTB bid requests as
801 // SkippableBidRequestType::ALLOW_SKIPPABLE.
802 SkippableAdType string `json:"skippableAdType,omitempty"`
803 // ForceSendFields is a list of field names (e.g. "CreativeFormat") to
804 // unconditionally include in API requests. By default, fields with empty or
805 // default values are omitted from API requests. See
806 // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more
807 // details.
808 ForceSendFields []string `json:"-"`
809 // NullFields is a list of field names (e.g. "CreativeFormat") to include in
810 // API requests with the JSON null value. By default, fields with empty values
811 // are omitted from API requests. See
812 // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details.
813 NullFields []string `json:"-"`
814 }
815
816 func (s CreativeRequirements) MarshalJSON() ([]byte, error) {
817 type NoMethod CreativeRequirements
818 return gensupport.MarshalJSON(NoMethod(s), s.ForceSendFields, s.NullFields)
819 }
820
821 // CriteriaTargeting: Generic targeting used for targeting dimensions that
822 // contains a list of included and excluded numeric IDs. This cannot be
823 // filtered using list filter syntax.
824 type CriteriaTargeting struct {
825 // ExcludedCriteriaIds: A list of numeric IDs to be excluded.
826 ExcludedCriteriaIds googleapi.Int64s `json:"excludedCriteriaIds,omitempty"`
827 // TargetedCriteriaIds: A list of numeric IDs to be included.
828 TargetedCriteriaIds googleapi.Int64s `json:"targetedCriteriaIds,omitempty"`
829 // ForceSendFields is a list of field names (e.g. "ExcludedCriteriaIds") to
830 // unconditionally include in API requests. By default, fields with empty or
831 // default values are omitted from API requests. See
832 // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more
833 // details.
834 ForceSendFields []string `json:"-"`
835 // NullFields is a list of field names (e.g. "ExcludedCriteriaIds") to include
836 // in API requests with the JSON null value. By default, fields with empty
837 // values are omitted from API requests. See
838 // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details.
839 NullFields []string `json:"-"`
840 }
841
842 func (s CriteriaTargeting) MarshalJSON() ([]byte, error) {
843 type NoMethod CriteriaTargeting
844 return gensupport.MarshalJSON(NoMethod(s), s.ForceSendFields, s.NullFields)
845 }
846
847 // CuratedPackage: Represents a curated package of inventory created and
848 // managed by a Curator.
849 type CuratedPackage struct {
850 // AccessSettings: Required. Settings for controlling access to the curated
851 // package. Access to this curated package is limited to the allowlisted media
852 // planners and the creator. Buyers and bidders can not be allowlisted for or
853 // have direct access to this resource.
854 AccessSettings *AccessControlSettings `json:"accessSettings,omitempty"`
855 // CreateTime: Output only. The timestamp when the curated package was created.
856 // Can be used to filter the response of the curatedPackages.list method.
857 CreateTime string `json:"createTime,omitempty"`
858 // Description: Optional. A description of the curated package, provided by the
859 // curator.
860 Description string `json:"description,omitempty"`
861 // DisplayName: Required. The display name assigned to the curated package by
862 // the curator. Can be used to filter the response of the curatedPackages.list
863 // method.
864 DisplayName string `json:"displayName,omitempty"`
865 // FeeCpm: Optional. The CPM fee charged by the curator to buyers using this
866 // curated package. Can be used to filter the response of the
867 // curatedPackages.list method.
868 FeeCpm *Money `json:"feeCpm,omitempty"`
869 // FloorPriceCpm: Optional. The minimum CPM a buyer has to bid to participate
870 // in auctions for inventory in this curated package. Can be used to filter the
871 // response of the curatedPackages.list method.
872 FloorPriceCpm *Money `json:"floorPriceCpm,omitempty"`
873 // Name: Identifier. The unique resource name for the curated package. Format:
874 // `curators/{accountId}/curatedPackages/{curatedPackageId}`
875 Name string `json:"name,omitempty"`
876 // State: Output only. The state of the curated package. Can be used to filter
877 // the response of the curatedPackages.list method.
878 //
879 // Possible values:
880 // "STATE_UNSPECIFIED" - Default value.
881 // "ACTIVE" - The curated package is active.
882 // "INACTIVE" - The curated package is inactive.
883 State string `json:"state,omitempty"`
884 // Targeting: Optional. Targeting criteria for the curated package.
885 Targeting *PackageTargeting `json:"targeting,omitempty"`
886 // UpdateTime: Output only. The timestamp when the curated package was last
887 // updated. Can be used to filter the response of the curatedPackages.list
888 // method.
889 UpdateTime string `json:"updateTime,omitempty"`
890
891 // ServerResponse contains the HTTP response code and headers from the server.
892 googleapi.ServerResponse `json:"-"`
893 // ForceSendFields is a list of field names (e.g. "AccessSettings") to
894 // unconditionally include in API requests. By default, fields with empty or
895 // default values are omitted from API requests. See
896 // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more
897 // details.
898 ForceSendFields []string `json:"-"`
899 // NullFields is a list of field names (e.g. "AccessSettings") to include in
900 // API requests with the JSON null value. By default, fields with empty values
901 // are omitted from API requests. See
902 // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details.
903 NullFields []string `json:"-"`
904 }
905
906 func (s CuratedPackage) MarshalJSON() ([]byte, error) {
907 type NoMethod CuratedPackage
908 return gensupport.MarshalJSON(NoMethod(s), s.ForceSendFields, s.NullFields)
909 }
910
911 // DataSegment: Defines an identifier for a segment of inventory that can be
912 // targeted by curators or media planners in the deals or auction packages UI.
913 // Curation of inventory is done by curators on external platforms.
914 type DataSegment struct {
915 // CpmFee: Optional. A fixed fee charged per thousand impressions. Once set,
916 // the currency code cannot be changed.
917 CpmFee *Money `json:"cpmFee,omitempty"`
918 // CreateTime: Output only. Time the data segment was created.
919 CreateTime string `json:"createTime,omitempty"`
920 // Name: Immutable. Identifier. The unique identifier for the data segment.
921 // Account ID corresponds to the account ID that created the segment. v1alpha
922 // format: `buyers/{accountId}/dataSegments/{curatorDataSegmentId}` v1beta
923 // format: `curators/{curatorAccountId}/dataSegments/{curatorDataSegmentId}`
924 Name string `json:"name,omitempty"`
925 // State: Output only. The state of the data segment.
926 //
927 // Possible values:
928 // "STATE_UNSPECIFIED" - Default value.
929 // "ACTIVE" - The data segment is active.
930 // "INACTIVE" - The data segment is inactive.
931 State string `json:"state,omitempty"`
932 // UpdateTime: Output only. Time the data segment was last updated.
933 UpdateTime string `json:"updateTime,omitempty"`
934
935 // ServerResponse contains the HTTP response code and headers from the server.
936 googleapi.ServerResponse `json:"-"`
937 // ForceSendFields is a list of field names (e.g. "CpmFee") to unconditionally
938 // include in API requests. By default, fields with empty or default values are
939 // omitted from API requests. See
940 // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more
941 // details.
942 ForceSendFields []string `json:"-"`
943 // NullFields is a list of field names (e.g. "CpmFee") to include in API
944 // requests with the JSON null value. By default, fields with empty values are
945 // omitted from API requests. See
946 // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details.
947 NullFields []string `json:"-"`
948 }
949
950 func (s DataSegment) MarshalJSON() ([]byte, error) {
951 type NoMethod DataSegment
952 return gensupport.MarshalJSON(NoMethod(s), s.ForceSendFields, s.NullFields)
953 }
954
955 // DayPart: Defines targeting for a period of time on a specific week day.
956 type DayPart struct {
957 // DayOfWeek: Day of week for the period.
958 //
959 // Possible values:
960 // "DAY_OF_WEEK_UNSPECIFIED" - The day of the week is unspecified.
961 // "MONDAY" - Monday
962 // "TUESDAY" - Tuesday
963 // "WEDNESDAY" - Wednesday
964 // "THURSDAY" - Thursday
965 // "FRIDAY" - Friday
966 // "SATURDAY" - Saturday
967 // "SUNDAY" - Sunday
968 DayOfWeek string `json:"dayOfWeek,omitempty"`
969 // EndTime: Hours in 24 hour time between 0 and 24, inclusive. Note: 24 is
970 // logically equivalent to 0, but is supported since in some cases there may
971 // need to be differentiation made between midnight on one day and midnight on
972 // the next day. Accepted values for minutes are [0, 15, 30, 45]. 0 is the only
973 // acceptable minute value for hour 24. Seconds and nanos are ignored.
974 EndTime *TimeOfDay `json:"endTime,omitempty"`
975 // StartTime: Hours in 24 hour time between 0 and 24, inclusive. Note: 24 is
976 // logically equivalent to 0, but is supported since in some cases there may
977 // need to be differentiation made between midnight on one day and midnight on
978 // the next day. Accepted values for minutes are [0, 15, 30, 45]. 0 is the only
979 // acceptable minute value for hour 24. Seconds and nanos are ignored.
980 StartTime *TimeOfDay `json:"startTime,omitempty"`
981 // ForceSendFields is a list of field names (e.g. "DayOfWeek") to
982 // unconditionally include in API requests. By default, fields with empty or
983 // default values are omitted from API requests. See
984 // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more
985 // details.
986 ForceSendFields []string `json:"-"`
987 // NullFields is a list of field names (e.g. "DayOfWeek") to include in API
988 // requests with the JSON null value. By default, fields with empty values are
989 // omitted from API requests. See
990 // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details.
991 NullFields []string `json:"-"`
992 }
993
994 func (s DayPart) MarshalJSON() ([]byte, error) {
995 type NoMethod DayPart
996 return gensupport.MarshalJSON(NoMethod(s), s.ForceSendFields, s.NullFields)
997 }
998
999 // DayPartTargeting: Represents Daypart targeting.
1000 type DayPartTargeting struct {
1001 // DayParts: The targeted weekdays and times
1002 DayParts []*DayPart `json:"dayParts,omitempty"`
1003 // TimeZoneType: The time zone type of the day parts
1004 //
1005 // Possible values:
1006 // "TIME_ZONE_TYPE_UNSPECIFIED" - Default value. This field is unused.
1007 // "SELLER" - The publisher's time zone
1008 // "USER" - The user's time zone
1009 TimeZoneType string `json:"timeZoneType,omitempty"`
1010 // ForceSendFields is a list of field names (e.g. "DayParts") to
1011 // unconditionally include in API requests. By default, fields with empty or
1012 // default values are omitted from API requests. See
1013 // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more
1014 // details.
1015 ForceSendFields []string `json:"-"`
1016 // NullFields is a list of field names (e.g. "DayParts") to include in API
1017 // requests with the JSON null value. By default, fields with empty values are
1018 // omitted from API requests. See
1019 // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details.
1020 NullFields []string `json:"-"`
1021 }
1022
1023 func (s DayPartTargeting) MarshalJSON() ([]byte, error) {
1024 type NoMethod DayPartTargeting
1025 return gensupport.MarshalJSON(NoMethod(s), s.ForceSendFields, s.NullFields)
1026 }
1027
1028 // DeactivateClientRequest: Request message for disabling a client.
1029 type DeactivateClientRequest struct {
1030 }
1031
1032 // DeactivateClientUserRequest: Request message for deactivating a client user.
1033 type DeactivateClientUserRequest struct {
1034 }
1035
1036 // DeactivateCuratedPackageRequest: Request message for
1037 // DeactivateCuratedPackage.
1038 type DeactivateCuratedPackageRequest struct {
1039 }
1040
1041 // DeactivateDataSegmentRequest: Request message for deactivating a data
1042 // segment
1043 type DeactivateDataSegmentRequest struct {
1044 }
1045
1046 // Deal: A deal represents a segment of inventory for displaying ads that
1047 // contains the terms and targeting information that is used for serving as
1048 // well as the deal stats and status. Note: A proposal may contain multiple
1049 // deals.
1050 type Deal struct {
1051 // BilledBuyer: Output only. When the client field is populated, this field
1052 // refers to the buyer who creates and manages the client buyer and gets billed
1053 // on behalf of the client buyer; when the buyer field is populated, this field
1054 // is the same value as buyer; when the deal belongs to a media planner
1055 // account, this field will be empty. Format : `buyers/{buyerAccountId}`
1056 BilledBuyer string `json:"billedBuyer,omitempty"`
1057 // Buyer: Output only. Refers to a buyer in Real-time Bidding API's Buyer
1058 // resource. Format: `buyers/{buyerAccountId}`
1059 Buyer string `json:"buyer,omitempty"`
1060 // BuyerPermissionType: Output only. The buyer permission type of the deal.
1061 //
1062 // Possible values:
1063 // "BUYER_PERMISSION_TYPE_UNSPECIFIED" - A placeholder for an undefined buyer
1064 // permission type.
1065 // "NEGOTIATOR_ONLY" - Only the [Deal.negotiating_buyer] can transact on the
1066 // deal.
1067 // "BIDDER" - All buyers under the [Deal.negotiating_buyer]'s bidder can
1068 // transact on the deal.
1069 BuyerPermissionType string `json:"buyerPermissionType,omitempty"`
1070 // Client: Output only. Refers to a Client. Format:
1071 // `buyers/{buyerAccountId}/clients/{clientAccountid}`
1072 Client string `json:"client,omitempty"`
1073 // CreateTime: Output only. The time of the deal creation.
1074 CreateTime string `json:"createTime,omitempty"`
1075 // CreativeRequirements: Output only. Metadata about the creatives of this
1076 // deal.
1077 CreativeRequirements *CreativeRequirements `json:"creativeRequirements,omitempty"`
1078 // DealType: Output only. Type of deal.
1079 //
1080 // Possible values:
1081 // "DEAL_TYPE_UNSPECIFIED" - Default, unspecified deal type.
1082 // "PREFERRED_DEAL" - Preferred deals.
1083 // "PRIVATE_AUCTION" - Private auction deals.
1084 // "PROGRAMMATIC_GUARANTEED" - Programmatic guaranteed deals.
1085 DealType string `json:"dealType,omitempty"`
1086 // DeliveryControl: Output only. Specifies the pacing set by the publisher.
1087 DeliveryControl *DeliveryControl `json:"deliveryControl,omitempty"`
1088 // Description: Output only. Free text description for the deal terms.
1089 Description string `json:"description,omitempty"`
1090 // DisplayName: Output only. The name of the deal. Maximum length of 255
1091 // unicode characters is allowed. Control characters are not allowed. Buyers
1092 // cannot update this field. Note: Not to be confused with name, which is a
1093 // unique identifier of the deal.
1094 DisplayName string `json:"displayName,omitempty"`
1095 // EligibleSeatIds: Output only. If set, this field contains the list of DSP
1096 // specific seat ids set by media planners that are eligible to transact on
1097 // this deal. The seat ID is in the calling DSP's namespace.
1098 EligibleSeatIds []string `json:"eligibleSeatIds,omitempty"`
1099 // EstimatedGrossSpend: Specified by buyers in request for proposal (RFP) to
1100 // notify publisher the total estimated spend for the proposal. Publishers will
1101 // receive this information and send back proposed deals accordingly.
1102 EstimatedGrossSpend *Money `json:"estimatedGrossSpend,omitempty"`
1103 // FlightEndTime: Proposed flight end time of the deal. This will generally be
1104 // stored in a granularity of a second. A value is not necessary for Private
1105 // Auction deals.
1106 FlightEndTime string `json:"flightEndTime,omitempty"`
1107 // FlightStartTime: Proposed flight start time of the deal. This will generally
1108 // be stored in the granularity of one second since deal serving starts at
1109 // seconds boundary. Any time specified with more granularity (for example, in
1110 // milliseconds) will be truncated towards the start of time in seconds.
1111 FlightStartTime string `json:"flightStartTime,omitempty"`
1112 // MediaPlanner: Output only. Refers to a buyer in Real-time Bidding API's
1113 // Buyer resource. This field represents a media planner (For example, agency
1114 // or big advertiser).
1115 MediaPlanner *MediaPlanner `json:"mediaPlanner,omitempty"`
1116 // Name: Immutable. The unique identifier of the deal. Auto-generated by the
1117 // server when a deal is created. Format:
1118 // buyers/{accountId}/proposals/{proposalId}/deals/{dealId}
1119 Name string `json:"name,omitempty"`
1120 // PreferredDealTerms: The terms for preferred deals.
1121 PreferredDealTerms *PreferredDealTerms `json:"preferredDealTerms,omitempty"`
1122 // PrivateAuctionTerms: The terms for private auction deals.
1123 PrivateAuctionTerms *PrivateAuctionTerms `json:"privateAuctionTerms,omitempty"`
1124 // ProgrammaticGuaranteedTerms: The terms for programmatic guaranteed deals.
1125 ProgrammaticGuaranteedTerms *ProgrammaticGuaranteedTerms `json:"programmaticGuaranteedTerms,omitempty"`
1126 // ProposalRevision: Output only. The revision number for the proposal and is
1127 // the same value as proposal.proposal_revision. Each update to deal causes the
1128 // proposal revision number to auto-increment. The buyer keeps track of the
1129 // last revision number they know of and pass it in when making an update. If
1130 // the head revision number on the server has since incremented, then an
1131 // ABORTED error is returned during the update operation to let the buyer know
1132 // that a subsequent update was made.
1133 ProposalRevision int64 `json:"proposalRevision,omitempty,string"`
1134 // PublisherProfile: Immutable. Reference to the seller on the deal. Format:
1135 // `buyers/{buyerAccountId}/publisherProfiles/{publisherProfileId}`
1136 PublisherProfile string `json:"publisherProfile,omitempty"`
1137 // SellerTimeZone: Output only. Time zone of the seller used to mark the
1138 // boundaries of a day for daypart targeting and CPD billing.
1139 SellerTimeZone *TimeZone `json:"sellerTimeZone,omitempty"`
1140 // Targeting: Specifies the subset of inventory targeted by the deal. Can be
1141 // updated by the buyer before the deal is finalized.
1142 Targeting *MarketplaceTargeting `json:"targeting,omitempty"`
1143 // UpdateTime: Output only. The time when the deal was last updated.
1144 UpdateTime string `json:"updateTime,omitempty"`
1145
1146 // ServerResponse contains the HTTP response code and headers from the server.
1147 googleapi.ServerResponse `json:"-"`
1148 // ForceSendFields is a list of field names (e.g. "BilledBuyer") to
1149 // unconditionally include in API requests. By default, fields with empty or
1150 // default values are omitted from API requests. See
1151 // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more
1152 // details.
1153 ForceSendFields []string `json:"-"`
1154 // NullFields is a list of field names (e.g. "BilledBuyer") to include in API
1155 // requests with the JSON null value. By default, fields with empty values are
1156 // omitted from API requests. See
1157 // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details.
1158 NullFields []string `json:"-"`
1159 }
1160
1161 func (s Deal) MarshalJSON() ([]byte, error) {
1162 type NoMethod Deal
1163 return gensupport.MarshalJSON(NoMethod(s), s.ForceSendFields, s.NullFields)
1164 }
1165
1166 // DealPausingInfo: Information related to deal pausing.
1167 type DealPausingInfo struct {
1168 // PauseReason: The reason for the pausing of the deal; empty for active deals.
1169 PauseReason string `json:"pauseReason,omitempty"`
1170 // PauseRole: The party that first paused the deal; unspecified for active
1171 // deals.
1172 //
1173 // Possible values:
1174 // "BUYER_SELLER_ROLE_UNSPECIFIED" - A placeholder for an undefined
1175 // buyer/seller role.
1176 // "BUYER" - Specifies the role as buyer.
1177 // "SELLER" - Specifies the role as seller.
1178 PauseRole string `json:"pauseRole,omitempty"`
1179 // PausingConsented: Whether pausing is consented between buyer and seller for
1180 // the deal.
1181 PausingConsented bool `json:"pausingConsented,omitempty"`
1182 // ForceSendFields is a list of field names (e.g. "PauseReason") to
1183 // unconditionally include in API requests. By default, fields with empty or
1184 // default values are omitted from API requests. See
1185 // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more
1186 // details.
1187 ForceSendFields []string `json:"-"`
1188 // NullFields is a list of field names (e.g. "PauseReason") to include in API
1189 // requests with the JSON null value. By default, fields with empty values are
1190 // omitted from API requests. See
1191 // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details.
1192 NullFields []string `json:"-"`
1193 }
1194
1195 func (s DealPausingInfo) MarshalJSON() ([]byte, error) {
1196 type NoMethod DealPausingInfo
1197 return gensupport.MarshalJSON(NoMethod(s), s.ForceSendFields, s.NullFields)
1198 }
1199
1200 // DeliveryControl: Message contains details about how the deal will be paced.
1201 type DeliveryControl struct {
1202 // CompanionDeliveryType: Output only. Specifies roadblocking in a main
1203 // companion lineitem.
1204 //
1205 // Possible values:
1206 // "COMPANION_DELIVERY_TYPE_UNSPECIFIED" - A placeholder for an unspecified
1207 // companion delivery type.
1208 // "DELIVERY_OPTIONAL" - Companions are not required to serve a creative set.
1209 // The creative set can serve an inventory that has zero or more matching
1210 // companions.
1211 // "DELIVERY_AT_LEAST_ONE" - At least one companion must be served in order
1212 // for the creative set to be used.
1213 // "DELIVERY_ALL" - All companions in the set must be served in order for the
1214 // creative set to be used. This can still serve to inventory that has more
1215 // companions than can be filled.
1216 CompanionDeliveryType string `json:"companionDeliveryType,omitempty"`
1217 // CreativeRotationType: Output only. Specifies strategy to use for selecting a
1218 // creative when multiple creatives of the same size are available.
1219 //
1220 // Possible values:
1221 // "CREATIVE_ROTATION_TYPE_UNSPECIFIED" - Creatives are displayed roughly the
1222 // same number of times over the duration of the deal.
1223 // "ROTATION_EVEN" - Creatives are displayed roughly the same number of times
1224 // over the duration of the deal.
1225 // "ROTATION_OPTIMIZED" - Creatives are served roughly proportionally to
1226 // their performance.
1227 // "ROTATION_MANUAL" - Creatives are served roughly proportionally to their
1228 // weights.
1229 // "ROTATION_SEQUENTIAL" - Creatives are served exactly in sequential order,
1230 // also known as Storyboarding.
1231 CreativeRotationType string `json:"creativeRotationType,omitempty"`
1232 // DeliveryRateType: Output only. Specifies how the impression delivery will be
1233 // paced.
1234 //
1235 // Possible values:
1236 // "DELIVERY_RATE_TYPE_UNSPECIFIED" - A placeholder for an undefined delivery
1237 // rate type.
1238 // "EVENLY" - Impressions are served uniformly over the life of the deal.
1239 // "FRONT_LOADED" - Impressions are served front-loaded.
1240 // "AS_FAST_AS_POSSIBLE" - Impressions are served as fast as possible.
1241 DeliveryRateType string `json:"deliveryRateType,omitempty"`
1242 // FrequencyCap: Output only. Specifies any frequency caps. Cannot be filtered
1243 // within ListDealsRequest.
1244 FrequencyCap []*FrequencyCap `json:"frequencyCap,omitempty"`
1245 // RoadblockingType: Output only. Specifies the roadblocking type in display
1246 // creatives.
1247 //
1248 // Possible values:
1249 // "ROADBLOCKING_TYPE_UNSPECIFIED" - A placeholder for an unspecified
1250 // roadblocking type.
1251 // "ONLY_ONE" - Only one creative from a deal can serve per ad request.
1252 // https://support.google.com/admanager/answer/177277.
1253 // "ONE_OR_MORE" - Any number of creatives from a deal can serve together per
1254 // ad request.
1255 // "AS_MANY_AS_POSSIBLE" - As many creatives from a deal as can fit on a page
1256 // will serve. This could mean anywhere from one to all of a deal's creatives
1257 // given the size constraints of ad slots on a page.
1258 // "ALL_ROADBLOCK" - All or none of the creatives from a deal will serve.
1259 // "CREATIVE_SET" - A main/companion creative set roadblocking type.
1260 RoadblockingType string `json:"roadblockingType,omitempty"`
1261 // ForceSendFields is a list of field names (e.g. "CompanionDeliveryType") to
1262 // unconditionally include in API requests. By default, fields with empty or
1263 // default values are omitted from API requests. See
1264 // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more
1265 // details.
1266 ForceSendFields []string `json:"-"`
1267 // NullFields is a list of field names (e.g. "CompanionDeliveryType") to
1268 // include in API requests with the JSON null value. By default, fields with
1269 // empty values are omitted from API requests. See
1270 // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details.
1271 NullFields []string `json:"-"`
1272 }
1273
1274 func (s DeliveryControl) MarshalJSON() ([]byte, error) {
1275 type NoMethod DeliveryControl
1276 return gensupport.MarshalJSON(NoMethod(s), s.ForceSendFields, s.NullFields)
1277 }
1278
1279 // Empty: A generic empty message that you can re-use to avoid defining
1280 // duplicated empty messages in your APIs. A typical example is to use it as
1281 // the request or the response type of an API method. For instance: service Foo
1282 // { rpc Bar(google.protobuf.Empty) returns (google.protobuf.Empty); }
1283 type Empty struct {
1284 // ServerResponse contains the HTTP response code and headers from the server.
1285 googleapi.ServerResponse `json:"-"`
1286 }
1287
1288 // FinalizedDeal: A finalized deal is a snapshot of the deal when both buyer
1289 // and seller accept the deal. The buyer or seller can update the deal after
1290 // it's been finalized and renegotiate on the deal targeting, terms and other
1291 // fields, while at the same time the finalized snapshot of the deal can still
1292 // be retrieved using this API. The finalized deal contains a copy of the deal
1293 // as it existed when most recently finalized, as well as fields related to
1294 // deal serving such as pause/resume status, RTB metrics, and more.
1295 type FinalizedDeal struct {
1296 // Deal: A copy of the Deal made upon finalization. During renegotiation, this
1297 // will reflect the last finalized deal before renegotiation was initiated.
1298 Deal *Deal `json:"deal,omitempty"`
1299 // DealPausingInfo: Information related to deal pausing for the deal.
1300 DealPausingInfo *DealPausingInfo `json:"dealPausingInfo,omitempty"`
1301 // DealServingStatus: Serving status of the deal.
1302 //
1303 // Possible values:
1304 // "DEAL_SERVING_STATUS_UNSPECIFIED" - Unspecified.
1305 // "ACTIVE" - The deal is actively serving or ready to serve when the start
1306 // date is reached.
1307 // "ENDED" - The deal serving has ended.
1308 // "PAUSED_BY_BUYER" - The deal serving is paused by buyer.
1309 // "PAUSED_BY_SELLER" - The deal serving is paused by seller.
1310 DealServingStatus string `json:"dealServingStatus,omitempty"`
1311 // Name: The resource name of the finalized deal. Format:
1312 // `buyers/{accountId}/finalizedDeals/{finalizedDealId}`
1313 Name string `json:"name,omitempty"`
1314 // ReadyToServe: Whether the Programmatic Guaranteed deal is ready for serving.
1315 ReadyToServe bool `json:"readyToServe,omitempty"`
1316 // RtbMetrics: Real-time bidding metrics for this deal.
1317 RtbMetrics *RtbMetrics `json:"rtbMetrics,omitempty"`
1318
1319 // ServerResponse contains the HTTP response code and headers from the server.
1320 googleapi.ServerResponse `json:"-"`
1321 // ForceSendFields is a list of field names (e.g. "Deal") to unconditionally
1322 // include in API requests. By default, fields with empty or default values are
1323 // omitted from API requests. See
1324 // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more
1325 // details.
1326 ForceSendFields []string `json:"-"`
1327 // NullFields is a list of field names (e.g. "Deal") to include in API requests
1328 // with the JSON null value. By default, fields with empty values are omitted
1329 // from API requests. See
1330 // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details.
1331 NullFields []string `json:"-"`
1332 }
1333
1334 func (s FinalizedDeal) MarshalJSON() ([]byte, error) {
1335 type NoMethod FinalizedDeal
1336 return gensupport.MarshalJSON(NoMethod(s), s.ForceSendFields, s.NullFields)
1337 }
1338
1339 // FirstPartyMobileApplicationTargeting: Represents a list of targeted and
1340 // excluded mobile application IDs that publishers own. Android App ID, for
1341 // example, com.google.android.apps.maps, can be found in Google Play Store
1342 // URL. iOS App ID (which is a number) can be found at the end of iTunes store
1343 // URL. First party mobile applications is either included or excluded.
1344 type FirstPartyMobileApplicationTargeting struct {
1345 // ExcludedAppIds: A list of application IDs to be excluded.
1346 ExcludedAppIds []string `json:"excludedAppIds,omitempty"`
1347 // TargetedAppIds: A list of application IDs to be included.
1348 TargetedAppIds []string `json:"targetedAppIds,omitempty"`
1349 // ForceSendFields is a list of field names (e.g. "ExcludedAppIds") to
1350 // unconditionally include in API requests. By default, fields with empty or
1351 // default values are omitted from API requests. See
1352 // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more
1353 // details.
1354 ForceSendFields []string `json:"-"`
1355 // NullFields is a list of field names (e.g. "ExcludedAppIds") to include in
1356 // API requests with the JSON null value. By default, fields with empty values
1357 // are omitted from API requests. See
1358 // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details.
1359 NullFields []string `json:"-"`
1360 }
1361
1362 func (s FirstPartyMobileApplicationTargeting) MarshalJSON() ([]byte, error) {
1363 type NoMethod FirstPartyMobileApplicationTargeting
1364 return gensupport.MarshalJSON(NoMethod(s), s.ForceSendFields, s.NullFields)
1365 }
1366
1367 // FrequencyCap: Message contains details about publisher-set frequency caps of
1368 // the delivery.
1369 type FrequencyCap struct {
1370 // MaxImpressions: The maximum number of impressions that can be served to a
1371 // user within the specified time period.
1372 MaxImpressions int64 `json:"maxImpressions,omitempty"`
1373 // TimeUnitType: The time unit. Along with num_time_units defines the amount of
1374 // time over which impressions per user are counted and capped.
1375 //
1376 // Possible values:
1377 // "TIME_UNIT_TYPE_UNSPECIFIED" - A placeholder for an undefined time unit
1378 // type. This just indicates the variable with this value hasn't been
1379 // initialized.
1380 // "MINUTE" - Minute unit.
1381 // "HOUR" - Hour unit.
1382 // "DAY" - Day unit.
1383 // "WEEK" - Week unit.
1384 // "MONTH" - Month unit.
1385 // "LIFETIME" - Lifecycle/Lifetime unit.
1386 // "POD" - Pod unit.
1387 // "STREAM" - Stream unit.
1388 TimeUnitType string `json:"timeUnitType,omitempty"`
1389 // TimeUnitsCount: The amount of time, in the units specified by
1390 // time_unit_type. Defines the amount of time over which impressions per user
1391 // are counted and capped.
1392 TimeUnitsCount int64 `json:"timeUnitsCount,omitempty"`
1393 // ForceSendFields is a list of field names (e.g. "MaxImpressions") to
1394 // unconditionally include in API requests. By default, fields with empty or
1395 // default values are omitted from API requests. See
1396 // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more
1397 // details.
1398 ForceSendFields []string `json:"-"`
1399 // NullFields is a list of field names (e.g. "MaxImpressions") to include in
1400 // API requests with the JSON null value. By default, fields with empty values
1401 // are omitted from API requests. See
1402 // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details.
1403 NullFields []string `json:"-"`
1404 }
1405
1406 func (s FrequencyCap) MarshalJSON() ([]byte, error) {
1407 type NoMethod FrequencyCap
1408 return gensupport.MarshalJSON(NoMethod(s), s.ForceSendFields, s.NullFields)
1409 }
1410
1411 // InventorySizeTargeting: Represents the size of an ad unit that can be
1412 // targeted on a bid request.
1413 type InventorySizeTargeting struct {
1414 // ExcludedInventorySizes: A list of inventory sizes to be excluded.
1415 ExcludedInventorySizes []*AdSize `json:"excludedInventorySizes,omitempty"`
1416 // TargetedInventorySizes: A list of inventory sizes to be included.
1417 TargetedInventorySizes []*AdSize `json:"targetedInventorySizes,omitempty"`
1418 // ForceSendFields is a list of field names (e.g. "ExcludedInventorySizes") to
1419 // unconditionally include in API requests. By default, fields with empty or
1420 // default values are omitted from API requests. See
1421 // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more
1422 // details.
1423 ForceSendFields []string `json:"-"`
1424 // NullFields is a list of field names (e.g. "ExcludedInventorySizes") to
1425 // include in API requests with the JSON null value. By default, fields with
1426 // empty values are omitted from API requests. See
1427 // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details.
1428 NullFields []string `json:"-"`
1429 }
1430
1431 func (s InventorySizeTargeting) MarshalJSON() ([]byte, error) {
1432 type NoMethod InventorySizeTargeting
1433 return gensupport.MarshalJSON(NoMethod(s), s.ForceSendFields, s.NullFields)
1434 }
1435
1436 // InventoryTypeTargeting: Targeting of the inventory types a bid request can
1437 // originate from.
1438 type InventoryTypeTargeting struct {
1439 // InventoryTypes: The list of targeted inventory types for the bid request.
1440 //
1441 // Possible values:
1442 // "INVENTORY_TYPE_UNSPECIFIED" - Unspecified inventory type
1443 // "BROWSER" - Desktop or mobile web browser excluding ads inside a video
1444 // player
1445 // "MOBILE_APP" - Mobile apps other than video players and web browsers
1446 // "VIDEO_PLAYER" - Instream video and audio
1447 InventoryTypes []string `json:"inventoryTypes,omitempty"`
1448 // ForceSendFields is a list of field names (e.g. "InventoryTypes") to
1449 // unconditionally include in API requests. By default, fields with empty or
1450 // default values are omitted from API requests. See
1451 // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more
1452 // details.
1453 ForceSendFields []string `json:"-"`
1454 // NullFields is a list of field names (e.g. "InventoryTypes") to include in
1455 // API requests with the JSON null value. By default, fields with empty values
1456 // are omitted from API requests. See
1457 // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details.
1458 NullFields []string `json:"-"`
1459 }
1460
1461 func (s InventoryTypeTargeting) MarshalJSON() ([]byte, error) {
1462 type NoMethod InventoryTypeTargeting
1463 return gensupport.MarshalJSON(NoMethod(s), s.ForceSendFields, s.NullFields)
1464 }
1465
1466 // ListAuctionPackagesResponse: Response message for listing auction packages.
1467 type ListAuctionPackagesResponse struct {
1468 // AuctionPackages: The list of auction packages.
1469 AuctionPackages []*AuctionPackage `json:"auctionPackages,omitempty"`
1470 // NextPageToken: Continuation token for fetching the next page of results.
1471 // Pass this value in the ListAuctionPackagesRequest.pageToken field in the
1472 // subsequent call to the `ListAuctionPackages` method to retrieve the next
1473 // page of results.
1474 NextPageToken string `json:"nextPageToken,omitempty"`
1475
1476 // ServerResponse contains the HTTP response code and headers from the server.
1477 googleapi.ServerResponse `json:"-"`
1478 // ForceSendFields is a list of field names (e.g. "AuctionPackages") to
1479 // unconditionally include in API requests. By default, fields with empty or
1480 // default values are omitted from API requests. See
1481 // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more
1482 // details.
1483 ForceSendFields []string `json:"-"`
1484 // NullFields is a list of field names (e.g. "AuctionPackages") to include in
1485 // API requests with the JSON null value. By default, fields with empty values
1486 // are omitted from API requests. See
1487 // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details.
1488 NullFields []string `json:"-"`
1489 }
1490
1491 func (s ListAuctionPackagesResponse) MarshalJSON() ([]byte, error) {
1492 type NoMethod ListAuctionPackagesResponse
1493 return gensupport.MarshalJSON(NoMethod(s), s.ForceSendFields, s.NullFields)
1494 }
1495
1496 // ListClientUsersResponse: Response message for the list method.
1497 type ListClientUsersResponse struct {
1498 // ClientUsers: The returned list of client users.
1499 ClientUsers []*ClientUser `json:"clientUsers,omitempty"`
1500 // NextPageToken: A token to retrieve the next page of results. Pass this value
1501 // in the ListClientUsersRequest.pageToken field in the subsequent call to the
1502 // list method to retrieve the next page of results.
1503 NextPageToken string `json:"nextPageToken,omitempty"`
1504
1505 // ServerResponse contains the HTTP response code and headers from the server.
1506 googleapi.ServerResponse `json:"-"`
1507 // ForceSendFields is a list of field names (e.g. "ClientUsers") to
1508 // unconditionally include in API requests. By default, fields with empty or
1509 // default values are omitted from API requests. See
1510 // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more
1511 // details.
1512 ForceSendFields []string `json:"-"`
1513 // NullFields is a list of field names (e.g. "ClientUsers") to include in API
1514 // requests with the JSON null value. By default, fields with empty values are
1515 // omitted from API requests. See
1516 // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details.
1517 NullFields []string `json:"-"`
1518 }
1519
1520 func (s ListClientUsersResponse) MarshalJSON() ([]byte, error) {
1521 type NoMethod ListClientUsersResponse
1522 return gensupport.MarshalJSON(NoMethod(s), s.ForceSendFields, s.NullFields)
1523 }
1524
1525 // ListClientsResponse: Response message for the list method.
1526 type ListClientsResponse struct {
1527 // Clients: The returned list of clients.
1528 Clients []*Client `json:"clients,omitempty"`
1529 // NextPageToken: A token to retrieve the next page of results. Pass this value
1530 // in the ListClientsRequest.pageToken field in the subsequent call to the list
1531 // method to retrieve the next page of results.
1532 NextPageToken string `json:"nextPageToken,omitempty"`
1533
1534 // ServerResponse contains the HTTP response code and headers from the server.
1535 googleapi.ServerResponse `json:"-"`
1536 // ForceSendFields is a list of field names (e.g. "Clients") to unconditionally
1537 // include in API requests. By default, fields with empty or default values are
1538 // omitted from API requests. See
1539 // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more
1540 // details.
1541 ForceSendFields []string `json:"-"`
1542 // NullFields is a list of field names (e.g. "Clients") to include in API
1543 // requests with the JSON null value. By default, fields with empty values are
1544 // omitted from API requests. See
1545 // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details.
1546 NullFields []string `json:"-"`
1547 }
1548
1549 func (s ListClientsResponse) MarshalJSON() ([]byte, error) {
1550 type NoMethod ListClientsResponse
1551 return gensupport.MarshalJSON(NoMethod(s), s.ForceSendFields, s.NullFields)
1552 }
1553
1554 // ListCuratedPackagesResponse: Response message for ListCuratedPackages.
1555 type ListCuratedPackagesResponse struct {
1556 // CuratedPackages: The list of curated packages.
1557 CuratedPackages []*CuratedPackage `json:"curatedPackages,omitempty"`
1558 // NextPageToken: A token to retrieve the next page of results. Pass this value
1559 // in the ListCuratedPackagesRequest.pageToken field in the subsequent call to
1560 // `ListCuratedPackages` method to retrieve the next page of results. If empty,
1561 // then there are no more results.
1562 NextPageToken string `json:"nextPageToken,omitempty"`
1563
1564 // ServerResponse contains the HTTP response code and headers from the server.
1565 googleapi.ServerResponse `json:"-"`
1566 // ForceSendFields is a list of field names (e.g. "CuratedPackages") to
1567 // unconditionally include in API requests. By default, fields with empty or
1568 // default values are omitted from API requests. See
1569 // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more
1570 // details.
1571 ForceSendFields []string `json:"-"`
1572 // NullFields is a list of field names (e.g. "CuratedPackages") to include in
1573 // API requests with the JSON null value. By default, fields with empty values
1574 // are omitted from API requests. See
1575 // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details.
1576 NullFields []string `json:"-"`
1577 }
1578
1579 func (s ListCuratedPackagesResponse) MarshalJSON() ([]byte, error) {
1580 type NoMethod ListCuratedPackagesResponse
1581 return gensupport.MarshalJSON(NoMethod(s), s.ForceSendFields, s.NullFields)
1582 }
1583
1584 // ListDataSegmentsResponse: Response message for listing data segments.
1585 type ListDataSegmentsResponse struct {
1586 // DataSegments: The list of data segments.
1587 DataSegments []*DataSegment `json:"dataSegments,omitempty"`
1588 // NextPageToken: Continuation token for fetching the next page of results.
1589 // Pass this value in the ListDataSegmentsRequest.pageToken field in the
1590 // subsequent call to the `ListDataSegments` method to retrieve the next page
1591 // of results.
1592 NextPageToken string `json:"nextPageToken,omitempty"`
1593
1594 // ServerResponse contains the HTTP response code and headers from the server.
1595 googleapi.ServerResponse `json:"-"`
1596 // ForceSendFields is a list of field names (e.g. "DataSegments") to
1597 // unconditionally include in API requests. By default, fields with empty or
1598 // default values are omitted from API requests. See
1599 // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more
1600 // details.
1601 ForceSendFields []string `json:"-"`
1602 // NullFields is a list of field names (e.g. "DataSegments") to include in API
1603 // requests with the JSON null value. By default, fields with empty values are
1604 // omitted from API requests. See
1605 // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details.
1606 NullFields []string `json:"-"`
1607 }
1608
1609 func (s ListDataSegmentsResponse) MarshalJSON() ([]byte, error) {
1610 type NoMethod ListDataSegmentsResponse
1611 return gensupport.MarshalJSON(NoMethod(s), s.ForceSendFields, s.NullFields)
1612 }
1613
1614 // ListDealsResponse: Response message for listing deals in a proposal.
1615 type ListDealsResponse struct {
1616 // Deals: The list of deals.
1617 Deals []*Deal `json:"deals,omitempty"`
1618 // NextPageToken: Token to fetch the next page of results.
1619 NextPageToken string `json:"nextPageToken,omitempty"`
1620
1621 // ServerResponse contains the HTTP response code and headers from the server.
1622 googleapi.ServerResponse `json:"-"`
1623 // ForceSendFields is a list of field names (e.g. "Deals") to unconditionally
1624 // include in API requests. By default, fields with empty or default values are
1625 // omitted from API requests. See
1626 // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more
1627 // details.
1628 ForceSendFields []string `json:"-"`
1629 // NullFields is a list of field names (e.g. "Deals") to include in API
1630 // requests with the JSON null value. By default, fields with empty values are
1631 // omitted from API requests. See
1632 // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details.
1633 NullFields []string `json:"-"`
1634 }
1635
1636 func (s ListDealsResponse) MarshalJSON() ([]byte, error) {
1637 type NoMethod ListDealsResponse
1638 return gensupport.MarshalJSON(NoMethod(s), s.ForceSendFields, s.NullFields)
1639 }
1640
1641 // ListFinalizedDealsResponse: Response message for listing finalized deals.
1642 type ListFinalizedDealsResponse struct {
1643 // FinalizedDeals: The list of finalized deals.
1644 FinalizedDeals []*FinalizedDeal `json:"finalizedDeals,omitempty"`
1645 // NextPageToken: Token to fetch the next page of results.
1646 NextPageToken string `json:"nextPageToken,omitempty"`
1647
1648 // ServerResponse contains the HTTP response code and headers from the server.
1649 googleapi.ServerResponse `json:"-"`
1650 // ForceSendFields is a list of field names (e.g. "FinalizedDeals") to
1651 // unconditionally include in API requests. By default, fields with empty or
1652 // default values are omitted from API requests. See
1653 // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more
1654 // details.
1655 ForceSendFields []string `json:"-"`
1656 // NullFields is a list of field names (e.g. "FinalizedDeals") to include in
1657 // API requests with the JSON null value. By default, fields with empty values
1658 // are omitted from API requests. See
1659 // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details.
1660 NullFields []string `json:"-"`
1661 }
1662
1663 func (s ListFinalizedDealsResponse) MarshalJSON() ([]byte, error) {
1664 type NoMethod ListFinalizedDealsResponse
1665 return gensupport.MarshalJSON(NoMethod(s), s.ForceSendFields, s.NullFields)
1666 }
1667
1668 // ListMediaPlannersResponse: A response containing media planner account
1669 // information.
1670 type ListMediaPlannersResponse struct {
1671 // MediaPlanners: List of media planners.
1672 MediaPlanners []*MediaPlanner `json:"mediaPlanners,omitempty"`
1673 // NextPageToken: A token which can be passed to a subsequent call to the
1674 // `ListMediaPlanners` method to retrieve the next page of results in
1675 // ListMediaPlannersRequest.pageToken.
1676 NextPageToken string `json:"nextPageToken,omitempty"`
1677
1678 // ServerResponse contains the HTTP response code and headers from the server.
1679 googleapi.ServerResponse `json:"-"`
1680 // ForceSendFields is a list of field names (e.g. "MediaPlanners") to
1681 // unconditionally include in API requests. By default, fields with empty or
1682 // default values are omitted from API requests. See
1683 // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more
1684 // details.
1685 ForceSendFields []string `json:"-"`
1686 // NullFields is a list of field names (e.g. "MediaPlanners") to include in API
1687 // requests with the JSON null value. By default, fields with empty values are
1688 // omitted from API requests. See
1689 // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details.
1690 NullFields []string `json:"-"`
1691 }
1692
1693 func (s ListMediaPlannersResponse) MarshalJSON() ([]byte, error) {
1694 type NoMethod ListMediaPlannersResponse
1695 return gensupport.MarshalJSON(NoMethod(s), s.ForceSendFields, s.NullFields)
1696 }
1697
1698 // ListProposalsResponse: Response message for listing proposals.
1699 type ListProposalsResponse struct {
1700 // NextPageToken: Continuation token for fetching the next page of results.
1701 NextPageToken string `json:"nextPageToken,omitempty"`
1702 // Proposals: The list of proposals.
1703 Proposals []*Proposal `json:"proposals,omitempty"`
1704
1705 // ServerResponse contains the HTTP response code and headers from the server.
1706 googleapi.ServerResponse `json:"-"`
1707 // ForceSendFields is a list of field names (e.g. "NextPageToken") to
1708 // unconditionally include in API requests. By default, fields with empty or
1709 // default values are omitted from API requests. See
1710 // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more
1711 // details.
1712 ForceSendFields []string `json:"-"`
1713 // NullFields is a list of field names (e.g. "NextPageToken") to include in API
1714 // requests with the JSON null value. By default, fields with empty values are
1715 // omitted from API requests. See
1716 // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details.
1717 NullFields []string `json:"-"`
1718 }
1719
1720 func (s ListProposalsResponse) MarshalJSON() ([]byte, error) {
1721 type NoMethod ListProposalsResponse
1722 return gensupport.MarshalJSON(NoMethod(s), s.ForceSendFields, s.NullFields)
1723 }
1724
1725 // ListPublisherProfilesResponse: Response message for profiles visible to the
1726 // buyer.
1727 type ListPublisherProfilesResponse struct {
1728 // NextPageToken: Token to fetch the next page of results.
1729 NextPageToken string `json:"nextPageToken,omitempty"`
1730 // PublisherProfiles: The list of matching publisher profiles.
1731 PublisherProfiles []*PublisherProfile `json:"publisherProfiles,omitempty"`
1732
1733 // ServerResponse contains the HTTP response code and headers from the server.
1734 googleapi.ServerResponse `json:"-"`
1735 // ForceSendFields is a list of field names (e.g. "NextPageToken") to
1736 // unconditionally include in API requests. By default, fields with empty or
1737 // default values are omitted from API requests. See
1738 // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more
1739 // details.
1740 ForceSendFields []string `json:"-"`
1741 // NullFields is a list of field names (e.g. "NextPageToken") to include in API
1742 // requests with the JSON null value. By default, fields with empty values are
1743 // omitted from API requests. See
1744 // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details.
1745 NullFields []string `json:"-"`
1746 }
1747
1748 func (s ListPublisherProfilesResponse) MarshalJSON() ([]byte, error) {
1749 type NoMethod ListPublisherProfilesResponse
1750 return gensupport.MarshalJSON(NoMethod(s), s.ForceSendFields, s.NullFields)
1751 }
1752
1753 // MarketplaceTargeting: Targeting represents different criteria that can be
1754 // used to target deals or auction packages. For example, they can choose to
1755 // target inventory only if the user is in the US. Multiple types of targeting
1756 // are always applied as a logical AND, unless noted otherwise.
1757 type MarketplaceTargeting struct {
1758 // DaypartTargeting: Daypart targeting information.
1759 DaypartTargeting *DayPartTargeting `json:"daypartTargeting,omitempty"`
1760 // ExcludedSensitiveCategoryIds: Output only. The sensitive content category
1761 // label IDs excluded. Refer to this file
1762 // https://storage.googleapis.com/adx-rtb-dictionaries/content-labels.txt for
1763 // category IDs.
1764 ExcludedSensitiveCategoryIds googleapi.Int64s `json:"excludedSensitiveCategoryIds,omitempty"`
1765 // GeoTargeting: Output only. Geo criteria IDs to be included/excluded.
1766 GeoTargeting *CriteriaTargeting `json:"geoTargeting,omitempty"`
1767 // InventorySizeTargeting: Output only. Inventory sizes to be
1768 // included/excluded.
1769 InventorySizeTargeting *InventorySizeTargeting `json:"inventorySizeTargeting,omitempty"`
1770 // InventoryTypeTargeting: Output only. Inventory type targeting information.
1771 InventoryTypeTargeting *InventoryTypeTargeting `json:"inventoryTypeTargeting,omitempty"`
1772 // PlacementTargeting: Output only. Placement targeting information, for
1773 // example, URL, mobile applications.
1774 PlacementTargeting *PlacementTargeting `json:"placementTargeting,omitempty"`
1775 // TechnologyTargeting: Output only. Technology targeting information, for
1776 // example, operating system, device category.
1777 TechnologyTargeting *TechnologyTargeting `json:"technologyTargeting,omitempty"`
1778 // UserListTargeting: Buyer user list targeting information. User lists can be
1779 // uploaded using
1780 // https://developers.google.com/authorized-buyers/rtb/bulk-uploader.
1781 UserListTargeting *CriteriaTargeting `json:"userListTargeting,omitempty"`
1782 // VerticalTargeting: Output only. The verticals included or excluded as
1783 // defined in
1784 // https://developers.google.com/authorized-buyers/rtb/downloads/publisher-verticals
1785 VerticalTargeting *CriteriaTargeting `json:"verticalTargeting,omitempty"`
1786 // VideoTargeting: Output only. Video targeting information.
1787 VideoTargeting *VideoTargeting `json:"videoTargeting,omitempty"`
1788 // ForceSendFields is a list of field names (e.g. "DaypartTargeting") to
1789 // unconditionally include in API requests. By default, fields with empty or
1790 // default values are omitted from API requests. See
1791 // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more
1792 // details.
1793 ForceSendFields []string `json:"-"`
1794 // NullFields is a list of field names (e.g. "DaypartTargeting") to include in
1795 // API requests with the JSON null value. By default, fields with empty values
1796 // are omitted from API requests. See
1797 // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details.
1798 NullFields []string `json:"-"`
1799 }
1800
1801 func (s MarketplaceTargeting) MarshalJSON() ([]byte, error) {
1802 type NoMethod MarketplaceTargeting
1803 return gensupport.MarshalJSON(NoMethod(s), s.ForceSendFields, s.NullFields)
1804 }
1805
1806 // MediaPlanner: Represents a media planner account.
1807 type MediaPlanner struct {
1808 // AccountId: Output only. Account ID of the media planner.
1809 AccountId string `json:"accountId,omitempty"`
1810 // AncestorNames: Output only. The ancestor names of the media planner. Format:
1811 // `mediaPlanners/{mediaPlannerAccountId}` Can be used to filter the response
1812 // of the mediaPlanners.list method.
1813 AncestorNames []string `json:"ancestorNames,omitempty"`
1814 // DisplayName: Output only. The display name of the media planner. Can be used
1815 // to filter the response of the mediaPlanners.list method.
1816 DisplayName string `json:"displayName,omitempty"`
1817 // Name: Identifier. The unique resource name of the media planner. Format:
1818 // `mediaPlanners/{mediaPlannerAccountId}` Can be used to filter the response
1819 // of the mediaPlanners.list method.
1820 Name string `json:"name,omitempty"`
1821 // ForceSendFields is a list of field names (e.g. "AccountId") to
1822 // unconditionally include in API requests. By default, fields with empty or
1823 // default values are omitted from API requests. See
1824 // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more
1825 // details.
1826 ForceSendFields []string `json:"-"`
1827 // NullFields is a list of field names (e.g. "AccountId") to include in API
1828 // requests with the JSON null value. By default, fields with empty values are
1829 // omitted from API requests. See
1830 // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details.
1831 NullFields []string `json:"-"`
1832 }
1833
1834 func (s MediaPlanner) MarshalJSON() ([]byte, error) {
1835 type NoMethod MediaPlanner
1836 return gensupport.MarshalJSON(NoMethod(s), s.ForceSendFields, s.NullFields)
1837 }
1838
1839 // MobileApplicationTargeting: Mobile application targeting settings.
1840 type MobileApplicationTargeting struct {
1841 // FirstPartyTargeting: Publisher owned apps to be targeted or excluded by the
1842 // publisher to display the ads in.
1843 FirstPartyTargeting *FirstPartyMobileApplicationTargeting `json:"firstPartyTargeting,omitempty"`
1844 // ForceSendFields is a list of field names (e.g. "FirstPartyTargeting") to
1845 // unconditionally include in API requests. By default, fields with empty or
1846 // default values are omitted from API requests. See
1847 // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more
1848 // details.
1849 ForceSendFields []string `json:"-"`
1850 // NullFields is a list of field names (e.g. "FirstPartyTargeting") to include
1851 // in API requests with the JSON null value. By default, fields with empty
1852 // values are omitted from API requests. See
1853 // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details.
1854 NullFields []string `json:"-"`
1855 }
1856
1857 func (s MobileApplicationTargeting) MarshalJSON() ([]byte, error) {
1858 type NoMethod MobileApplicationTargeting
1859 return gensupport.MarshalJSON(NoMethod(s), s.ForceSendFields, s.NullFields)
1860 }
1861
1862 // Money: Represents an amount of money with its currency type.
1863 type Money struct {
1864 // CurrencyCode: The three-letter currency code defined in ISO 4217.
1865 CurrencyCode string `json:"currencyCode,omitempty"`
1866 // Nanos: Number of nano (10^-9) units of the amount. The value must be between
1867 // -999,999,999 and +999,999,999 inclusive. If `units` is positive, `nanos`
1868 // must be positive or zero. If `units` is zero, `nanos` can be positive, zero,
1869 // or negative. If `units` is negative, `nanos` must be negative or zero. For
1870 // example $-1.75 is represented as `units`=-1 and `nanos`=-750,000,000.
1871 Nanos int64 `json:"nanos,omitempty"`
1872 // Units: The whole units of the amount. For example if `currencyCode` is
1873 // "USD", then 1 unit is one US dollar.
1874 Units int64 `json:"units,omitempty,string"`
1875 // ForceSendFields is a list of field names (e.g. "CurrencyCode") to
1876 // unconditionally include in API requests. By default, fields with empty or
1877 // default values are omitted from API requests. See
1878 // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more
1879 // details.
1880 ForceSendFields []string `json:"-"`
1881 // NullFields is a list of field names (e.g. "CurrencyCode") to include in API
1882 // requests with the JSON null value. By default, fields with empty values are
1883 // omitted from API requests. See
1884 // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details.
1885 NullFields []string `json:"-"`
1886 }
1887
1888 func (s Money) MarshalJSON() ([]byte, error) {
1889 type NoMethod Money
1890 return gensupport.MarshalJSON(NoMethod(s), s.ForceSendFields, s.NullFields)
1891 }
1892
1893 // Note: A text note attached to the proposal to facilitate the communication
1894 // between buyers and sellers.
1895 type Note struct {
1896 // CreateTime: Output only. When this note was created.
1897 CreateTime string `json:"createTime,omitempty"`
1898 // CreatorRole: Output only. The role who created the note.
1899 //
1900 // Possible values:
1901 // "BUYER_SELLER_ROLE_UNSPECIFIED" - A placeholder for an undefined
1902 // buyer/seller role.
1903 // "BUYER" - Specifies the role as buyer.
1904 // "SELLER" - Specifies the role as seller.
1905 CreatorRole string `json:"creatorRole,omitempty"`
1906 // Note: The text of the note. Maximum length is 1024 characters.
1907 Note string `json:"note,omitempty"`
1908 // ForceSendFields is a list of field names (e.g. "CreateTime") to
1909 // unconditionally include in API requests. By default, fields with empty or
1910 // default values are omitted from API requests. See
1911 // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more
1912 // details.
1913 ForceSendFields []string `json:"-"`
1914 // NullFields is a list of field names (e.g. "CreateTime") to include in API
1915 // requests with the JSON null value. By default, fields with empty values are
1916 // omitted from API requests. See
1917 // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details.
1918 NullFields []string `json:"-"`
1919 }
1920
1921 func (s Note) MarshalJSON() ([]byte, error) {
1922 type NoMethod Note
1923 return gensupport.MarshalJSON(NoMethod(s), s.ForceSendFields, s.NullFields)
1924 }
1925
1926 // OperatingSystemTargeting: Represents targeting information for operating
1927 // systems.
1928 type OperatingSystemTargeting struct {
1929 // OperatingSystemCriteria: IDs of operating systems to be included/excluded.
1930 OperatingSystemCriteria *CriteriaTargeting `json:"operatingSystemCriteria,omitempty"`
1931 // OperatingSystemVersionCriteria: IDs of operating system versions to be
1932 // included/excluded.
1933 OperatingSystemVersionCriteria *CriteriaTargeting `json:"operatingSystemVersionCriteria,omitempty"`
1934 // ForceSendFields is a list of field names (e.g. "OperatingSystemCriteria") to
1935 // unconditionally include in API requests. By default, fields with empty or
1936 // default values are omitted from API requests. See
1937 // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more
1938 // details.
1939 ForceSendFields []string `json:"-"`
1940 // NullFields is a list of field names (e.g. "OperatingSystemCriteria") to
1941 // include in API requests with the JSON null value. By default, fields with
1942 // empty values are omitted from API requests. See
1943 // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details.
1944 NullFields []string `json:"-"`
1945 }
1946
1947 func (s OperatingSystemTargeting) MarshalJSON() ([]byte, error) {
1948 type NoMethod OperatingSystemTargeting
1949 return gensupport.MarshalJSON(NoMethod(s), s.ForceSendFields, s.NullFields)
1950 }
1951
1952 // PackagePlacementTargeting: Represents targeting about where the ads can
1953 // appear, for example, certain sites or mobile applications. Different
1954 // placement targeting types will be logically OR'ed.
1955 type PackagePlacementTargeting struct {
1956 // IncludedMobileAppCategoryTargeting: Optional. The list of targeted mobile
1957 // app categories.
1958 IncludedMobileAppCategoryTargeting googleapi.Int64s `json:"includedMobileAppCategoryTargeting,omitempty"`
1959 // MobileAppTargeting: Optional. The list of targeted or excluded mobile
1960 // application IDs that publishers own. Currently, only Android and Apple apps
1961 // are supported. Android App ID, for example, com.google.android.apps.maps,
1962 // can be found in Google Play Store URL. iOS App ID (which is a number) can be
1963 // found at the end of iTunes store URL. First party mobile applications is
1964 // either included or excluded.
1965 MobileAppTargeting *StringTargetingDimension `json:"mobileAppTargeting,omitempty"`
1966 // UriTargeting: Optional. The list of targeted or excluded URLs. The domains
1967 // should have the http/https stripped (for example, google.com), and can
1968 // contain a max of 5 paths per url.
1969 UriTargeting *StringTargetingDimension `json:"uriTargeting,omitempty"`
1970 // ForceSendFields is a list of field names (e.g.
1971 // "IncludedMobileAppCategoryTargeting") to unconditionally include in API
1972 // requests. By default, fields with empty or default values are omitted from
1973 // API requests. See
1974 // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more
1975 // details.
1976 ForceSendFields []string `json:"-"`
1977 // NullFields is a list of field names (e.g.
1978 // "IncludedMobileAppCategoryTargeting") to include in API requests with the
1979 // JSON null value. By default, fields with empty values are omitted from API
1980 // requests. See https://pkg.go.dev/google.golang.org/api#hdr-NullFields for
1981 // more details.
1982 NullFields []string `json:"-"`
1983 }
1984
1985 func (s PackagePlacementTargeting) MarshalJSON() ([]byte, error) {
1986 type NoMethod PackagePlacementTargeting
1987 return gensupport.MarshalJSON(NoMethod(s), s.ForceSendFields, s.NullFields)
1988 }
1989
1990 // PackagePublisherProvidedSignalsTargeting: Represents targeting about
1991 // publisher provided signals. Different publisher provided signals types will
1992 // be logically OR'ed.
1993 type PackagePublisherProvidedSignalsTargeting struct {
1994 // AudienceTargeting: Optional. The list of targeted or excluded audience IDs.
1995 // Based off of IAB Audience Taxonomy version 1.1
1996 // (https://github.com/InteractiveAdvertisingBureau/Taxonomies/blob/main/Audience%20Taxonomies/Audience%20Taxonomy%201.1.tsv)
1997 AudienceTargeting *TaxonomyTargeting `json:"audienceTargeting,omitempty"`
1998 // ContentTargeting: Optional. The list of targeted or excluded content IDs.
1999 // Based off of IAB Content Taxonomy version 2.2
2000 // (https://github.com/InteractiveAdvertisingBureau/Taxonomies/blob/main/Content%20Taxonomies/Content%20Taxonomy%202.2.tsv)
2001 ContentTargeting *TaxonomyTargeting `json:"contentTargeting,omitempty"`
2002 // VideoAndAudioSignalsTargeting: Optional. The list of targeted and excluded
2003 // video and audio signals IDs. These are additional signals supported by
2004 // publisher provided signals.
2005 VideoAndAudioSignalsTargeting *StringTargetingDimension `json:"videoAndAudioSignalsTargeting,omitempty"`
2006 // ForceSendFields is a list of field names (e.g. "AudienceTargeting") to
2007 // unconditionally include in API requests. By default, fields with empty or
2008 // default values are omitted from API requests. See
2009 // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more
2010 // details.
2011 ForceSendFields []string `json:"-"`
2012 // NullFields is a list of field names (e.g. "AudienceTargeting") to include in
2013 // API requests with the JSON null value. By default, fields with empty values
2014 // are omitted from API requests. See
2015 // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details.
2016 NullFields []string `json:"-"`
2017 }
2018
2019 func (s PackagePublisherProvidedSignalsTargeting) MarshalJSON() ([]byte, error) {
2020 type NoMethod PackagePublisherProvidedSignalsTargeting
2021 return gensupport.MarshalJSON(NoMethod(s), s.ForceSendFields, s.NullFields)
2022 }
2023
2024 // PackageTargeting: Targeting criteria for curated and auction packages.
2025 type PackageTargeting struct {
2026 // GeoTargeting: Optional. The geo criteria IDs to be included or excluded as
2027 // defined in
2028 // https://storage.googleapis.com/adx-rtb-dictionaries/geo-table.csv. If unset,
2029 // inventory will be targeted regardless of geo.
2030 GeoTargeting *CriteriaTargeting `json:"geoTargeting,omitempty"`
2031 // IncludedAcceleratedMobilePageType: Optional. The targeted accelerated mobile
2032 // page type. If unset, inventory will be targeted regardless of AMP status.
2033 //
2034 // Possible values:
2035 // "ACCELERATED_MOBILE_PAGE_TYPE_UNSPECIFIED" - Default value. Should not be
2036 // used in targeting specifications.
2037 // "ACCELERATED_MOBILE_PAGE_TYPE_NON_AMP" - Targets inventory on standard web
2038 // pages not using any AMP framework.
2039 // "ACCELERATED_MOBILE_PAGE_TYPE_AMP" - Targets inventory on pages built
2040 // using the core AMP HTML framework.
2041 // "ACCELERATED_MOBILE_PAGE_TYPE_AMP_STORY" - Targets inventory on pages
2042 // using the AMP Story (STAMP) format, which is optimized for visual
2043 // storytelling (e.g., tappable full-screen experiences).
2044 IncludedAcceleratedMobilePageType string `json:"includedAcceleratedMobilePageType,omitempty"`
2045 // IncludedAdSizes: Optional. The list of ad sizes to target. If unset,
2046 // inventory will be targeted regardless of ad size. Curated packages supports
2047 // `PIXEL` and `INTERSTITIAL` ad sizes.
2048 IncludedAdSizes []*AdSize `json:"includedAdSizes,omitempty"`
2049 // IncludedAuthorizedSellerStatuses: Optional. The included list of targeted
2050 // authorized seller statuses. If empty, inventory will be targeted regardless
2051 // of seller status.
2052 //
2053 // Possible values:
2054 // "AUTHORIZED_SELLER_STATUS_UNSPECIFIED" - Default value. Should not be used
2055 // in targeting specifications.
2056 // "AUTHORIZED_SELLER_STATUS_DIRECT" - Targets inventory where the seller is
2057 // declared as 'DIRECT'. This indicates the publisher (content owner) directly
2058 // controls the seller account and has a direct business contract with the
2059 // advertising system for this account.
2060 // "AUTHORIZED_SELLER_STATUS_RESELLER" - Targets inventory where the seller
2061 // is declared as 'RESELLER'. This indicates the publisher has authorized
2062 // another entity to operate the listed seller account and resell their ad
2063 // space.
2064 IncludedAuthorizedSellerStatuses []string `json:"includedAuthorizedSellerStatuses,omitempty"`
2065 // IncludedCreativeFormat: Optional. The creative format to target. If unset,
2066 // all creative markup types are targeted.
2067 //
2068 // Possible values:
2069 // "CREATIVE_FORMAT_UNSPECIFIED" - Default value. Should not be used in
2070 // targeting specifications.
2071 // "CREATIVE_FORMAT_DISPLAY" - Targets ad slots intended for HTML display
2072 // creatives.
2073 // "CREATIVE_FORMAT_VIDEO" - Targets ad slots intended for video creatives.
2074 // "CREATIVE_FORMAT_AUDIO" - Targets ad slots intended for audio creatives.
2075 IncludedCreativeFormat string `json:"includedCreativeFormat,omitempty"`
2076 // IncludedDataSegments: Optional. The active data segments to be targeted. If
2077 // unset, inventory will be targeted regardless of data segments. Format:
2078 // `curators/{account_id}/dataSegments/{data_segment_id}`
2079 IncludedDataSegments []string `json:"includedDataSegments,omitempty"`
2080 // IncludedDeviceTypes: Optional. The list of included device types to target.
2081 // If empty, all device types are targeted.
2082 //
2083 // Possible values:
2084 // "DEVICE_TYPE_UNSPECIFIED" - Default value. Should not be used in targeting
2085 // specifications.
2086 // "DEVICE_TYPE_PERSONAL_COMPUTER" - Targets desktop or laptop computers.
2087 // "DEVICE_TYPE_CONNECTED_TV" - Targets connected TVs: devices that stream TV
2088 // content, including smart TVs, gaming consoles, and streaming boxes/sticks.
2089 // "DEVICE_TYPE_PHONE" - Targets high-end mobile devices.
2090 // "DEVICE_TYPE_TABLET" - Targets tablet devices.
2091 IncludedDeviceTypes []string `json:"includedDeviceTypes,omitempty"`
2092 // IncludedEnvironment: Optional. The environment to target. If unspecified,
2093 // all environments are targeted.
2094 //
2095 // Possible values:
2096 // "ENVIRONMENT_UNSPECIFIED" - Default value. Should not be used in targeting
2097 // specifications.
2098 // "ENVIRONMENT_SITE" - Targets inventory rendered within an ad-supported
2099 // website.
2100 // "ENVIRONMENT_APP" - Targets inventory within a mobile application.
2101 IncludedEnvironment string `json:"includedEnvironment,omitempty"`
2102 // IncludedNativeInventoryTypes: Optional. The targeted native inventory types.
2103 // If empty, inventory will be targeted regardless of native inventory type.
2104 //
2105 // Possible values:
2106 // "NATIVE_INVENTORY_TYPE_UNSPECIFIED" - Default value. Should not be used in
2107 // targeting specifications.
2108 // "NATIVE_INVENTORY_TYPE_NATIVE_ONLY" - Targets ad slots that *only* accept
2109 // and render native ads.
2110 // "NATIVE_INVENTORY_TYPE_NATIVE_OR_BANNER" - Targets ad slots that accept
2111 // and render either native or banner ads.
2112 IncludedNativeInventoryTypes []string `json:"includedNativeInventoryTypes,omitempty"`
2113 // IncludedOpenMeasurementTypes: Optional. The list of targeted open
2114 // measurement types. If empty, inventory will be targeted regardless of Open
2115 // Measurement support.
2116 //
2117 // Possible values:
2118 // "OPEN_MEASUREMENT_TYPE_UNSPECIFIED" - Default value. Should not be used in
2119 // targeting specifications.
2120 // "OPEN_MEASUREMENT_TYPE_OMID_V1" - Targets inventory that supports the v1
2121 // Open Measurement Interface Definition (OMID).
2122 IncludedOpenMeasurementTypes []string `json:"includedOpenMeasurementTypes,omitempty"`
2123 // IncludedRestrictedCategories: Optional. The list of targeted restricted
2124 // categories. If empty, inventory will be targeted regardless of restricted
2125 // categories.
2126 //
2127 // Possible values:
2128 // "RESTRICTED_CATEGORY_UNSPECIFIED" - Default value. Should not be used in
2129 // targeting specifications.
2130 // "RESTRICTED_CATEGORY_ALCOHOL" - Targets inventory where alcohol ads are
2131 // allowed by the publisher.
2132 // "RESTRICTED_CATEGORY_GAMBLING" - Targets inventory where gambling ads are
2133 // allowed by the publisher.
2134 IncludedRestrictedCategories []string `json:"includedRestrictedCategories,omitempty"`
2135 // IncludedRewardedType: Optional. The targeted rewarded type. If unset,
2136 // inventory will be targeted regardless of rewarded type.
2137 //
2138 // Possible values:
2139 // "REWARDED_TYPE_UNSPECIFIED" - Default value. Should not be used in
2140 // targeting specifications.
2141 // "REWARDED_TYPE_NON_REWARDED" - Targets inventory that does NOT offer an
2142 // explicit reward to the user for watching or interacting with the ad.
2143 // "REWARDED_TYPE_REWARDED" - Targets inventory that offers a reward to the
2144 // user in exchange for watching or engaging with the ad.
2145 IncludedRewardedType string `json:"includedRewardedType,omitempty"`
2146 // LanguageTargeting: Optional. The languages to target. If unset, inventory
2147 // will be targeted regardless of language. See
2148 // https://developers.google.com/google-ads/api/data/codes-formats#languages
2149 // for the list of supported language codes.
2150 LanguageTargeting *StringTargetingDimension `json:"languageTargeting,omitempty"`
2151 // MinimumPredictedClickThroughRatePercentageMillis: Optional. The targeted
2152 // minimum predicted click through rate, ranging in values [10, 10000] (0.01% -
2153 // 10%). A value of 50 means that the configuration will only match adslots for
2154 // which we predict at least 0.05% click through rate. An unset value indicates
2155 // inventory will be targeted regardless of predicted click through rate.
2156 MinimumPredictedClickThroughRatePercentageMillis int64 `json:"minimumPredictedClickThroughRatePercentageMillis,omitempty,string"`
2157 // MinimumPredictedViewabilityPercentage: Optional. The targeted minimum
2158 // predicted viewability percentage. This value must be a multiple of 10
2159 // between 10 and 90 (inclusive). For example, 10 is valid, but 0, 15, and 100
2160 // are not. A value of 10 means that the configuration will only match adslots
2161 // for which we predict at least 10% viewability. An unset value indicates
2162 // inventory will be targeted regardless of predicted viewability.
2163 MinimumPredictedViewabilityPercentage int64 `json:"minimumPredictedViewabilityPercentage,omitempty,string"`
2164 // PlacementTargeting: Optional. Placement targeting information, for example,
2165 // URL, mobile applications.
2166 PlacementTargeting *PackagePlacementTargeting `json:"placementTargeting,omitempty"`
2167 // PublisherProvidedSignalsTargeting: Optional. The publisher provided signals
2168 // to target. If unset, inventory will be targeted regardless of publisher
2169 // provided signals.
2170 PublisherProvidedSignalsTargeting *PackagePublisherProvidedSignalsTargeting `json:"publisherProvidedSignalsTargeting,omitempty"`
2171 // PublisherTargeting: Optional. The targeted publishers. If unset, inventory
2172 // will be targeted regardless of publisher. Publishers are identified by their
2173 // publisher ID from ads.txt / app-ads.txt. See https://iabtechlab.com/ads-txt/
2174 // and https://iabtechlab.com/app-ads-txt/ for more details.
2175 PublisherTargeting *StringTargetingDimension `json:"publisherTargeting,omitempty"`
2176 // VerticalTargeting: Optional. The verticals included or excluded as defined
2177 // in
2178 // https://developers.google.com/authorized-buyers/rtb/downloads/publisher-verticals.
2179 // If unset, inventory will be targeted regardless of vertical.
2180 VerticalTargeting *CriteriaTargeting `json:"verticalTargeting,omitempty"`
2181 // VideoTargeting: Optional. Video specific targeting criteria.
2182 VideoTargeting *PackageVideoTargeting `json:"videoTargeting,omitempty"`
2183 // ForceSendFields is a list of field names (e.g. "GeoTargeting") to
2184 // unconditionally include in API requests. By default, fields with empty or
2185 // default values are omitted from API requests. See
2186 // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more
2187 // details.
2188 ForceSendFields []string `json:"-"`
2189 // NullFields is a list of field names (e.g. "GeoTargeting") to include in API
2190 // requests with the JSON null value. By default, fields with empty values are
2191 // omitted from API requests. See
2192 // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details.
2193 NullFields []string `json:"-"`
2194 }
2195
2196 func (s PackageTargeting) MarshalJSON() ([]byte, error) {
2197 type NoMethod PackageTargeting
2198 return gensupport.MarshalJSON(NoMethod(s), s.ForceSendFields, s.NullFields)
2199 }
2200
2201 // PackageVideoTargeting: Video specific targeting criteria.
2202 type PackageVideoTargeting struct {
2203 // IncludedContentDeliveryMethod: Optional. The targeted video delivery method.
2204 // If unset, inventory will be targeted regardless of video delivery method.
2205 //
2206 // Possible values:
2207 // "CONTENT_DELIVERY_METHOD_UNSPECIFIED" - Default value. Should not be used
2208 // in targeting specifications.
2209 // "CONTENT_DELIVERY_METHOD_STREAMING" - Targets video content that is being
2210 // broadcast live.
2211 // "CONTENT_DELIVERY_METHOD_PROGRESSIVE" - Targets video content that is
2212 // transferred incrementally as client's playback requires.
2213 IncludedContentDeliveryMethod string `json:"includedContentDeliveryMethod,omitempty"`
2214 // IncludedMaximumAdDurationTargeting: Optional. The targeted maximum video ad
2215 // duration. If unset, inventory will be targeted regardless of maximum video
2216 // ad duration.
2217 //
2218 // Possible values:
2219 // "MAXIMUM_VIDEO_AD_DURATION_UNSPECIFIED" - Default value. Should not be
2220 // used in targeting specifications.
2221 // "MAXIMUM_VIDEO_AD_DURATION_FIFTEEN_SECONDS" - Applies to video ads with a
2222 // duration up to 15 seconds (0 < duration <= 15s).
2223 // "MAXIMUM_VIDEO_AD_DURATION_TWENTY_SECONDS" - Applies to video ads with a
2224 // duration up to 20 seconds (0 < duration <= 20s).
2225 // "MAXIMUM_VIDEO_AD_DURATION_THIRTY_SECONDS" - Applies to video ads with a
2226 // duration up to 30 seconds (0 < duration <= 30s).
2227 // "MAXIMUM_VIDEO_AD_DURATION_SIXTY_SECONDS" - Applies to video ads with a
2228 // duration up to 60 seconds (0 < duration <= 60s).
2229 // "MAXIMUM_VIDEO_AD_DURATION_NINETY_SECONDS" - Applies to video ads with a
2230 // duration up to 90 seconds (0 < duration <= 90s).
2231 // "MAXIMUM_VIDEO_AD_DURATION_ONE_HUNDRED_TWENTY_SECONDS" - Applies to video
2232 // ads with a duration up to 120 seconds (0 < duration <= 120s).
2233 IncludedMaximumAdDurationTargeting string `json:"includedMaximumAdDurationTargeting,omitempty"`
2234 // IncludedMimeTypes: Optional. The list of targeted video mime types using the
2235 // IANA published MIME type strings
2236 // (https://www.iana.org/assignments/media-types/media-types.xhtml). If empty,
2237 // inventory will be targeted regardless of video mime type.
2238 //
2239 // Possible values:
2240 // "VIDEO_MIME_TYPE_UNSPECIFIED" - Default value. Should not be used in
2241 // targeting specifications.
2242 // "VIDEO_MIME_TYPE_THREEGPP" - 3GPP container format used on 3G phones.
2243 // "VIDEO_MIME_TYPE_APPLICATION_MPEGURL" - HLS/M3U8
2244 // "VIDEO_MIME_TYPE_MP4" - MPEG-4 container typically with H.264 codec.
2245 // "VIDEO_MIME_TYPE_APPLICATION_MPEGDASH" - DASH.
2246 // "VIDEO_MIME_TYPE_APPLICATION_JAVASCRIPT" - JavaScript (used for VPAID
2247 // ads).
2248 // "VIDEO_MIME_TYPE_WEBM" - WebM container assuming VP9 codec.
2249 IncludedMimeTypes []string `json:"includedMimeTypes,omitempty"`
2250 // IncludedPlaybackMethods: Optional. The list of targeted video playback
2251 // methods. If empty, inventory will be targeted regardless of video playback
2252 // method.
2253 //
2254 // Possible values:
2255 // "PLAYBACK_METHOD_UNSPECIFIED" - Unspecified video playback method. Should
2256 // not be used.
2257 // "PLAYBACK_METHOD_AUTO_PLAY_SOUND_ON" - Playback starts automatically when
2258 // the page/content loads.
2259 // "PLAYBACK_METHOD_AUTO_PLAY_SOUND_OFF" - Playback starts automatically when
2260 // the page/content loads, but with sound off.
2261 // "PLAYBACK_METHOD_CLICK_TO_PLAY" - Playback is initiated by a user action
2262 // (e.g., clicking a play button).
2263 IncludedPlaybackMethods []string `json:"includedPlaybackMethods,omitempty"`
2264 // IncludedPlayerSizeTargeting: Optional. The targeted video player size. If
2265 // unset, inventory will be targeted regardless of video player size.
2266 IncludedPlayerSizeTargeting *VideoPlayerSizeTargeting `json:"includedPlayerSizeTargeting,omitempty"`
2267 // IncludedPositionTypes: Optional. The targeted video ad position types. If
2268 // empty, inventory will be targeted regardless of video ad position type.
2269 //
2270 // Possible values:
2271 // "POSITION_TYPE_UNSPECIFIED" - Default value. Should not be used in
2272 // targeting specifications.
2273 // "POSITION_TYPE_MIDROLL" - The ad is played in the middle of the video
2274 // content.
2275 // "POSITION_TYPE_POSTROLL" - The ad is played after the video content.
2276 // "POSITION_TYPE_PREROLL" - The ad is played before the video content.
2277 IncludedPositionTypes []string `json:"includedPositionTypes,omitempty"`
2278 // MinimumPredictedCompletionRatePercentage: Optional. The targeted minimum
2279 // predicted completion rate percentage. This value must be a multiple of 10
2280 // between 10 and 90 (inclusive). For example, 10 is valid, but 0, 15, and 100
2281 // are not. A value of 10 means that the configuration will only match adslots
2282 // for which we predict at least 10% completion rate. An unset value indicates
2283 // inventory will be targeted regardless of predicted completion rate.
2284 MinimumPredictedCompletionRatePercentage int64 `json:"minimumPredictedCompletionRatePercentage,omitempty,string"`
2285 // PlcmtTargeting: Optional. The targeted video plcmt types. If unset,
2286 // inventory will be targeted regardless of video plcmt type.
2287 PlcmtTargeting *VideoPlcmtTargeting `json:"plcmtTargeting,omitempty"`
2288 // ForceSendFields is a list of field names (e.g.
2289 // "IncludedContentDeliveryMethod") to unconditionally include in API requests.
2290 // By default, fields with empty or default values are omitted from API
2291 // requests. See https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields
2292 // for more details.
2293 ForceSendFields []string `json:"-"`
2294 // NullFields is a list of field names (e.g. "IncludedContentDeliveryMethod")
2295 // to include in API requests with the JSON null value. By default, fields with
2296 // empty values are omitted from API requests. See
2297 // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details.
2298 NullFields []string `json:"-"`
2299 }
2300
2301 func (s PackageVideoTargeting) MarshalJSON() ([]byte, error) {
2302 type NoMethod PackageVideoTargeting
2303 return gensupport.MarshalJSON(NoMethod(s), s.ForceSendFields, s.NullFields)
2304 }
2305
2306 // PauseFinalizedDealRequest: Request message for pausing a finalized deal.
2307 type PauseFinalizedDealRequest struct {
2308 // Reason: The reason to pause the finalized deal, will be displayed to the
2309 // seller. Maximum length is 1000 characters.
2310 Reason string `json:"reason,omitempty"`
2311 // ForceSendFields is a list of field names (e.g. "Reason") to unconditionally
2312 // include in API requests. By default, fields with empty or default values are
2313 // omitted from API requests. See
2314 // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more
2315 // details.
2316 ForceSendFields []string `json:"-"`
2317 // NullFields is a list of field names (e.g. "Reason") to include in API
2318 // requests with the JSON null value. By default, fields with empty values are
2319 // omitted from API requests. See
2320 // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details.
2321 NullFields []string `json:"-"`
2322 }
2323
2324 func (s PauseFinalizedDealRequest) MarshalJSON() ([]byte, error) {
2325 type NoMethod PauseFinalizedDealRequest
2326 return gensupport.MarshalJSON(NoMethod(s), s.ForceSendFields, s.NullFields)
2327 }
2328
2329 // PlacementTargeting: Represents targeting about where the ads can appear, for
2330 // example, certain sites or mobile applications. Different placement targeting
2331 // types will be logically OR'ed.
2332 type PlacementTargeting struct {
2333 // MobileApplicationTargeting: Mobile application targeting information in a
2334 // deal. This doesn't apply to Auction Packages.
2335 MobileApplicationTargeting *MobileApplicationTargeting `json:"mobileApplicationTargeting,omitempty"`
2336 // UriTargeting: URLs to be included/excluded.
2337 UriTargeting *UriTargeting `json:"uriTargeting,omitempty"`
2338 // ForceSendFields is a list of field names (e.g. "MobileApplicationTargeting")
2339 // to unconditionally include in API requests. By default, fields with empty or
2340 // default values are omitted from API requests. See
2341 // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more
2342 // details.
2343 ForceSendFields []string `json:"-"`
2344 // NullFields is a list of field names (e.g. "MobileApplicationTargeting") to
2345 // include in API requests with the JSON null value. By default, fields with
2346 // empty values are omitted from API requests. See
2347 // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details.
2348 NullFields []string `json:"-"`
2349 }
2350
2351 func (s PlacementTargeting) MarshalJSON() ([]byte, error) {
2352 type NoMethod PlacementTargeting
2353 return gensupport.MarshalJSON(NoMethod(s), s.ForceSendFields, s.NullFields)
2354 }
2355
2356 // PreferredDealTerms: Pricing terms for Preferred Deals.
2357 type PreferredDealTerms struct {
2358 // FixedPrice: Fixed price for the deal.
2359 FixedPrice *Price `json:"fixedPrice,omitempty"`
2360 // ForceSendFields is a list of field names (e.g. "FixedPrice") to
2361 // unconditionally include in API requests. By default, fields with empty or
2362 // default values are omitted from API requests. See
2363 // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more
2364 // details.
2365 ForceSendFields []string `json:"-"`
2366 // NullFields is a list of field names (e.g. "FixedPrice") to include in API
2367 // requests with the JSON null value. By default, fields with empty values are
2368 // omitted from API requests. See
2369 // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details.
2370 NullFields []string `json:"-"`
2371 }
2372
2373 func (s PreferredDealTerms) MarshalJSON() ([]byte, error) {
2374 type NoMethod PreferredDealTerms
2375 return gensupport.MarshalJSON(NoMethod(s), s.ForceSendFields, s.NullFields)
2376 }
2377
2378 // Price: Represents a price and a pricing type for a deal.
2379 type Price struct {
2380 // Amount: The actual price with currency specified.
2381 Amount *Money `json:"amount,omitempty"`
2382 // Type: The pricing type for the deal.
2383 //
2384 // Possible values:
2385 // "TYPE_UNSPECIFIED" - A placeholder for an undefined pricing type. If the
2386 // pricing type is unspecified, CPM will be used instead.
2387 // "CPM" - Cost per thousand impressions.
2388 // "CPD" - Cost per day.
2389 Type string `json:"type,omitempty"`
2390 // ForceSendFields is a list of field names (e.g. "Amount") to unconditionally
2391 // include in API requests. By default, fields with empty or default values are
2392 // omitted from API requests. See
2393 // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more
2394 // details.
2395 ForceSendFields []string `json:"-"`
2396 // NullFields is a list of field names (e.g. "Amount") to include in API
2397 // requests with the JSON null value. By default, fields with empty values are
2398 // omitted from API requests. See
2399 // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details.
2400 NullFields []string `json:"-"`
2401 }
2402
2403 func (s Price) MarshalJSON() ([]byte, error) {
2404 type NoMethod Price
2405 return gensupport.MarshalJSON(NoMethod(s), s.ForceSendFields, s.NullFields)
2406 }
2407
2408 // PrivateAuctionTerms: Pricing terms for Private Auctions.
2409 type PrivateAuctionTerms struct {
2410 // FloorPrice: The minimum price buyer has to bid to compete in the private
2411 // auction.
2412 FloorPrice *Price `json:"floorPrice,omitempty"`
2413 // OpenAuctionAllowed: Output only. True if open auction buyers are allowed to
2414 // compete with invited buyers in this private auction.
2415 OpenAuctionAllowed bool `json:"openAuctionAllowed,omitempty"`
2416 // ForceSendFields is a list of field names (e.g. "FloorPrice") to
2417 // unconditionally include in API requests. By default, fields with empty or
2418 // default values are omitted from API requests. See
2419 // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more
2420 // details.
2421 ForceSendFields []string `json:"-"`
2422 // NullFields is a list of field names (e.g. "FloorPrice") to include in API
2423 // requests with the JSON null value. By default, fields with empty values are
2424 // omitted from API requests. See
2425 // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details.
2426 NullFields []string `json:"-"`
2427 }
2428
2429 func (s PrivateAuctionTerms) MarshalJSON() ([]byte, error) {
2430 type NoMethod PrivateAuctionTerms
2431 return gensupport.MarshalJSON(NoMethod(s), s.ForceSendFields, s.NullFields)
2432 }
2433
2434 // PrivateData: Buyers are allowed to store certain types of private data in a
2435 // proposal.
2436 type PrivateData struct {
2437 // ReferenceId: A buyer specified reference ID. This can be queried in the list
2438 // operations (max-length: 1024 unicode code units).
2439 ReferenceId string `json:"referenceId,omitempty"`
2440 // ForceSendFields is a list of field names (e.g. "ReferenceId") to
2441 // unconditionally include in API requests. By default, fields with empty or
2442 // default values are omitted from API requests. See
2443 // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more
2444 // details.
2445 ForceSendFields []string `json:"-"`
2446 // NullFields is a list of field names (e.g. "ReferenceId") to include in API
2447 // requests with the JSON null value. By default, fields with empty values are
2448 // omitted from API requests. See
2449 // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details.
2450 NullFields []string `json:"-"`
2451 }
2452
2453 func (s PrivateData) MarshalJSON() ([]byte, error) {
2454 type NoMethod PrivateData
2455 return gensupport.MarshalJSON(NoMethod(s), s.ForceSendFields, s.NullFields)
2456 }
2457
2458 // ProgrammaticGuaranteedTerms: Pricing terms for Programmatic Guaranteed
2459 // Deals.
2460 type ProgrammaticGuaranteedTerms struct {
2461 // FixedPrice: Fixed price for the deal.
2462 FixedPrice *Price `json:"fixedPrice,omitempty"`
2463 // GuaranteedLooks: Count of guaranteed looks. For CPD deals, buyer changes to
2464 // guaranteed_looks will be ignored.
2465 GuaranteedLooks int64 `json:"guaranteedLooks,omitempty,string"`
2466 // ImpressionCap: The lifetime impression cap for CPM Sponsorship deals. Deal
2467 // will stop serving when cap is reached.
2468 ImpressionCap int64 `json:"impressionCap,omitempty,string"`
2469 // MinimumDailyLooks: Daily minimum looks for CPD deal types. For CPD deals,
2470 // buyer should negotiate on this field instead of guaranteed_looks.
2471 MinimumDailyLooks int64 `json:"minimumDailyLooks,omitempty,string"`
2472 // PercentShareOfVoice: For sponsorship deals, this is the percentage of the
2473 // seller's eligible impressions that the deal will serve until the cap is
2474 // reached. Valid value is within range 0~100.
2475 PercentShareOfVoice int64 `json:"percentShareOfVoice,omitempty,string"`
2476 // ReservationType: The reservation type for a Programmatic Guaranteed deal.
2477 // This indicates whether the number of impressions is fixed, or a percent of
2478 // available impressions. If not specified, the default reservation type is
2479 // STANDARD.
2480 //
2481 // Possible values:
2482 // "RESERVATION_TYPE_UNSPECIFIED" - An unspecified reservation type.
2483 // "STANDARD" - Non-sponsorship deal.
2484 // "SPONSORSHIP" - Sponsorship deals don't have impression goal
2485 // (guaranteed_looks) and they are served based on the flight dates. For CPM
2486 // Sponsorship deals, impression_cap is the lifetime impression limit.
2487 ReservationType string `json:"reservationType,omitempty"`
2488 // ForceSendFields is a list of field names (e.g. "FixedPrice") to
2489 // unconditionally include in API requests. By default, fields with empty or
2490 // default values are omitted from API requests. See
2491 // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more
2492 // details.
2493 ForceSendFields []string `json:"-"`
2494 // NullFields is a list of field names (e.g. "FixedPrice") to include in API
2495 // requests with the JSON null value. By default, fields with empty values are
2496 // omitted from API requests. See
2497 // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details.
2498 NullFields []string `json:"-"`
2499 }
2500
2501 func (s ProgrammaticGuaranteedTerms) MarshalJSON() ([]byte, error) {
2502 type NoMethod ProgrammaticGuaranteedTerms
2503 return gensupport.MarshalJSON(NoMethod(s), s.ForceSendFields, s.NullFields)
2504 }
2505
2506 // Proposal: Represents a proposal in the Marketplace. A proposal is the unit
2507 // of negotiation between a seller and a buyer.
2508 type Proposal struct {
2509 // BilledBuyer: Output only. When the client field is populated, this field
2510 // refers to the buyer who creates and manages the client buyer and gets billed
2511 // on behalf of the client buyer; when the buyer field is populated, this field
2512 // is the same value as buyer. Format : `buyers/{buyerAccountId}`
2513 BilledBuyer string `json:"billedBuyer,omitempty"`
2514 // Buyer: Output only. Refers to a buyer in The Realtime-bidding API. Format:
2515 // `buyers/{buyerAccountId}`
2516 Buyer string `json:"buyer,omitempty"`
2517 // BuyerContacts: Contact information for the buyer.
2518 BuyerContacts []*Contact `json:"buyerContacts,omitempty"`
2519 // BuyerPrivateData: Buyer private data (hidden from seller).
2520 BuyerPrivateData *PrivateData `json:"buyerPrivateData,omitempty"`
2521 // Client: Output only. Refers to a Client. Format:
2522 // `buyers/{buyerAccountId}/clients/{clientAccountid}`
2523 Client string `json:"client,omitempty"`
2524 // DealType: Output only. Type of deal the proposal contains.
2525 //
2526 // Possible values:
2527 // "DEAL_TYPE_UNSPECIFIED" - Default, unspecified deal type.
2528 // "PREFERRED_DEAL" - Preferred deals.
2529 // "PRIVATE_AUCTION" - Private auction deals.
2530 // "PROGRAMMATIC_GUARANTEED" - Programmatic guaranteed deals.
2531 DealType string `json:"dealType,omitempty"`
2532 // DisplayName: Output only. The descriptive name for the proposal. Maximum
2533 // length of 255 unicode characters is allowed. Control characters are not
2534 // allowed. Buyers cannot update this field. Note: Not to be confused with
2535 // name, which is a unique identifier of the proposal.
2536 DisplayName string `json:"displayName,omitempty"`
2537 // IsRenegotiating: Output only. True if the proposal was previously finalized
2538 // and is now being renegotiated.
2539 IsRenegotiating bool `json:"isRenegotiating,omitempty"`
2540 // LastUpdaterOrCommentorRole: Output only. The role of the last user that
2541 // either updated the proposal or left a comment.
2542 //
2543 // Possible values:
2544 // "BUYER_SELLER_ROLE_UNSPECIFIED" - A placeholder for an undefined
2545 // buyer/seller role.
2546 // "BUYER" - Specifies the role as buyer.
2547 // "SELLER" - Specifies the role as seller.
2548 LastUpdaterOrCommentorRole string `json:"lastUpdaterOrCommentorRole,omitempty"`
2549 // Name: Immutable. The name of the proposal serving as a unique identifier.
2550 // Format: buyers/{accountId}/proposals/{proposalId}
2551 Name string `json:"name,omitempty"`
2552 // Notes: A list of notes from the buyer and the seller attached to this
2553 // proposal.
2554 Notes []*Note `json:"notes,omitempty"`
2555 // OriginatorRole: Output only. Indicates whether the buyer/seller created the
2556 // proposal.
2557 //
2558 // Possible values:
2559 // "BUYER_SELLER_ROLE_UNSPECIFIED" - A placeholder for an undefined
2560 // buyer/seller role.
2561 // "BUYER" - Specifies the role as buyer.
2562 // "SELLER" - Specifies the role as seller.
2563 OriginatorRole string `json:"originatorRole,omitempty"`
2564 // PausingConsented: Whether pausing is allowed for the proposal. This is a
2565 // negotiable term between buyers and publishers.
2566 PausingConsented bool `json:"pausingConsented,omitempty"`
2567 // ProposalRevision: Output only. The revision number for the proposal. Each
2568 // update to the proposal or deal causes the proposal revision number to
2569 // auto-increment. The buyer keeps track of the last revision number they know
2570 // of and pass it in when making an update. If the head revision number on the
2571 // server has since incremented, then an ABORTED error is returned during the
2572 // update operation to let the buyer know that a subsequent update was made.
2573 ProposalRevision int64 `json:"proposalRevision,omitempty,string"`
2574 // PublisherProfile: Immutable. Reference to the seller on the proposal.
2575 // Format: `buyers/{buyerAccountId}/publisherProfiles/{publisherProfileId}`
2576 // Note: This field may be set only when creating the resource. Modifying this
2577 // field while updating the resource will result in an error.
2578 PublisherProfile string `json:"publisherProfile,omitempty"`
2579 // SellerContacts: Output only. Contact information for the seller.
2580 SellerContacts []*Contact `json:"sellerContacts,omitempty"`
2581 // State: Output only. Indicates the state of the proposal.
2582 //
2583 // Possible values:
2584 // "STATE_UNSPECIFIED" - Unspecified proposal state
2585 // "BUYER_REVIEW_REQUESTED" - When a proposal is waiting for buyer to review.
2586 // "SELLER_REVIEW_REQUESTED" - When the proposal is waiting for the seller to
2587 // review.
2588 // "BUYER_ACCEPTANCE_REQUESTED" - When the seller accepted the proposal and
2589 // sent it to the buyer for review.
2590 // "FINALIZED" - When both buyer and seller has accepted the proposal
2591 // "TERMINATED" - When either buyer or seller has cancelled the proposal
2592 State string `json:"state,omitempty"`
2593 // TermsAndConditions: Output only. The terms and conditions associated with
2594 // this proposal. Accepting a proposal implies acceptance of this field. This
2595 // is created by the seller, the buyer can only view it.
2596 TermsAndConditions string `json:"termsAndConditions,omitempty"`
2597 // UpdateTime: Output only. The time when the proposal was last revised.
2598 UpdateTime string `json:"updateTime,omitempty"`
2599
2600 // ServerResponse contains the HTTP response code and headers from the server.
2601 googleapi.ServerResponse `json:"-"`
2602 // ForceSendFields is a list of field names (e.g. "BilledBuyer") to
2603 // unconditionally include in API requests. By default, fields with empty or
2604 // default values are omitted from API requests. See
2605 // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more
2606 // details.
2607 ForceSendFields []string `json:"-"`
2608 // NullFields is a list of field names (e.g. "BilledBuyer") to include in API
2609 // requests with the JSON null value. By default, fields with empty values are
2610 // omitted from API requests. See
2611 // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details.
2612 NullFields []string `json:"-"`
2613 }
2614
2615 func (s Proposal) MarshalJSON() ([]byte, error) {
2616 type NoMethod Proposal
2617 return gensupport.MarshalJSON(NoMethod(s), s.ForceSendFields, s.NullFields)
2618 }
2619
2620 // PublisherProfile: The values in the publisher profile are supplied by the
2621 // publisher. All fields are not filterable unless stated otherwise.
2622 type PublisherProfile struct {
2623 // AudienceDescription: Description on the publisher's audience.
2624 AudienceDescription string `json:"audienceDescription,omitempty"`
2625 // DirectDealsContact: Contact information for direct reservation deals. This
2626 // is free text entered by the publisher and may include information like
2627 // names, phone numbers and email addresses.
2628 DirectDealsContact string `json:"directDealsContact,omitempty"`
2629 // DisplayName: Display name of the publisher profile. Can be used to filter
2630 // the response of the publisherProfiles.list method.
2631 DisplayName string `json:"displayName,omitempty"`
2632 // Domains: The list of domains represented in this publisher profile. Empty if
2633 // this is a parent profile. These are top private domains, meaning that these
2634 // will not contain a string like "photos.google.co.uk/123", but will instead
2635 // contain "google.co.uk". Can be used to filter the response of the
2636 // publisherProfiles.list method.
2637 Domains []string `json:"domains,omitempty"`
2638 // IsParent: Indicates if this profile is the parent profile of the seller. A
2639 // parent profile represents all the inventory from the seller, as opposed to
2640 // child profile that is created to brand a portion of inventory. One seller
2641 // has only one parent publisher profile, and can have multiple child profiles.
2642 // See https://support.google.com/admanager/answer/6035806 for details. Can be
2643 // used to filter the response of the publisherProfiles.list method by setting
2644 // the filter to "is_parent: true".
2645 IsParent bool `json:"isParent,omitempty"`
2646 // LogoUrl: A Google public URL to the logo for this publisher profile. The
2647 // logo is stored as a PNG, JPG, or GIF image.
2648 LogoUrl string `json:"logoUrl,omitempty"`
2649 // MediaKitUrl: URL to additional marketing and sales materials.
2650 MediaKitUrl string `json:"mediaKitUrl,omitempty"`
2651 // MobileApps: The list of apps represented in this publisher profile. Empty if
2652 // this is a parent profile.
2653 MobileApps []*PublisherProfileMobileApplication `json:"mobileApps,omitempty"`
2654 // Name: Name of the publisher profile. Format:
2655 // `buyers/{buyer}/publisherProfiles/{publisher_profile}`
2656 Name string `json:"name,omitempty"`
2657 // Overview: Overview of the publisher.
2658 Overview string `json:"overview,omitempty"`
2659 // PitchStatement: Statement explaining what's unique about publisher's
2660 // business, and why buyers should partner with the publisher.
2661 PitchStatement string `json:"pitchStatement,omitempty"`
2662 // ProgrammaticDealsContact: Contact information for programmatic deals. This
2663 // is free text entered by the publisher and may include information like
2664 // names, phone numbers and email addresses.
2665 ProgrammaticDealsContact string `json:"programmaticDealsContact,omitempty"`
2666 // PublisherCode: A unique identifying code for the seller. This value is the
2667 // same for all of the seller's parent and child publisher profiles. Can be
2668 // used to filter the response of the publisherProfiles.list method.
2669 PublisherCode string `json:"publisherCode,omitempty"`
2670 // SamplePageUrl: URL to a sample content page.
2671 SamplePageUrl string `json:"samplePageUrl,omitempty"`
2672 // TopHeadlines: Up to three key metrics and rankings. For example, "#1 Mobile
2673 // News Site for 20 Straight Months".
2674 TopHeadlines []string `json:"topHeadlines,omitempty"`
2675
2676 // ServerResponse contains the HTTP response code and headers from the server.
2677 googleapi.ServerResponse `json:"-"`
2678 // ForceSendFields is a list of field names (e.g. "AudienceDescription") to
2679 // unconditionally include in API requests. By default, fields with empty or
2680 // default values are omitted from API requests. See
2681 // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more
2682 // details.
2683 ForceSendFields []string `json:"-"`
2684 // NullFields is a list of field names (e.g. "AudienceDescription") to include
2685 // in API requests with the JSON null value. By default, fields with empty
2686 // values are omitted from API requests. See
2687 // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details.
2688 NullFields []string `json:"-"`
2689 }
2690
2691 func (s PublisherProfile) MarshalJSON() ([]byte, error) {
2692 type NoMethod PublisherProfile
2693 return gensupport.MarshalJSON(NoMethod(s), s.ForceSendFields, s.NullFields)
2694 }
2695
2696 // PublisherProfileMobileApplication: A mobile application that contains a
2697 // external app ID, name, and app store.
2698 type PublisherProfileMobileApplication struct {
2699 // AppStore: The app store the app belongs to. Can be used to filter the
2700 // response of the publisherProfiles.list method.
2701 //
2702 // Possible values:
2703 // "APP_STORE_TYPE_UNSPECIFIED" - A placeholder for an unknown app store.
2704 // "APPLE_ITUNES" - Apple iTunes
2705 // "GOOGLE_PLAY" - Google Play
2706 // "ROKU" - Roku
2707 // "AMAZON_FIRE_TV" - Amazon Fire TV
2708 // "PLAYSTATION" - PlayStation
2709 // "XBOX" - Xbox
2710 // "SAMSUNG_TV" - Samsung TV
2711 // "AMAZON" - Amazon Appstore
2712 // "OPPO" - OPPO App Market
2713 // "SAMSUNG" - Samsung Galaxy Store
2714 // "VIVO" - VIVO App Store
2715 // "XIAOMI" - Xiaomi GetApps
2716 // "LG_TV" - LG TV
2717 AppStore string `json:"appStore,omitempty"`
2718 // ExternalAppId: The external ID for the app from its app store. Can be used
2719 // to filter the response of the publisherProfiles.list method.
2720 ExternalAppId string `json:"externalAppId,omitempty"`
2721 // Name: The name of the app.
2722 Name string `json:"name,omitempty"`
2723 // ForceSendFields is a list of field names (e.g. "AppStore") to
2724 // unconditionally include in API requests. By default, fields with empty or
2725 // default values are omitted from API requests. See
2726 // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more
2727 // details.
2728 ForceSendFields []string `json:"-"`
2729 // NullFields is a list of field names (e.g. "AppStore") to include in API
2730 // requests with the JSON null value. By default, fields with empty values are
2731 // omitted from API requests. See
2732 // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details.
2733 NullFields []string `json:"-"`
2734 }
2735
2736 func (s PublisherProfileMobileApplication) MarshalJSON() ([]byte, error) {
2737 type NoMethod PublisherProfileMobileApplication
2738 return gensupport.MarshalJSON(NoMethod(s), s.ForceSendFields, s.NullFields)
2739 }
2740
2741 // ResumeFinalizedDealRequest: Request message for resuming a finalized deal.
2742 type ResumeFinalizedDealRequest struct {
2743 }
2744
2745 // RtbMetrics: Real-time bidding metrics. For what each metric means refer to
2746 // Report metrics
2747 // (https://support.google.com/adxbuyer/answer/6115195#report-metrics)
2748 type RtbMetrics struct {
2749 // AdImpressions7Days: Ad impressions in last 7 days.
2750 AdImpressions7Days int64 `json:"adImpressions7Days,omitempty,string"`
2751 // BidRate7Days: Bid rate in last 7 days, calculated by (bids / bid requests).
2752 BidRate7Days float64 `json:"bidRate7Days,omitempty"`
2753 // BidRequests7Days: Bid requests in last 7 days.
2754 BidRequests7Days int64 `json:"bidRequests7Days,omitempty,string"`
2755 // Bids7Days: Bids in last 7 days.
2756 Bids7Days int64 `json:"bids7Days,omitempty,string"`
2757 // FilteredBidRate7Days: Filtered bid rate in last 7 days, calculated by
2758 // (filtered bids / bids).
2759 FilteredBidRate7Days float64 `json:"filteredBidRate7Days,omitempty"`
2760 // MustBidRateCurrentMonth: Must bid rate for current month.
2761 MustBidRateCurrentMonth float64 `json:"mustBidRateCurrentMonth,omitempty"`
2762 // ForceSendFields is a list of field names (e.g. "AdImpressions7Days") to
2763 // unconditionally include in API requests. By default, fields with empty or
2764 // default values are omitted from API requests. See
2765 // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more
2766 // details.
2767 ForceSendFields []string `json:"-"`
2768 // NullFields is a list of field names (e.g. "AdImpressions7Days") to include
2769 // in API requests with the JSON null value. By default, fields with empty
2770 // values are omitted from API requests. See
2771 // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details.
2772 NullFields []string `json:"-"`
2773 }
2774
2775 func (s RtbMetrics) MarshalJSON() ([]byte, error) {
2776 type NoMethod RtbMetrics
2777 return gensupport.MarshalJSON(NoMethod(s), s.ForceSendFields, s.NullFields)
2778 }
2779
2780 func (s *RtbMetrics) UnmarshalJSON(data []byte) error {
2781 type NoMethod RtbMetrics
2782 var s1 struct {
2783 BidRate7Days gensupport.JSONFloat64 `json:"bidRate7Days"`
2784 FilteredBidRate7Days gensupport.JSONFloat64 `json:"filteredBidRate7Days"`
2785 MustBidRateCurrentMonth gensupport.JSONFloat64 `json:"mustBidRateCurrentMonth"`
2786 *NoMethod
2787 }
2788 s1.NoMethod = (*NoMethod)(s)
2789 if err := json.Unmarshal(data, &s1); err != nil {
2790 return err
2791 }
2792 s.BidRate7Days = float64(s1.BidRate7Days)
2793 s.FilteredBidRate7Days = float64(s1.FilteredBidRate7Days)
2794 s.MustBidRateCurrentMonth = float64(s1.MustBidRateCurrentMonth)
2795 return nil
2796 }
2797
2798 // SendRfpRequest: Request to send an RFP. All fields in this request are
2799 // proposed to publisher and subject to changes by publisher during later
2800 // negotiation.
2801 type SendRfpRequest struct {
2802 // BuyerContacts: Contact information for the buyer.
2803 BuyerContacts []*Contact `json:"buyerContacts,omitempty"`
2804 // Client: If the current buyer is sending the RFP on behalf of its client, use
2805 // this field to specify the name of the client in the format:
2806 // `buyers/{accountId}/clients/{clientAccountid}`.
2807 Client string `json:"client,omitempty"`
2808 // DisplayName: Required. The display name of the proposal being created by
2809 // this RFP.
2810 DisplayName string `json:"displayName,omitempty"`
2811 // EstimatedGrossSpend: Specified by buyers in request for proposal (RFP) to
2812 // notify publisher the total estimated spend for the proposal. Publishers will
2813 // receive this information and send back proposed deals accordingly.
2814 EstimatedGrossSpend *Money `json:"estimatedGrossSpend,omitempty"`
2815 // FlightEndTime: Required. Proposed flight end time of the RFP. A timestamp in
2816 // RFC3339 UTC "Zulu" format. Note that the specified value will be truncated
2817 // to a granularity of one second.
2818 FlightEndTime string `json:"flightEndTime,omitempty"`
2819 // FlightStartTime: Required. Proposed flight start time of the RFP. A
2820 // timestamp in RFC3339 UTC "Zulu" format. Note that the specified value will
2821 // be truncated to a granularity of one second.
2822 FlightStartTime string `json:"flightStartTime,omitempty"`
2823 // GeoTargeting: Geo criteria IDs to be targeted. Refer to Geo tables.
2824 GeoTargeting *CriteriaTargeting `json:"geoTargeting,omitempty"`
2825 // InventorySizeTargeting: Inventory sizes to be targeted. Only PIXEL inventory
2826 // size type is supported.
2827 InventorySizeTargeting *InventorySizeTargeting `json:"inventorySizeTargeting,omitempty"`
2828 // Note: A message that is sent to the publisher. Maximum length is 1024
2829 // characters.
2830 Note string `json:"note,omitempty"`
2831 // PreferredDealTerms: The terms for preferred deals.
2832 PreferredDealTerms *PreferredDealTerms `json:"preferredDealTerms,omitempty"`
2833 // ProgrammaticGuaranteedTerms: The terms for programmatic guaranteed deals.
2834 ProgrammaticGuaranteedTerms *ProgrammaticGuaranteedTerms `json:"programmaticGuaranteedTerms,omitempty"`
2835 // PublisherProfile: Required. The profile of the publisher who will receive
2836 // this RFP in the format:
2837 // `buyers/{accountId}/publisherProfiles/{publisherProfileId}`.
2838 PublisherProfile string `json:"publisherProfile,omitempty"`
2839 // ForceSendFields is a list of field names (e.g. "BuyerContacts") to
2840 // unconditionally include in API requests. By default, fields with empty or
2841 // default values are omitted from API requests. See
2842 // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more
2843 // details.
2844 ForceSendFields []string `json:"-"`
2845 // NullFields is a list of field names (e.g. "BuyerContacts") to include in API
2846 // requests with the JSON null value. By default, fields with empty values are
2847 // omitted from API requests. See
2848 // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details.
2849 NullFields []string `json:"-"`
2850 }
2851
2852 func (s SendRfpRequest) MarshalJSON() ([]byte, error) {
2853 type NoMethod SendRfpRequest
2854 return gensupport.MarshalJSON(NoMethod(s), s.ForceSendFields, s.NullFields)
2855 }
2856
2857 // SetReadyToServeRequest: Request message for setting ready to serve for a
2858 // finalized deal.
2859 type SetReadyToServeRequest struct {
2860 }
2861
2862 // StringTargetingDimension: Generic targeting with string values.
2863 type StringTargetingDimension struct {
2864 // SelectionType: Required. How the items in this list should be targeted.
2865 //
2866 // Possible values:
2867 // "SELECTION_TYPE_UNSPECIFIED" - Unspecified selection type. Should not be
2868 // used.
2869 // "SELECTION_TYPE_INCLUDE" - The values in the targeting dimension are
2870 // included.
2871 // "SELECTION_TYPE_EXCLUDE" - The values in the targeting dimension are
2872 // excluded.
2873 SelectionType string `json:"selectionType,omitempty"`
2874 // Values: Required. The values specified.
2875 Values []string `json:"values,omitempty"`
2876 // ForceSendFields is a list of field names (e.g. "SelectionType") to
2877 // unconditionally include in API requests. By default, fields with empty or
2878 // default values are omitted from API requests. See
2879 // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more
2880 // details.
2881 ForceSendFields []string `json:"-"`
2882 // NullFields is a list of field names (e.g. "SelectionType") to include in API
2883 // requests with the JSON null value. By default, fields with empty values are
2884 // omitted from API requests. See
2885 // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details.
2886 NullFields []string `json:"-"`
2887 }
2888
2889 func (s StringTargetingDimension) MarshalJSON() ([]byte, error) {
2890 type NoMethod StringTargetingDimension
2891 return gensupport.MarshalJSON(NoMethod(s), s.ForceSendFields, s.NullFields)
2892 }
2893
2894 // SubscribeAuctionPackageRequest: Request message for SubscribeAuctionPackage.
2895 type SubscribeAuctionPackageRequest struct {
2896 }
2897
2898 // SubscribeClientsRequest: Request message for SubscribeAuctionPackageClients.
2899 type SubscribeClientsRequest struct {
2900 // Clients: Optional. A list of client buyers to subscribe to the auction
2901 // package, with client buyer in the format
2902 // `buyers/{accountId}/clients/{clientAccountId}`. The current buyer will be
2903 // subscribed to the auction package regardless of the list contents if not
2904 // already.
2905 Clients []string `json:"clients,omitempty"`
2906 // ForceSendFields is a list of field names (e.g. "Clients") to unconditionally
2907 // include in API requests. By default, fields with empty or default values are
2908 // omitted from API requests. See
2909 // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more
2910 // details.
2911 ForceSendFields []string `json:"-"`
2912 // NullFields is a list of field names (e.g. "Clients") to include in API
2913 // requests with the JSON null value. By default, fields with empty values are
2914 // omitted from API requests. See
2915 // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details.
2916 NullFields []string `json:"-"`
2917 }
2918
2919 func (s SubscribeClientsRequest) MarshalJSON() ([]byte, error) {
2920 type NoMethod SubscribeClientsRequest
2921 return gensupport.MarshalJSON(NoMethod(s), s.ForceSendFields, s.NullFields)
2922 }
2923
2924 // TaxonomyTargeting: Defines targeting criteria for handling the IAB audience
2925 // and content Taxonomy ID space.
2926 type TaxonomyTargeting struct {
2927 // ExcludedTaxonomyIds: Optional. The list of excluded content taxonomy IDs.
2928 ExcludedTaxonomyIds []string `json:"excludedTaxonomyIds,omitempty"`
2929 // TargetedTaxonomyIds: Optional. The list of targeted content taxonomy IDs.
2930 TargetedTaxonomyIds []string `json:"targetedTaxonomyIds,omitempty"`
2931 // ForceSendFields is a list of field names (e.g. "ExcludedTaxonomyIds") to
2932 // unconditionally include in API requests. By default, fields with empty or
2933 // default values are omitted from API requests. See
2934 // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more
2935 // details.
2936 ForceSendFields []string `json:"-"`
2937 // NullFields is a list of field names (e.g. "ExcludedTaxonomyIds") to include
2938 // in API requests with the JSON null value. By default, fields with empty
2939 // values are omitted from API requests. See
2940 // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details.
2941 NullFields []string `json:"-"`
2942 }
2943
2944 func (s TaxonomyTargeting) MarshalJSON() ([]byte, error) {
2945 type NoMethod TaxonomyTargeting
2946 return gensupport.MarshalJSON(NoMethod(s), s.ForceSendFields, s.NullFields)
2947 }
2948
2949 // TechnologyTargeting: Represents targeting about various types of technology.
2950 type TechnologyTargeting struct {
2951 // DeviceCapabilityTargeting: IDs of device capabilities to be
2952 // included/excluded.
2953 DeviceCapabilityTargeting *CriteriaTargeting `json:"deviceCapabilityTargeting,omitempty"`
2954 // DeviceCategoryTargeting: IDs of device categories to be included/excluded.
2955 DeviceCategoryTargeting *CriteriaTargeting `json:"deviceCategoryTargeting,omitempty"`
2956 // OperatingSystemTargeting: Operating system related targeting information.
2957 OperatingSystemTargeting *OperatingSystemTargeting `json:"operatingSystemTargeting,omitempty"`
2958 // ForceSendFields is a list of field names (e.g. "DeviceCapabilityTargeting")
2959 // to unconditionally include in API requests. By default, fields with empty or
2960 // default values are omitted from API requests. See
2961 // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more
2962 // details.
2963 ForceSendFields []string `json:"-"`
2964 // NullFields is a list of field names (e.g. "DeviceCapabilityTargeting") to
2965 // include in API requests with the JSON null value. By default, fields with
2966 // empty values are omitted from API requests. See
2967 // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details.
2968 NullFields []string `json:"-"`
2969 }
2970
2971 func (s TechnologyTargeting) MarshalJSON() ([]byte, error) {
2972 type NoMethod TechnologyTargeting
2973 return gensupport.MarshalJSON(NoMethod(s), s.ForceSendFields, s.NullFields)
2974 }
2975
2976 // TimeOfDay: Represents a time of day. The date and time zone are either not
2977 // significant or are specified elsewhere. An API may choose to allow leap
2978 // seconds. Related types are google.type.Date and `google.protobuf.Timestamp`.
2979 type TimeOfDay struct {
2980 // Hours: Hours of a day in 24 hour format. Must be greater than or equal to 0
2981 // and typically must be less than or equal to 23. An API may choose to allow
2982 // the value "24:00:00" for scenarios like business closing time.
2983 Hours int64 `json:"hours,omitempty"`
2984 // Minutes: Minutes of an hour. Must be greater than or equal to 0 and less
2985 // than or equal to 59.
2986 Minutes int64 `json:"minutes,omitempty"`
2987 // Nanos: Fractions of seconds, in nanoseconds. Must be greater than or equal
2988 // to 0 and less than or equal to 999,999,999.
2989 Nanos int64 `json:"nanos,omitempty"`
2990 // Seconds: Seconds of a minute. Must be greater than or equal to 0 and
2991 // typically must be less than or equal to 59. An API may allow the value 60 if
2992 // it allows leap-seconds.
2993 Seconds int64 `json:"seconds,omitempty"`
2994 // ForceSendFields is a list of field names (e.g. "Hours") to unconditionally
2995 // include in API requests. By default, fields with empty or default values are
2996 // omitted from API requests. See
2997 // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more
2998 // details.
2999 ForceSendFields []string `json:"-"`
3000 // NullFields is a list of field names (e.g. "Hours") to include in API
3001 // requests with the JSON null value. By default, fields with empty values are
3002 // omitted from API requests. See
3003 // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details.
3004 NullFields []string `json:"-"`
3005 }
3006
3007 func (s TimeOfDay) MarshalJSON() ([]byte, error) {
3008 type NoMethod TimeOfDay
3009 return gensupport.MarshalJSON(NoMethod(s), s.ForceSendFields, s.NullFields)
3010 }
3011
3012 // TimeZone: Represents a time zone from the IANA Time Zone Database
3013 // (https://www.iana.org/time-zones).
3014 type TimeZone struct {
3015 // Id: IANA Time Zone Database time zone. For example "America/New_York".
3016 Id string `json:"id,omitempty"`
3017 // Version: Optional. IANA Time Zone Database version number. For example
3018 // "2019a".
3019 Version string `json:"version,omitempty"`
3020 // ForceSendFields is a list of field names (e.g. "Id") to unconditionally
3021 // include in API requests. By default, fields with empty or default values are
3022 // omitted from API requests. See
3023 // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more
3024 // details.
3025 ForceSendFields []string `json:"-"`
3026 // NullFields is a list of field names (e.g. "Id") to include in API requests
3027 // with the JSON null value. By default, fields with empty values are omitted
3028 // from API requests. See
3029 // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details.
3030 NullFields []string `json:"-"`
3031 }
3032
3033 func (s TimeZone) MarshalJSON() ([]byte, error) {
3034 type NoMethod TimeZone
3035 return gensupport.MarshalJSON(NoMethod(s), s.ForceSendFields, s.NullFields)
3036 }
3037
3038 // UnsubscribeAuctionPackageRequest: Request message for
3039 // UnsubscribeAuctionPackage.
3040 type UnsubscribeAuctionPackageRequest struct {
3041 }
3042
3043 // UnsubscribeClientsRequest: Request message for UnsubscribeAuctionPackage.
3044 type UnsubscribeClientsRequest struct {
3045 // Clients: Optional. A list of client buyers to unsubscribe from the auction
3046 // package, with client buyer in the format
3047 // `buyers/{accountId}/clients/{clientAccountId}`.
3048 Clients []string `json:"clients,omitempty"`
3049 // ForceSendFields is a list of field names (e.g. "Clients") to unconditionally
3050 // include in API requests. By default, fields with empty or default values are
3051 // omitted from API requests. See
3052 // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more
3053 // details.
3054 ForceSendFields []string `json:"-"`
3055 // NullFields is a list of field names (e.g. "Clients") to include in API
3056 // requests with the JSON null value. By default, fields with empty values are
3057 // omitted from API requests. See
3058 // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details.
3059 NullFields []string `json:"-"`
3060 }
3061
3062 func (s UnsubscribeClientsRequest) MarshalJSON() ([]byte, error) {
3063 type NoMethod UnsubscribeClientsRequest
3064 return gensupport.MarshalJSON(NoMethod(s), s.ForceSendFields, s.NullFields)
3065 }
3066
3067 // UpdateDealRequest: Request message for updating the deal at the given
3068 // revision number.
3069 type UpdateDealRequest struct {
3070 // Deal: Required. The deal to update. The deal's `name` field is used to
3071 // identify the deal to be updated. Note: proposal_revision will have to be
3072 // provided within the resource or else an error will be thrown. Format:
3073 // buyers/{accountId}/proposals/{proposalId}/deals/{dealId}
3074 Deal *Deal `json:"deal,omitempty"`
3075 // UpdateMask: List of fields to be updated. If empty or unspecified, the
3076 // service will update all fields populated in the update request excluding the
3077 // output only fields and primitive fields with default value. Note that
3078 // explicit field mask is required in order to reset a primitive field back to
3079 // its default value, for example, false for boolean fields, 0 for integer
3080 // fields. A special field mask consisting of a single path "*" can be used to
3081 // indicate full replacement(the equivalent of PUT method), updatable fields
3082 // unset or unspecified in the input will be cleared or set to default value.
3083 // Output only fields will be ignored regardless of the value of updateMask.
3084 UpdateMask string `json:"updateMask,omitempty"`
3085 // ForceSendFields is a list of field names (e.g. "Deal") to unconditionally
3086 // include in API requests. By default, fields with empty or default values are
3087 // omitted from API requests. See
3088 // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more
3089 // details.
3090 ForceSendFields []string `json:"-"`
3091 // NullFields is a list of field names (e.g. "Deal") to include in API requests
3092 // with the JSON null value. By default, fields with empty values are omitted
3093 // from API requests. See
3094 // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details.
3095 NullFields []string `json:"-"`
3096 }
3097
3098 func (s UpdateDealRequest) MarshalJSON() ([]byte, error) {
3099 type NoMethod UpdateDealRequest
3100 return gensupport.MarshalJSON(NoMethod(s), s.ForceSendFields, s.NullFields)
3101 }
3102
3103 // UriTargeting: Represents a list of targeted and excluded URLs (for example,
3104 // google.com). For Private Auction Deals, URLs are either included or
3105 // excluded. For Programmatic Guaranteed and Preferred Deals, this doesn't
3106 // apply.
3107 type UriTargeting struct {
3108 // ExcludedUris: A list of URLs to be excluded.
3109 ExcludedUris []string `json:"excludedUris,omitempty"`
3110 // TargetedUris: A list of URLs to be included.
3111 TargetedUris []string `json:"targetedUris,omitempty"`
3112 // ForceSendFields is a list of field names (e.g. "ExcludedUris") to
3113 // unconditionally include in API requests. By default, fields with empty or
3114 // default values are omitted from API requests. See
3115 // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more
3116 // details.
3117 ForceSendFields []string `json:"-"`
3118 // NullFields is a list of field names (e.g. "ExcludedUris") to include in API
3119 // requests with the JSON null value. By default, fields with empty values are
3120 // omitted from API requests. See
3121 // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details.
3122 NullFields []string `json:"-"`
3123 }
3124
3125 func (s UriTargeting) MarshalJSON() ([]byte, error) {
3126 type NoMethod UriTargeting
3127 return gensupport.MarshalJSON(NoMethod(s), s.ForceSendFields, s.NullFields)
3128 }
3129
3130 // VideoPlayerSizeTargeting: Represents the size of the video player that can
3131 // be targeted. Both width and height are required to be set to non-zero
3132 // values.
3133 type VideoPlayerSizeTargeting struct {
3134 // MinimumHeight: Required. The minimum height of the video player in pixels.
3135 MinimumHeight int64 `json:"minimumHeight,omitempty,string"`
3136 // MinimumWidth: Required. The minimum width of the video player in pixels.
3137 MinimumWidth int64 `json:"minimumWidth,omitempty,string"`
3138 // ForceSendFields is a list of field names (e.g. "MinimumHeight") to
3139 // unconditionally include in API requests. By default, fields with empty or
3140 // default values are omitted from API requests. See
3141 // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more
3142 // details.
3143 ForceSendFields []string `json:"-"`
3144 // NullFields is a list of field names (e.g. "MinimumHeight") to include in API
3145 // requests with the JSON null value. By default, fields with empty values are
3146 // omitted from API requests. See
3147 // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details.
3148 NullFields []string `json:"-"`
3149 }
3150
3151 func (s VideoPlayerSizeTargeting) MarshalJSON() ([]byte, error) {
3152 type NoMethod VideoPlayerSizeTargeting
3153 return gensupport.MarshalJSON(NoMethod(s), s.ForceSendFields, s.NullFields)
3154 }
3155
3156 // VideoPlcmtTargeting: Defines targeting criteria based on the video placement
3157 // type, often corresponding to the IAB OpenRTB 'plcmt' field.
3158 type VideoPlcmtTargeting struct {
3159 // SelectionType: Required. The selection type for the list of video plcmts.
3160 //
3161 // Possible values:
3162 // "SELECTION_TYPE_UNSPECIFIED" - Unspecified selection type. Should not be
3163 // used.
3164 // "SELECTION_TYPE_INCLUDE" - The values in the targeting dimension are
3165 // included.
3166 // "SELECTION_TYPE_EXCLUDE" - The values in the targeting dimension are
3167 // excluded.
3168 SelectionType string `json:"selectionType,omitempty"`
3169 // VideoPlcmtTypes: Required. The list of targeted video plcmts types. If
3170 // empty, inventory will be targeted regardless of video plcmt type.
3171 //
3172 // Possible values:
3173 // "VIDEO_PLCMT_TYPE_UNSPECIFIED" - Default value. Should not be used in
3174 // targeting specifications.
3175 // "INSTREAM" - Pre-roll, mid-roll, and post-roll ads that are played before,
3176 // during or after the streaming video content that the consumer has requested.
3177 // Instream video must be set to “sound on” by default at player start, or
3178 // have explicitly clear user intent to watch the video content. While there
3179 // may be other content surrounding the player, the video content must be the
3180 // focus of the user’s visit. It should remain the primary content on the
3181 // page and the only video player in-view capable of audio when playing. If the
3182 // player converts to floating/sticky, subsequent ad calls should accurately
3183 // convey the updated player size.
3184 // "ACCOMPANYING_CONTENT" - Pre-roll, mid-roll, and post-roll ads that are
3185 // played before, during, or after streaming video content. The video player
3186 // loads and plays before, between, or after paragraphs of text or graphical
3187 // content, and starts playing only when it enters the viewport. Accompanying
3188 // content should only start playback upon entering the viewport. It may
3189 // convert to a floating/sticky player as it scrolls off the page.
3190 // "INTERSTITIAL" - Video ads that are played without video content. During
3191 // playback, it must be the primary focus of the page and take up the majority
3192 // of the viewport and cannot be scrolled out of view. This can be in
3193 // placements like in-app video or slideshows.
3194 // "NO_CONTENT" - Video ads that are played without streaming video content.
3195 // This can be in placements like slideshows, native feeds, in-content or
3196 // sticky/floating.
3197 VideoPlcmtTypes []string `json:"videoPlcmtTypes,omitempty"`
3198 // ForceSendFields is a list of field names (e.g. "SelectionType") to
3199 // unconditionally include in API requests. By default, fields with empty or
3200 // default values are omitted from API requests. See
3201 // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more
3202 // details.
3203 ForceSendFields []string `json:"-"`
3204 // NullFields is a list of field names (e.g. "SelectionType") to include in API
3205 // requests with the JSON null value. By default, fields with empty values are
3206 // omitted from API requests. See
3207 // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details.
3208 NullFields []string `json:"-"`
3209 }
3210
3211 func (s VideoPlcmtTargeting) MarshalJSON() ([]byte, error) {
3212 type NoMethod VideoPlcmtTargeting
3213 return gensupport.MarshalJSON(NoMethod(s), s.ForceSendFields, s.NullFields)
3214 }
3215
3216 // VideoTargeting: Represents targeting information about video.
3217 type VideoTargeting struct {
3218 // ExcludedPositionTypes: A list of video positions to be excluded. When this
3219 // field is populated, the targeted_position_types field must be empty.
3220 //
3221 // Possible values:
3222 // "POSITION_TYPE_UNSPECIFIED" - A placeholder for an undefined video
3223 // position.
3224 // "PREROLL" - Ad is played before the video.
3225 // "MIDROLL" - Ad is played during the video.
3226 // "POSTROLL" - Ad is played after the video.
3227 ExcludedPositionTypes []string `json:"excludedPositionTypes,omitempty"`
3228 // TargetedPositionTypes: A list of video positions to be included. When this
3229 // field is populated, the excluded_position_types field must be empty.
3230 //
3231 // Possible values:
3232 // "POSITION_TYPE_UNSPECIFIED" - A placeholder for an undefined video
3233 // position.
3234 // "PREROLL" - Ad is played before the video.
3235 // "MIDROLL" - Ad is played during the video.
3236 // "POSTROLL" - Ad is played after the video.
3237 TargetedPositionTypes []string `json:"targetedPositionTypes,omitempty"`
3238 // ForceSendFields is a list of field names (e.g. "ExcludedPositionTypes") to
3239 // unconditionally include in API requests. By default, fields with empty or
3240 // default values are omitted from API requests. See
3241 // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more
3242 // details.
3243 ForceSendFields []string `json:"-"`
3244 // NullFields is a list of field names (e.g. "ExcludedPositionTypes") to
3245 // include in API requests with the JSON null value. By default, fields with
3246 // empty values are omitted from API requests. See
3247 // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details.
3248 NullFields []string `json:"-"`
3249 }
3250
3251 func (s VideoTargeting) MarshalJSON() ([]byte, error) {
3252 type NoMethod VideoTargeting
3253 return gensupport.MarshalJSON(NoMethod(s), s.ForceSendFields, s.NullFields)
3254 }
3255
3256 type BiddersAuctionPackagesListCall struct {
3257 s *Service
3258 parent string
3259 urlParams_ gensupport.URLParams
3260 ifNoneMatch_ string
3261 ctx_ context.Context
3262 header_ http.Header
3263 }
3264
3265 // List: List the auction packages. Buyers can use the URL path
3266 // "/v1alpha/buyers/{accountId}/auctionPackages" to list auction packages for
3267 // the current buyer and its clients. Bidders can use the URL path
3268 // "/v1alpha/bidders/{accountId}/auctionPackages" to list auction packages for
3269 // the bidder, its media planners, its buyers, and all their clients.
3270 //
3271 // - parent: Name of the parent buyer that can access the auction package.
3272 // Format: `buyers/{accountId}`. When used with a bidder account, the auction
3273 // packages that the bidder, its media planners, its buyers and clients are
3274 // subscribed to will be listed, in the format `bidders/{accountId}`.
3275 func (r *BiddersAuctionPackagesService) List(parent string) *BiddersAuctionPackagesListCall {
3276 c := &BiddersAuctionPackagesListCall{s: r.s, urlParams_: make(gensupport.URLParams)}
3277 c.parent = parent
3278 return c
3279 }
3280
3281 // Filter sets the optional parameter "filter": Optional query string using the
3282 // Cloud API list filtering syntax
3283 // (/authorized-buyers/apis/guides/list-filters). Only supported when parent is
3284 // bidder. Supported columns for filtering are: * displayName * createTime *
3285 // updateTime * eligibleSeatIds
3286 func (c *BiddersAuctionPackagesListCall) Filter(filter string) *BiddersAuctionPackagesListCall {
3287 c.urlParams_.Set("filter", filter)
3288 return c
3289 }
3290
3291 // OrderBy sets the optional parameter "orderBy": An optional query string to
3292 // sort auction packages using the Cloud API sorting syntax
3293 // (https://cloud.google.com/apis/design/design_patterns#sorting_order). If no
3294 // sort order is specified, results will be returned in an arbitrary order.
3295 // Only supported when parent is bidder. Supported columns for sorting are: *
3296 // displayName * createTime * updateTime
3297 func (c *BiddersAuctionPackagesListCall) OrderBy(orderBy string) *BiddersAuctionPackagesListCall {
3298 c.urlParams_.Set("orderBy", orderBy)
3299 return c
3300 }
3301
3302 // PageSize sets the optional parameter "pageSize": Requested page size. The
3303 // server may return fewer results than requested. Max allowed page size is
3304 // 500.
3305 func (c *BiddersAuctionPackagesListCall) PageSize(pageSize int64) *BiddersAuctionPackagesListCall {
3306 c.urlParams_.Set("pageSize", fmt.Sprint(pageSize))
3307 return c
3308 }
3309
3310 // PageToken sets the optional parameter "pageToken": The page token as
3311 // returned. ListAuctionPackagesResponse.nextPageToken
3312 func (c *BiddersAuctionPackagesListCall) PageToken(pageToken string) *BiddersAuctionPackagesListCall {
3313 c.urlParams_.Set("pageToken", pageToken)
3314 return c
3315 }
3316
3317 // Fields allows partial responses to be retrieved. See
3318 // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse for more
3319 // details.
3320 func (c *BiddersAuctionPackagesListCall) Fields(s ...googleapi.Field) *BiddersAuctionPackagesListCall {
3321 c.urlParams_.Set("fields", googleapi.CombineFields(s))
3322 return c
3323 }
3324
3325 // IfNoneMatch sets an optional parameter which makes the operation fail if the
3326 // object's ETag matches the given value. This is useful for getting updates
3327 // only after the object has changed since the last request.
3328 func (c *BiddersAuctionPackagesListCall) IfNoneMatch(entityTag string) *BiddersAuctionPackagesListCall {
3329 c.ifNoneMatch_ = entityTag
3330 return c
3331 }
3332
3333 // Context sets the context to be used in this call's Do method.
3334 func (c *BiddersAuctionPackagesListCall) Context(ctx context.Context) *BiddersAuctionPackagesListCall {
3335 c.ctx_ = ctx
3336 return c
3337 }
3338
3339 // Header returns a http.Header that can be modified by the caller to add
3340 // headers to the request.
3341 func (c *BiddersAuctionPackagesListCall) Header() http.Header {
3342 if c.header_ == nil {
3343 c.header_ = make(http.Header)
3344 }
3345 return c.header_
3346 }
3347
3348 func (c *BiddersAuctionPackagesListCall) doRequest(alt string) (*http.Response, error) {
3349 reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_)
3350 if c.ifNoneMatch_ != "" {
3351 reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
3352 }
3353 c.urlParams_.Set("alt", alt)
3354 c.urlParams_.Set("prettyPrint", "false")
3355 urls := googleapi.ResolveRelative(c.s.BasePath, "v1alpha/{+parent}/auctionPackages")
3356 urls += "?" + c.urlParams_.Encode()
3357 req, err := http.NewRequest("GET", urls, nil)
3358 if err != nil {
3359 return nil, err
3360 }
3361 req.Header = reqHeaders
3362 googleapi.Expand(req.URL, map[string]string{
3363 "parent": c.parent,
3364 })
3365 c.s.logger.DebugContext(c.ctx_, "api request", "serviceName", apiName, "rpcName", "authorizedbuyersmarketplace.bidders.auctionPackages.list", "request", internallog.HTTPRequest(req, nil))
3366 return gensupport.SendRequest(c.ctx_, c.s.client, req)
3367 }
3368
3369 // Do executes the "authorizedbuyersmarketplace.bidders.auctionPackages.list" call.
3370 // Any non-2xx status code is an error. Response headers are in either
3371 // *ListAuctionPackagesResponse.ServerResponse.Header or (if a response was
3372 // returned at all) in error.(*googleapi.Error).Header. Use
3373 // googleapi.IsNotModified to check whether the returned error was because
3374 // http.StatusNotModified was returned.
3375 func (c *BiddersAuctionPackagesListCall) Do(opts ...googleapi.CallOption) (*ListAuctionPackagesResponse, error) {
3376 gensupport.SetOptions(c.urlParams_, opts...)
3377 res, err := c.doRequest("json")
3378 if res != nil && res.StatusCode == http.StatusNotModified {
3379 if res.Body != nil {
3380 res.Body.Close()
3381 }
3382 return nil, gensupport.WrapError(&googleapi.Error{
3383 Code: res.StatusCode,
3384 Header: res.Header,
3385 })
3386 }
3387 if err != nil {
3388 return nil, err
3389 }
3390 defer googleapi.CloseBody(res)
3391 if err := googleapi.CheckResponse(res); err != nil {
3392 return nil, gensupport.WrapError(err)
3393 }
3394 ret := &ListAuctionPackagesResponse{
3395 ServerResponse: googleapi.ServerResponse{
3396 Header: res.Header,
3397 HTTPStatusCode: res.StatusCode,
3398 },
3399 }
3400 target := &ret
3401 b, err := gensupport.DecodeResponseBytes(target, res)
3402 if err != nil {
3403 return nil, err
3404 }
3405 c.s.logger.DebugContext(c.ctx_, "api response", "serviceName", apiName, "rpcName", "authorizedbuyersmarketplace.bidders.auctionPackages.list", "response", internallog.HTTPResponse(res, b))
3406 return ret, nil
3407 }
3408
3409 // Pages invokes f for each page of results.
3410 // A non-nil error returned from f will halt the iteration.
3411 // The provided context supersedes any context provided to the Context method.
3412 func (c *BiddersAuctionPackagesListCall) Pages(ctx context.Context, f func(*ListAuctionPackagesResponse) error) error {
3413 c.ctx_ = ctx
3414 defer c.PageToken(c.urlParams_.Get("pageToken"))
3415 for {
3416 x, err := c.Do()
3417 if err != nil {
3418 return err
3419 }
3420 if err := f(x); err != nil {
3421 return err
3422 }
3423 if x.NextPageToken == "" {
3424 return nil
3425 }
3426 c.PageToken(x.NextPageToken)
3427 }
3428 }
3429
3430 type BiddersFinalizedDealsListCall struct {
3431 s *Service
3432 parent string
3433 urlParams_ gensupport.URLParams
3434 ifNoneMatch_ string
3435 ctx_ context.Context
3436 header_ http.Header
3437 }
3438
3439 // List: Lists finalized deals. Use the URL path
3440 // "/v1alpha/buyers/{accountId}/finalizedDeals" to list finalized deals for the
3441 // current buyer and its clients. Bidders can use the URL path
3442 // "/v1alpha/bidders/{accountId}/finalizedDeals" to list finalized deals for
3443 // the bidder, its buyers and all their clients.
3444 //
3445 // - parent: The buyer to list the finalized deals for, in the format:
3446 // `buyers/{accountId}`. When used to list finalized deals for a bidder, its
3447 // buyers and clients, in the format `bidders/{accountId}`.
3448 func (r *BiddersFinalizedDealsService) List(parent string) *BiddersFinalizedDealsListCall {
3449 c := &BiddersFinalizedDealsListCall{s: r.s, urlParams_: make(gensupport.URLParams)}
3450 c.parent = parent
3451 return c
3452 }
3453
3454 // Filter sets the optional parameter "filter": Optional query string using the
3455 // Cloud API list filtering syntax
3456 // (https://developers.google.com/authorized-buyers/apis/guides/list-filters)
3457 // Supported columns for filtering are: * deal.displayName * deal.dealType *
3458 // deal.createTime * deal.updateTime * deal.flightStartTime *
3459 // deal.flightEndTime * deal.eligibleSeatIds * dealServingStatus * readyToServe
3460 func (c *BiddersFinalizedDealsListCall) Filter(filter string) *BiddersFinalizedDealsListCall {
3461 c.urlParams_.Set("filter", filter)
3462 return c
3463 }
3464
3465 // OrderBy sets the optional parameter "orderBy": An optional query string to
3466 // sort finalized deals using the Cloud API sorting syntax
3467 // (https://cloud.google.com/apis/design/design_patterns#sorting_order). If no
3468 // sort order is specified, results will be returned in an arbitrary order.
3469 // Supported columns for sorting are: * deal.displayName * deal.createTime *
3470 // deal.updateTime * deal.flightStartTime * deal.flightEndTime *
3471 // rtbMetrics.bidRequests7Days * rtbMetrics.bids7Days *
3472 // rtbMetrics.adImpressions7Days * rtbMetrics.bidRate7Days *
3473 // rtbMetrics.filteredBidRate7Days * rtbMetrics.mustBidRateCurrentMonth
3474 func (c *BiddersFinalizedDealsListCall) OrderBy(orderBy string) *BiddersFinalizedDealsListCall {
3475 c.urlParams_.Set("orderBy", orderBy)
3476 return c
3477 }
3478
3479 // PageSize sets the optional parameter "pageSize": Requested page size. The
3480 // server may return fewer results than requested. If requested more than 500,
3481 // the server will return 500 results per page. If unspecified, the server will
3482 // pick a default page size of 100.
3483 func (c *BiddersFinalizedDealsListCall) PageSize(pageSize int64) *BiddersFinalizedDealsListCall {
3484 c.urlParams_.Set("pageSize", fmt.Sprint(pageSize))
3485 return c
3486 }
3487
3488 // PageToken sets the optional parameter "pageToken": The page token as
3489 // returned from ListFinalizedDealsResponse.
3490 func (c *BiddersFinalizedDealsListCall) PageToken(pageToken string) *BiddersFinalizedDealsListCall {
3491 c.urlParams_.Set("pageToken", pageToken)
3492 return c
3493 }
3494
3495 // Fields allows partial responses to be retrieved. See
3496 // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse for more
3497 // details.
3498 func (c *BiddersFinalizedDealsListCall) Fields(s ...googleapi.Field) *BiddersFinalizedDealsListCall {
3499 c.urlParams_.Set("fields", googleapi.CombineFields(s))
3500 return c
3501 }
3502
3503 // IfNoneMatch sets an optional parameter which makes the operation fail if the
3504 // object's ETag matches the given value. This is useful for getting updates
3505 // only after the object has changed since the last request.
3506 func (c *BiddersFinalizedDealsListCall) IfNoneMatch(entityTag string) *BiddersFinalizedDealsListCall {
3507 c.ifNoneMatch_ = entityTag
3508 return c
3509 }
3510
3511 // Context sets the context to be used in this call's Do method.
3512 func (c *BiddersFinalizedDealsListCall) Context(ctx context.Context) *BiddersFinalizedDealsListCall {
3513 c.ctx_ = ctx
3514 return c
3515 }
3516
3517 // Header returns a http.Header that can be modified by the caller to add
3518 // headers to the request.
3519 func (c *BiddersFinalizedDealsListCall) Header() http.Header {
3520 if c.header_ == nil {
3521 c.header_ = make(http.Header)
3522 }
3523 return c.header_
3524 }
3525
3526 func (c *BiddersFinalizedDealsListCall) doRequest(alt string) (*http.Response, error) {
3527 reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_)
3528 if c.ifNoneMatch_ != "" {
3529 reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
3530 }
3531 c.urlParams_.Set("alt", alt)
3532 c.urlParams_.Set("prettyPrint", "false")
3533 urls := googleapi.ResolveRelative(c.s.BasePath, "v1alpha/{+parent}/finalizedDeals")
3534 urls += "?" + c.urlParams_.Encode()
3535 req, err := http.NewRequest("GET", urls, nil)
3536 if err != nil {
3537 return nil, err
3538 }
3539 req.Header = reqHeaders
3540 googleapi.Expand(req.URL, map[string]string{
3541 "parent": c.parent,
3542 })
3543 c.s.logger.DebugContext(c.ctx_, "api request", "serviceName", apiName, "rpcName", "authorizedbuyersmarketplace.bidders.finalizedDeals.list", "request", internallog.HTTPRequest(req, nil))
3544 return gensupport.SendRequest(c.ctx_, c.s.client, req)
3545 }
3546
3547 // Do executes the "authorizedbuyersmarketplace.bidders.finalizedDeals.list" call.
3548 // Any non-2xx status code is an error. Response headers are in either
3549 // *ListFinalizedDealsResponse.ServerResponse.Header or (if a response was
3550 // returned at all) in error.(*googleapi.Error).Header. Use
3551 // googleapi.IsNotModified to check whether the returned error was because
3552 // http.StatusNotModified was returned.
3553 func (c *BiddersFinalizedDealsListCall) Do(opts ...googleapi.CallOption) (*ListFinalizedDealsResponse, error) {
3554 gensupport.SetOptions(c.urlParams_, opts...)
3555 res, err := c.doRequest("json")
3556 if res != nil && res.StatusCode == http.StatusNotModified {
3557 if res.Body != nil {
3558 res.Body.Close()
3559 }
3560 return nil, gensupport.WrapError(&googleapi.Error{
3561 Code: res.StatusCode,
3562 Header: res.Header,
3563 })
3564 }
3565 if err != nil {
3566 return nil, err
3567 }
3568 defer googleapi.CloseBody(res)
3569 if err := googleapi.CheckResponse(res); err != nil {
3570 return nil, gensupport.WrapError(err)
3571 }
3572 ret := &ListFinalizedDealsResponse{
3573 ServerResponse: googleapi.ServerResponse{
3574 Header: res.Header,
3575 HTTPStatusCode: res.StatusCode,
3576 },
3577 }
3578 target := &ret
3579 b, err := gensupport.DecodeResponseBytes(target, res)
3580 if err != nil {
3581 return nil, err
3582 }
3583 c.s.logger.DebugContext(c.ctx_, "api response", "serviceName", apiName, "rpcName", "authorizedbuyersmarketplace.bidders.finalizedDeals.list", "response", internallog.HTTPResponse(res, b))
3584 return ret, nil
3585 }
3586
3587 // Pages invokes f for each page of results.
3588 // A non-nil error returned from f will halt the iteration.
3589 // The provided context supersedes any context provided to the Context method.
3590 func (c *BiddersFinalizedDealsListCall) Pages(ctx context.Context, f func(*ListFinalizedDealsResponse) error) error {
3591 c.ctx_ = ctx
3592 defer c.PageToken(c.urlParams_.Get("pageToken"))
3593 for {
3594 x, err := c.Do()
3595 if err != nil {
3596 return err
3597 }
3598 if err := f(x); err != nil {
3599 return err
3600 }
3601 if x.NextPageToken == "" {
3602 return nil
3603 }
3604 c.PageToken(x.NextPageToken)
3605 }
3606 }
3607
3608 type BiddersFinalizedDealsSetReadyToServeCall struct {
3609 s *Service
3610 deal string
3611 setreadytoserverequest *SetReadyToServeRequest
3612 urlParams_ gensupport.URLParams
3613 ctx_ context.Context
3614 header_ http.Header
3615 }
3616
3617 // SetReadyToServe: Sets the given finalized deal as ready to serve. By
3618 // default, deals are set as ready to serve as soon as they're finalized. If
3619 // you want to opt out of the default behavior, and manually indicate that
3620 // deals are ready to serve, ask your Technical Account Manager to add you to
3621 // the allowlist. If you choose to use this method, finalized deals belonging
3622 // to the bidder and its child seats don't start serving until after you call
3623 // `setReadyToServe`, and after the deals become active. For example, you can
3624 // use this method to delay receiving bid requests until your creative is
3625 // ready. In addition, bidders can use the URL path
3626 // "/v1alpha/bidders/{accountId}/finalizedDeals/{dealId}" to set ready to serve
3627 // for the finalized deals belong to itself, its child seats and all their
3628 // clients. This method only applies to programmatic guaranteed deals.
3629 //
3630 // - deal: Format: `buyers/{accountId}/finalizedDeals/{dealId}` or
3631 // `bidders/{accountId}/finalizedDeals/{dealId}`.
3632 func (r *BiddersFinalizedDealsService) SetReadyToServe(deal string, setreadytoserverequest *SetReadyToServeRequest) *BiddersFinalizedDealsSetReadyToServeCall {
3633 c := &BiddersFinalizedDealsSetReadyToServeCall{s: r.s, urlParams_: make(gensupport.URLParams)}
3634 c.deal = deal
3635 c.setreadytoserverequest = setreadytoserverequest
3636 return c
3637 }
3638
3639 // Fields allows partial responses to be retrieved. See
3640 // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse for more
3641 // details.
3642 func (c *BiddersFinalizedDealsSetReadyToServeCall) Fields(s ...googleapi.Field) *BiddersFinalizedDealsSetReadyToServeCall {
3643 c.urlParams_.Set("fields", googleapi.CombineFields(s))
3644 return c
3645 }
3646
3647 // Context sets the context to be used in this call's Do method.
3648 func (c *BiddersFinalizedDealsSetReadyToServeCall) Context(ctx context.Context) *BiddersFinalizedDealsSetReadyToServeCall {
3649 c.ctx_ = ctx
3650 return c
3651 }
3652
3653 // Header returns a http.Header that can be modified by the caller to add
3654 // headers to the request.
3655 func (c *BiddersFinalizedDealsSetReadyToServeCall) Header() http.Header {
3656 if c.header_ == nil {
3657 c.header_ = make(http.Header)
3658 }
3659 return c.header_
3660 }
3661
3662 func (c *BiddersFinalizedDealsSetReadyToServeCall) doRequest(alt string) (*http.Response, error) {
3663 reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_)
3664 body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.setreadytoserverequest)
3665 if err != nil {
3666 return nil, err
3667 }
3668 c.urlParams_.Set("alt", alt)
3669 c.urlParams_.Set("prettyPrint", "false")
3670 urls := googleapi.ResolveRelative(c.s.BasePath, "v1alpha/{+deal}:setReadyToServe")
3671 urls += "?" + c.urlParams_.Encode()
3672 req, err := http.NewRequest("POST", urls, body)
3673 if err != nil {
3674 return nil, err
3675 }
3676 req.Header = reqHeaders
3677 googleapi.Expand(req.URL, map[string]string{
3678 "deal": c.deal,
3679 })
3680 c.s.logger.DebugContext(c.ctx_, "api request", "serviceName", apiName, "rpcName", "authorizedbuyersmarketplace.bidders.finalizedDeals.setReadyToServe", "request", internallog.HTTPRequest(req, body.Bytes()))
3681 return gensupport.SendRequest(c.ctx_, c.s.client, req)
3682 }
3683
3684 // Do executes the "authorizedbuyersmarketplace.bidders.finalizedDeals.setReadyToServe" call.
3685 // Any non-2xx status code is an error. Response headers are in either
3686 // *FinalizedDeal.ServerResponse.Header or (if a response was returned at all)
3687 // in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to check
3688 // whether the returned error was because http.StatusNotModified was returned.
3689 func (c *BiddersFinalizedDealsSetReadyToServeCall) Do(opts ...googleapi.CallOption) (*FinalizedDeal, error) {
3690 gensupport.SetOptions(c.urlParams_, opts...)
3691 res, err := c.doRequest("json")
3692 if res != nil && res.StatusCode == http.StatusNotModified {
3693 if res.Body != nil {
3694 res.Body.Close()
3695 }
3696 return nil, gensupport.WrapError(&googleapi.Error{
3697 Code: res.StatusCode,
3698 Header: res.Header,
3699 })
3700 }
3701 if err != nil {
3702 return nil, err
3703 }
3704 defer googleapi.CloseBody(res)
3705 if err := googleapi.CheckResponse(res); err != nil {
3706 return nil, gensupport.WrapError(err)
3707 }
3708 ret := &FinalizedDeal{
3709 ServerResponse: googleapi.ServerResponse{
3710 Header: res.Header,
3711 HTTPStatusCode: res.StatusCode,
3712 },
3713 }
3714 target := &ret
3715 b, err := gensupport.DecodeResponseBytes(target, res)
3716 if err != nil {
3717 return nil, err
3718 }
3719 c.s.logger.DebugContext(c.ctx_, "api response", "serviceName", apiName, "rpcName", "authorizedbuyersmarketplace.bidders.finalizedDeals.setReadyToServe", "response", internallog.HTTPResponse(res, b))
3720 return ret, nil
3721 }
3722
3723 type BuyersAuctionPackagesGetCall struct {
3724 s *Service
3725 name string
3726 urlParams_ gensupport.URLParams
3727 ifNoneMatch_ string
3728 ctx_ context.Context
3729 header_ http.Header
3730 }
3731
3732 // Get: Gets an auction package given its name.
3733 //
3734 // - name: Name of auction package to get. Format:
3735 // `buyers/{accountId}/auctionPackages/{auctionPackageId}`.
3736 func (r *BuyersAuctionPackagesService) Get(name string) *BuyersAuctionPackagesGetCall {
3737 c := &BuyersAuctionPackagesGetCall{s: r.s, urlParams_: make(gensupport.URLParams)}
3738 c.name = name
3739 return c
3740 }
3741
3742 // Fields allows partial responses to be retrieved. See
3743 // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse for more
3744 // details.
3745 func (c *BuyersAuctionPackagesGetCall) Fields(s ...googleapi.Field) *BuyersAuctionPackagesGetCall {
3746 c.urlParams_.Set("fields", googleapi.CombineFields(s))
3747 return c
3748 }
3749
3750 // IfNoneMatch sets an optional parameter which makes the operation fail if the
3751 // object's ETag matches the given value. This is useful for getting updates
3752 // only after the object has changed since the last request.
3753 func (c *BuyersAuctionPackagesGetCall) IfNoneMatch(entityTag string) *BuyersAuctionPackagesGetCall {
3754 c.ifNoneMatch_ = entityTag
3755 return c
3756 }
3757
3758 // Context sets the context to be used in this call's Do method.
3759 func (c *BuyersAuctionPackagesGetCall) Context(ctx context.Context) *BuyersAuctionPackagesGetCall {
3760 c.ctx_ = ctx
3761 return c
3762 }
3763
3764 // Header returns a http.Header that can be modified by the caller to add
3765 // headers to the request.
3766 func (c *BuyersAuctionPackagesGetCall) Header() http.Header {
3767 if c.header_ == nil {
3768 c.header_ = make(http.Header)
3769 }
3770 return c.header_
3771 }
3772
3773 func (c *BuyersAuctionPackagesGetCall) doRequest(alt string) (*http.Response, error) {
3774 reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_)
3775 if c.ifNoneMatch_ != "" {
3776 reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
3777 }
3778 c.urlParams_.Set("alt", alt)
3779 c.urlParams_.Set("prettyPrint", "false")
3780 urls := googleapi.ResolveRelative(c.s.BasePath, "v1alpha/{+name}")
3781 urls += "?" + c.urlParams_.Encode()
3782 req, err := http.NewRequest("GET", urls, nil)
3783 if err != nil {
3784 return nil, err
3785 }
3786 req.Header = reqHeaders
3787 googleapi.Expand(req.URL, map[string]string{
3788 "name": c.name,
3789 })
3790 c.s.logger.DebugContext(c.ctx_, "api request", "serviceName", apiName, "rpcName", "authorizedbuyersmarketplace.buyers.auctionPackages.get", "request", internallog.HTTPRequest(req, nil))
3791 return gensupport.SendRequest(c.ctx_, c.s.client, req)
3792 }
3793
3794 // Do executes the "authorizedbuyersmarketplace.buyers.auctionPackages.get" call.
3795 // Any non-2xx status code is an error. Response headers are in either
3796 // *AuctionPackage.ServerResponse.Header or (if a response was returned at all)
3797 // in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to check
3798 // whether the returned error was because http.StatusNotModified was returned.
3799 func (c *BuyersAuctionPackagesGetCall) Do(opts ...googleapi.CallOption) (*AuctionPackage, error) {
3800 gensupport.SetOptions(c.urlParams_, opts...)
3801 res, err := c.doRequest("json")
3802 if res != nil && res.StatusCode == http.StatusNotModified {
3803 if res.Body != nil {
3804 res.Body.Close()
3805 }
3806 return nil, gensupport.WrapError(&googleapi.Error{
3807 Code: res.StatusCode,
3808 Header: res.Header,
3809 })
3810 }
3811 if err != nil {
3812 return nil, err
3813 }
3814 defer googleapi.CloseBody(res)
3815 if err := googleapi.CheckResponse(res); err != nil {
3816 return nil, gensupport.WrapError(err)
3817 }
3818 ret := &AuctionPackage{
3819 ServerResponse: googleapi.ServerResponse{
3820 Header: res.Header,
3821 HTTPStatusCode: res.StatusCode,
3822 },
3823 }
3824 target := &ret
3825 b, err := gensupport.DecodeResponseBytes(target, res)
3826 if err != nil {
3827 return nil, err
3828 }
3829 c.s.logger.DebugContext(c.ctx_, "api response", "serviceName", apiName, "rpcName", "authorizedbuyersmarketplace.buyers.auctionPackages.get", "response", internallog.HTTPResponse(res, b))
3830 return ret, nil
3831 }
3832
3833 type BuyersAuctionPackagesListCall struct {
3834 s *Service
3835 parent string
3836 urlParams_ gensupport.URLParams
3837 ifNoneMatch_ string
3838 ctx_ context.Context
3839 header_ http.Header
3840 }
3841
3842 // List: List the auction packages. Buyers can use the URL path
3843 // "/v1alpha/buyers/{accountId}/auctionPackages" to list auction packages for
3844 // the current buyer and its clients. Bidders can use the URL path
3845 // "/v1alpha/bidders/{accountId}/auctionPackages" to list auction packages for
3846 // the bidder, its media planners, its buyers, and all their clients.
3847 //
3848 // - parent: Name of the parent buyer that can access the auction package.
3849 // Format: `buyers/{accountId}`. When used with a bidder account, the auction
3850 // packages that the bidder, its media planners, its buyers and clients are
3851 // subscribed to will be listed, in the format `bidders/{accountId}`.
3852 func (r *BuyersAuctionPackagesService) List(parent string) *BuyersAuctionPackagesListCall {
3853 c := &BuyersAuctionPackagesListCall{s: r.s, urlParams_: make(gensupport.URLParams)}
3854 c.parent = parent
3855 return c
3856 }
3857
3858 // Filter sets the optional parameter "filter": Optional query string using the
3859 // Cloud API list filtering syntax
3860 // (/authorized-buyers/apis/guides/list-filters). Only supported when parent is
3861 // bidder. Supported columns for filtering are: * displayName * createTime *
3862 // updateTime * eligibleSeatIds
3863 func (c *BuyersAuctionPackagesListCall) Filter(filter string) *BuyersAuctionPackagesListCall {
3864 c.urlParams_.Set("filter", filter)
3865 return c
3866 }
3867
3868 // OrderBy sets the optional parameter "orderBy": An optional query string to
3869 // sort auction packages using the Cloud API sorting syntax
3870 // (https://cloud.google.com/apis/design/design_patterns#sorting_order). If no
3871 // sort order is specified, results will be returned in an arbitrary order.
3872 // Only supported when parent is bidder. Supported columns for sorting are: *
3873 // displayName * createTime * updateTime
3874 func (c *BuyersAuctionPackagesListCall) OrderBy(orderBy string) *BuyersAuctionPackagesListCall {
3875 c.urlParams_.Set("orderBy", orderBy)
3876 return c
3877 }
3878
3879 // PageSize sets the optional parameter "pageSize": Requested page size. The
3880 // server may return fewer results than requested. Max allowed page size is
3881 // 500.
3882 func (c *BuyersAuctionPackagesListCall) PageSize(pageSize int64) *BuyersAuctionPackagesListCall {
3883 c.urlParams_.Set("pageSize", fmt.Sprint(pageSize))
3884 return c
3885 }
3886
3887 // PageToken sets the optional parameter "pageToken": The page token as
3888 // returned. ListAuctionPackagesResponse.nextPageToken
3889 func (c *BuyersAuctionPackagesListCall) PageToken(pageToken string) *BuyersAuctionPackagesListCall {
3890 c.urlParams_.Set("pageToken", pageToken)
3891 return c
3892 }
3893
3894 // Fields allows partial responses to be retrieved. See
3895 // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse for more
3896 // details.
3897 func (c *BuyersAuctionPackagesListCall) Fields(s ...googleapi.Field) *BuyersAuctionPackagesListCall {
3898 c.urlParams_.Set("fields", googleapi.CombineFields(s))
3899 return c
3900 }
3901
3902 // IfNoneMatch sets an optional parameter which makes the operation fail if the
3903 // object's ETag matches the given value. This is useful for getting updates
3904 // only after the object has changed since the last request.
3905 func (c *BuyersAuctionPackagesListCall) IfNoneMatch(entityTag string) *BuyersAuctionPackagesListCall {
3906 c.ifNoneMatch_ = entityTag
3907 return c
3908 }
3909
3910 // Context sets the context to be used in this call's Do method.
3911 func (c *BuyersAuctionPackagesListCall) Context(ctx context.Context) *BuyersAuctionPackagesListCall {
3912 c.ctx_ = ctx
3913 return c
3914 }
3915
3916 // Header returns a http.Header that can be modified by the caller to add
3917 // headers to the request.
3918 func (c *BuyersAuctionPackagesListCall) Header() http.Header {
3919 if c.header_ == nil {
3920 c.header_ = make(http.Header)
3921 }
3922 return c.header_
3923 }
3924
3925 func (c *BuyersAuctionPackagesListCall) doRequest(alt string) (*http.Response, error) {
3926 reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_)
3927 if c.ifNoneMatch_ != "" {
3928 reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
3929 }
3930 c.urlParams_.Set("alt", alt)
3931 c.urlParams_.Set("prettyPrint", "false")
3932 urls := googleapi.ResolveRelative(c.s.BasePath, "v1alpha/{+parent}/auctionPackages")
3933 urls += "?" + c.urlParams_.Encode()
3934 req, err := http.NewRequest("GET", urls, nil)
3935 if err != nil {
3936 return nil, err
3937 }
3938 req.Header = reqHeaders
3939 googleapi.Expand(req.URL, map[string]string{
3940 "parent": c.parent,
3941 })
3942 c.s.logger.DebugContext(c.ctx_, "api request", "serviceName", apiName, "rpcName", "authorizedbuyersmarketplace.buyers.auctionPackages.list", "request", internallog.HTTPRequest(req, nil))
3943 return gensupport.SendRequest(c.ctx_, c.s.client, req)
3944 }
3945
3946 // Do executes the "authorizedbuyersmarketplace.buyers.auctionPackages.list" call.
3947 // Any non-2xx status code is an error. Response headers are in either
3948 // *ListAuctionPackagesResponse.ServerResponse.Header or (if a response was
3949 // returned at all) in error.(*googleapi.Error).Header. Use
3950 // googleapi.IsNotModified to check whether the returned error was because
3951 // http.StatusNotModified was returned.
3952 func (c *BuyersAuctionPackagesListCall) Do(opts ...googleapi.CallOption) (*ListAuctionPackagesResponse, error) {
3953 gensupport.SetOptions(c.urlParams_, opts...)
3954 res, err := c.doRequest("json")
3955 if res != nil && res.StatusCode == http.StatusNotModified {
3956 if res.Body != nil {
3957 res.Body.Close()
3958 }
3959 return nil, gensupport.WrapError(&googleapi.Error{
3960 Code: res.StatusCode,
3961 Header: res.Header,
3962 })
3963 }
3964 if err != nil {
3965 return nil, err
3966 }
3967 defer googleapi.CloseBody(res)
3968 if err := googleapi.CheckResponse(res); err != nil {
3969 return nil, gensupport.WrapError(err)
3970 }
3971 ret := &ListAuctionPackagesResponse{
3972 ServerResponse: googleapi.ServerResponse{
3973 Header: res.Header,
3974 HTTPStatusCode: res.StatusCode,
3975 },
3976 }
3977 target := &ret
3978 b, err := gensupport.DecodeResponseBytes(target, res)
3979 if err != nil {
3980 return nil, err
3981 }
3982 c.s.logger.DebugContext(c.ctx_, "api response", "serviceName", apiName, "rpcName", "authorizedbuyersmarketplace.buyers.auctionPackages.list", "response", internallog.HTTPResponse(res, b))
3983 return ret, nil
3984 }
3985
3986 // Pages invokes f for each page of results.
3987 // A non-nil error returned from f will halt the iteration.
3988 // The provided context supersedes any context provided to the Context method.
3989 func (c *BuyersAuctionPackagesListCall) Pages(ctx context.Context, f func(*ListAuctionPackagesResponse) error) error {
3990 c.ctx_ = ctx
3991 defer c.PageToken(c.urlParams_.Get("pageToken"))
3992 for {
3993 x, err := c.Do()
3994 if err != nil {
3995 return err
3996 }
3997 if err := f(x); err != nil {
3998 return err
3999 }
4000 if x.NextPageToken == "" {
4001 return nil
4002 }
4003 c.PageToken(x.NextPageToken)
4004 }
4005 }
4006
4007 type BuyersAuctionPackagesSubscribeCall struct {
4008 s *Service
4009 name string
4010 subscribeauctionpackagerequest *SubscribeAuctionPackageRequest
4011 urlParams_ gensupport.URLParams
4012 ctx_ context.Context
4013 header_ http.Header
4014 }
4015
4016 // Subscribe: Subscribe to the auction package for the specified buyer. Once
4017 // subscribed, the bidder will receive a call out for inventory matching the
4018 // auction package targeting criteria with the auction package deal ID and the
4019 // specified buyer.
4020 //
4021 // - name: Name of the auction package. Format:
4022 // `buyers/{accountId}/auctionPackages/{auctionPackageId}`.
4023 func (r *BuyersAuctionPackagesService) Subscribe(name string, subscribeauctionpackagerequest *SubscribeAuctionPackageRequest) *BuyersAuctionPackagesSubscribeCall {
4024 c := &BuyersAuctionPackagesSubscribeCall{s: r.s, urlParams_: make(gensupport.URLParams)}
4025 c.name = name
4026 c.subscribeauctionpackagerequest = subscribeauctionpackagerequest
4027 return c
4028 }
4029
4030 // Fields allows partial responses to be retrieved. See
4031 // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse for more
4032 // details.
4033 func (c *BuyersAuctionPackagesSubscribeCall) Fields(s ...googleapi.Field) *BuyersAuctionPackagesSubscribeCall {
4034 c.urlParams_.Set("fields", googleapi.CombineFields(s))
4035 return c
4036 }
4037
4038 // Context sets the context to be used in this call's Do method.
4039 func (c *BuyersAuctionPackagesSubscribeCall) Context(ctx context.Context) *BuyersAuctionPackagesSubscribeCall {
4040 c.ctx_ = ctx
4041 return c
4042 }
4043
4044 // Header returns a http.Header that can be modified by the caller to add
4045 // headers to the request.
4046 func (c *BuyersAuctionPackagesSubscribeCall) Header() http.Header {
4047 if c.header_ == nil {
4048 c.header_ = make(http.Header)
4049 }
4050 return c.header_
4051 }
4052
4053 func (c *BuyersAuctionPackagesSubscribeCall) doRequest(alt string) (*http.Response, error) {
4054 reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_)
4055 body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.subscribeauctionpackagerequest)
4056 if err != nil {
4057 return nil, err
4058 }
4059 c.urlParams_.Set("alt", alt)
4060 c.urlParams_.Set("prettyPrint", "false")
4061 urls := googleapi.ResolveRelative(c.s.BasePath, "v1alpha/{+name}:subscribe")
4062 urls += "?" + c.urlParams_.Encode()
4063 req, err := http.NewRequest("POST", urls, body)
4064 if err != nil {
4065 return nil, err
4066 }
4067 req.Header = reqHeaders
4068 googleapi.Expand(req.URL, map[string]string{
4069 "name": c.name,
4070 })
4071 c.s.logger.DebugContext(c.ctx_, "api request", "serviceName", apiName, "rpcName", "authorizedbuyersmarketplace.buyers.auctionPackages.subscribe", "request", internallog.HTTPRequest(req, body.Bytes()))
4072 return gensupport.SendRequest(c.ctx_, c.s.client, req)
4073 }
4074
4075 // Do executes the "authorizedbuyersmarketplace.buyers.auctionPackages.subscribe" call.
4076 // Any non-2xx status code is an error. Response headers are in either
4077 // *AuctionPackage.ServerResponse.Header or (if a response was returned at all)
4078 // in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to check
4079 // whether the returned error was because http.StatusNotModified was returned.
4080 func (c *BuyersAuctionPackagesSubscribeCall) Do(opts ...googleapi.CallOption) (*AuctionPackage, error) {
4081 gensupport.SetOptions(c.urlParams_, opts...)
4082 res, err := c.doRequest("json")
4083 if res != nil && res.StatusCode == http.StatusNotModified {
4084 if res.Body != nil {
4085 res.Body.Close()
4086 }
4087 return nil, gensupport.WrapError(&googleapi.Error{
4088 Code: res.StatusCode,
4089 Header: res.Header,
4090 })
4091 }
4092 if err != nil {
4093 return nil, err
4094 }
4095 defer googleapi.CloseBody(res)
4096 if err := googleapi.CheckResponse(res); err != nil {
4097 return nil, gensupport.WrapError(err)
4098 }
4099 ret := &AuctionPackage{
4100 ServerResponse: googleapi.ServerResponse{
4101 Header: res.Header,
4102 HTTPStatusCode: res.StatusCode,
4103 },
4104 }
4105 target := &ret
4106 b, err := gensupport.DecodeResponseBytes(target, res)
4107 if err != nil {
4108 return nil, err
4109 }
4110 c.s.logger.DebugContext(c.ctx_, "api response", "serviceName", apiName, "rpcName", "authorizedbuyersmarketplace.buyers.auctionPackages.subscribe", "response", internallog.HTTPResponse(res, b))
4111 return ret, nil
4112 }
4113
4114 type BuyersAuctionPackagesSubscribeClientsCall struct {
4115 s *Service
4116 auctionPackage string
4117 subscribeclientsrequest *SubscribeClientsRequest
4118 urlParams_ gensupport.URLParams
4119 ctx_ context.Context
4120 header_ http.Header
4121 }
4122
4123 // SubscribeClients: Subscribe the specified clients of the buyer to the
4124 // auction package. If a client in the list does not belong to the buyer, an
4125 // error response will be returned, and all of the following clients in the
4126 // list will not be subscribed. Subscribing an already subscribed client will
4127 // have no effect.
4128 //
4129 // - auctionPackage: Name of the auction package. Format:
4130 // `buyers/{accountId}/auctionPackages/{auctionPackageId}`.
4131 func (r *BuyersAuctionPackagesService) SubscribeClients(auctionPackage string, subscribeclientsrequest *SubscribeClientsRequest) *BuyersAuctionPackagesSubscribeClientsCall {
4132 c := &BuyersAuctionPackagesSubscribeClientsCall{s: r.s, urlParams_: make(gensupport.URLParams)}
4133 c.auctionPackage = auctionPackage
4134 c.subscribeclientsrequest = subscribeclientsrequest
4135 return c
4136 }
4137
4138 // Fields allows partial responses to be retrieved. See
4139 // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse for more
4140 // details.
4141 func (c *BuyersAuctionPackagesSubscribeClientsCall) Fields(s ...googleapi.Field) *BuyersAuctionPackagesSubscribeClientsCall {
4142 c.urlParams_.Set("fields", googleapi.CombineFields(s))
4143 return c
4144 }
4145
4146 // Context sets the context to be used in this call's Do method.
4147 func (c *BuyersAuctionPackagesSubscribeClientsCall) Context(ctx context.Context) *BuyersAuctionPackagesSubscribeClientsCall {
4148 c.ctx_ = ctx
4149 return c
4150 }
4151
4152 // Header returns a http.Header that can be modified by the caller to add
4153 // headers to the request.
4154 func (c *BuyersAuctionPackagesSubscribeClientsCall) Header() http.Header {
4155 if c.header_ == nil {
4156 c.header_ = make(http.Header)
4157 }
4158 return c.header_
4159 }
4160
4161 func (c *BuyersAuctionPackagesSubscribeClientsCall) doRequest(alt string) (*http.Response, error) {
4162 reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_)
4163 body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.subscribeclientsrequest)
4164 if err != nil {
4165 return nil, err
4166 }
4167 c.urlParams_.Set("alt", alt)
4168 c.urlParams_.Set("prettyPrint", "false")
4169 urls := googleapi.ResolveRelative(c.s.BasePath, "v1alpha/{+auctionPackage}:subscribeClients")
4170 urls += "?" + c.urlParams_.Encode()
4171 req, err := http.NewRequest("POST", urls, body)
4172 if err != nil {
4173 return nil, err
4174 }
4175 req.Header = reqHeaders
4176 googleapi.Expand(req.URL, map[string]string{
4177 "auctionPackage": c.auctionPackage,
4178 })
4179 c.s.logger.DebugContext(c.ctx_, "api request", "serviceName", apiName, "rpcName", "authorizedbuyersmarketplace.buyers.auctionPackages.subscribeClients", "request", internallog.HTTPRequest(req, body.Bytes()))
4180 return gensupport.SendRequest(c.ctx_, c.s.client, req)
4181 }
4182
4183 // Do executes the "authorizedbuyersmarketplace.buyers.auctionPackages.subscribeClients" call.
4184 // Any non-2xx status code is an error. Response headers are in either
4185 // *AuctionPackage.ServerResponse.Header or (if a response was returned at all)
4186 // in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to check
4187 // whether the returned error was because http.StatusNotModified was returned.
4188 func (c *BuyersAuctionPackagesSubscribeClientsCall) Do(opts ...googleapi.CallOption) (*AuctionPackage, error) {
4189 gensupport.SetOptions(c.urlParams_, opts...)
4190 res, err := c.doRequest("json")
4191 if res != nil && res.StatusCode == http.StatusNotModified {
4192 if res.Body != nil {
4193 res.Body.Close()
4194 }
4195 return nil, gensupport.WrapError(&googleapi.Error{
4196 Code: res.StatusCode,
4197 Header: res.Header,
4198 })
4199 }
4200 if err != nil {
4201 return nil, err
4202 }
4203 defer googleapi.CloseBody(res)
4204 if err := googleapi.CheckResponse(res); err != nil {
4205 return nil, gensupport.WrapError(err)
4206 }
4207 ret := &AuctionPackage{
4208 ServerResponse: googleapi.ServerResponse{
4209 Header: res.Header,
4210 HTTPStatusCode: res.StatusCode,
4211 },
4212 }
4213 target := &ret
4214 b, err := gensupport.DecodeResponseBytes(target, res)
4215 if err != nil {
4216 return nil, err
4217 }
4218 c.s.logger.DebugContext(c.ctx_, "api response", "serviceName", apiName, "rpcName", "authorizedbuyersmarketplace.buyers.auctionPackages.subscribeClients", "response", internallog.HTTPResponse(res, b))
4219 return ret, nil
4220 }
4221
4222 type BuyersAuctionPackagesUnsubscribeCall struct {
4223 s *Service
4224 name string
4225 unsubscribeauctionpackagerequest *UnsubscribeAuctionPackageRequest
4226 urlParams_ gensupport.URLParams
4227 ctx_ context.Context
4228 header_ http.Header
4229 }
4230
4231 // Unsubscribe: Unsubscribe from the auction package for the specified buyer.
4232 // Once unsubscribed, the bidder will no longer receive a call out for the
4233 // auction package deal ID and the specified buyer.
4234 //
4235 // - name: Name of the auction package. Format:
4236 // `buyers/{accountId}/auctionPackages/{auctionPackageId}`.
4237 func (r *BuyersAuctionPackagesService) Unsubscribe(name string, unsubscribeauctionpackagerequest *UnsubscribeAuctionPackageRequest) *BuyersAuctionPackagesUnsubscribeCall {
4238 c := &BuyersAuctionPackagesUnsubscribeCall{s: r.s, urlParams_: make(gensupport.URLParams)}
4239 c.name = name
4240 c.unsubscribeauctionpackagerequest = unsubscribeauctionpackagerequest
4241 return c
4242 }
4243
4244 // Fields allows partial responses to be retrieved. See
4245 // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse for more
4246 // details.
4247 func (c *BuyersAuctionPackagesUnsubscribeCall) Fields(s ...googleapi.Field) *BuyersAuctionPackagesUnsubscribeCall {
4248 c.urlParams_.Set("fields", googleapi.CombineFields(s))
4249 return c
4250 }
4251
4252 // Context sets the context to be used in this call's Do method.
4253 func (c *BuyersAuctionPackagesUnsubscribeCall) Context(ctx context.Context) *BuyersAuctionPackagesUnsubscribeCall {
4254 c.ctx_ = ctx
4255 return c
4256 }
4257
4258 // Header returns a http.Header that can be modified by the caller to add
4259 // headers to the request.
4260 func (c *BuyersAuctionPackagesUnsubscribeCall) Header() http.Header {
4261 if c.header_ == nil {
4262 c.header_ = make(http.Header)
4263 }
4264 return c.header_
4265 }
4266
4267 func (c *BuyersAuctionPackagesUnsubscribeCall) doRequest(alt string) (*http.Response, error) {
4268 reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_)
4269 body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.unsubscribeauctionpackagerequest)
4270 if err != nil {
4271 return nil, err
4272 }
4273 c.urlParams_.Set("alt", alt)
4274 c.urlParams_.Set("prettyPrint", "false")
4275 urls := googleapi.ResolveRelative(c.s.BasePath, "v1alpha/{+name}:unsubscribe")
4276 urls += "?" + c.urlParams_.Encode()
4277 req, err := http.NewRequest("POST", urls, body)
4278 if err != nil {
4279 return nil, err
4280 }
4281 req.Header = reqHeaders
4282 googleapi.Expand(req.URL, map[string]string{
4283 "name": c.name,
4284 })
4285 c.s.logger.DebugContext(c.ctx_, "api request", "serviceName", apiName, "rpcName", "authorizedbuyersmarketplace.buyers.auctionPackages.unsubscribe", "request", internallog.HTTPRequest(req, body.Bytes()))
4286 return gensupport.SendRequest(c.ctx_, c.s.client, req)
4287 }
4288
4289 // Do executes the "authorizedbuyersmarketplace.buyers.auctionPackages.unsubscribe" call.
4290 // Any non-2xx status code is an error. Response headers are in either
4291 // *AuctionPackage.ServerResponse.Header or (if a response was returned at all)
4292 // in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to check
4293 // whether the returned error was because http.StatusNotModified was returned.
4294 func (c *BuyersAuctionPackagesUnsubscribeCall) Do(opts ...googleapi.CallOption) (*AuctionPackage, error) {
4295 gensupport.SetOptions(c.urlParams_, opts...)
4296 res, err := c.doRequest("json")
4297 if res != nil && res.StatusCode == http.StatusNotModified {
4298 if res.Body != nil {
4299 res.Body.Close()
4300 }
4301 return nil, gensupport.WrapError(&googleapi.Error{
4302 Code: res.StatusCode,
4303 Header: res.Header,
4304 })
4305 }
4306 if err != nil {
4307 return nil, err
4308 }
4309 defer googleapi.CloseBody(res)
4310 if err := googleapi.CheckResponse(res); err != nil {
4311 return nil, gensupport.WrapError(err)
4312 }
4313 ret := &AuctionPackage{
4314 ServerResponse: googleapi.ServerResponse{
4315 Header: res.Header,
4316 HTTPStatusCode: res.StatusCode,
4317 },
4318 }
4319 target := &ret
4320 b, err := gensupport.DecodeResponseBytes(target, res)
4321 if err != nil {
4322 return nil, err
4323 }
4324 c.s.logger.DebugContext(c.ctx_, "api response", "serviceName", apiName, "rpcName", "authorizedbuyersmarketplace.buyers.auctionPackages.unsubscribe", "response", internallog.HTTPResponse(res, b))
4325 return ret, nil
4326 }
4327
4328 type BuyersAuctionPackagesUnsubscribeClientsCall struct {
4329 s *Service
4330 auctionPackage string
4331 unsubscribeclientsrequest *UnsubscribeClientsRequest
4332 urlParams_ gensupport.URLParams
4333 ctx_ context.Context
4334 header_ http.Header
4335 }
4336
4337 // UnsubscribeClients: Unsubscribe from the auction package for the specified
4338 // clients of the buyer. Unsubscribing a client that is not subscribed will
4339 // have no effect.
4340 //
4341 // - auctionPackage: Name of the auction package. Format:
4342 // `buyers/{accountId}/auctionPackages/{auctionPackageId}`.
4343 func (r *BuyersAuctionPackagesService) UnsubscribeClients(auctionPackage string, unsubscribeclientsrequest *UnsubscribeClientsRequest) *BuyersAuctionPackagesUnsubscribeClientsCall {
4344 c := &BuyersAuctionPackagesUnsubscribeClientsCall{s: r.s, urlParams_: make(gensupport.URLParams)}
4345 c.auctionPackage = auctionPackage
4346 c.unsubscribeclientsrequest = unsubscribeclientsrequest
4347 return c
4348 }
4349
4350 // Fields allows partial responses to be retrieved. See
4351 // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse for more
4352 // details.
4353 func (c *BuyersAuctionPackagesUnsubscribeClientsCall) Fields(s ...googleapi.Field) *BuyersAuctionPackagesUnsubscribeClientsCall {
4354 c.urlParams_.Set("fields", googleapi.CombineFields(s))
4355 return c
4356 }
4357
4358 // Context sets the context to be used in this call's Do method.
4359 func (c *BuyersAuctionPackagesUnsubscribeClientsCall) Context(ctx context.Context) *BuyersAuctionPackagesUnsubscribeClientsCall {
4360 c.ctx_ = ctx
4361 return c
4362 }
4363
4364 // Header returns a http.Header that can be modified by the caller to add
4365 // headers to the request.
4366 func (c *BuyersAuctionPackagesUnsubscribeClientsCall) Header() http.Header {
4367 if c.header_ == nil {
4368 c.header_ = make(http.Header)
4369 }
4370 return c.header_
4371 }
4372
4373 func (c *BuyersAuctionPackagesUnsubscribeClientsCall) doRequest(alt string) (*http.Response, error) {
4374 reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_)
4375 body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.unsubscribeclientsrequest)
4376 if err != nil {
4377 return nil, err
4378 }
4379 c.urlParams_.Set("alt", alt)
4380 c.urlParams_.Set("prettyPrint", "false")
4381 urls := googleapi.ResolveRelative(c.s.BasePath, "v1alpha/{+auctionPackage}:unsubscribeClients")
4382 urls += "?" + c.urlParams_.Encode()
4383 req, err := http.NewRequest("POST", urls, body)
4384 if err != nil {
4385 return nil, err
4386 }
4387 req.Header = reqHeaders
4388 googleapi.Expand(req.URL, map[string]string{
4389 "auctionPackage": c.auctionPackage,
4390 })
4391 c.s.logger.DebugContext(c.ctx_, "api request", "serviceName", apiName, "rpcName", "authorizedbuyersmarketplace.buyers.auctionPackages.unsubscribeClients", "request", internallog.HTTPRequest(req, body.Bytes()))
4392 return gensupport.SendRequest(c.ctx_, c.s.client, req)
4393 }
4394
4395 // Do executes the "authorizedbuyersmarketplace.buyers.auctionPackages.unsubscribeClients" call.
4396 // Any non-2xx status code is an error. Response headers are in either
4397 // *AuctionPackage.ServerResponse.Header or (if a response was returned at all)
4398 // in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to check
4399 // whether the returned error was because http.StatusNotModified was returned.
4400 func (c *BuyersAuctionPackagesUnsubscribeClientsCall) Do(opts ...googleapi.CallOption) (*AuctionPackage, error) {
4401 gensupport.SetOptions(c.urlParams_, opts...)
4402 res, err := c.doRequest("json")
4403 if res != nil && res.StatusCode == http.StatusNotModified {
4404 if res.Body != nil {
4405 res.Body.Close()
4406 }
4407 return nil, gensupport.WrapError(&googleapi.Error{
4408 Code: res.StatusCode,
4409 Header: res.Header,
4410 })
4411 }
4412 if err != nil {
4413 return nil, err
4414 }
4415 defer googleapi.CloseBody(res)
4416 if err := googleapi.CheckResponse(res); err != nil {
4417 return nil, gensupport.WrapError(err)
4418 }
4419 ret := &AuctionPackage{
4420 ServerResponse: googleapi.ServerResponse{
4421 Header: res.Header,
4422 HTTPStatusCode: res.StatusCode,
4423 },
4424 }
4425 target := &ret
4426 b, err := gensupport.DecodeResponseBytes(target, res)
4427 if err != nil {
4428 return nil, err
4429 }
4430 c.s.logger.DebugContext(c.ctx_, "api response", "serviceName", apiName, "rpcName", "authorizedbuyersmarketplace.buyers.auctionPackages.unsubscribeClients", "response", internallog.HTTPResponse(res, b))
4431 return ret, nil
4432 }
4433
4434 type BuyersClientsActivateCall struct {
4435 s *Service
4436 name string
4437 activateclientrequest *ActivateClientRequest
4438 urlParams_ gensupport.URLParams
4439 ctx_ context.Context
4440 header_ http.Header
4441 }
4442
4443 // Activate: Activates an existing client. The state of the client will be
4444 // updated to "ACTIVE". This method has no effect if the client is already in
4445 // "ACTIVE" state.
4446 //
4447 // - name: Format: `buyers/{buyerAccountId}/clients/{clientAccountId}`.
4448 func (r *BuyersClientsService) Activate(name string, activateclientrequest *ActivateClientRequest) *BuyersClientsActivateCall {
4449 c := &BuyersClientsActivateCall{s: r.s, urlParams_: make(gensupport.URLParams)}
4450 c.name = name
4451 c.activateclientrequest = activateclientrequest
4452 return c
4453 }
4454
4455 // Fields allows partial responses to be retrieved. See
4456 // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse for more
4457 // details.
4458 func (c *BuyersClientsActivateCall) Fields(s ...googleapi.Field) *BuyersClientsActivateCall {
4459 c.urlParams_.Set("fields", googleapi.CombineFields(s))
4460 return c
4461 }
4462
4463 // Context sets the context to be used in this call's Do method.
4464 func (c *BuyersClientsActivateCall) Context(ctx context.Context) *BuyersClientsActivateCall {
4465 c.ctx_ = ctx
4466 return c
4467 }
4468
4469 // Header returns a http.Header that can be modified by the caller to add
4470 // headers to the request.
4471 func (c *BuyersClientsActivateCall) Header() http.Header {
4472 if c.header_ == nil {
4473 c.header_ = make(http.Header)
4474 }
4475 return c.header_
4476 }
4477
4478 func (c *BuyersClientsActivateCall) doRequest(alt string) (*http.Response, error) {
4479 reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_)
4480 body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.activateclientrequest)
4481 if err != nil {
4482 return nil, err
4483 }
4484 c.urlParams_.Set("alt", alt)
4485 c.urlParams_.Set("prettyPrint", "false")
4486 urls := googleapi.ResolveRelative(c.s.BasePath, "v1alpha/{+name}:activate")
4487 urls += "?" + c.urlParams_.Encode()
4488 req, err := http.NewRequest("POST", urls, body)
4489 if err != nil {
4490 return nil, err
4491 }
4492 req.Header = reqHeaders
4493 googleapi.Expand(req.URL, map[string]string{
4494 "name": c.name,
4495 })
4496 c.s.logger.DebugContext(c.ctx_, "api request", "serviceName", apiName, "rpcName", "authorizedbuyersmarketplace.buyers.clients.activate", "request", internallog.HTTPRequest(req, body.Bytes()))
4497 return gensupport.SendRequest(c.ctx_, c.s.client, req)
4498 }
4499
4500 // Do executes the "authorizedbuyersmarketplace.buyers.clients.activate" call.
4501 // Any non-2xx status code is an error. Response headers are in either
4502 // *Client.ServerResponse.Header or (if a response was returned at all) in
4503 // error.(*googleapi.Error).Header. Use googleapi.IsNotModified to check
4504 // whether the returned error was because http.StatusNotModified was returned.
4505 func (c *BuyersClientsActivateCall) Do(opts ...googleapi.CallOption) (*Client, error) {
4506 gensupport.SetOptions(c.urlParams_, opts...)
4507 res, err := c.doRequest("json")
4508 if res != nil && res.StatusCode == http.StatusNotModified {
4509 if res.Body != nil {
4510 res.Body.Close()
4511 }
4512 return nil, gensupport.WrapError(&googleapi.Error{
4513 Code: res.StatusCode,
4514 Header: res.Header,
4515 })
4516 }
4517 if err != nil {
4518 return nil, err
4519 }
4520 defer googleapi.CloseBody(res)
4521 if err := googleapi.CheckResponse(res); err != nil {
4522 return nil, gensupport.WrapError(err)
4523 }
4524 ret := &Client{
4525 ServerResponse: googleapi.ServerResponse{
4526 Header: res.Header,
4527 HTTPStatusCode: res.StatusCode,
4528 },
4529 }
4530 target := &ret
4531 b, err := gensupport.DecodeResponseBytes(target, res)
4532 if err != nil {
4533 return nil, err
4534 }
4535 c.s.logger.DebugContext(c.ctx_, "api response", "serviceName", apiName, "rpcName", "authorizedbuyersmarketplace.buyers.clients.activate", "response", internallog.HTTPResponse(res, b))
4536 return ret, nil
4537 }
4538
4539 type BuyersClientsCreateCall struct {
4540 s *Service
4541 parent string
4542 client *Client
4543 urlParams_ gensupport.URLParams
4544 ctx_ context.Context
4545 header_ http.Header
4546 }
4547
4548 // Create: Creates a new client.
4549 //
4550 // - parent: The name of the buyer. Format: `buyers/{accountId}`.
4551 func (r *BuyersClientsService) Create(parent string, client *Client) *BuyersClientsCreateCall {
4552 c := &BuyersClientsCreateCall{s: r.s, urlParams_: make(gensupport.URLParams)}
4553 c.parent = parent
4554 c.client = client
4555 return c
4556 }
4557
4558 // Fields allows partial responses to be retrieved. See
4559 // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse for more
4560 // details.
4561 func (c *BuyersClientsCreateCall) Fields(s ...googleapi.Field) *BuyersClientsCreateCall {
4562 c.urlParams_.Set("fields", googleapi.CombineFields(s))
4563 return c
4564 }
4565
4566 // Context sets the context to be used in this call's Do method.
4567 func (c *BuyersClientsCreateCall) Context(ctx context.Context) *BuyersClientsCreateCall {
4568 c.ctx_ = ctx
4569 return c
4570 }
4571
4572 // Header returns a http.Header that can be modified by the caller to add
4573 // headers to the request.
4574 func (c *BuyersClientsCreateCall) Header() http.Header {
4575 if c.header_ == nil {
4576 c.header_ = make(http.Header)
4577 }
4578 return c.header_
4579 }
4580
4581 func (c *BuyersClientsCreateCall) doRequest(alt string) (*http.Response, error) {
4582 reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_)
4583 body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.client)
4584 if err != nil {
4585 return nil, err
4586 }
4587 c.urlParams_.Set("alt", alt)
4588 c.urlParams_.Set("prettyPrint", "false")
4589 urls := googleapi.ResolveRelative(c.s.BasePath, "v1alpha/{+parent}/clients")
4590 urls += "?" + c.urlParams_.Encode()
4591 req, err := http.NewRequest("POST", urls, body)
4592 if err != nil {
4593 return nil, err
4594 }
4595 req.Header = reqHeaders
4596 googleapi.Expand(req.URL, map[string]string{
4597 "parent": c.parent,
4598 })
4599 c.s.logger.DebugContext(c.ctx_, "api request", "serviceName", apiName, "rpcName", "authorizedbuyersmarketplace.buyers.clients.create", "request", internallog.HTTPRequest(req, body.Bytes()))
4600 return gensupport.SendRequest(c.ctx_, c.s.client, req)
4601 }
4602
4603 // Do executes the "authorizedbuyersmarketplace.buyers.clients.create" call.
4604 // Any non-2xx status code is an error. Response headers are in either
4605 // *Client.ServerResponse.Header or (if a response was returned at all) in
4606 // error.(*googleapi.Error).Header. Use googleapi.IsNotModified to check
4607 // whether the returned error was because http.StatusNotModified was returned.
4608 func (c *BuyersClientsCreateCall) Do(opts ...googleapi.CallOption) (*Client, error) {
4609 gensupport.SetOptions(c.urlParams_, opts...)
4610 res, err := c.doRequest("json")
4611 if res != nil && res.StatusCode == http.StatusNotModified {
4612 if res.Body != nil {
4613 res.Body.Close()
4614 }
4615 return nil, gensupport.WrapError(&googleapi.Error{
4616 Code: res.StatusCode,
4617 Header: res.Header,
4618 })
4619 }
4620 if err != nil {
4621 return nil, err
4622 }
4623 defer googleapi.CloseBody(res)
4624 if err := googleapi.CheckResponse(res); err != nil {
4625 return nil, gensupport.WrapError(err)
4626 }
4627 ret := &Client{
4628 ServerResponse: googleapi.ServerResponse{
4629 Header: res.Header,
4630 HTTPStatusCode: res.StatusCode,
4631 },
4632 }
4633 target := &ret
4634 b, err := gensupport.DecodeResponseBytes(target, res)
4635 if err != nil {
4636 return nil, err
4637 }
4638 c.s.logger.DebugContext(c.ctx_, "api response", "serviceName", apiName, "rpcName", "authorizedbuyersmarketplace.buyers.clients.create", "response", internallog.HTTPResponse(res, b))
4639 return ret, nil
4640 }
4641
4642 type BuyersClientsDeactivateCall struct {
4643 s *Service
4644 name string
4645 deactivateclientrequest *DeactivateClientRequest
4646 urlParams_ gensupport.URLParams
4647 ctx_ context.Context
4648 header_ http.Header
4649 }
4650
4651 // Deactivate: Deactivates an existing client. The state of the client will be
4652 // updated to "INACTIVE". This method has no effect if the client is already in
4653 // "INACTIVE" state.
4654 //
4655 // - name: Format: `buyers/{buyerAccountId}/clients/{clientAccountId}`.
4656 func (r *BuyersClientsService) Deactivate(name string, deactivateclientrequest *DeactivateClientRequest) *BuyersClientsDeactivateCall {
4657 c := &BuyersClientsDeactivateCall{s: r.s, urlParams_: make(gensupport.URLParams)}
4658 c.name = name
4659 c.deactivateclientrequest = deactivateclientrequest
4660 return c
4661 }
4662
4663 // Fields allows partial responses to be retrieved. See
4664 // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse for more
4665 // details.
4666 func (c *BuyersClientsDeactivateCall) Fields(s ...googleapi.Field) *BuyersClientsDeactivateCall {
4667 c.urlParams_.Set("fields", googleapi.CombineFields(s))
4668 return c
4669 }
4670
4671 // Context sets the context to be used in this call's Do method.
4672 func (c *BuyersClientsDeactivateCall) Context(ctx context.Context) *BuyersClientsDeactivateCall {
4673 c.ctx_ = ctx
4674 return c
4675 }
4676
4677 // Header returns a http.Header that can be modified by the caller to add
4678 // headers to the request.
4679 func (c *BuyersClientsDeactivateCall) Header() http.Header {
4680 if c.header_ == nil {
4681 c.header_ = make(http.Header)
4682 }
4683 return c.header_
4684 }
4685
4686 func (c *BuyersClientsDeactivateCall) doRequest(alt string) (*http.Response, error) {
4687 reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_)
4688 body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.deactivateclientrequest)
4689 if err != nil {
4690 return nil, err
4691 }
4692 c.urlParams_.Set("alt", alt)
4693 c.urlParams_.Set("prettyPrint", "false")
4694 urls := googleapi.ResolveRelative(c.s.BasePath, "v1alpha/{+name}:deactivate")
4695 urls += "?" + c.urlParams_.Encode()
4696 req, err := http.NewRequest("POST", urls, body)
4697 if err != nil {
4698 return nil, err
4699 }
4700 req.Header = reqHeaders
4701 googleapi.Expand(req.URL, map[string]string{
4702 "name": c.name,
4703 })
4704 c.s.logger.DebugContext(c.ctx_, "api request", "serviceName", apiName, "rpcName", "authorizedbuyersmarketplace.buyers.clients.deactivate", "request", internallog.HTTPRequest(req, body.Bytes()))
4705 return gensupport.SendRequest(c.ctx_, c.s.client, req)
4706 }
4707
4708 // Do executes the "authorizedbuyersmarketplace.buyers.clients.deactivate" call.
4709 // Any non-2xx status code is an error. Response headers are in either
4710 // *Client.ServerResponse.Header or (if a response was returned at all) in
4711 // error.(*googleapi.Error).Header. Use googleapi.IsNotModified to check
4712 // whether the returned error was because http.StatusNotModified was returned.
4713 func (c *BuyersClientsDeactivateCall) Do(opts ...googleapi.CallOption) (*Client, error) {
4714 gensupport.SetOptions(c.urlParams_, opts...)
4715 res, err := c.doRequest("json")
4716 if res != nil && res.StatusCode == http.StatusNotModified {
4717 if res.Body != nil {
4718 res.Body.Close()
4719 }
4720 return nil, gensupport.WrapError(&googleapi.Error{
4721 Code: res.StatusCode,
4722 Header: res.Header,
4723 })
4724 }
4725 if err != nil {
4726 return nil, err
4727 }
4728 defer googleapi.CloseBody(res)
4729 if err := googleapi.CheckResponse(res); err != nil {
4730 return nil, gensupport.WrapError(err)
4731 }
4732 ret := &Client{
4733 ServerResponse: googleapi.ServerResponse{
4734 Header: res.Header,
4735 HTTPStatusCode: res.StatusCode,
4736 },
4737 }
4738 target := &ret
4739 b, err := gensupport.DecodeResponseBytes(target, res)
4740 if err != nil {
4741 return nil, err
4742 }
4743 c.s.logger.DebugContext(c.ctx_, "api response", "serviceName", apiName, "rpcName", "authorizedbuyersmarketplace.buyers.clients.deactivate", "response", internallog.HTTPResponse(res, b))
4744 return ret, nil
4745 }
4746
4747 type BuyersClientsGetCall struct {
4748 s *Service
4749 name string
4750 urlParams_ gensupport.URLParams
4751 ifNoneMatch_ string
4752 ctx_ context.Context
4753 header_ http.Header
4754 }
4755
4756 // Get: Gets a client with a given resource name.
4757 //
4758 // - name: Format: `buyers/{accountId}/clients/{clientAccountId}`.
4759 func (r *BuyersClientsService) Get(name string) *BuyersClientsGetCall {
4760 c := &BuyersClientsGetCall{s: r.s, urlParams_: make(gensupport.URLParams)}
4761 c.name = name
4762 return c
4763 }
4764
4765 // Fields allows partial responses to be retrieved. See
4766 // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse for more
4767 // details.
4768 func (c *BuyersClientsGetCall) Fields(s ...googleapi.Field) *BuyersClientsGetCall {
4769 c.urlParams_.Set("fields", googleapi.CombineFields(s))
4770 return c
4771 }
4772
4773 // IfNoneMatch sets an optional parameter which makes the operation fail if the
4774 // object's ETag matches the given value. This is useful for getting updates
4775 // only after the object has changed since the last request.
4776 func (c *BuyersClientsGetCall) IfNoneMatch(entityTag string) *BuyersClientsGetCall {
4777 c.ifNoneMatch_ = entityTag
4778 return c
4779 }
4780
4781 // Context sets the context to be used in this call's Do method.
4782 func (c *BuyersClientsGetCall) Context(ctx context.Context) *BuyersClientsGetCall {
4783 c.ctx_ = ctx
4784 return c
4785 }
4786
4787 // Header returns a http.Header that can be modified by the caller to add
4788 // headers to the request.
4789 func (c *BuyersClientsGetCall) Header() http.Header {
4790 if c.header_ == nil {
4791 c.header_ = make(http.Header)
4792 }
4793 return c.header_
4794 }
4795
4796 func (c *BuyersClientsGetCall) doRequest(alt string) (*http.Response, error) {
4797 reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_)
4798 if c.ifNoneMatch_ != "" {
4799 reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
4800 }
4801 c.urlParams_.Set("alt", alt)
4802 c.urlParams_.Set("prettyPrint", "false")
4803 urls := googleapi.ResolveRelative(c.s.BasePath, "v1alpha/{+name}")
4804 urls += "?" + c.urlParams_.Encode()
4805 req, err := http.NewRequest("GET", urls, nil)
4806 if err != nil {
4807 return nil, err
4808 }
4809 req.Header = reqHeaders
4810 googleapi.Expand(req.URL, map[string]string{
4811 "name": c.name,
4812 })
4813 c.s.logger.DebugContext(c.ctx_, "api request", "serviceName", apiName, "rpcName", "authorizedbuyersmarketplace.buyers.clients.get", "request", internallog.HTTPRequest(req, nil))
4814 return gensupport.SendRequest(c.ctx_, c.s.client, req)
4815 }
4816
4817 // Do executes the "authorizedbuyersmarketplace.buyers.clients.get" call.
4818 // Any non-2xx status code is an error. Response headers are in either
4819 // *Client.ServerResponse.Header or (if a response was returned at all) in
4820 // error.(*googleapi.Error).Header. Use googleapi.IsNotModified to check
4821 // whether the returned error was because http.StatusNotModified was returned.
4822 func (c *BuyersClientsGetCall) Do(opts ...googleapi.CallOption) (*Client, error) {
4823 gensupport.SetOptions(c.urlParams_, opts...)
4824 res, err := c.doRequest("json")
4825 if res != nil && res.StatusCode == http.StatusNotModified {
4826 if res.Body != nil {
4827 res.Body.Close()
4828 }
4829 return nil, gensupport.WrapError(&googleapi.Error{
4830 Code: res.StatusCode,
4831 Header: res.Header,
4832 })
4833 }
4834 if err != nil {
4835 return nil, err
4836 }
4837 defer googleapi.CloseBody(res)
4838 if err := googleapi.CheckResponse(res); err != nil {
4839 return nil, gensupport.WrapError(err)
4840 }
4841 ret := &Client{
4842 ServerResponse: googleapi.ServerResponse{
4843 Header: res.Header,
4844 HTTPStatusCode: res.StatusCode,
4845 },
4846 }
4847 target := &ret
4848 b, err := gensupport.DecodeResponseBytes(target, res)
4849 if err != nil {
4850 return nil, err
4851 }
4852 c.s.logger.DebugContext(c.ctx_, "api response", "serviceName", apiName, "rpcName", "authorizedbuyersmarketplace.buyers.clients.get", "response", internallog.HTTPResponse(res, b))
4853 return ret, nil
4854 }
4855
4856 type BuyersClientsListCall struct {
4857 s *Service
4858 parent string
4859 urlParams_ gensupport.URLParams
4860 ifNoneMatch_ string
4861 ctx_ context.Context
4862 header_ http.Header
4863 }
4864
4865 // List: Lists all the clients for the current buyer.
4866 //
4867 // - parent: The name of the buyer. Format: `buyers/{accountId}`.
4868 func (r *BuyersClientsService) List(parent string) *BuyersClientsListCall {
4869 c := &BuyersClientsListCall{s: r.s, urlParams_: make(gensupport.URLParams)}
4870 c.parent = parent
4871 return c
4872 }
4873
4874 // Filter sets the optional parameter "filter": Query string using the
4875 // Filtering Syntax
4876 // (https://developers.google.com/authorized-buyers/apis/guides/list-filters)
4877 // Supported fields for filtering are: * partnerClientId Use this field to
4878 // filter the clients by the partnerClientId. For example, if the
4879 // partnerClientId of the client is "1234", the value of this field should be
4880 // `partnerClientId = "1234", in order to get only the client whose
4881 // partnerClientId is "1234" in the response.
4882 func (c *BuyersClientsListCall) Filter(filter string) *BuyersClientsListCall {
4883 c.urlParams_.Set("filter", filter)
4884 return c
4885 }
4886
4887 // PageSize sets the optional parameter "pageSize": Requested page size. If
4888 // left blank, a default page size of 500 will be applied.
4889 func (c *BuyersClientsListCall) PageSize(pageSize int64) *BuyersClientsListCall {
4890 c.urlParams_.Set("pageSize", fmt.Sprint(pageSize))
4891 return c
4892 }
4893
4894 // PageToken sets the optional parameter "pageToken": A token identifying a
4895 // page of results the server should return. Typically, this is the value of
4896 // ListClientsResponse.nextPageToken returned from the previous call to the
4897 // list method.
4898 func (c *BuyersClientsListCall) PageToken(pageToken string) *BuyersClientsListCall {
4899 c.urlParams_.Set("pageToken", pageToken)
4900 return c
4901 }
4902
4903 // Fields allows partial responses to be retrieved. See
4904 // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse for more
4905 // details.
4906 func (c *BuyersClientsListCall) Fields(s ...googleapi.Field) *BuyersClientsListCall {
4907 c.urlParams_.Set("fields", googleapi.CombineFields(s))
4908 return c
4909 }
4910
4911 // IfNoneMatch sets an optional parameter which makes the operation fail if the
4912 // object's ETag matches the given value. This is useful for getting updates
4913 // only after the object has changed since the last request.
4914 func (c *BuyersClientsListCall) IfNoneMatch(entityTag string) *BuyersClientsListCall {
4915 c.ifNoneMatch_ = entityTag
4916 return c
4917 }
4918
4919 // Context sets the context to be used in this call's Do method.
4920 func (c *BuyersClientsListCall) Context(ctx context.Context) *BuyersClientsListCall {
4921 c.ctx_ = ctx
4922 return c
4923 }
4924
4925 // Header returns a http.Header that can be modified by the caller to add
4926 // headers to the request.
4927 func (c *BuyersClientsListCall) Header() http.Header {
4928 if c.header_ == nil {
4929 c.header_ = make(http.Header)
4930 }
4931 return c.header_
4932 }
4933
4934 func (c *BuyersClientsListCall) doRequest(alt string) (*http.Response, error) {
4935 reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_)
4936 if c.ifNoneMatch_ != "" {
4937 reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
4938 }
4939 c.urlParams_.Set("alt", alt)
4940 c.urlParams_.Set("prettyPrint", "false")
4941 urls := googleapi.ResolveRelative(c.s.BasePath, "v1alpha/{+parent}/clients")
4942 urls += "?" + c.urlParams_.Encode()
4943 req, err := http.NewRequest("GET", urls, nil)
4944 if err != nil {
4945 return nil, err
4946 }
4947 req.Header = reqHeaders
4948 googleapi.Expand(req.URL, map[string]string{
4949 "parent": c.parent,
4950 })
4951 c.s.logger.DebugContext(c.ctx_, "api request", "serviceName", apiName, "rpcName", "authorizedbuyersmarketplace.buyers.clients.list", "request", internallog.HTTPRequest(req, nil))
4952 return gensupport.SendRequest(c.ctx_, c.s.client, req)
4953 }
4954
4955 // Do executes the "authorizedbuyersmarketplace.buyers.clients.list" call.
4956 // Any non-2xx status code is an error. Response headers are in either
4957 // *ListClientsResponse.ServerResponse.Header or (if a response was returned at
4958 // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to
4959 // check whether the returned error was because http.StatusNotModified was
4960 // returned.
4961 func (c *BuyersClientsListCall) Do(opts ...googleapi.CallOption) (*ListClientsResponse, error) {
4962 gensupport.SetOptions(c.urlParams_, opts...)
4963 res, err := c.doRequest("json")
4964 if res != nil && res.StatusCode == http.StatusNotModified {
4965 if res.Body != nil {
4966 res.Body.Close()
4967 }
4968 return nil, gensupport.WrapError(&googleapi.Error{
4969 Code: res.StatusCode,
4970 Header: res.Header,
4971 })
4972 }
4973 if err != nil {
4974 return nil, err
4975 }
4976 defer googleapi.CloseBody(res)
4977 if err := googleapi.CheckResponse(res); err != nil {
4978 return nil, gensupport.WrapError(err)
4979 }
4980 ret := &ListClientsResponse{
4981 ServerResponse: googleapi.ServerResponse{
4982 Header: res.Header,
4983 HTTPStatusCode: res.StatusCode,
4984 },
4985 }
4986 target := &ret
4987 b, err := gensupport.DecodeResponseBytes(target, res)
4988 if err != nil {
4989 return nil, err
4990 }
4991 c.s.logger.DebugContext(c.ctx_, "api response", "serviceName", apiName, "rpcName", "authorizedbuyersmarketplace.buyers.clients.list", "response", internallog.HTTPResponse(res, b))
4992 return ret, nil
4993 }
4994
4995 // Pages invokes f for each page of results.
4996 // A non-nil error returned from f will halt the iteration.
4997 // The provided context supersedes any context provided to the Context method.
4998 func (c *BuyersClientsListCall) Pages(ctx context.Context, f func(*ListClientsResponse) error) error {
4999 c.ctx_ = ctx
5000 defer c.PageToken(c.urlParams_.Get("pageToken"))
5001 for {
5002 x, err := c.Do()
5003 if err != nil {
5004 return err
5005 }
5006 if err := f(x); err != nil {
5007 return err
5008 }
5009 if x.NextPageToken == "" {
5010 return nil
5011 }
5012 c.PageToken(x.NextPageToken)
5013 }
5014 }
5015
5016 type BuyersClientsPatchCall struct {
5017 s *Service
5018 name string
5019 client *Client
5020 urlParams_ gensupport.URLParams
5021 ctx_ context.Context
5022 header_ http.Header
5023 }
5024
5025 // Patch: Updates an existing client.
5026 //
5027 // - name: Output only. The resource name of the client. Format:
5028 // `buyers/{accountId}/clients/{clientAccountId}`.
5029 func (r *BuyersClientsService) Patch(name string, client *Client) *BuyersClientsPatchCall {
5030 c := &BuyersClientsPatchCall{s: r.s, urlParams_: make(gensupport.URLParams)}
5031 c.name = name
5032 c.client = client
5033 return c
5034 }
5035
5036 // UpdateMask sets the optional parameter "updateMask": List of fields to be
5037 // updated. If empty or unspecified, the service will update all fields
5038 // populated in the update request excluding the output only fields and
5039 // primitive fields with default value. Note that explicit field mask is
5040 // required in order to reset a primitive field back to its default value, for
5041 // example, false for boolean fields, 0 for integer fields. A special field
5042 // mask consisting of a single path "*" can be used to indicate full
5043 // replacement(the equivalent of PUT method), updatable fields unset or
5044 // unspecified in the input will be cleared or set to default value. Output
5045 // only fields will be ignored regardless of the value of updateMask.
5046 func (c *BuyersClientsPatchCall) UpdateMask(updateMask string) *BuyersClientsPatchCall {
5047 c.urlParams_.Set("updateMask", updateMask)
5048 return c
5049 }
5050
5051 // Fields allows partial responses to be retrieved. See
5052 // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse for more
5053 // details.
5054 func (c *BuyersClientsPatchCall) Fields(s ...googleapi.Field) *BuyersClientsPatchCall {
5055 c.urlParams_.Set("fields", googleapi.CombineFields(s))
5056 return c
5057 }
5058
5059 // Context sets the context to be used in this call's Do method.
5060 func (c *BuyersClientsPatchCall) Context(ctx context.Context) *BuyersClientsPatchCall {
5061 c.ctx_ = ctx
5062 return c
5063 }
5064
5065 // Header returns a http.Header that can be modified by the caller to add
5066 // headers to the request.
5067 func (c *BuyersClientsPatchCall) Header() http.Header {
5068 if c.header_ == nil {
5069 c.header_ = make(http.Header)
5070 }
5071 return c.header_
5072 }
5073
5074 func (c *BuyersClientsPatchCall) doRequest(alt string) (*http.Response, error) {
5075 reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_)
5076 body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.client)
5077 if err != nil {
5078 return nil, err
5079 }
5080 c.urlParams_.Set("alt", alt)
5081 c.urlParams_.Set("prettyPrint", "false")
5082 urls := googleapi.ResolveRelative(c.s.BasePath, "v1alpha/{+name}")
5083 urls += "?" + c.urlParams_.Encode()
5084 req, err := http.NewRequest("PATCH", urls, body)
5085 if err != nil {
5086 return nil, err
5087 }
5088 req.Header = reqHeaders
5089 googleapi.Expand(req.URL, map[string]string{
5090 "name": c.name,
5091 })
5092 c.s.logger.DebugContext(c.ctx_, "api request", "serviceName", apiName, "rpcName", "authorizedbuyersmarketplace.buyers.clients.patch", "request", internallog.HTTPRequest(req, body.Bytes()))
5093 return gensupport.SendRequest(c.ctx_, c.s.client, req)
5094 }
5095
5096 // Do executes the "authorizedbuyersmarketplace.buyers.clients.patch" call.
5097 // Any non-2xx status code is an error. Response headers are in either
5098 // *Client.ServerResponse.Header or (if a response was returned at all) in
5099 // error.(*googleapi.Error).Header. Use googleapi.IsNotModified to check
5100 // whether the returned error was because http.StatusNotModified was returned.
5101 func (c *BuyersClientsPatchCall) Do(opts ...googleapi.CallOption) (*Client, error) {
5102 gensupport.SetOptions(c.urlParams_, opts...)
5103 res, err := c.doRequest("json")
5104 if res != nil && res.StatusCode == http.StatusNotModified {
5105 if res.Body != nil {
5106 res.Body.Close()
5107 }
5108 return nil, gensupport.WrapError(&googleapi.Error{
5109 Code: res.StatusCode,
5110 Header: res.Header,
5111 })
5112 }
5113 if err != nil {
5114 return nil, err
5115 }
5116 defer googleapi.CloseBody(res)
5117 if err := googleapi.CheckResponse(res); err != nil {
5118 return nil, gensupport.WrapError(err)
5119 }
5120 ret := &Client{
5121 ServerResponse: googleapi.ServerResponse{
5122 Header: res.Header,
5123 HTTPStatusCode: res.StatusCode,
5124 },
5125 }
5126 target := &ret
5127 b, err := gensupport.DecodeResponseBytes(target, res)
5128 if err != nil {
5129 return nil, err
5130 }
5131 c.s.logger.DebugContext(c.ctx_, "api response", "serviceName", apiName, "rpcName", "authorizedbuyersmarketplace.buyers.clients.patch", "response", internallog.HTTPResponse(res, b))
5132 return ret, nil
5133 }
5134
5135 type BuyersClientsUsersActivateCall struct {
5136 s *Service
5137 name string
5138 activateclientuserrequest *ActivateClientUserRequest
5139 urlParams_ gensupport.URLParams
5140 ctx_ context.Context
5141 header_ http.Header
5142 }
5143
5144 // Activate: Activates an existing client user. The state of the client user
5145 // will be updated from "INACTIVE" to "ACTIVE". This method has no effect if
5146 // the client user is already in "ACTIVE" state. An error will be returned if
5147 // the client user to activate is still in "INVITED" state.
5148 //
5149 // - name: Format:
5150 // `buyers/{buyerAccountId}/clients/{clientAccountId}/clientUsers/{userId}`.
5151 func (r *BuyersClientsUsersService) Activate(name string, activateclientuserrequest *ActivateClientUserRequest) *BuyersClientsUsersActivateCall {
5152 c := &BuyersClientsUsersActivateCall{s: r.s, urlParams_: make(gensupport.URLParams)}
5153 c.name = name
5154 c.activateclientuserrequest = activateclientuserrequest
5155 return c
5156 }
5157
5158 // Fields allows partial responses to be retrieved. See
5159 // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse for more
5160 // details.
5161 func (c *BuyersClientsUsersActivateCall) Fields(s ...googleapi.Field) *BuyersClientsUsersActivateCall {
5162 c.urlParams_.Set("fields", googleapi.CombineFields(s))
5163 return c
5164 }
5165
5166 // Context sets the context to be used in this call's Do method.
5167 func (c *BuyersClientsUsersActivateCall) Context(ctx context.Context) *BuyersClientsUsersActivateCall {
5168 c.ctx_ = ctx
5169 return c
5170 }
5171
5172 // Header returns a http.Header that can be modified by the caller to add
5173 // headers to the request.
5174 func (c *BuyersClientsUsersActivateCall) Header() http.Header {
5175 if c.header_ == nil {
5176 c.header_ = make(http.Header)
5177 }
5178 return c.header_
5179 }
5180
5181 func (c *BuyersClientsUsersActivateCall) doRequest(alt string) (*http.Response, error) {
5182 reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_)
5183 body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.activateclientuserrequest)
5184 if err != nil {
5185 return nil, err
5186 }
5187 c.urlParams_.Set("alt", alt)
5188 c.urlParams_.Set("prettyPrint", "false")
5189 urls := googleapi.ResolveRelative(c.s.BasePath, "v1alpha/{+name}:activate")
5190 urls += "?" + c.urlParams_.Encode()
5191 req, err := http.NewRequest("POST", urls, body)
5192 if err != nil {
5193 return nil, err
5194 }
5195 req.Header = reqHeaders
5196 googleapi.Expand(req.URL, map[string]string{
5197 "name": c.name,
5198 })
5199 c.s.logger.DebugContext(c.ctx_, "api request", "serviceName", apiName, "rpcName", "authorizedbuyersmarketplace.buyers.clients.users.activate", "request", internallog.HTTPRequest(req, body.Bytes()))
5200 return gensupport.SendRequest(c.ctx_, c.s.client, req)
5201 }
5202
5203 // Do executes the "authorizedbuyersmarketplace.buyers.clients.users.activate" call.
5204 // Any non-2xx status code is an error. Response headers are in either
5205 // *ClientUser.ServerResponse.Header or (if a response was returned at all) in
5206 // error.(*googleapi.Error).Header. Use googleapi.IsNotModified to check
5207 // whether the returned error was because http.StatusNotModified was returned.
5208 func (c *BuyersClientsUsersActivateCall) Do(opts ...googleapi.CallOption) (*ClientUser, error) {
5209 gensupport.SetOptions(c.urlParams_, opts...)
5210 res, err := c.doRequest("json")
5211 if res != nil && res.StatusCode == http.StatusNotModified {
5212 if res.Body != nil {
5213 res.Body.Close()
5214 }
5215 return nil, gensupport.WrapError(&googleapi.Error{
5216 Code: res.StatusCode,
5217 Header: res.Header,
5218 })
5219 }
5220 if err != nil {
5221 return nil, err
5222 }
5223 defer googleapi.CloseBody(res)
5224 if err := googleapi.CheckResponse(res); err != nil {
5225 return nil, gensupport.WrapError(err)
5226 }
5227 ret := &ClientUser{
5228 ServerResponse: googleapi.ServerResponse{
5229 Header: res.Header,
5230 HTTPStatusCode: res.StatusCode,
5231 },
5232 }
5233 target := &ret
5234 b, err := gensupport.DecodeResponseBytes(target, res)
5235 if err != nil {
5236 return nil, err
5237 }
5238 c.s.logger.DebugContext(c.ctx_, "api response", "serviceName", apiName, "rpcName", "authorizedbuyersmarketplace.buyers.clients.users.activate", "response", internallog.HTTPResponse(res, b))
5239 return ret, nil
5240 }
5241
5242 type BuyersClientsUsersCreateCall struct {
5243 s *Service
5244 parent string
5245 clientuser *ClientUser
5246 urlParams_ gensupport.URLParams
5247 ctx_ context.Context
5248 header_ http.Header
5249 }
5250
5251 // Create: Creates a new client user in "INVITED" state. An email invitation
5252 // will be sent to the new user, once accepted the user will become active.
5253 //
5254 // - parent: The name of the client. Format:
5255 // `buyers/{accountId}/clients/{clientAccountId}`.
5256 func (r *BuyersClientsUsersService) Create(parent string, clientuser *ClientUser) *BuyersClientsUsersCreateCall {
5257 c := &BuyersClientsUsersCreateCall{s: r.s, urlParams_: make(gensupport.URLParams)}
5258 c.parent = parent
5259 c.clientuser = clientuser
5260 return c
5261 }
5262
5263 // Fields allows partial responses to be retrieved. See
5264 // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse for more
5265 // details.
5266 func (c *BuyersClientsUsersCreateCall) Fields(s ...googleapi.Field) *BuyersClientsUsersCreateCall {
5267 c.urlParams_.Set("fields", googleapi.CombineFields(s))
5268 return c
5269 }
5270
5271 // Context sets the context to be used in this call's Do method.
5272 func (c *BuyersClientsUsersCreateCall) Context(ctx context.Context) *BuyersClientsUsersCreateCall {
5273 c.ctx_ = ctx
5274 return c
5275 }
5276
5277 // Header returns a http.Header that can be modified by the caller to add
5278 // headers to the request.
5279 func (c *BuyersClientsUsersCreateCall) Header() http.Header {
5280 if c.header_ == nil {
5281 c.header_ = make(http.Header)
5282 }
5283 return c.header_
5284 }
5285
5286 func (c *BuyersClientsUsersCreateCall) doRequest(alt string) (*http.Response, error) {
5287 reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_)
5288 body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.clientuser)
5289 if err != nil {
5290 return nil, err
5291 }
5292 c.urlParams_.Set("alt", alt)
5293 c.urlParams_.Set("prettyPrint", "false")
5294 urls := googleapi.ResolveRelative(c.s.BasePath, "v1alpha/{+parent}/users")
5295 urls += "?" + c.urlParams_.Encode()
5296 req, err := http.NewRequest("POST", urls, body)
5297 if err != nil {
5298 return nil, err
5299 }
5300 req.Header = reqHeaders
5301 googleapi.Expand(req.URL, map[string]string{
5302 "parent": c.parent,
5303 })
5304 c.s.logger.DebugContext(c.ctx_, "api request", "serviceName", apiName, "rpcName", "authorizedbuyersmarketplace.buyers.clients.users.create", "request", internallog.HTTPRequest(req, body.Bytes()))
5305 return gensupport.SendRequest(c.ctx_, c.s.client, req)
5306 }
5307
5308 // Do executes the "authorizedbuyersmarketplace.buyers.clients.users.create" call.
5309 // Any non-2xx status code is an error. Response headers are in either
5310 // *ClientUser.ServerResponse.Header or (if a response was returned at all) in
5311 // error.(*googleapi.Error).Header. Use googleapi.IsNotModified to check
5312 // whether the returned error was because http.StatusNotModified was returned.
5313 func (c *BuyersClientsUsersCreateCall) Do(opts ...googleapi.CallOption) (*ClientUser, error) {
5314 gensupport.SetOptions(c.urlParams_, opts...)
5315 res, err := c.doRequest("json")
5316 if res != nil && res.StatusCode == http.StatusNotModified {
5317 if res.Body != nil {
5318 res.Body.Close()
5319 }
5320 return nil, gensupport.WrapError(&googleapi.Error{
5321 Code: res.StatusCode,
5322 Header: res.Header,
5323 })
5324 }
5325 if err != nil {
5326 return nil, err
5327 }
5328 defer googleapi.CloseBody(res)
5329 if err := googleapi.CheckResponse(res); err != nil {
5330 return nil, gensupport.WrapError(err)
5331 }
5332 ret := &ClientUser{
5333 ServerResponse: googleapi.ServerResponse{
5334 Header: res.Header,
5335 HTTPStatusCode: res.StatusCode,
5336 },
5337 }
5338 target := &ret
5339 b, err := gensupport.DecodeResponseBytes(target, res)
5340 if err != nil {
5341 return nil, err
5342 }
5343 c.s.logger.DebugContext(c.ctx_, "api response", "serviceName", apiName, "rpcName", "authorizedbuyersmarketplace.buyers.clients.users.create", "response", internallog.HTTPResponse(res, b))
5344 return ret, nil
5345 }
5346
5347 type BuyersClientsUsersDeactivateCall struct {
5348 s *Service
5349 name string
5350 deactivateclientuserrequest *DeactivateClientUserRequest
5351 urlParams_ gensupport.URLParams
5352 ctx_ context.Context
5353 header_ http.Header
5354 }
5355
5356 // Deactivate: Deactivates an existing client user. The state of the client
5357 // user will be updated from "ACTIVE" to "INACTIVE". This method has no effect
5358 // if the client user is already in "INACTIVE" state. An error will be returned
5359 // if the client user to deactivate is still in "INVITED" state.
5360 //
5361 // - name: Format:
5362 // `buyers/{buyerAccountId}/clients/{clientAccountId}/clientUsers/{userId}`.
5363 func (r *BuyersClientsUsersService) Deactivate(name string, deactivateclientuserrequest *DeactivateClientUserRequest) *BuyersClientsUsersDeactivateCall {
5364 c := &BuyersClientsUsersDeactivateCall{s: r.s, urlParams_: make(gensupport.URLParams)}
5365 c.name = name
5366 c.deactivateclientuserrequest = deactivateclientuserrequest
5367 return c
5368 }
5369
5370 // Fields allows partial responses to be retrieved. See
5371 // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse for more
5372 // details.
5373 func (c *BuyersClientsUsersDeactivateCall) Fields(s ...googleapi.Field) *BuyersClientsUsersDeactivateCall {
5374 c.urlParams_.Set("fields", googleapi.CombineFields(s))
5375 return c
5376 }
5377
5378 // Context sets the context to be used in this call's Do method.
5379 func (c *BuyersClientsUsersDeactivateCall) Context(ctx context.Context) *BuyersClientsUsersDeactivateCall {
5380 c.ctx_ = ctx
5381 return c
5382 }
5383
5384 // Header returns a http.Header that can be modified by the caller to add
5385 // headers to the request.
5386 func (c *BuyersClientsUsersDeactivateCall) Header() http.Header {
5387 if c.header_ == nil {
5388 c.header_ = make(http.Header)
5389 }
5390 return c.header_
5391 }
5392
5393 func (c *BuyersClientsUsersDeactivateCall) doRequest(alt string) (*http.Response, error) {
5394 reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_)
5395 body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.deactivateclientuserrequest)
5396 if err != nil {
5397 return nil, err
5398 }
5399 c.urlParams_.Set("alt", alt)
5400 c.urlParams_.Set("prettyPrint", "false")
5401 urls := googleapi.ResolveRelative(c.s.BasePath, "v1alpha/{+name}:deactivate")
5402 urls += "?" + c.urlParams_.Encode()
5403 req, err := http.NewRequest("POST", urls, body)
5404 if err != nil {
5405 return nil, err
5406 }
5407 req.Header = reqHeaders
5408 googleapi.Expand(req.URL, map[string]string{
5409 "name": c.name,
5410 })
5411 c.s.logger.DebugContext(c.ctx_, "api request", "serviceName", apiName, "rpcName", "authorizedbuyersmarketplace.buyers.clients.users.deactivate", "request", internallog.HTTPRequest(req, body.Bytes()))
5412 return gensupport.SendRequest(c.ctx_, c.s.client, req)
5413 }
5414
5415 // Do executes the "authorizedbuyersmarketplace.buyers.clients.users.deactivate" call.
5416 // Any non-2xx status code is an error. Response headers are in either
5417 // *ClientUser.ServerResponse.Header or (if a response was returned at all) in
5418 // error.(*googleapi.Error).Header. Use googleapi.IsNotModified to check
5419 // whether the returned error was because http.StatusNotModified was returned.
5420 func (c *BuyersClientsUsersDeactivateCall) Do(opts ...googleapi.CallOption) (*ClientUser, error) {
5421 gensupport.SetOptions(c.urlParams_, opts...)
5422 res, err := c.doRequest("json")
5423 if res != nil && res.StatusCode == http.StatusNotModified {
5424 if res.Body != nil {
5425 res.Body.Close()
5426 }
5427 return nil, gensupport.WrapError(&googleapi.Error{
5428 Code: res.StatusCode,
5429 Header: res.Header,
5430 })
5431 }
5432 if err != nil {
5433 return nil, err
5434 }
5435 defer googleapi.CloseBody(res)
5436 if err := googleapi.CheckResponse(res); err != nil {
5437 return nil, gensupport.WrapError(err)
5438 }
5439 ret := &ClientUser{
5440 ServerResponse: googleapi.ServerResponse{
5441 Header: res.Header,
5442 HTTPStatusCode: res.StatusCode,
5443 },
5444 }
5445 target := &ret
5446 b, err := gensupport.DecodeResponseBytes(target, res)
5447 if err != nil {
5448 return nil, err
5449 }
5450 c.s.logger.DebugContext(c.ctx_, "api response", "serviceName", apiName, "rpcName", "authorizedbuyersmarketplace.buyers.clients.users.deactivate", "response", internallog.HTTPResponse(res, b))
5451 return ret, nil
5452 }
5453
5454 type BuyersClientsUsersDeleteCall struct {
5455 s *Service
5456 name string
5457 urlParams_ gensupport.URLParams
5458 ctx_ context.Context
5459 header_ http.Header
5460 }
5461
5462 // Delete: Deletes an existing client user. The client user will lose access to
5463 // the Authorized Buyers UI. Note that if a client user is deleted, the user's
5464 // access to the UI can't be restored unless a new client user is created and
5465 // activated.
5466 //
5467 // - name: Format:
5468 // `buyers/{buyerAccountId}/clients/{clientAccountId}/clientUsers/{userId}`.
5469 func (r *BuyersClientsUsersService) Delete(name string) *BuyersClientsUsersDeleteCall {
5470 c := &BuyersClientsUsersDeleteCall{s: r.s, urlParams_: make(gensupport.URLParams)}
5471 c.name = name
5472 return c
5473 }
5474
5475 // Fields allows partial responses to be retrieved. See
5476 // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse for more
5477 // details.
5478 func (c *BuyersClientsUsersDeleteCall) Fields(s ...googleapi.Field) *BuyersClientsUsersDeleteCall {
5479 c.urlParams_.Set("fields", googleapi.CombineFields(s))
5480 return c
5481 }
5482
5483 // Context sets the context to be used in this call's Do method.
5484 func (c *BuyersClientsUsersDeleteCall) Context(ctx context.Context) *BuyersClientsUsersDeleteCall {
5485 c.ctx_ = ctx
5486 return c
5487 }
5488
5489 // Header returns a http.Header that can be modified by the caller to add
5490 // headers to the request.
5491 func (c *BuyersClientsUsersDeleteCall) Header() http.Header {
5492 if c.header_ == nil {
5493 c.header_ = make(http.Header)
5494 }
5495 return c.header_
5496 }
5497
5498 func (c *BuyersClientsUsersDeleteCall) doRequest(alt string) (*http.Response, error) {
5499 reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_)
5500 c.urlParams_.Set("alt", alt)
5501 c.urlParams_.Set("prettyPrint", "false")
5502 urls := googleapi.ResolveRelative(c.s.BasePath, "v1alpha/{+name}")
5503 urls += "?" + c.urlParams_.Encode()
5504 req, err := http.NewRequest("DELETE", urls, nil)
5505 if err != nil {
5506 return nil, err
5507 }
5508 req.Header = reqHeaders
5509 googleapi.Expand(req.URL, map[string]string{
5510 "name": c.name,
5511 })
5512 c.s.logger.DebugContext(c.ctx_, "api request", "serviceName", apiName, "rpcName", "authorizedbuyersmarketplace.buyers.clients.users.delete", "request", internallog.HTTPRequest(req, nil))
5513 return gensupport.SendRequest(c.ctx_, c.s.client, req)
5514 }
5515
5516 // Do executes the "authorizedbuyersmarketplace.buyers.clients.users.delete" call.
5517 // Any non-2xx status code is an error. Response headers are in either
5518 // *Empty.ServerResponse.Header or (if a response was returned at all) in
5519 // error.(*googleapi.Error).Header. Use googleapi.IsNotModified to check
5520 // whether the returned error was because http.StatusNotModified was returned.
5521 func (c *BuyersClientsUsersDeleteCall) Do(opts ...googleapi.CallOption) (*Empty, error) {
5522 gensupport.SetOptions(c.urlParams_, opts...)
5523 res, err := c.doRequest("json")
5524 if res != nil && res.StatusCode == http.StatusNotModified {
5525 if res.Body != nil {
5526 res.Body.Close()
5527 }
5528 return nil, gensupport.WrapError(&googleapi.Error{
5529 Code: res.StatusCode,
5530 Header: res.Header,
5531 })
5532 }
5533 if err != nil {
5534 return nil, err
5535 }
5536 defer googleapi.CloseBody(res)
5537 if err := googleapi.CheckResponse(res); err != nil {
5538 return nil, gensupport.WrapError(err)
5539 }
5540 ret := &Empty{
5541 ServerResponse: googleapi.ServerResponse{
5542 Header: res.Header,
5543 HTTPStatusCode: res.StatusCode,
5544 },
5545 }
5546 target := &ret
5547 b, err := gensupport.DecodeResponseBytes(target, res)
5548 if err != nil {
5549 return nil, err
5550 }
5551 c.s.logger.DebugContext(c.ctx_, "api response", "serviceName", apiName, "rpcName", "authorizedbuyersmarketplace.buyers.clients.users.delete", "response", internallog.HTTPResponse(res, b))
5552 return ret, nil
5553 }
5554
5555 type BuyersClientsUsersGetCall struct {
5556 s *Service
5557 name string
5558 urlParams_ gensupport.URLParams
5559 ifNoneMatch_ string
5560 ctx_ context.Context
5561 header_ http.Header
5562 }
5563
5564 // Get: Retrieves an existing client user.
5565 //
5566 // - name: Format:
5567 // `buyers/{buyerAccountId}/clients/{clientAccountId}/clientUsers/{userId}`.
5568 func (r *BuyersClientsUsersService) Get(name string) *BuyersClientsUsersGetCall {
5569 c := &BuyersClientsUsersGetCall{s: r.s, urlParams_: make(gensupport.URLParams)}
5570 c.name = name
5571 return c
5572 }
5573
5574 // Fields allows partial responses to be retrieved. See
5575 // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse for more
5576 // details.
5577 func (c *BuyersClientsUsersGetCall) Fields(s ...googleapi.Field) *BuyersClientsUsersGetCall {
5578 c.urlParams_.Set("fields", googleapi.CombineFields(s))
5579 return c
5580 }
5581
5582 // IfNoneMatch sets an optional parameter which makes the operation fail if the
5583 // object's ETag matches the given value. This is useful for getting updates
5584 // only after the object has changed since the last request.
5585 func (c *BuyersClientsUsersGetCall) IfNoneMatch(entityTag string) *BuyersClientsUsersGetCall {
5586 c.ifNoneMatch_ = entityTag
5587 return c
5588 }
5589
5590 // Context sets the context to be used in this call's Do method.
5591 func (c *BuyersClientsUsersGetCall) Context(ctx context.Context) *BuyersClientsUsersGetCall {
5592 c.ctx_ = ctx
5593 return c
5594 }
5595
5596 // Header returns a http.Header that can be modified by the caller to add
5597 // headers to the request.
5598 func (c *BuyersClientsUsersGetCall) Header() http.Header {
5599 if c.header_ == nil {
5600 c.header_ = make(http.Header)
5601 }
5602 return c.header_
5603 }
5604
5605 func (c *BuyersClientsUsersGetCall) doRequest(alt string) (*http.Response, error) {
5606 reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_)
5607 if c.ifNoneMatch_ != "" {
5608 reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
5609 }
5610 c.urlParams_.Set("alt", alt)
5611 c.urlParams_.Set("prettyPrint", "false")
5612 urls := googleapi.ResolveRelative(c.s.BasePath, "v1alpha/{+name}")
5613 urls += "?" + c.urlParams_.Encode()
5614 req, err := http.NewRequest("GET", urls, nil)
5615 if err != nil {
5616 return nil, err
5617 }
5618 req.Header = reqHeaders
5619 googleapi.Expand(req.URL, map[string]string{
5620 "name": c.name,
5621 })
5622 c.s.logger.DebugContext(c.ctx_, "api request", "serviceName", apiName, "rpcName", "authorizedbuyersmarketplace.buyers.clients.users.get", "request", internallog.HTTPRequest(req, nil))
5623 return gensupport.SendRequest(c.ctx_, c.s.client, req)
5624 }
5625
5626 // Do executes the "authorizedbuyersmarketplace.buyers.clients.users.get" call.
5627 // Any non-2xx status code is an error. Response headers are in either
5628 // *ClientUser.ServerResponse.Header or (if a response was returned at all) in
5629 // error.(*googleapi.Error).Header. Use googleapi.IsNotModified to check
5630 // whether the returned error was because http.StatusNotModified was returned.
5631 func (c *BuyersClientsUsersGetCall) Do(opts ...googleapi.CallOption) (*ClientUser, error) {
5632 gensupport.SetOptions(c.urlParams_, opts...)
5633 res, err := c.doRequest("json")
5634 if res != nil && res.StatusCode == http.StatusNotModified {
5635 if res.Body != nil {
5636 res.Body.Close()
5637 }
5638 return nil, gensupport.WrapError(&googleapi.Error{
5639 Code: res.StatusCode,
5640 Header: res.Header,
5641 })
5642 }
5643 if err != nil {
5644 return nil, err
5645 }
5646 defer googleapi.CloseBody(res)
5647 if err := googleapi.CheckResponse(res); err != nil {
5648 return nil, gensupport.WrapError(err)
5649 }
5650 ret := &ClientUser{
5651 ServerResponse: googleapi.ServerResponse{
5652 Header: res.Header,
5653 HTTPStatusCode: res.StatusCode,
5654 },
5655 }
5656 target := &ret
5657 b, err := gensupport.DecodeResponseBytes(target, res)
5658 if err != nil {
5659 return nil, err
5660 }
5661 c.s.logger.DebugContext(c.ctx_, "api response", "serviceName", apiName, "rpcName", "authorizedbuyersmarketplace.buyers.clients.users.get", "response", internallog.HTTPResponse(res, b))
5662 return ret, nil
5663 }
5664
5665 type BuyersClientsUsersListCall struct {
5666 s *Service
5667 parent string
5668 urlParams_ gensupport.URLParams
5669 ifNoneMatch_ string
5670 ctx_ context.Context
5671 header_ http.Header
5672 }
5673
5674 // List: Lists all client users for a specified client.
5675 //
5676 // - parent: The name of the client. Format:
5677 // `buyers/{buyerAccountId}/clients/{clientAccountId}`.
5678 func (r *BuyersClientsUsersService) List(parent string) *BuyersClientsUsersListCall {
5679 c := &BuyersClientsUsersListCall{s: r.s, urlParams_: make(gensupport.URLParams)}
5680 c.parent = parent
5681 return c
5682 }
5683
5684 // PageSize sets the optional parameter "pageSize": Requested page size. If
5685 // left blank, a default page size of 500 will be applied.
5686 func (c *BuyersClientsUsersListCall) PageSize(pageSize int64) *BuyersClientsUsersListCall {
5687 c.urlParams_.Set("pageSize", fmt.Sprint(pageSize))
5688 return c
5689 }
5690
5691 // PageToken sets the optional parameter "pageToken": A token identifying a
5692 // page of results the server should return. Typically, this is the value of
5693 // ListClientUsersResponse.nextPageToken returned from the previous call to the
5694 // list method.
5695 func (c *BuyersClientsUsersListCall) PageToken(pageToken string) *BuyersClientsUsersListCall {
5696 c.urlParams_.Set("pageToken", pageToken)
5697 return c
5698 }
5699
5700 // Fields allows partial responses to be retrieved. See
5701 // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse for more
5702 // details.
5703 func (c *BuyersClientsUsersListCall) Fields(s ...googleapi.Field) *BuyersClientsUsersListCall {
5704 c.urlParams_.Set("fields", googleapi.CombineFields(s))
5705 return c
5706 }
5707
5708 // IfNoneMatch sets an optional parameter which makes the operation fail if the
5709 // object's ETag matches the given value. This is useful for getting updates
5710 // only after the object has changed since the last request.
5711 func (c *BuyersClientsUsersListCall) IfNoneMatch(entityTag string) *BuyersClientsUsersListCall {
5712 c.ifNoneMatch_ = entityTag
5713 return c
5714 }
5715
5716 // Context sets the context to be used in this call's Do method.
5717 func (c *BuyersClientsUsersListCall) Context(ctx context.Context) *BuyersClientsUsersListCall {
5718 c.ctx_ = ctx
5719 return c
5720 }
5721
5722 // Header returns a http.Header that can be modified by the caller to add
5723 // headers to the request.
5724 func (c *BuyersClientsUsersListCall) Header() http.Header {
5725 if c.header_ == nil {
5726 c.header_ = make(http.Header)
5727 }
5728 return c.header_
5729 }
5730
5731 func (c *BuyersClientsUsersListCall) doRequest(alt string) (*http.Response, error) {
5732 reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_)
5733 if c.ifNoneMatch_ != "" {
5734 reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
5735 }
5736 c.urlParams_.Set("alt", alt)
5737 c.urlParams_.Set("prettyPrint", "false")
5738 urls := googleapi.ResolveRelative(c.s.BasePath, "v1alpha/{+parent}/users")
5739 urls += "?" + c.urlParams_.Encode()
5740 req, err := http.NewRequest("GET", urls, nil)
5741 if err != nil {
5742 return nil, err
5743 }
5744 req.Header = reqHeaders
5745 googleapi.Expand(req.URL, map[string]string{
5746 "parent": c.parent,
5747 })
5748 c.s.logger.DebugContext(c.ctx_, "api request", "serviceName", apiName, "rpcName", "authorizedbuyersmarketplace.buyers.clients.users.list", "request", internallog.HTTPRequest(req, nil))
5749 return gensupport.SendRequest(c.ctx_, c.s.client, req)
5750 }
5751
5752 // Do executes the "authorizedbuyersmarketplace.buyers.clients.users.list" call.
5753 // Any non-2xx status code is an error. Response headers are in either
5754 // *ListClientUsersResponse.ServerResponse.Header or (if a response was
5755 // returned at all) in error.(*googleapi.Error).Header. Use
5756 // googleapi.IsNotModified to check whether the returned error was because
5757 // http.StatusNotModified was returned.
5758 func (c *BuyersClientsUsersListCall) Do(opts ...googleapi.CallOption) (*ListClientUsersResponse, error) {
5759 gensupport.SetOptions(c.urlParams_, opts...)
5760 res, err := c.doRequest("json")
5761 if res != nil && res.StatusCode == http.StatusNotModified {
5762 if res.Body != nil {
5763 res.Body.Close()
5764 }
5765 return nil, gensupport.WrapError(&googleapi.Error{
5766 Code: res.StatusCode,
5767 Header: res.Header,
5768 })
5769 }
5770 if err != nil {
5771 return nil, err
5772 }
5773 defer googleapi.CloseBody(res)
5774 if err := googleapi.CheckResponse(res); err != nil {
5775 return nil, gensupport.WrapError(err)
5776 }
5777 ret := &ListClientUsersResponse{
5778 ServerResponse: googleapi.ServerResponse{
5779 Header: res.Header,
5780 HTTPStatusCode: res.StatusCode,
5781 },
5782 }
5783 target := &ret
5784 b, err := gensupport.DecodeResponseBytes(target, res)
5785 if err != nil {
5786 return nil, err
5787 }
5788 c.s.logger.DebugContext(c.ctx_, "api response", "serviceName", apiName, "rpcName", "authorizedbuyersmarketplace.buyers.clients.users.list", "response", internallog.HTTPResponse(res, b))
5789 return ret, nil
5790 }
5791
5792 // Pages invokes f for each page of results.
5793 // A non-nil error returned from f will halt the iteration.
5794 // The provided context supersedes any context provided to the Context method.
5795 func (c *BuyersClientsUsersListCall) Pages(ctx context.Context, f func(*ListClientUsersResponse) error) error {
5796 c.ctx_ = ctx
5797 defer c.PageToken(c.urlParams_.Get("pageToken"))
5798 for {
5799 x, err := c.Do()
5800 if err != nil {
5801 return err
5802 }
5803 if err := f(x); err != nil {
5804 return err
5805 }
5806 if x.NextPageToken == "" {
5807 return nil
5808 }
5809 c.PageToken(x.NextPageToken)
5810 }
5811 }
5812
5813 type BuyersDataSegmentsActivateCall struct {
5814 s *Service
5815 name string
5816 activatedatasegmentrequest *ActivateDataSegmentRequest
5817 urlParams_ gensupport.URLParams
5818 ctx_ context.Context
5819 header_ http.Header
5820 }
5821
5822 // Activate: Activates a data segment.
5823 //
5824 // - name: Name of data segment to activate. v1alpha format:
5825 // `buyers/{accountId}/dataSegments/{curatorDataSegmentId}` v1beta format:
5826 // `curators/{accountId}/dataSegments/{curatorDataSegmentId}`.
5827 func (r *BuyersDataSegmentsService) Activate(name string, activatedatasegmentrequest *ActivateDataSegmentRequest) *BuyersDataSegmentsActivateCall {
5828 c := &BuyersDataSegmentsActivateCall{s: r.s, urlParams_: make(gensupport.URLParams)}
5829 c.name = name
5830 c.activatedatasegmentrequest = activatedatasegmentrequest
5831 return c
5832 }
5833
5834 // Fields allows partial responses to be retrieved. See
5835 // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse for more
5836 // details.
5837 func (c *BuyersDataSegmentsActivateCall) Fields(s ...googleapi.Field) *BuyersDataSegmentsActivateCall {
5838 c.urlParams_.Set("fields", googleapi.CombineFields(s))
5839 return c
5840 }
5841
5842 // Context sets the context to be used in this call's Do method.
5843 func (c *BuyersDataSegmentsActivateCall) Context(ctx context.Context) *BuyersDataSegmentsActivateCall {
5844 c.ctx_ = ctx
5845 return c
5846 }
5847
5848 // Header returns a http.Header that can be modified by the caller to add
5849 // headers to the request.
5850 func (c *BuyersDataSegmentsActivateCall) Header() http.Header {
5851 if c.header_ == nil {
5852 c.header_ = make(http.Header)
5853 }
5854 return c.header_
5855 }
5856
5857 func (c *BuyersDataSegmentsActivateCall) doRequest(alt string) (*http.Response, error) {
5858 reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_)
5859 body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.activatedatasegmentrequest)
5860 if err != nil {
5861 return nil, err
5862 }
5863 c.urlParams_.Set("alt", alt)
5864 c.urlParams_.Set("prettyPrint", "false")
5865 urls := googleapi.ResolveRelative(c.s.BasePath, "v1alpha/{+name}:activate")
5866 urls += "?" + c.urlParams_.Encode()
5867 req, err := http.NewRequest("POST", urls, body)
5868 if err != nil {
5869 return nil, err
5870 }
5871 req.Header = reqHeaders
5872 googleapi.Expand(req.URL, map[string]string{
5873 "name": c.name,
5874 })
5875 c.s.logger.DebugContext(c.ctx_, "api request", "serviceName", apiName, "rpcName", "authorizedbuyersmarketplace.buyers.dataSegments.activate", "request", internallog.HTTPRequest(req, body.Bytes()))
5876 return gensupport.SendRequest(c.ctx_, c.s.client, req)
5877 }
5878
5879 // Do executes the "authorizedbuyersmarketplace.buyers.dataSegments.activate" call.
5880 // Any non-2xx status code is an error. Response headers are in either
5881 // *DataSegment.ServerResponse.Header or (if a response was returned at all) in
5882 // error.(*googleapi.Error).Header. Use googleapi.IsNotModified to check
5883 // whether the returned error was because http.StatusNotModified was returned.
5884 func (c *BuyersDataSegmentsActivateCall) Do(opts ...googleapi.CallOption) (*DataSegment, error) {
5885 gensupport.SetOptions(c.urlParams_, opts...)
5886 res, err := c.doRequest("json")
5887 if res != nil && res.StatusCode == http.StatusNotModified {
5888 if res.Body != nil {
5889 res.Body.Close()
5890 }
5891 return nil, gensupport.WrapError(&googleapi.Error{
5892 Code: res.StatusCode,
5893 Header: res.Header,
5894 })
5895 }
5896 if err != nil {
5897 return nil, err
5898 }
5899 defer googleapi.CloseBody(res)
5900 if err := googleapi.CheckResponse(res); err != nil {
5901 return nil, gensupport.WrapError(err)
5902 }
5903 ret := &DataSegment{
5904 ServerResponse: googleapi.ServerResponse{
5905 Header: res.Header,
5906 HTTPStatusCode: res.StatusCode,
5907 },
5908 }
5909 target := &ret
5910 b, err := gensupport.DecodeResponseBytes(target, res)
5911 if err != nil {
5912 return nil, err
5913 }
5914 c.s.logger.DebugContext(c.ctx_, "api response", "serviceName", apiName, "rpcName", "authorizedbuyersmarketplace.buyers.dataSegments.activate", "response", internallog.HTTPResponse(res, b))
5915 return ret, nil
5916 }
5917
5918 type BuyersDataSegmentsCreateCall struct {
5919 s *Service
5920 parent string
5921 datasegment *DataSegment
5922 urlParams_ gensupport.URLParams
5923 ctx_ context.Context
5924 header_ http.Header
5925 }
5926
5927 // Create: Creates a data segment owned by the listed curator. The data segment
5928 // will be created in the `ACTIVE` state, meaning it will be immediately
5929 // available for buyers to use in preferred deals, private auction deals, and
5930 // auction packages.
5931 //
5932 // - parent: The parent resource where this data segment will be created.
5933 // v1alpha format: `buyers/{accountId}` v1beta format: `curators/{accountId}`.
5934 func (r *BuyersDataSegmentsService) Create(parent string, datasegment *DataSegment) *BuyersDataSegmentsCreateCall {
5935 c := &BuyersDataSegmentsCreateCall{s: r.s, urlParams_: make(gensupport.URLParams)}
5936 c.parent = parent
5937 c.datasegment = datasegment
5938 return c
5939 }
5940
5941 // Fields allows partial responses to be retrieved. See
5942 // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse for more
5943 // details.
5944 func (c *BuyersDataSegmentsCreateCall) Fields(s ...googleapi.Field) *BuyersDataSegmentsCreateCall {
5945 c.urlParams_.Set("fields", googleapi.CombineFields(s))
5946 return c
5947 }
5948
5949 // Context sets the context to be used in this call's Do method.
5950 func (c *BuyersDataSegmentsCreateCall) Context(ctx context.Context) *BuyersDataSegmentsCreateCall {
5951 c.ctx_ = ctx
5952 return c
5953 }
5954
5955 // Header returns a http.Header that can be modified by the caller to add
5956 // headers to the request.
5957 func (c *BuyersDataSegmentsCreateCall) Header() http.Header {
5958 if c.header_ == nil {
5959 c.header_ = make(http.Header)
5960 }
5961 return c.header_
5962 }
5963
5964 func (c *BuyersDataSegmentsCreateCall) doRequest(alt string) (*http.Response, error) {
5965 reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_)
5966 body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.datasegment)
5967 if err != nil {
5968 return nil, err
5969 }
5970 c.urlParams_.Set("alt", alt)
5971 c.urlParams_.Set("prettyPrint", "false")
5972 urls := googleapi.ResolveRelative(c.s.BasePath, "v1alpha/{+parent}/dataSegments")
5973 urls += "?" + c.urlParams_.Encode()
5974 req, err := http.NewRequest("POST", urls, body)
5975 if err != nil {
5976 return nil, err
5977 }
5978 req.Header = reqHeaders
5979 googleapi.Expand(req.URL, map[string]string{
5980 "parent": c.parent,
5981 })
5982 c.s.logger.DebugContext(c.ctx_, "api request", "serviceName", apiName, "rpcName", "authorizedbuyersmarketplace.buyers.dataSegments.create", "request", internallog.HTTPRequest(req, body.Bytes()))
5983 return gensupport.SendRequest(c.ctx_, c.s.client, req)
5984 }
5985
5986 // Do executes the "authorizedbuyersmarketplace.buyers.dataSegments.create" call.
5987 // Any non-2xx status code is an error. Response headers are in either
5988 // *DataSegment.ServerResponse.Header or (if a response was returned at all) in
5989 // error.(*googleapi.Error).Header. Use googleapi.IsNotModified to check
5990 // whether the returned error was because http.StatusNotModified was returned.
5991 func (c *BuyersDataSegmentsCreateCall) Do(opts ...googleapi.CallOption) (*DataSegment, error) {
5992 gensupport.SetOptions(c.urlParams_, opts...)
5993 res, err := c.doRequest("json")
5994 if res != nil && res.StatusCode == http.StatusNotModified {
5995 if res.Body != nil {
5996 res.Body.Close()
5997 }
5998 return nil, gensupport.WrapError(&googleapi.Error{
5999 Code: res.StatusCode,
6000 Header: res.Header,
6001 })
6002 }
6003 if err != nil {
6004 return nil, err
6005 }
6006 defer googleapi.CloseBody(res)
6007 if err := googleapi.CheckResponse(res); err != nil {
6008 return nil, gensupport.WrapError(err)
6009 }
6010 ret := &DataSegment{
6011 ServerResponse: googleapi.ServerResponse{
6012 Header: res.Header,
6013 HTTPStatusCode: res.StatusCode,
6014 },
6015 }
6016 target := &ret
6017 b, err := gensupport.DecodeResponseBytes(target, res)
6018 if err != nil {
6019 return nil, err
6020 }
6021 c.s.logger.DebugContext(c.ctx_, "api response", "serviceName", apiName, "rpcName", "authorizedbuyersmarketplace.buyers.dataSegments.create", "response", internallog.HTTPResponse(res, b))
6022 return ret, nil
6023 }
6024
6025 type BuyersDataSegmentsDeactivateCall struct {
6026 s *Service
6027 name string
6028 deactivatedatasegmentrequest *DeactivateDataSegmentRequest
6029 urlParams_ gensupport.URLParams
6030 ctx_ context.Context
6031 header_ http.Header
6032 }
6033
6034 // Deactivate: Deactivates a data segment.
6035 //
6036 // - name: Name of data segment to deactivate. v1alpha format:
6037 // `buyers/{accountId}/dataSegments/{curatorDataSegmentId}` v1beta format:
6038 // `curators/{accountId}/dataSegments/{curatorDataSegmentId}`.
6039 func (r *BuyersDataSegmentsService) Deactivate(name string, deactivatedatasegmentrequest *DeactivateDataSegmentRequest) *BuyersDataSegmentsDeactivateCall {
6040 c := &BuyersDataSegmentsDeactivateCall{s: r.s, urlParams_: make(gensupport.URLParams)}
6041 c.name = name
6042 c.deactivatedatasegmentrequest = deactivatedatasegmentrequest
6043 return c
6044 }
6045
6046 // Fields allows partial responses to be retrieved. See
6047 // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse for more
6048 // details.
6049 func (c *BuyersDataSegmentsDeactivateCall) Fields(s ...googleapi.Field) *BuyersDataSegmentsDeactivateCall {
6050 c.urlParams_.Set("fields", googleapi.CombineFields(s))
6051 return c
6052 }
6053
6054 // Context sets the context to be used in this call's Do method.
6055 func (c *BuyersDataSegmentsDeactivateCall) Context(ctx context.Context) *BuyersDataSegmentsDeactivateCall {
6056 c.ctx_ = ctx
6057 return c
6058 }
6059
6060 // Header returns a http.Header that can be modified by the caller to add
6061 // headers to the request.
6062 func (c *BuyersDataSegmentsDeactivateCall) Header() http.Header {
6063 if c.header_ == nil {
6064 c.header_ = make(http.Header)
6065 }
6066 return c.header_
6067 }
6068
6069 func (c *BuyersDataSegmentsDeactivateCall) doRequest(alt string) (*http.Response, error) {
6070 reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_)
6071 body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.deactivatedatasegmentrequest)
6072 if err != nil {
6073 return nil, err
6074 }
6075 c.urlParams_.Set("alt", alt)
6076 c.urlParams_.Set("prettyPrint", "false")
6077 urls := googleapi.ResolveRelative(c.s.BasePath, "v1alpha/{+name}:deactivate")
6078 urls += "?" + c.urlParams_.Encode()
6079 req, err := http.NewRequest("POST", urls, body)
6080 if err != nil {
6081 return nil, err
6082 }
6083 req.Header = reqHeaders
6084 googleapi.Expand(req.URL, map[string]string{
6085 "name": c.name,
6086 })
6087 c.s.logger.DebugContext(c.ctx_, "api request", "serviceName", apiName, "rpcName", "authorizedbuyersmarketplace.buyers.dataSegments.deactivate", "request", internallog.HTTPRequest(req, body.Bytes()))
6088 return gensupport.SendRequest(c.ctx_, c.s.client, req)
6089 }
6090
6091 // Do executes the "authorizedbuyersmarketplace.buyers.dataSegments.deactivate" call.
6092 // Any non-2xx status code is an error. Response headers are in either
6093 // *DataSegment.ServerResponse.Header or (if a response was returned at all) in
6094 // error.(*googleapi.Error).Header. Use googleapi.IsNotModified to check
6095 // whether the returned error was because http.StatusNotModified was returned.
6096 func (c *BuyersDataSegmentsDeactivateCall) Do(opts ...googleapi.CallOption) (*DataSegment, error) {
6097 gensupport.SetOptions(c.urlParams_, opts...)
6098 res, err := c.doRequest("json")
6099 if res != nil && res.StatusCode == http.StatusNotModified {
6100 if res.Body != nil {
6101 res.Body.Close()
6102 }
6103 return nil, gensupport.WrapError(&googleapi.Error{
6104 Code: res.StatusCode,
6105 Header: res.Header,
6106 })
6107 }
6108 if err != nil {
6109 return nil, err
6110 }
6111 defer googleapi.CloseBody(res)
6112 if err := googleapi.CheckResponse(res); err != nil {
6113 return nil, gensupport.WrapError(err)
6114 }
6115 ret := &DataSegment{
6116 ServerResponse: googleapi.ServerResponse{
6117 Header: res.Header,
6118 HTTPStatusCode: res.StatusCode,
6119 },
6120 }
6121 target := &ret
6122 b, err := gensupport.DecodeResponseBytes(target, res)
6123 if err != nil {
6124 return nil, err
6125 }
6126 c.s.logger.DebugContext(c.ctx_, "api response", "serviceName", apiName, "rpcName", "authorizedbuyersmarketplace.buyers.dataSegments.deactivate", "response", internallog.HTTPResponse(res, b))
6127 return ret, nil
6128 }
6129
6130 type BuyersDataSegmentsGetCall struct {
6131 s *Service
6132 name string
6133 urlParams_ gensupport.URLParams
6134 ifNoneMatch_ string
6135 ctx_ context.Context
6136 header_ http.Header
6137 }
6138
6139 // Get: Gets a data segment given its name.
6140 //
6141 // - name: Name of data segment to get. v1alpha format:
6142 // `buyers/{accountId}/dataSegments/{curatorDataSegmentId}` v1beta format:
6143 // `curators/{accountId}/dataSegments/{curatorDataSegmentId}`.
6144 func (r *BuyersDataSegmentsService) Get(name string) *BuyersDataSegmentsGetCall {
6145 c := &BuyersDataSegmentsGetCall{s: r.s, urlParams_: make(gensupport.URLParams)}
6146 c.name = name
6147 return c
6148 }
6149
6150 // Fields allows partial responses to be retrieved. See
6151 // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse for more
6152 // details.
6153 func (c *BuyersDataSegmentsGetCall) Fields(s ...googleapi.Field) *BuyersDataSegmentsGetCall {
6154 c.urlParams_.Set("fields", googleapi.CombineFields(s))
6155 return c
6156 }
6157
6158 // IfNoneMatch sets an optional parameter which makes the operation fail if the
6159 // object's ETag matches the given value. This is useful for getting updates
6160 // only after the object has changed since the last request.
6161 func (c *BuyersDataSegmentsGetCall) IfNoneMatch(entityTag string) *BuyersDataSegmentsGetCall {
6162 c.ifNoneMatch_ = entityTag
6163 return c
6164 }
6165
6166 // Context sets the context to be used in this call's Do method.
6167 func (c *BuyersDataSegmentsGetCall) Context(ctx context.Context) *BuyersDataSegmentsGetCall {
6168 c.ctx_ = ctx
6169 return c
6170 }
6171
6172 // Header returns a http.Header that can be modified by the caller to add
6173 // headers to the request.
6174 func (c *BuyersDataSegmentsGetCall) Header() http.Header {
6175 if c.header_ == nil {
6176 c.header_ = make(http.Header)
6177 }
6178 return c.header_
6179 }
6180
6181 func (c *BuyersDataSegmentsGetCall) doRequest(alt string) (*http.Response, error) {
6182 reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_)
6183 if c.ifNoneMatch_ != "" {
6184 reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
6185 }
6186 c.urlParams_.Set("alt", alt)
6187 c.urlParams_.Set("prettyPrint", "false")
6188 urls := googleapi.ResolveRelative(c.s.BasePath, "v1alpha/{+name}")
6189 urls += "?" + c.urlParams_.Encode()
6190 req, err := http.NewRequest("GET", urls, nil)
6191 if err != nil {
6192 return nil, err
6193 }
6194 req.Header = reqHeaders
6195 googleapi.Expand(req.URL, map[string]string{
6196 "name": c.name,
6197 })
6198 c.s.logger.DebugContext(c.ctx_, "api request", "serviceName", apiName, "rpcName", "authorizedbuyersmarketplace.buyers.dataSegments.get", "request", internallog.HTTPRequest(req, nil))
6199 return gensupport.SendRequest(c.ctx_, c.s.client, req)
6200 }
6201
6202 // Do executes the "authorizedbuyersmarketplace.buyers.dataSegments.get" call.
6203 // Any non-2xx status code is an error. Response headers are in either
6204 // *DataSegment.ServerResponse.Header or (if a response was returned at all) in
6205 // error.(*googleapi.Error).Header. Use googleapi.IsNotModified to check
6206 // whether the returned error was because http.StatusNotModified was returned.
6207 func (c *BuyersDataSegmentsGetCall) Do(opts ...googleapi.CallOption) (*DataSegment, error) {
6208 gensupport.SetOptions(c.urlParams_, opts...)
6209 res, err := c.doRequest("json")
6210 if res != nil && res.StatusCode == http.StatusNotModified {
6211 if res.Body != nil {
6212 res.Body.Close()
6213 }
6214 return nil, gensupport.WrapError(&googleapi.Error{
6215 Code: res.StatusCode,
6216 Header: res.Header,
6217 })
6218 }
6219 if err != nil {
6220 return nil, err
6221 }
6222 defer googleapi.CloseBody(res)
6223 if err := googleapi.CheckResponse(res); err != nil {
6224 return nil, gensupport.WrapError(err)
6225 }
6226 ret := &DataSegment{
6227 ServerResponse: googleapi.ServerResponse{
6228 Header: res.Header,
6229 HTTPStatusCode: res.StatusCode,
6230 },
6231 }
6232 target := &ret
6233 b, err := gensupport.DecodeResponseBytes(target, res)
6234 if err != nil {
6235 return nil, err
6236 }
6237 c.s.logger.DebugContext(c.ctx_, "api response", "serviceName", apiName, "rpcName", "authorizedbuyersmarketplace.buyers.dataSegments.get", "response", internallog.HTTPResponse(res, b))
6238 return ret, nil
6239 }
6240
6241 type BuyersDataSegmentsListCall struct {
6242 s *Service
6243 parent string
6244 urlParams_ gensupport.URLParams
6245 ifNoneMatch_ string
6246 ctx_ context.Context
6247 header_ http.Header
6248 }
6249
6250 // List: List the data segments owned by a curator.
6251 //
6252 // - parent: Name of the parent curator that can access the data segment.
6253 // v1alpha format: `buyers/{accountId}` v1beta format: `curators/{accountId}`.
6254 func (r *BuyersDataSegmentsService) List(parent string) *BuyersDataSegmentsListCall {
6255 c := &BuyersDataSegmentsListCall{s: r.s, urlParams_: make(gensupport.URLParams)}
6256 c.parent = parent
6257 return c
6258 }
6259
6260 // PageSize sets the optional parameter "pageSize": Requested page size. The
6261 // server may return fewer results than requested. Max allowed page size is
6262 // 500. If unspecified, the server will default to 500.
6263 func (c *BuyersDataSegmentsListCall) PageSize(pageSize int64) *BuyersDataSegmentsListCall {
6264 c.urlParams_.Set("pageSize", fmt.Sprint(pageSize))
6265 return c
6266 }
6267
6268 // PageToken sets the optional parameter "pageToken": The page token as
6269 // returned. ListDataSegmentsResponse.nextPageToken
6270 func (c *BuyersDataSegmentsListCall) PageToken(pageToken string) *BuyersDataSegmentsListCall {
6271 c.urlParams_.Set("pageToken", pageToken)
6272 return c
6273 }
6274
6275 // Fields allows partial responses to be retrieved. See
6276 // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse for more
6277 // details.
6278 func (c *BuyersDataSegmentsListCall) Fields(s ...googleapi.Field) *BuyersDataSegmentsListCall {
6279 c.urlParams_.Set("fields", googleapi.CombineFields(s))
6280 return c
6281 }
6282
6283 // IfNoneMatch sets an optional parameter which makes the operation fail if the
6284 // object's ETag matches the given value. This is useful for getting updates
6285 // only after the object has changed since the last request.
6286 func (c *BuyersDataSegmentsListCall) IfNoneMatch(entityTag string) *BuyersDataSegmentsListCall {
6287 c.ifNoneMatch_ = entityTag
6288 return c
6289 }
6290
6291 // Context sets the context to be used in this call's Do method.
6292 func (c *BuyersDataSegmentsListCall) Context(ctx context.Context) *BuyersDataSegmentsListCall {
6293 c.ctx_ = ctx
6294 return c
6295 }
6296
6297 // Header returns a http.Header that can be modified by the caller to add
6298 // headers to the request.
6299 func (c *BuyersDataSegmentsListCall) Header() http.Header {
6300 if c.header_ == nil {
6301 c.header_ = make(http.Header)
6302 }
6303 return c.header_
6304 }
6305
6306 func (c *BuyersDataSegmentsListCall) doRequest(alt string) (*http.Response, error) {
6307 reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_)
6308 if c.ifNoneMatch_ != "" {
6309 reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
6310 }
6311 c.urlParams_.Set("alt", alt)
6312 c.urlParams_.Set("prettyPrint", "false")
6313 urls := googleapi.ResolveRelative(c.s.BasePath, "v1alpha/{+parent}/dataSegments")
6314 urls += "?" + c.urlParams_.Encode()
6315 req, err := http.NewRequest("GET", urls, nil)
6316 if err != nil {
6317 return nil, err
6318 }
6319 req.Header = reqHeaders
6320 googleapi.Expand(req.URL, map[string]string{
6321 "parent": c.parent,
6322 })
6323 c.s.logger.DebugContext(c.ctx_, "api request", "serviceName", apiName, "rpcName", "authorizedbuyersmarketplace.buyers.dataSegments.list", "request", internallog.HTTPRequest(req, nil))
6324 return gensupport.SendRequest(c.ctx_, c.s.client, req)
6325 }
6326
6327 // Do executes the "authorizedbuyersmarketplace.buyers.dataSegments.list" call.
6328 // Any non-2xx status code is an error. Response headers are in either
6329 // *ListDataSegmentsResponse.ServerResponse.Header or (if a response was
6330 // returned at all) in error.(*googleapi.Error).Header. Use
6331 // googleapi.IsNotModified to check whether the returned error was because
6332 // http.StatusNotModified was returned.
6333 func (c *BuyersDataSegmentsListCall) Do(opts ...googleapi.CallOption) (*ListDataSegmentsResponse, error) {
6334 gensupport.SetOptions(c.urlParams_, opts...)
6335 res, err := c.doRequest("json")
6336 if res != nil && res.StatusCode == http.StatusNotModified {
6337 if res.Body != nil {
6338 res.Body.Close()
6339 }
6340 return nil, gensupport.WrapError(&googleapi.Error{
6341 Code: res.StatusCode,
6342 Header: res.Header,
6343 })
6344 }
6345 if err != nil {
6346 return nil, err
6347 }
6348 defer googleapi.CloseBody(res)
6349 if err := googleapi.CheckResponse(res); err != nil {
6350 return nil, gensupport.WrapError(err)
6351 }
6352 ret := &ListDataSegmentsResponse{
6353 ServerResponse: googleapi.ServerResponse{
6354 Header: res.Header,
6355 HTTPStatusCode: res.StatusCode,
6356 },
6357 }
6358 target := &ret
6359 b, err := gensupport.DecodeResponseBytes(target, res)
6360 if err != nil {
6361 return nil, err
6362 }
6363 c.s.logger.DebugContext(c.ctx_, "api response", "serviceName", apiName, "rpcName", "authorizedbuyersmarketplace.buyers.dataSegments.list", "response", internallog.HTTPResponse(res, b))
6364 return ret, nil
6365 }
6366
6367 // Pages invokes f for each page of results.
6368 // A non-nil error returned from f will halt the iteration.
6369 // The provided context supersedes any context provided to the Context method.
6370 func (c *BuyersDataSegmentsListCall) Pages(ctx context.Context, f func(*ListDataSegmentsResponse) error) error {
6371 c.ctx_ = ctx
6372 defer c.PageToken(c.urlParams_.Get("pageToken"))
6373 for {
6374 x, err := c.Do()
6375 if err != nil {
6376 return err
6377 }
6378 if err := f(x); err != nil {
6379 return err
6380 }
6381 if x.NextPageToken == "" {
6382 return nil
6383 }
6384 c.PageToken(x.NextPageToken)
6385 }
6386 }
6387
6388 type BuyersDataSegmentsPatchCall struct {
6389 s *Service
6390 nameid string
6391 datasegment *DataSegment
6392 urlParams_ gensupport.URLParams
6393 ctx_ context.Context
6394 header_ http.Header
6395 }
6396
6397 // Patch: Updates a data segment.
6398 //
6399 // - name: Immutable. Identifier. The unique identifier for the data segment.
6400 // Account ID corresponds to the account ID that created the segment. v1alpha
6401 // format: `buyers/{accountId}/dataSegments/{curatorDataSegmentId}` v1beta
6402 // format: `curators/{curatorAccountId}/dataSegments/{curatorDataSegmentId}`.
6403 func (r *BuyersDataSegmentsService) Patch(nameid string, datasegment *DataSegment) *BuyersDataSegmentsPatchCall {
6404 c := &BuyersDataSegmentsPatchCall{s: r.s, urlParams_: make(gensupport.URLParams)}
6405 c.nameid = nameid
6406 c.datasegment = datasegment
6407 return c
6408 }
6409
6410 // UpdateMask sets the optional parameter "updateMask": List of fields to be
6411 // updated. If empty or unspecified, the service will update all fields
6412 // populated in the update request excluding the output only fields and
6413 // primitive fields with default value. Note that explicit field mask is
6414 // required in order to reset a primitive field back to its default value, for
6415 // example, false for boolean fields, 0 for integer fields. A special field
6416 // mask consisting of a single path "*" can be used to indicate full
6417 // replacement(the equivalent of PUT method), updatable fields unset or
6418 // unspecified in the input will be cleared or set to default value. Output
6419 // only fields will be ignored regardless of the value of updateMask.
6420 func (c *BuyersDataSegmentsPatchCall) UpdateMask(updateMask string) *BuyersDataSegmentsPatchCall {
6421 c.urlParams_.Set("updateMask", updateMask)
6422 return c
6423 }
6424
6425 // Fields allows partial responses to be retrieved. See
6426 // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse for more
6427 // details.
6428 func (c *BuyersDataSegmentsPatchCall) Fields(s ...googleapi.Field) *BuyersDataSegmentsPatchCall {
6429 c.urlParams_.Set("fields", googleapi.CombineFields(s))
6430 return c
6431 }
6432
6433 // Context sets the context to be used in this call's Do method.
6434 func (c *BuyersDataSegmentsPatchCall) Context(ctx context.Context) *BuyersDataSegmentsPatchCall {
6435 c.ctx_ = ctx
6436 return c
6437 }
6438
6439 // Header returns a http.Header that can be modified by the caller to add
6440 // headers to the request.
6441 func (c *BuyersDataSegmentsPatchCall) Header() http.Header {
6442 if c.header_ == nil {
6443 c.header_ = make(http.Header)
6444 }
6445 return c.header_
6446 }
6447
6448 func (c *BuyersDataSegmentsPatchCall) doRequest(alt string) (*http.Response, error) {
6449 reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_)
6450 body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.datasegment)
6451 if err != nil {
6452 return nil, err
6453 }
6454 c.urlParams_.Set("alt", alt)
6455 c.urlParams_.Set("prettyPrint", "false")
6456 urls := googleapi.ResolveRelative(c.s.BasePath, "v1alpha/{+name}")
6457 urls += "?" + c.urlParams_.Encode()
6458 req, err := http.NewRequest("PATCH", urls, body)
6459 if err != nil {
6460 return nil, err
6461 }
6462 req.Header = reqHeaders
6463 googleapi.Expand(req.URL, map[string]string{
6464 "name": c.nameid,
6465 })
6466 c.s.logger.DebugContext(c.ctx_, "api request", "serviceName", apiName, "rpcName", "authorizedbuyersmarketplace.buyers.dataSegments.patch", "request", internallog.HTTPRequest(req, body.Bytes()))
6467 return gensupport.SendRequest(c.ctx_, c.s.client, req)
6468 }
6469
6470 // Do executes the "authorizedbuyersmarketplace.buyers.dataSegments.patch" call.
6471 // Any non-2xx status code is an error. Response headers are in either
6472 // *DataSegment.ServerResponse.Header or (if a response was returned at all) in
6473 // error.(*googleapi.Error).Header. Use googleapi.IsNotModified to check
6474 // whether the returned error was because http.StatusNotModified was returned.
6475 func (c *BuyersDataSegmentsPatchCall) Do(opts ...googleapi.CallOption) (*DataSegment, error) {
6476 gensupport.SetOptions(c.urlParams_, opts...)
6477 res, err := c.doRequest("json")
6478 if res != nil && res.StatusCode == http.StatusNotModified {
6479 if res.Body != nil {
6480 res.Body.Close()
6481 }
6482 return nil, gensupport.WrapError(&googleapi.Error{
6483 Code: res.StatusCode,
6484 Header: res.Header,
6485 })
6486 }
6487 if err != nil {
6488 return nil, err
6489 }
6490 defer googleapi.CloseBody(res)
6491 if err := googleapi.CheckResponse(res); err != nil {
6492 return nil, gensupport.WrapError(err)
6493 }
6494 ret := &DataSegment{
6495 ServerResponse: googleapi.ServerResponse{
6496 Header: res.Header,
6497 HTTPStatusCode: res.StatusCode,
6498 },
6499 }
6500 target := &ret
6501 b, err := gensupport.DecodeResponseBytes(target, res)
6502 if err != nil {
6503 return nil, err
6504 }
6505 c.s.logger.DebugContext(c.ctx_, "api response", "serviceName", apiName, "rpcName", "authorizedbuyersmarketplace.buyers.dataSegments.patch", "response", internallog.HTTPResponse(res, b))
6506 return ret, nil
6507 }
6508
6509 type BuyersFinalizedDealsAddCreativeCall struct {
6510 s *Service
6511 deal string
6512 addcreativerequest *AddCreativeRequest
6513 urlParams_ gensupport.URLParams
6514 ctx_ context.Context
6515 header_ http.Header
6516 }
6517
6518 // AddCreative: Add creative to be used in the bidding process for a finalized
6519 // deal. For programmatic guaranteed deals, it's recommended that you associate
6520 // at least one approved creative with the deal before calling SetReadyToServe,
6521 // to help reduce the number of bid responses filtered because they don't
6522 // contain approved creatives. Creatives successfully added to a deal can be
6523 // found in the Realtime-bidding Creatives API creative.deal_ids. This method
6524 // only applies to programmatic guaranteed deals. Maximum number of 1000
6525 // creatives can be added to a finalized deal.
6526 //
6527 // - deal: Name of the finalized deal in the format of:
6528 // `buyers/{accountId}/finalizedDeals/{dealId}`.
6529 func (r *BuyersFinalizedDealsService) AddCreative(deal string, addcreativerequest *AddCreativeRequest) *BuyersFinalizedDealsAddCreativeCall {
6530 c := &BuyersFinalizedDealsAddCreativeCall{s: r.s, urlParams_: make(gensupport.URLParams)}
6531 c.deal = deal
6532 c.addcreativerequest = addcreativerequest
6533 return c
6534 }
6535
6536 // Fields allows partial responses to be retrieved. See
6537 // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse for more
6538 // details.
6539 func (c *BuyersFinalizedDealsAddCreativeCall) Fields(s ...googleapi.Field) *BuyersFinalizedDealsAddCreativeCall {
6540 c.urlParams_.Set("fields", googleapi.CombineFields(s))
6541 return c
6542 }
6543
6544 // Context sets the context to be used in this call's Do method.
6545 func (c *BuyersFinalizedDealsAddCreativeCall) Context(ctx context.Context) *BuyersFinalizedDealsAddCreativeCall {
6546 c.ctx_ = ctx
6547 return c
6548 }
6549
6550 // Header returns a http.Header that can be modified by the caller to add
6551 // headers to the request.
6552 func (c *BuyersFinalizedDealsAddCreativeCall) Header() http.Header {
6553 if c.header_ == nil {
6554 c.header_ = make(http.Header)
6555 }
6556 return c.header_
6557 }
6558
6559 func (c *BuyersFinalizedDealsAddCreativeCall) doRequest(alt string) (*http.Response, error) {
6560 reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_)
6561 body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.addcreativerequest)
6562 if err != nil {
6563 return nil, err
6564 }
6565 c.urlParams_.Set("alt", alt)
6566 c.urlParams_.Set("prettyPrint", "false")
6567 urls := googleapi.ResolveRelative(c.s.BasePath, "v1alpha/{+deal}:addCreative")
6568 urls += "?" + c.urlParams_.Encode()
6569 req, err := http.NewRequest("POST", urls, body)
6570 if err != nil {
6571 return nil, err
6572 }
6573 req.Header = reqHeaders
6574 googleapi.Expand(req.URL, map[string]string{
6575 "deal": c.deal,
6576 })
6577 c.s.logger.DebugContext(c.ctx_, "api request", "serviceName", apiName, "rpcName", "authorizedbuyersmarketplace.buyers.finalizedDeals.addCreative", "request", internallog.HTTPRequest(req, body.Bytes()))
6578 return gensupport.SendRequest(c.ctx_, c.s.client, req)
6579 }
6580
6581 // Do executes the "authorizedbuyersmarketplace.buyers.finalizedDeals.addCreative" call.
6582 // Any non-2xx status code is an error. Response headers are in either
6583 // *FinalizedDeal.ServerResponse.Header or (if a response was returned at all)
6584 // in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to check
6585 // whether the returned error was because http.StatusNotModified was returned.
6586 func (c *BuyersFinalizedDealsAddCreativeCall) Do(opts ...googleapi.CallOption) (*FinalizedDeal, error) {
6587 gensupport.SetOptions(c.urlParams_, opts...)
6588 res, err := c.doRequest("json")
6589 if res != nil && res.StatusCode == http.StatusNotModified {
6590 if res.Body != nil {
6591 res.Body.Close()
6592 }
6593 return nil, gensupport.WrapError(&googleapi.Error{
6594 Code: res.StatusCode,
6595 Header: res.Header,
6596 })
6597 }
6598 if err != nil {
6599 return nil, err
6600 }
6601 defer googleapi.CloseBody(res)
6602 if err := googleapi.CheckResponse(res); err != nil {
6603 return nil, gensupport.WrapError(err)
6604 }
6605 ret := &FinalizedDeal{
6606 ServerResponse: googleapi.ServerResponse{
6607 Header: res.Header,
6608 HTTPStatusCode: res.StatusCode,
6609 },
6610 }
6611 target := &ret
6612 b, err := gensupport.DecodeResponseBytes(target, res)
6613 if err != nil {
6614 return nil, err
6615 }
6616 c.s.logger.DebugContext(c.ctx_, "api response", "serviceName", apiName, "rpcName", "authorizedbuyersmarketplace.buyers.finalizedDeals.addCreative", "response", internallog.HTTPResponse(res, b))
6617 return ret, nil
6618 }
6619
6620 type BuyersFinalizedDealsGetCall struct {
6621 s *Service
6622 name string
6623 urlParams_ gensupport.URLParams
6624 ifNoneMatch_ string
6625 ctx_ context.Context
6626 header_ http.Header
6627 }
6628
6629 // Get: Gets a finalized deal given its name.
6630 //
6631 // - name: Format: `buyers/{accountId}/finalizedDeals/{dealId}`.
6632 func (r *BuyersFinalizedDealsService) Get(name string) *BuyersFinalizedDealsGetCall {
6633 c := &BuyersFinalizedDealsGetCall{s: r.s, urlParams_: make(gensupport.URLParams)}
6634 c.name = name
6635 return c
6636 }
6637
6638 // Fields allows partial responses to be retrieved. See
6639 // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse for more
6640 // details.
6641 func (c *BuyersFinalizedDealsGetCall) Fields(s ...googleapi.Field) *BuyersFinalizedDealsGetCall {
6642 c.urlParams_.Set("fields", googleapi.CombineFields(s))
6643 return c
6644 }
6645
6646 // IfNoneMatch sets an optional parameter which makes the operation fail if the
6647 // object's ETag matches the given value. This is useful for getting updates
6648 // only after the object has changed since the last request.
6649 func (c *BuyersFinalizedDealsGetCall) IfNoneMatch(entityTag string) *BuyersFinalizedDealsGetCall {
6650 c.ifNoneMatch_ = entityTag
6651 return c
6652 }
6653
6654 // Context sets the context to be used in this call's Do method.
6655 func (c *BuyersFinalizedDealsGetCall) Context(ctx context.Context) *BuyersFinalizedDealsGetCall {
6656 c.ctx_ = ctx
6657 return c
6658 }
6659
6660 // Header returns a http.Header that can be modified by the caller to add
6661 // headers to the request.
6662 func (c *BuyersFinalizedDealsGetCall) Header() http.Header {
6663 if c.header_ == nil {
6664 c.header_ = make(http.Header)
6665 }
6666 return c.header_
6667 }
6668
6669 func (c *BuyersFinalizedDealsGetCall) doRequest(alt string) (*http.Response, error) {
6670 reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_)
6671 if c.ifNoneMatch_ != "" {
6672 reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
6673 }
6674 c.urlParams_.Set("alt", alt)
6675 c.urlParams_.Set("prettyPrint", "false")
6676 urls := googleapi.ResolveRelative(c.s.BasePath, "v1alpha/{+name}")
6677 urls += "?" + c.urlParams_.Encode()
6678 req, err := http.NewRequest("GET", urls, nil)
6679 if err != nil {
6680 return nil, err
6681 }
6682 req.Header = reqHeaders
6683 googleapi.Expand(req.URL, map[string]string{
6684 "name": c.name,
6685 })
6686 c.s.logger.DebugContext(c.ctx_, "api request", "serviceName", apiName, "rpcName", "authorizedbuyersmarketplace.buyers.finalizedDeals.get", "request", internallog.HTTPRequest(req, nil))
6687 return gensupport.SendRequest(c.ctx_, c.s.client, req)
6688 }
6689
6690 // Do executes the "authorizedbuyersmarketplace.buyers.finalizedDeals.get" call.
6691 // Any non-2xx status code is an error. Response headers are in either
6692 // *FinalizedDeal.ServerResponse.Header or (if a response was returned at all)
6693 // in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to check
6694 // whether the returned error was because http.StatusNotModified was returned.
6695 func (c *BuyersFinalizedDealsGetCall) Do(opts ...googleapi.CallOption) (*FinalizedDeal, error) {
6696 gensupport.SetOptions(c.urlParams_, opts...)
6697 res, err := c.doRequest("json")
6698 if res != nil && res.StatusCode == http.StatusNotModified {
6699 if res.Body != nil {
6700 res.Body.Close()
6701 }
6702 return nil, gensupport.WrapError(&googleapi.Error{
6703 Code: res.StatusCode,
6704 Header: res.Header,
6705 })
6706 }
6707 if err != nil {
6708 return nil, err
6709 }
6710 defer googleapi.CloseBody(res)
6711 if err := googleapi.CheckResponse(res); err != nil {
6712 return nil, gensupport.WrapError(err)
6713 }
6714 ret := &FinalizedDeal{
6715 ServerResponse: googleapi.ServerResponse{
6716 Header: res.Header,
6717 HTTPStatusCode: res.StatusCode,
6718 },
6719 }
6720 target := &ret
6721 b, err := gensupport.DecodeResponseBytes(target, res)
6722 if err != nil {
6723 return nil, err
6724 }
6725 c.s.logger.DebugContext(c.ctx_, "api response", "serviceName", apiName, "rpcName", "authorizedbuyersmarketplace.buyers.finalizedDeals.get", "response", internallog.HTTPResponse(res, b))
6726 return ret, nil
6727 }
6728
6729 type BuyersFinalizedDealsListCall struct {
6730 s *Service
6731 parent string
6732 urlParams_ gensupport.URLParams
6733 ifNoneMatch_ string
6734 ctx_ context.Context
6735 header_ http.Header
6736 }
6737
6738 // List: Lists finalized deals. Use the URL path
6739 // "/v1alpha/buyers/{accountId}/finalizedDeals" to list finalized deals for the
6740 // current buyer and its clients. Bidders can use the URL path
6741 // "/v1alpha/bidders/{accountId}/finalizedDeals" to list finalized deals for
6742 // the bidder, its buyers and all their clients.
6743 //
6744 // - parent: The buyer to list the finalized deals for, in the format:
6745 // `buyers/{accountId}`. When used to list finalized deals for a bidder, its
6746 // buyers and clients, in the format `bidders/{accountId}`.
6747 func (r *BuyersFinalizedDealsService) List(parent string) *BuyersFinalizedDealsListCall {
6748 c := &BuyersFinalizedDealsListCall{s: r.s, urlParams_: make(gensupport.URLParams)}
6749 c.parent = parent
6750 return c
6751 }
6752
6753 // Filter sets the optional parameter "filter": Optional query string using the
6754 // Cloud API list filtering syntax
6755 // (https://developers.google.com/authorized-buyers/apis/guides/list-filters)
6756 // Supported columns for filtering are: * deal.displayName * deal.dealType *
6757 // deal.createTime * deal.updateTime * deal.flightStartTime *
6758 // deal.flightEndTime * deal.eligibleSeatIds * dealServingStatus * readyToServe
6759 func (c *BuyersFinalizedDealsListCall) Filter(filter string) *BuyersFinalizedDealsListCall {
6760 c.urlParams_.Set("filter", filter)
6761 return c
6762 }
6763
6764 // OrderBy sets the optional parameter "orderBy": An optional query string to
6765 // sort finalized deals using the Cloud API sorting syntax
6766 // (https://cloud.google.com/apis/design/design_patterns#sorting_order). If no
6767 // sort order is specified, results will be returned in an arbitrary order.
6768 // Supported columns for sorting are: * deal.displayName * deal.createTime *
6769 // deal.updateTime * deal.flightStartTime * deal.flightEndTime *
6770 // rtbMetrics.bidRequests7Days * rtbMetrics.bids7Days *
6771 // rtbMetrics.adImpressions7Days * rtbMetrics.bidRate7Days *
6772 // rtbMetrics.filteredBidRate7Days * rtbMetrics.mustBidRateCurrentMonth
6773 func (c *BuyersFinalizedDealsListCall) OrderBy(orderBy string) *BuyersFinalizedDealsListCall {
6774 c.urlParams_.Set("orderBy", orderBy)
6775 return c
6776 }
6777
6778 // PageSize sets the optional parameter "pageSize": Requested page size. The
6779 // server may return fewer results than requested. If requested more than 500,
6780 // the server will return 500 results per page. If unspecified, the server will
6781 // pick a default page size of 100.
6782 func (c *BuyersFinalizedDealsListCall) PageSize(pageSize int64) *BuyersFinalizedDealsListCall {
6783 c.urlParams_.Set("pageSize", fmt.Sprint(pageSize))
6784 return c
6785 }
6786
6787 // PageToken sets the optional parameter "pageToken": The page token as
6788 // returned from ListFinalizedDealsResponse.
6789 func (c *BuyersFinalizedDealsListCall) PageToken(pageToken string) *BuyersFinalizedDealsListCall {
6790 c.urlParams_.Set("pageToken", pageToken)
6791 return c
6792 }
6793
6794 // Fields allows partial responses to be retrieved. See
6795 // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse for more
6796 // details.
6797 func (c *BuyersFinalizedDealsListCall) Fields(s ...googleapi.Field) *BuyersFinalizedDealsListCall {
6798 c.urlParams_.Set("fields", googleapi.CombineFields(s))
6799 return c
6800 }
6801
6802 // IfNoneMatch sets an optional parameter which makes the operation fail if the
6803 // object's ETag matches the given value. This is useful for getting updates
6804 // only after the object has changed since the last request.
6805 func (c *BuyersFinalizedDealsListCall) IfNoneMatch(entityTag string) *BuyersFinalizedDealsListCall {
6806 c.ifNoneMatch_ = entityTag
6807 return c
6808 }
6809
6810 // Context sets the context to be used in this call's Do method.
6811 func (c *BuyersFinalizedDealsListCall) Context(ctx context.Context) *BuyersFinalizedDealsListCall {
6812 c.ctx_ = ctx
6813 return c
6814 }
6815
6816 // Header returns a http.Header that can be modified by the caller to add
6817 // headers to the request.
6818 func (c *BuyersFinalizedDealsListCall) Header() http.Header {
6819 if c.header_ == nil {
6820 c.header_ = make(http.Header)
6821 }
6822 return c.header_
6823 }
6824
6825 func (c *BuyersFinalizedDealsListCall) doRequest(alt string) (*http.Response, error) {
6826 reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_)
6827 if c.ifNoneMatch_ != "" {
6828 reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
6829 }
6830 c.urlParams_.Set("alt", alt)
6831 c.urlParams_.Set("prettyPrint", "false")
6832 urls := googleapi.ResolveRelative(c.s.BasePath, "v1alpha/{+parent}/finalizedDeals")
6833 urls += "?" + c.urlParams_.Encode()
6834 req, err := http.NewRequest("GET", urls, nil)
6835 if err != nil {
6836 return nil, err
6837 }
6838 req.Header = reqHeaders
6839 googleapi.Expand(req.URL, map[string]string{
6840 "parent": c.parent,
6841 })
6842 c.s.logger.DebugContext(c.ctx_, "api request", "serviceName", apiName, "rpcName", "authorizedbuyersmarketplace.buyers.finalizedDeals.list", "request", internallog.HTTPRequest(req, nil))
6843 return gensupport.SendRequest(c.ctx_, c.s.client, req)
6844 }
6845
6846 // Do executes the "authorizedbuyersmarketplace.buyers.finalizedDeals.list" call.
6847 // Any non-2xx status code is an error. Response headers are in either
6848 // *ListFinalizedDealsResponse.ServerResponse.Header or (if a response was
6849 // returned at all) in error.(*googleapi.Error).Header. Use
6850 // googleapi.IsNotModified to check whether the returned error was because
6851 // http.StatusNotModified was returned.
6852 func (c *BuyersFinalizedDealsListCall) Do(opts ...googleapi.CallOption) (*ListFinalizedDealsResponse, error) {
6853 gensupport.SetOptions(c.urlParams_, opts...)
6854 res, err := c.doRequest("json")
6855 if res != nil && res.StatusCode == http.StatusNotModified {
6856 if res.Body != nil {
6857 res.Body.Close()
6858 }
6859 return nil, gensupport.WrapError(&googleapi.Error{
6860 Code: res.StatusCode,
6861 Header: res.Header,
6862 })
6863 }
6864 if err != nil {
6865 return nil, err
6866 }
6867 defer googleapi.CloseBody(res)
6868 if err := googleapi.CheckResponse(res); err != nil {
6869 return nil, gensupport.WrapError(err)
6870 }
6871 ret := &ListFinalizedDealsResponse{
6872 ServerResponse: googleapi.ServerResponse{
6873 Header: res.Header,
6874 HTTPStatusCode: res.StatusCode,
6875 },
6876 }
6877 target := &ret
6878 b, err := gensupport.DecodeResponseBytes(target, res)
6879 if err != nil {
6880 return nil, err
6881 }
6882 c.s.logger.DebugContext(c.ctx_, "api response", "serviceName", apiName, "rpcName", "authorizedbuyersmarketplace.buyers.finalizedDeals.list", "response", internallog.HTTPResponse(res, b))
6883 return ret, nil
6884 }
6885
6886 // Pages invokes f for each page of results.
6887 // A non-nil error returned from f will halt the iteration.
6888 // The provided context supersedes any context provided to the Context method.
6889 func (c *BuyersFinalizedDealsListCall) Pages(ctx context.Context, f func(*ListFinalizedDealsResponse) error) error {
6890 c.ctx_ = ctx
6891 defer c.PageToken(c.urlParams_.Get("pageToken"))
6892 for {
6893 x, err := c.Do()
6894 if err != nil {
6895 return err
6896 }
6897 if err := f(x); err != nil {
6898 return err
6899 }
6900 if x.NextPageToken == "" {
6901 return nil
6902 }
6903 c.PageToken(x.NextPageToken)
6904 }
6905 }
6906
6907 type BuyersFinalizedDealsPauseCall struct {
6908 s *Service
6909 name string
6910 pausefinalizeddealrequest *PauseFinalizedDealRequest
6911 urlParams_ gensupport.URLParams
6912 ctx_ context.Context
6913 header_ http.Header
6914 }
6915
6916 // Pause: Pauses serving of the given finalized deal. This call only pauses the
6917 // serving status, and does not affect other fields of the finalized deal.
6918 // Calling this method for an already paused deal has no effect. This method
6919 // only applies to programmatic guaranteed deals and preferred deals.
6920 //
6921 // - name: Format: `buyers/{accountId}/finalizedDeals/{dealId}`.
6922 func (r *BuyersFinalizedDealsService) Pause(name string, pausefinalizeddealrequest *PauseFinalizedDealRequest) *BuyersFinalizedDealsPauseCall {
6923 c := &BuyersFinalizedDealsPauseCall{s: r.s, urlParams_: make(gensupport.URLParams)}
6924 c.name = name
6925 c.pausefinalizeddealrequest = pausefinalizeddealrequest
6926 return c
6927 }
6928
6929 // Fields allows partial responses to be retrieved. See
6930 // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse for more
6931 // details.
6932 func (c *BuyersFinalizedDealsPauseCall) Fields(s ...googleapi.Field) *BuyersFinalizedDealsPauseCall {
6933 c.urlParams_.Set("fields", googleapi.CombineFields(s))
6934 return c
6935 }
6936
6937 // Context sets the context to be used in this call's Do method.
6938 func (c *BuyersFinalizedDealsPauseCall) Context(ctx context.Context) *BuyersFinalizedDealsPauseCall {
6939 c.ctx_ = ctx
6940 return c
6941 }
6942
6943 // Header returns a http.Header that can be modified by the caller to add
6944 // headers to the request.
6945 func (c *BuyersFinalizedDealsPauseCall) Header() http.Header {
6946 if c.header_ == nil {
6947 c.header_ = make(http.Header)
6948 }
6949 return c.header_
6950 }
6951
6952 func (c *BuyersFinalizedDealsPauseCall) doRequest(alt string) (*http.Response, error) {
6953 reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_)
6954 body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.pausefinalizeddealrequest)
6955 if err != nil {
6956 return nil, err
6957 }
6958 c.urlParams_.Set("alt", alt)
6959 c.urlParams_.Set("prettyPrint", "false")
6960 urls := googleapi.ResolveRelative(c.s.BasePath, "v1alpha/{+name}:pause")
6961 urls += "?" + c.urlParams_.Encode()
6962 req, err := http.NewRequest("POST", urls, body)
6963 if err != nil {
6964 return nil, err
6965 }
6966 req.Header = reqHeaders
6967 googleapi.Expand(req.URL, map[string]string{
6968 "name": c.name,
6969 })
6970 c.s.logger.DebugContext(c.ctx_, "api request", "serviceName", apiName, "rpcName", "authorizedbuyersmarketplace.buyers.finalizedDeals.pause", "request", internallog.HTTPRequest(req, body.Bytes()))
6971 return gensupport.SendRequest(c.ctx_, c.s.client, req)
6972 }
6973
6974 // Do executes the "authorizedbuyersmarketplace.buyers.finalizedDeals.pause" call.
6975 // Any non-2xx status code is an error. Response headers are in either
6976 // *FinalizedDeal.ServerResponse.Header or (if a response was returned at all)
6977 // in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to check
6978 // whether the returned error was because http.StatusNotModified was returned.
6979 func (c *BuyersFinalizedDealsPauseCall) Do(opts ...googleapi.CallOption) (*FinalizedDeal, error) {
6980 gensupport.SetOptions(c.urlParams_, opts...)
6981 res, err := c.doRequest("json")
6982 if res != nil && res.StatusCode == http.StatusNotModified {
6983 if res.Body != nil {
6984 res.Body.Close()
6985 }
6986 return nil, gensupport.WrapError(&googleapi.Error{
6987 Code: res.StatusCode,
6988 Header: res.Header,
6989 })
6990 }
6991 if err != nil {
6992 return nil, err
6993 }
6994 defer googleapi.CloseBody(res)
6995 if err := googleapi.CheckResponse(res); err != nil {
6996 return nil, gensupport.WrapError(err)
6997 }
6998 ret := &FinalizedDeal{
6999 ServerResponse: googleapi.ServerResponse{
7000 Header: res.Header,
7001 HTTPStatusCode: res.StatusCode,
7002 },
7003 }
7004 target := &ret
7005 b, err := gensupport.DecodeResponseBytes(target, res)
7006 if err != nil {
7007 return nil, err
7008 }
7009 c.s.logger.DebugContext(c.ctx_, "api response", "serviceName", apiName, "rpcName", "authorizedbuyersmarketplace.buyers.finalizedDeals.pause", "response", internallog.HTTPResponse(res, b))
7010 return ret, nil
7011 }
7012
7013 type BuyersFinalizedDealsResumeCall struct {
7014 s *Service
7015 name string
7016 resumefinalizeddealrequest *ResumeFinalizedDealRequest
7017 urlParams_ gensupport.URLParams
7018 ctx_ context.Context
7019 header_ http.Header
7020 }
7021
7022 // Resume: Resumes serving of the given finalized deal. Calling this method for
7023 // an running deal has no effect. If a deal is initially paused by the seller,
7024 // calling this method will not resume serving of the deal until the seller
7025 // also resumes the deal. This method only applies to programmatic guaranteed
7026 // deals and preferred deals.
7027 //
7028 // - name: Format: `buyers/{accountId}/finalizedDeals/{dealId}`.
7029 func (r *BuyersFinalizedDealsService) Resume(name string, resumefinalizeddealrequest *ResumeFinalizedDealRequest) *BuyersFinalizedDealsResumeCall {
7030 c := &BuyersFinalizedDealsResumeCall{s: r.s, urlParams_: make(gensupport.URLParams)}
7031 c.name = name
7032 c.resumefinalizeddealrequest = resumefinalizeddealrequest
7033 return c
7034 }
7035
7036 // Fields allows partial responses to be retrieved. See
7037 // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse for more
7038 // details.
7039 func (c *BuyersFinalizedDealsResumeCall) Fields(s ...googleapi.Field) *BuyersFinalizedDealsResumeCall {
7040 c.urlParams_.Set("fields", googleapi.CombineFields(s))
7041 return c
7042 }
7043
7044 // Context sets the context to be used in this call's Do method.
7045 func (c *BuyersFinalizedDealsResumeCall) Context(ctx context.Context) *BuyersFinalizedDealsResumeCall {
7046 c.ctx_ = ctx
7047 return c
7048 }
7049
7050 // Header returns a http.Header that can be modified by the caller to add
7051 // headers to the request.
7052 func (c *BuyersFinalizedDealsResumeCall) Header() http.Header {
7053 if c.header_ == nil {
7054 c.header_ = make(http.Header)
7055 }
7056 return c.header_
7057 }
7058
7059 func (c *BuyersFinalizedDealsResumeCall) doRequest(alt string) (*http.Response, error) {
7060 reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_)
7061 body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.resumefinalizeddealrequest)
7062 if err != nil {
7063 return nil, err
7064 }
7065 c.urlParams_.Set("alt", alt)
7066 c.urlParams_.Set("prettyPrint", "false")
7067 urls := googleapi.ResolveRelative(c.s.BasePath, "v1alpha/{+name}:resume")
7068 urls += "?" + c.urlParams_.Encode()
7069 req, err := http.NewRequest("POST", urls, body)
7070 if err != nil {
7071 return nil, err
7072 }
7073 req.Header = reqHeaders
7074 googleapi.Expand(req.URL, map[string]string{
7075 "name": c.name,
7076 })
7077 c.s.logger.DebugContext(c.ctx_, "api request", "serviceName", apiName, "rpcName", "authorizedbuyersmarketplace.buyers.finalizedDeals.resume", "request", internallog.HTTPRequest(req, body.Bytes()))
7078 return gensupport.SendRequest(c.ctx_, c.s.client, req)
7079 }
7080
7081 // Do executes the "authorizedbuyersmarketplace.buyers.finalizedDeals.resume" call.
7082 // Any non-2xx status code is an error. Response headers are in either
7083 // *FinalizedDeal.ServerResponse.Header or (if a response was returned at all)
7084 // in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to check
7085 // whether the returned error was because http.StatusNotModified was returned.
7086 func (c *BuyersFinalizedDealsResumeCall) Do(opts ...googleapi.CallOption) (*FinalizedDeal, error) {
7087 gensupport.SetOptions(c.urlParams_, opts...)
7088 res, err := c.doRequest("json")
7089 if res != nil && res.StatusCode == http.StatusNotModified {
7090 if res.Body != nil {
7091 res.Body.Close()
7092 }
7093 return nil, gensupport.WrapError(&googleapi.Error{
7094 Code: res.StatusCode,
7095 Header: res.Header,
7096 })
7097 }
7098 if err != nil {
7099 return nil, err
7100 }
7101 defer googleapi.CloseBody(res)
7102 if err := googleapi.CheckResponse(res); err != nil {
7103 return nil, gensupport.WrapError(err)
7104 }
7105 ret := &FinalizedDeal{
7106 ServerResponse: googleapi.ServerResponse{
7107 Header: res.Header,
7108 HTTPStatusCode: res.StatusCode,
7109 },
7110 }
7111 target := &ret
7112 b, err := gensupport.DecodeResponseBytes(target, res)
7113 if err != nil {
7114 return nil, err
7115 }
7116 c.s.logger.DebugContext(c.ctx_, "api response", "serviceName", apiName, "rpcName", "authorizedbuyersmarketplace.buyers.finalizedDeals.resume", "response", internallog.HTTPResponse(res, b))
7117 return ret, nil
7118 }
7119
7120 type BuyersFinalizedDealsSetReadyToServeCall struct {
7121 s *Service
7122 deal string
7123 setreadytoserverequest *SetReadyToServeRequest
7124 urlParams_ gensupport.URLParams
7125 ctx_ context.Context
7126 header_ http.Header
7127 }
7128
7129 // SetReadyToServe: Sets the given finalized deal as ready to serve. By
7130 // default, deals are set as ready to serve as soon as they're finalized. If
7131 // you want to opt out of the default behavior, and manually indicate that
7132 // deals are ready to serve, ask your Technical Account Manager to add you to
7133 // the allowlist. If you choose to use this method, finalized deals belonging
7134 // to the bidder and its child seats don't start serving until after you call
7135 // `setReadyToServe`, and after the deals become active. For example, you can
7136 // use this method to delay receiving bid requests until your creative is
7137 // ready. In addition, bidders can use the URL path
7138 // "/v1alpha/bidders/{accountId}/finalizedDeals/{dealId}" to set ready to serve
7139 // for the finalized deals belong to itself, its child seats and all their
7140 // clients. This method only applies to programmatic guaranteed deals.
7141 //
7142 // - deal: Format: `buyers/{accountId}/finalizedDeals/{dealId}` or
7143 // `bidders/{accountId}/finalizedDeals/{dealId}`.
7144 func (r *BuyersFinalizedDealsService) SetReadyToServe(deal string, setreadytoserverequest *SetReadyToServeRequest) *BuyersFinalizedDealsSetReadyToServeCall {
7145 c := &BuyersFinalizedDealsSetReadyToServeCall{s: r.s, urlParams_: make(gensupport.URLParams)}
7146 c.deal = deal
7147 c.setreadytoserverequest = setreadytoserverequest
7148 return c
7149 }
7150
7151 // Fields allows partial responses to be retrieved. See
7152 // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse for more
7153 // details.
7154 func (c *BuyersFinalizedDealsSetReadyToServeCall) Fields(s ...googleapi.Field) *BuyersFinalizedDealsSetReadyToServeCall {
7155 c.urlParams_.Set("fields", googleapi.CombineFields(s))
7156 return c
7157 }
7158
7159 // Context sets the context to be used in this call's Do method.
7160 func (c *BuyersFinalizedDealsSetReadyToServeCall) Context(ctx context.Context) *BuyersFinalizedDealsSetReadyToServeCall {
7161 c.ctx_ = ctx
7162 return c
7163 }
7164
7165 // Header returns a http.Header that can be modified by the caller to add
7166 // headers to the request.
7167 func (c *BuyersFinalizedDealsSetReadyToServeCall) Header() http.Header {
7168 if c.header_ == nil {
7169 c.header_ = make(http.Header)
7170 }
7171 return c.header_
7172 }
7173
7174 func (c *BuyersFinalizedDealsSetReadyToServeCall) doRequest(alt string) (*http.Response, error) {
7175 reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_)
7176 body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.setreadytoserverequest)
7177 if err != nil {
7178 return nil, err
7179 }
7180 c.urlParams_.Set("alt", alt)
7181 c.urlParams_.Set("prettyPrint", "false")
7182 urls := googleapi.ResolveRelative(c.s.BasePath, "v1alpha/{+deal}:setReadyToServe")
7183 urls += "?" + c.urlParams_.Encode()
7184 req, err := http.NewRequest("POST", urls, body)
7185 if err != nil {
7186 return nil, err
7187 }
7188 req.Header = reqHeaders
7189 googleapi.Expand(req.URL, map[string]string{
7190 "deal": c.deal,
7191 })
7192 c.s.logger.DebugContext(c.ctx_, "api request", "serviceName", apiName, "rpcName", "authorizedbuyersmarketplace.buyers.finalizedDeals.setReadyToServe", "request", internallog.HTTPRequest(req, body.Bytes()))
7193 return gensupport.SendRequest(c.ctx_, c.s.client, req)
7194 }
7195
7196 // Do executes the "authorizedbuyersmarketplace.buyers.finalizedDeals.setReadyToServe" call.
7197 // Any non-2xx status code is an error. Response headers are in either
7198 // *FinalizedDeal.ServerResponse.Header or (if a response was returned at all)
7199 // in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to check
7200 // whether the returned error was because http.StatusNotModified was returned.
7201 func (c *BuyersFinalizedDealsSetReadyToServeCall) Do(opts ...googleapi.CallOption) (*FinalizedDeal, error) {
7202 gensupport.SetOptions(c.urlParams_, opts...)
7203 res, err := c.doRequest("json")
7204 if res != nil && res.StatusCode == http.StatusNotModified {
7205 if res.Body != nil {
7206 res.Body.Close()
7207 }
7208 return nil, gensupport.WrapError(&googleapi.Error{
7209 Code: res.StatusCode,
7210 Header: res.Header,
7211 })
7212 }
7213 if err != nil {
7214 return nil, err
7215 }
7216 defer googleapi.CloseBody(res)
7217 if err := googleapi.CheckResponse(res); err != nil {
7218 return nil, gensupport.WrapError(err)
7219 }
7220 ret := &FinalizedDeal{
7221 ServerResponse: googleapi.ServerResponse{
7222 Header: res.Header,
7223 HTTPStatusCode: res.StatusCode,
7224 },
7225 }
7226 target := &ret
7227 b, err := gensupport.DecodeResponseBytes(target, res)
7228 if err != nil {
7229 return nil, err
7230 }
7231 c.s.logger.DebugContext(c.ctx_, "api response", "serviceName", apiName, "rpcName", "authorizedbuyersmarketplace.buyers.finalizedDeals.setReadyToServe", "response", internallog.HTTPResponse(res, b))
7232 return ret, nil
7233 }
7234
7235 type BuyersProposalsAcceptCall struct {
7236 s *Service
7237 name string
7238 acceptproposalrequest *AcceptProposalRequest
7239 urlParams_ gensupport.URLParams
7240 ctx_ context.Context
7241 header_ http.Header
7242 }
7243
7244 // Accept: Accepts the proposal at the given revision number. If the revision
7245 // number in the request is behind the latest from the server, an error message
7246 // will be returned. This call updates the Proposal.state from
7247 // `BUYER_ACCEPTANCE_REQUESTED` to `FINALIZED`; it has no side effect if the
7248 // Proposal.state is already `FINALIZED` and throws exception if the
7249 // Proposal.state is not either `BUYER_ACCEPTANCE_REQUESTED` or `FINALIZED`.
7250 // Accepting a proposal means the buyer understands and accepts the
7251 // Proposal.terms_and_conditions proposed by the seller.
7252 //
7253 // - name: Name of the proposal. Format:
7254 // `buyers/{accountId}/proposals/{proposalId}`.
7255 func (r *BuyersProposalsService) Accept(name string, acceptproposalrequest *AcceptProposalRequest) *BuyersProposalsAcceptCall {
7256 c := &BuyersProposalsAcceptCall{s: r.s, urlParams_: make(gensupport.URLParams)}
7257 c.name = name
7258 c.acceptproposalrequest = acceptproposalrequest
7259 return c
7260 }
7261
7262 // Fields allows partial responses to be retrieved. See
7263 // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse for more
7264 // details.
7265 func (c *BuyersProposalsAcceptCall) Fields(s ...googleapi.Field) *BuyersProposalsAcceptCall {
7266 c.urlParams_.Set("fields", googleapi.CombineFields(s))
7267 return c
7268 }
7269
7270 // Context sets the context to be used in this call's Do method.
7271 func (c *BuyersProposalsAcceptCall) Context(ctx context.Context) *BuyersProposalsAcceptCall {
7272 c.ctx_ = ctx
7273 return c
7274 }
7275
7276 // Header returns a http.Header that can be modified by the caller to add
7277 // headers to the request.
7278 func (c *BuyersProposalsAcceptCall) Header() http.Header {
7279 if c.header_ == nil {
7280 c.header_ = make(http.Header)
7281 }
7282 return c.header_
7283 }
7284
7285 func (c *BuyersProposalsAcceptCall) doRequest(alt string) (*http.Response, error) {
7286 reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_)
7287 body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.acceptproposalrequest)
7288 if err != nil {
7289 return nil, err
7290 }
7291 c.urlParams_.Set("alt", alt)
7292 c.urlParams_.Set("prettyPrint", "false")
7293 urls := googleapi.ResolveRelative(c.s.BasePath, "v1alpha/{+name}:accept")
7294 urls += "?" + c.urlParams_.Encode()
7295 req, err := http.NewRequest("POST", urls, body)
7296 if err != nil {
7297 return nil, err
7298 }
7299 req.Header = reqHeaders
7300 googleapi.Expand(req.URL, map[string]string{
7301 "name": c.name,
7302 })
7303 c.s.logger.DebugContext(c.ctx_, "api request", "serviceName", apiName, "rpcName", "authorizedbuyersmarketplace.buyers.proposals.accept", "request", internallog.HTTPRequest(req, body.Bytes()))
7304 return gensupport.SendRequest(c.ctx_, c.s.client, req)
7305 }
7306
7307 // Do executes the "authorizedbuyersmarketplace.buyers.proposals.accept" call.
7308 // Any non-2xx status code is an error. Response headers are in either
7309 // *Proposal.ServerResponse.Header or (if a response was returned at all) in
7310 // error.(*googleapi.Error).Header. Use googleapi.IsNotModified to check
7311 // whether the returned error was because http.StatusNotModified was returned.
7312 func (c *BuyersProposalsAcceptCall) Do(opts ...googleapi.CallOption) (*Proposal, error) {
7313 gensupport.SetOptions(c.urlParams_, opts...)
7314 res, err := c.doRequest("json")
7315 if res != nil && res.StatusCode == http.StatusNotModified {
7316 if res.Body != nil {
7317 res.Body.Close()
7318 }
7319 return nil, gensupport.WrapError(&googleapi.Error{
7320 Code: res.StatusCode,
7321 Header: res.Header,
7322 })
7323 }
7324 if err != nil {
7325 return nil, err
7326 }
7327 defer googleapi.CloseBody(res)
7328 if err := googleapi.CheckResponse(res); err != nil {
7329 return nil, gensupport.WrapError(err)
7330 }
7331 ret := &Proposal{
7332 ServerResponse: googleapi.ServerResponse{
7333 Header: res.Header,
7334 HTTPStatusCode: res.StatusCode,
7335 },
7336 }
7337 target := &ret
7338 b, err := gensupport.DecodeResponseBytes(target, res)
7339 if err != nil {
7340 return nil, err
7341 }
7342 c.s.logger.DebugContext(c.ctx_, "api response", "serviceName", apiName, "rpcName", "authorizedbuyersmarketplace.buyers.proposals.accept", "response", internallog.HTTPResponse(res, b))
7343 return ret, nil
7344 }
7345
7346 type BuyersProposalsAddNoteCall struct {
7347 s *Service
7348 proposal string
7349 addnoterequest *AddNoteRequest
7350 urlParams_ gensupport.URLParams
7351 ctx_ context.Context
7352 header_ http.Header
7353 }
7354
7355 // AddNote: Creates a note for this proposal and sends to the seller. This
7356 // method is not supported for proposals with DealType set to
7357 // 'PRIVATE_AUCTION'.
7358 //
7359 // - proposal: Name of the proposal. Format:
7360 // `buyers/{accountId}/proposals/{proposalId}`.
7361 func (r *BuyersProposalsService) AddNote(proposal string, addnoterequest *AddNoteRequest) *BuyersProposalsAddNoteCall {
7362 c := &BuyersProposalsAddNoteCall{s: r.s, urlParams_: make(gensupport.URLParams)}
7363 c.proposal = proposal
7364 c.addnoterequest = addnoterequest
7365 return c
7366 }
7367
7368 // Fields allows partial responses to be retrieved. See
7369 // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse for more
7370 // details.
7371 func (c *BuyersProposalsAddNoteCall) Fields(s ...googleapi.Field) *BuyersProposalsAddNoteCall {
7372 c.urlParams_.Set("fields", googleapi.CombineFields(s))
7373 return c
7374 }
7375
7376 // Context sets the context to be used in this call's Do method.
7377 func (c *BuyersProposalsAddNoteCall) Context(ctx context.Context) *BuyersProposalsAddNoteCall {
7378 c.ctx_ = ctx
7379 return c
7380 }
7381
7382 // Header returns a http.Header that can be modified by the caller to add
7383 // headers to the request.
7384 func (c *BuyersProposalsAddNoteCall) Header() http.Header {
7385 if c.header_ == nil {
7386 c.header_ = make(http.Header)
7387 }
7388 return c.header_
7389 }
7390
7391 func (c *BuyersProposalsAddNoteCall) doRequest(alt string) (*http.Response, error) {
7392 reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_)
7393 body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.addnoterequest)
7394 if err != nil {
7395 return nil, err
7396 }
7397 c.urlParams_.Set("alt", alt)
7398 c.urlParams_.Set("prettyPrint", "false")
7399 urls := googleapi.ResolveRelative(c.s.BasePath, "v1alpha/{+proposal}:addNote")
7400 urls += "?" + c.urlParams_.Encode()
7401 req, err := http.NewRequest("POST", urls, body)
7402 if err != nil {
7403 return nil, err
7404 }
7405 req.Header = reqHeaders
7406 googleapi.Expand(req.URL, map[string]string{
7407 "proposal": c.proposal,
7408 })
7409 c.s.logger.DebugContext(c.ctx_, "api request", "serviceName", apiName, "rpcName", "authorizedbuyersmarketplace.buyers.proposals.addNote", "request", internallog.HTTPRequest(req, body.Bytes()))
7410 return gensupport.SendRequest(c.ctx_, c.s.client, req)
7411 }
7412
7413 // Do executes the "authorizedbuyersmarketplace.buyers.proposals.addNote" call.
7414 // Any non-2xx status code is an error. Response headers are in either
7415 // *Proposal.ServerResponse.Header or (if a response was returned at all) in
7416 // error.(*googleapi.Error).Header. Use googleapi.IsNotModified to check
7417 // whether the returned error was because http.StatusNotModified was returned.
7418 func (c *BuyersProposalsAddNoteCall) Do(opts ...googleapi.CallOption) (*Proposal, error) {
7419 gensupport.SetOptions(c.urlParams_, opts...)
7420 res, err := c.doRequest("json")
7421 if res != nil && res.StatusCode == http.StatusNotModified {
7422 if res.Body != nil {
7423 res.Body.Close()
7424 }
7425 return nil, gensupport.WrapError(&googleapi.Error{
7426 Code: res.StatusCode,
7427 Header: res.Header,
7428 })
7429 }
7430 if err != nil {
7431 return nil, err
7432 }
7433 defer googleapi.CloseBody(res)
7434 if err := googleapi.CheckResponse(res); err != nil {
7435 return nil, gensupport.WrapError(err)
7436 }
7437 ret := &Proposal{
7438 ServerResponse: googleapi.ServerResponse{
7439 Header: res.Header,
7440 HTTPStatusCode: res.StatusCode,
7441 },
7442 }
7443 target := &ret
7444 b, err := gensupport.DecodeResponseBytes(target, res)
7445 if err != nil {
7446 return nil, err
7447 }
7448 c.s.logger.DebugContext(c.ctx_, "api response", "serviceName", apiName, "rpcName", "authorizedbuyersmarketplace.buyers.proposals.addNote", "response", internallog.HTTPResponse(res, b))
7449 return ret, nil
7450 }
7451
7452 type BuyersProposalsCancelNegotiationCall struct {
7453 s *Service
7454 proposal string
7455 cancelnegotiationrequest *CancelNegotiationRequest
7456 urlParams_ gensupport.URLParams
7457 ctx_ context.Context
7458 header_ http.Header
7459 }
7460
7461 // CancelNegotiation: Cancels an ongoing negotiation on a proposal. This does
7462 // not cancel or end serving for the deals if the proposal has been finalized.
7463 // If the proposal has not been finalized before, calling this method will set
7464 // the Proposal.state to `TERMINATED` and increment the
7465 // Proposal.proposal_revision. If the proposal has been finalized before and is
7466 // under renegotiation now, calling this method will reset the Proposal.state
7467 // to `FINALIZED` and increment the Proposal.proposal_revision. This method
7468 // does not support private auction proposals whose Proposal.deal_type is
7469 // 'PRIVATE_AUCTION'.
7470 //
7471 // - proposal: Name of the proposal. Format:
7472 // `buyers/{accountId}/proposals/{proposalId}`.
7473 func (r *BuyersProposalsService) CancelNegotiation(proposal string, cancelnegotiationrequest *CancelNegotiationRequest) *BuyersProposalsCancelNegotiationCall {
7474 c := &BuyersProposalsCancelNegotiationCall{s: r.s, urlParams_: make(gensupport.URLParams)}
7475 c.proposal = proposal
7476 c.cancelnegotiationrequest = cancelnegotiationrequest
7477 return c
7478 }
7479
7480 // Fields allows partial responses to be retrieved. See
7481 // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse for more
7482 // details.
7483 func (c *BuyersProposalsCancelNegotiationCall) Fields(s ...googleapi.Field) *BuyersProposalsCancelNegotiationCall {
7484 c.urlParams_.Set("fields", googleapi.CombineFields(s))
7485 return c
7486 }
7487
7488 // Context sets the context to be used in this call's Do method.
7489 func (c *BuyersProposalsCancelNegotiationCall) Context(ctx context.Context) *BuyersProposalsCancelNegotiationCall {
7490 c.ctx_ = ctx
7491 return c
7492 }
7493
7494 // Header returns a http.Header that can be modified by the caller to add
7495 // headers to the request.
7496 func (c *BuyersProposalsCancelNegotiationCall) Header() http.Header {
7497 if c.header_ == nil {
7498 c.header_ = make(http.Header)
7499 }
7500 return c.header_
7501 }
7502
7503 func (c *BuyersProposalsCancelNegotiationCall) doRequest(alt string) (*http.Response, error) {
7504 reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_)
7505 body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.cancelnegotiationrequest)
7506 if err != nil {
7507 return nil, err
7508 }
7509 c.urlParams_.Set("alt", alt)
7510 c.urlParams_.Set("prettyPrint", "false")
7511 urls := googleapi.ResolveRelative(c.s.BasePath, "v1alpha/{+proposal}:cancelNegotiation")
7512 urls += "?" + c.urlParams_.Encode()
7513 req, err := http.NewRequest("POST", urls, body)
7514 if err != nil {
7515 return nil, err
7516 }
7517 req.Header = reqHeaders
7518 googleapi.Expand(req.URL, map[string]string{
7519 "proposal": c.proposal,
7520 })
7521 c.s.logger.DebugContext(c.ctx_, "api request", "serviceName", apiName, "rpcName", "authorizedbuyersmarketplace.buyers.proposals.cancelNegotiation", "request", internallog.HTTPRequest(req, body.Bytes()))
7522 return gensupport.SendRequest(c.ctx_, c.s.client, req)
7523 }
7524
7525 // Do executes the "authorizedbuyersmarketplace.buyers.proposals.cancelNegotiation" call.
7526 // Any non-2xx status code is an error. Response headers are in either
7527 // *Proposal.ServerResponse.Header or (if a response was returned at all) in
7528 // error.(*googleapi.Error).Header. Use googleapi.IsNotModified to check
7529 // whether the returned error was because http.StatusNotModified was returned.
7530 func (c *BuyersProposalsCancelNegotiationCall) Do(opts ...googleapi.CallOption) (*Proposal, error) {
7531 gensupport.SetOptions(c.urlParams_, opts...)
7532 res, err := c.doRequest("json")
7533 if res != nil && res.StatusCode == http.StatusNotModified {
7534 if res.Body != nil {
7535 res.Body.Close()
7536 }
7537 return nil, gensupport.WrapError(&googleapi.Error{
7538 Code: res.StatusCode,
7539 Header: res.Header,
7540 })
7541 }
7542 if err != nil {
7543 return nil, err
7544 }
7545 defer googleapi.CloseBody(res)
7546 if err := googleapi.CheckResponse(res); err != nil {
7547 return nil, gensupport.WrapError(err)
7548 }
7549 ret := &Proposal{
7550 ServerResponse: googleapi.ServerResponse{
7551 Header: res.Header,
7552 HTTPStatusCode: res.StatusCode,
7553 },
7554 }
7555 target := &ret
7556 b, err := gensupport.DecodeResponseBytes(target, res)
7557 if err != nil {
7558 return nil, err
7559 }
7560 c.s.logger.DebugContext(c.ctx_, "api response", "serviceName", apiName, "rpcName", "authorizedbuyersmarketplace.buyers.proposals.cancelNegotiation", "response", internallog.HTTPResponse(res, b))
7561 return ret, nil
7562 }
7563
7564 type BuyersProposalsGetCall struct {
7565 s *Service
7566 name string
7567 urlParams_ gensupport.URLParams
7568 ifNoneMatch_ string
7569 ctx_ context.Context
7570 header_ http.Header
7571 }
7572
7573 // Get: Gets a proposal using its resource name. The proposal is returned at
7574 // the latest revision.
7575 //
7576 // - name: Name of the proposal. Format:
7577 // `buyers/{accountId}/proposals/{proposalId}`.
7578 func (r *BuyersProposalsService) Get(name string) *BuyersProposalsGetCall {
7579 c := &BuyersProposalsGetCall{s: r.s, urlParams_: make(gensupport.URLParams)}
7580 c.name = name
7581 return c
7582 }
7583
7584 // Fields allows partial responses to be retrieved. See
7585 // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse for more
7586 // details.
7587 func (c *BuyersProposalsGetCall) Fields(s ...googleapi.Field) *BuyersProposalsGetCall {
7588 c.urlParams_.Set("fields", googleapi.CombineFields(s))
7589 return c
7590 }
7591
7592 // IfNoneMatch sets an optional parameter which makes the operation fail if the
7593 // object's ETag matches the given value. This is useful for getting updates
7594 // only after the object has changed since the last request.
7595 func (c *BuyersProposalsGetCall) IfNoneMatch(entityTag string) *BuyersProposalsGetCall {
7596 c.ifNoneMatch_ = entityTag
7597 return c
7598 }
7599
7600 // Context sets the context to be used in this call's Do method.
7601 func (c *BuyersProposalsGetCall) Context(ctx context.Context) *BuyersProposalsGetCall {
7602 c.ctx_ = ctx
7603 return c
7604 }
7605
7606 // Header returns a http.Header that can be modified by the caller to add
7607 // headers to the request.
7608 func (c *BuyersProposalsGetCall) Header() http.Header {
7609 if c.header_ == nil {
7610 c.header_ = make(http.Header)
7611 }
7612 return c.header_
7613 }
7614
7615 func (c *BuyersProposalsGetCall) doRequest(alt string) (*http.Response, error) {
7616 reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_)
7617 if c.ifNoneMatch_ != "" {
7618 reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
7619 }
7620 c.urlParams_.Set("alt", alt)
7621 c.urlParams_.Set("prettyPrint", "false")
7622 urls := googleapi.ResolveRelative(c.s.BasePath, "v1alpha/{+name}")
7623 urls += "?" + c.urlParams_.Encode()
7624 req, err := http.NewRequest("GET", urls, nil)
7625 if err != nil {
7626 return nil, err
7627 }
7628 req.Header = reqHeaders
7629 googleapi.Expand(req.URL, map[string]string{
7630 "name": c.name,
7631 })
7632 c.s.logger.DebugContext(c.ctx_, "api request", "serviceName", apiName, "rpcName", "authorizedbuyersmarketplace.buyers.proposals.get", "request", internallog.HTTPRequest(req, nil))
7633 return gensupport.SendRequest(c.ctx_, c.s.client, req)
7634 }
7635
7636 // Do executes the "authorizedbuyersmarketplace.buyers.proposals.get" call.
7637 // Any non-2xx status code is an error. Response headers are in either
7638 // *Proposal.ServerResponse.Header or (if a response was returned at all) in
7639 // error.(*googleapi.Error).Header. Use googleapi.IsNotModified to check
7640 // whether the returned error was because http.StatusNotModified was returned.
7641 func (c *BuyersProposalsGetCall) Do(opts ...googleapi.CallOption) (*Proposal, error) {
7642 gensupport.SetOptions(c.urlParams_, opts...)
7643 res, err := c.doRequest("json")
7644 if res != nil && res.StatusCode == http.StatusNotModified {
7645 if res.Body != nil {
7646 res.Body.Close()
7647 }
7648 return nil, gensupport.WrapError(&googleapi.Error{
7649 Code: res.StatusCode,
7650 Header: res.Header,
7651 })
7652 }
7653 if err != nil {
7654 return nil, err
7655 }
7656 defer googleapi.CloseBody(res)
7657 if err := googleapi.CheckResponse(res); err != nil {
7658 return nil, gensupport.WrapError(err)
7659 }
7660 ret := &Proposal{
7661 ServerResponse: googleapi.ServerResponse{
7662 Header: res.Header,
7663 HTTPStatusCode: res.StatusCode,
7664 },
7665 }
7666 target := &ret
7667 b, err := gensupport.DecodeResponseBytes(target, res)
7668 if err != nil {
7669 return nil, err
7670 }
7671 c.s.logger.DebugContext(c.ctx_, "api response", "serviceName", apiName, "rpcName", "authorizedbuyersmarketplace.buyers.proposals.get", "response", internallog.HTTPResponse(res, b))
7672 return ret, nil
7673 }
7674
7675 type BuyersProposalsListCall struct {
7676 s *Service
7677 parent string
7678 urlParams_ gensupport.URLParams
7679 ifNoneMatch_ string
7680 ctx_ context.Context
7681 header_ http.Header
7682 }
7683
7684 // List: Lists proposals. A filter expression using Cloud API list filtering
7685 // syntax
7686 // (https://developers.google.com/authorized-buyers/apis/guides/list-filters)
7687 // may be specified to filter the results.
7688 //
7689 // - parent: Parent that owns the collection of proposals Format:
7690 // `buyers/{accountId}`.
7691 func (r *BuyersProposalsService) List(parent string) *BuyersProposalsListCall {
7692 c := &BuyersProposalsListCall{s: r.s, urlParams_: make(gensupport.URLParams)}
7693 c.parent = parent
7694 return c
7695 }
7696
7697 // Filter sets the optional parameter "filter": Optional query string using the
7698 // Cloud API list filtering syntax
7699 // (https://developers.google.com/authorized-buyers/apis/guides/list-filters)
7700 // Supported columns for filtering are: * displayName * dealType * updateTime *
7701 // state
7702 func (c *BuyersProposalsListCall) Filter(filter string) *BuyersProposalsListCall {
7703 c.urlParams_.Set("filter", filter)
7704 return c
7705 }
7706
7707 // PageSize sets the optional parameter "pageSize": Requested page size. The
7708 // server may return fewer results than requested. If unspecified, the server
7709 // will put a size of 500.
7710 func (c *BuyersProposalsListCall) PageSize(pageSize int64) *BuyersProposalsListCall {
7711 c.urlParams_.Set("pageSize", fmt.Sprint(pageSize))
7712 return c
7713 }
7714
7715 // PageToken sets the optional parameter "pageToken": The page token as
7716 // returned from ListProposalsResponse.
7717 func (c *BuyersProposalsListCall) PageToken(pageToken string) *BuyersProposalsListCall {
7718 c.urlParams_.Set("pageToken", pageToken)
7719 return c
7720 }
7721
7722 // Fields allows partial responses to be retrieved. See
7723 // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse for more
7724 // details.
7725 func (c *BuyersProposalsListCall) Fields(s ...googleapi.Field) *BuyersProposalsListCall {
7726 c.urlParams_.Set("fields", googleapi.CombineFields(s))
7727 return c
7728 }
7729
7730 // IfNoneMatch sets an optional parameter which makes the operation fail if the
7731 // object's ETag matches the given value. This is useful for getting updates
7732 // only after the object has changed since the last request.
7733 func (c *BuyersProposalsListCall) IfNoneMatch(entityTag string) *BuyersProposalsListCall {
7734 c.ifNoneMatch_ = entityTag
7735 return c
7736 }
7737
7738 // Context sets the context to be used in this call's Do method.
7739 func (c *BuyersProposalsListCall) Context(ctx context.Context) *BuyersProposalsListCall {
7740 c.ctx_ = ctx
7741 return c
7742 }
7743
7744 // Header returns a http.Header that can be modified by the caller to add
7745 // headers to the request.
7746 func (c *BuyersProposalsListCall) Header() http.Header {
7747 if c.header_ == nil {
7748 c.header_ = make(http.Header)
7749 }
7750 return c.header_
7751 }
7752
7753 func (c *BuyersProposalsListCall) doRequest(alt string) (*http.Response, error) {
7754 reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_)
7755 if c.ifNoneMatch_ != "" {
7756 reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
7757 }
7758 c.urlParams_.Set("alt", alt)
7759 c.urlParams_.Set("prettyPrint", "false")
7760 urls := googleapi.ResolveRelative(c.s.BasePath, "v1alpha/{+parent}/proposals")
7761 urls += "?" + c.urlParams_.Encode()
7762 req, err := http.NewRequest("GET", urls, nil)
7763 if err != nil {
7764 return nil, err
7765 }
7766 req.Header = reqHeaders
7767 googleapi.Expand(req.URL, map[string]string{
7768 "parent": c.parent,
7769 })
7770 c.s.logger.DebugContext(c.ctx_, "api request", "serviceName", apiName, "rpcName", "authorizedbuyersmarketplace.buyers.proposals.list", "request", internallog.HTTPRequest(req, nil))
7771 return gensupport.SendRequest(c.ctx_, c.s.client, req)
7772 }
7773
7774 // Do executes the "authorizedbuyersmarketplace.buyers.proposals.list" call.
7775 // Any non-2xx status code is an error. Response headers are in either
7776 // *ListProposalsResponse.ServerResponse.Header or (if a response was returned
7777 // at all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to
7778 // check whether the returned error was because http.StatusNotModified was
7779 // returned.
7780 func (c *BuyersProposalsListCall) Do(opts ...googleapi.CallOption) (*ListProposalsResponse, error) {
7781 gensupport.SetOptions(c.urlParams_, opts...)
7782 res, err := c.doRequest("json")
7783 if res != nil && res.StatusCode == http.StatusNotModified {
7784 if res.Body != nil {
7785 res.Body.Close()
7786 }
7787 return nil, gensupport.WrapError(&googleapi.Error{
7788 Code: res.StatusCode,
7789 Header: res.Header,
7790 })
7791 }
7792 if err != nil {
7793 return nil, err
7794 }
7795 defer googleapi.CloseBody(res)
7796 if err := googleapi.CheckResponse(res); err != nil {
7797 return nil, gensupport.WrapError(err)
7798 }
7799 ret := &ListProposalsResponse{
7800 ServerResponse: googleapi.ServerResponse{
7801 Header: res.Header,
7802 HTTPStatusCode: res.StatusCode,
7803 },
7804 }
7805 target := &ret
7806 b, err := gensupport.DecodeResponseBytes(target, res)
7807 if err != nil {
7808 return nil, err
7809 }
7810 c.s.logger.DebugContext(c.ctx_, "api response", "serviceName", apiName, "rpcName", "authorizedbuyersmarketplace.buyers.proposals.list", "response", internallog.HTTPResponse(res, b))
7811 return ret, nil
7812 }
7813
7814 // Pages invokes f for each page of results.
7815 // A non-nil error returned from f will halt the iteration.
7816 // The provided context supersedes any context provided to the Context method.
7817 func (c *BuyersProposalsListCall) Pages(ctx context.Context, f func(*ListProposalsResponse) error) error {
7818 c.ctx_ = ctx
7819 defer c.PageToken(c.urlParams_.Get("pageToken"))
7820 for {
7821 x, err := c.Do()
7822 if err != nil {
7823 return err
7824 }
7825 if err := f(x); err != nil {
7826 return err
7827 }
7828 if x.NextPageToken == "" {
7829 return nil
7830 }
7831 c.PageToken(x.NextPageToken)
7832 }
7833 }
7834
7835 type BuyersProposalsPatchCall struct {
7836 s *Service
7837 nameid string
7838 proposal *Proposal
7839 urlParams_ gensupport.URLParams
7840 ctx_ context.Context
7841 header_ http.Header
7842 }
7843
7844 // Patch: Updates the proposal at the given revision number. If the revision
7845 // number in the request is behind the latest one kept in the server, an error
7846 // message will be returned. See FieldMask for how to use FieldMask. Only
7847 // fields specified in the UpdateProposalRequest.update_mask will be updated;
7848 // Fields noted as 'Immutable' or 'Output only' yet specified in the
7849 // UpdateProposalRequest.update_mask will be ignored and left unchanged.
7850 // Updating a private auction proposal is only allowed for buyer private data,
7851 // all other fields are immutable.
7852 //
7853 // - name: Immutable. The name of the proposal serving as a unique identifier.
7854 // Format: buyers/{accountId}/proposals/{proposalId}.
7855 func (r *BuyersProposalsService) Patch(nameid string, proposal *Proposal) *BuyersProposalsPatchCall {
7856 c := &BuyersProposalsPatchCall{s: r.s, urlParams_: make(gensupport.URLParams)}
7857 c.nameid = nameid
7858 c.proposal = proposal
7859 return c
7860 }
7861
7862 // UpdateMask sets the optional parameter "updateMask": List of fields to be
7863 // updated. If empty or unspecified, the service will update all fields
7864 // populated in the update request excluding the output only fields and
7865 // primitive fields with default value. Note that explicit field mask is
7866 // required in order to reset a primitive field back to its default value, for
7867 // example, false for boolean fields, 0 for integer fields. A special field
7868 // mask consisting of a single path "*" can be used to indicate full
7869 // replacement(the equivalent of PUT method), updatable fields unset or
7870 // unspecified in the input will be cleared or set to default value. Output
7871 // only fields will be ignored regardless of the value of updateMask.
7872 func (c *BuyersProposalsPatchCall) UpdateMask(updateMask string) *BuyersProposalsPatchCall {
7873 c.urlParams_.Set("updateMask", updateMask)
7874 return c
7875 }
7876
7877 // Fields allows partial responses to be retrieved. See
7878 // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse for more
7879 // details.
7880 func (c *BuyersProposalsPatchCall) Fields(s ...googleapi.Field) *BuyersProposalsPatchCall {
7881 c.urlParams_.Set("fields", googleapi.CombineFields(s))
7882 return c
7883 }
7884
7885 // Context sets the context to be used in this call's Do method.
7886 func (c *BuyersProposalsPatchCall) Context(ctx context.Context) *BuyersProposalsPatchCall {
7887 c.ctx_ = ctx
7888 return c
7889 }
7890
7891 // Header returns a http.Header that can be modified by the caller to add
7892 // headers to the request.
7893 func (c *BuyersProposalsPatchCall) Header() http.Header {
7894 if c.header_ == nil {
7895 c.header_ = make(http.Header)
7896 }
7897 return c.header_
7898 }
7899
7900 func (c *BuyersProposalsPatchCall) doRequest(alt string) (*http.Response, error) {
7901 reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_)
7902 body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.proposal)
7903 if err != nil {
7904 return nil, err
7905 }
7906 c.urlParams_.Set("alt", alt)
7907 c.urlParams_.Set("prettyPrint", "false")
7908 urls := googleapi.ResolveRelative(c.s.BasePath, "v1alpha/{+name}")
7909 urls += "?" + c.urlParams_.Encode()
7910 req, err := http.NewRequest("PATCH", urls, body)
7911 if err != nil {
7912 return nil, err
7913 }
7914 req.Header = reqHeaders
7915 googleapi.Expand(req.URL, map[string]string{
7916 "name": c.nameid,
7917 })
7918 c.s.logger.DebugContext(c.ctx_, "api request", "serviceName", apiName, "rpcName", "authorizedbuyersmarketplace.buyers.proposals.patch", "request", internallog.HTTPRequest(req, body.Bytes()))
7919 return gensupport.SendRequest(c.ctx_, c.s.client, req)
7920 }
7921
7922 // Do executes the "authorizedbuyersmarketplace.buyers.proposals.patch" call.
7923 // Any non-2xx status code is an error. Response headers are in either
7924 // *Proposal.ServerResponse.Header or (if a response was returned at all) in
7925 // error.(*googleapi.Error).Header. Use googleapi.IsNotModified to check
7926 // whether the returned error was because http.StatusNotModified was returned.
7927 func (c *BuyersProposalsPatchCall) Do(opts ...googleapi.CallOption) (*Proposal, error) {
7928 gensupport.SetOptions(c.urlParams_, opts...)
7929 res, err := c.doRequest("json")
7930 if res != nil && res.StatusCode == http.StatusNotModified {
7931 if res.Body != nil {
7932 res.Body.Close()
7933 }
7934 return nil, gensupport.WrapError(&googleapi.Error{
7935 Code: res.StatusCode,
7936 Header: res.Header,
7937 })
7938 }
7939 if err != nil {
7940 return nil, err
7941 }
7942 defer googleapi.CloseBody(res)
7943 if err := googleapi.CheckResponse(res); err != nil {
7944 return nil, gensupport.WrapError(err)
7945 }
7946 ret := &Proposal{
7947 ServerResponse: googleapi.ServerResponse{
7948 Header: res.Header,
7949 HTTPStatusCode: res.StatusCode,
7950 },
7951 }
7952 target := &ret
7953 b, err := gensupport.DecodeResponseBytes(target, res)
7954 if err != nil {
7955 return nil, err
7956 }
7957 c.s.logger.DebugContext(c.ctx_, "api response", "serviceName", apiName, "rpcName", "authorizedbuyersmarketplace.buyers.proposals.patch", "response", internallog.HTTPResponse(res, b))
7958 return ret, nil
7959 }
7960
7961 type BuyersProposalsSendRfpCall struct {
7962 s *Service
7963 buyer string
7964 sendrfprequest *SendRfpRequest
7965 urlParams_ gensupport.URLParams
7966 ctx_ context.Context
7967 header_ http.Header
7968 }
7969
7970 // SendRfp: Sends a request for proposal (RFP) to a publisher to initiate the
7971 // negotiation regarding certain inventory. In the RFP, buyers can specify the
7972 // deal type, deal terms, start and end dates, targeting, and a message to the
7973 // publisher. Once the RFP is sent, a proposal in `SELLER_REVIEW_REQUESTED`
7974 // state will be created and returned in the response. The publisher may review
7975 // your request and respond with detailed deals in the proposal.
7976 //
7977 // - buyer: The current buyer who is sending the RFP in the format:
7978 // `buyers/{accountId}`.
7979 func (r *BuyersProposalsService) SendRfp(buyer string, sendrfprequest *SendRfpRequest) *BuyersProposalsSendRfpCall {
7980 c := &BuyersProposalsSendRfpCall{s: r.s, urlParams_: make(gensupport.URLParams)}
7981 c.buyer = buyer
7982 c.sendrfprequest = sendrfprequest
7983 return c
7984 }
7985
7986 // Fields allows partial responses to be retrieved. See
7987 // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse for more
7988 // details.
7989 func (c *BuyersProposalsSendRfpCall) Fields(s ...googleapi.Field) *BuyersProposalsSendRfpCall {
7990 c.urlParams_.Set("fields", googleapi.CombineFields(s))
7991 return c
7992 }
7993
7994 // Context sets the context to be used in this call's Do method.
7995 func (c *BuyersProposalsSendRfpCall) Context(ctx context.Context) *BuyersProposalsSendRfpCall {
7996 c.ctx_ = ctx
7997 return c
7998 }
7999
8000 // Header returns a http.Header that can be modified by the caller to add
8001 // headers to the request.
8002 func (c *BuyersProposalsSendRfpCall) Header() http.Header {
8003 if c.header_ == nil {
8004 c.header_ = make(http.Header)
8005 }
8006 return c.header_
8007 }
8008
8009 func (c *BuyersProposalsSendRfpCall) doRequest(alt string) (*http.Response, error) {
8010 reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_)
8011 body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.sendrfprequest)
8012 if err != nil {
8013 return nil, err
8014 }
8015 c.urlParams_.Set("alt", alt)
8016 c.urlParams_.Set("prettyPrint", "false")
8017 urls := googleapi.ResolveRelative(c.s.BasePath, "v1alpha/{+buyer}/proposals:sendRfp")
8018 urls += "?" + c.urlParams_.Encode()
8019 req, err := http.NewRequest("POST", urls, body)
8020 if err != nil {
8021 return nil, err
8022 }
8023 req.Header = reqHeaders
8024 googleapi.Expand(req.URL, map[string]string{
8025 "buyer": c.buyer,
8026 })
8027 c.s.logger.DebugContext(c.ctx_, "api request", "serviceName", apiName, "rpcName", "authorizedbuyersmarketplace.buyers.proposals.sendRfp", "request", internallog.HTTPRequest(req, body.Bytes()))
8028 return gensupport.SendRequest(c.ctx_, c.s.client, req)
8029 }
8030
8031 // Do executes the "authorizedbuyersmarketplace.buyers.proposals.sendRfp" call.
8032 // Any non-2xx status code is an error. Response headers are in either
8033 // *Proposal.ServerResponse.Header or (if a response was returned at all) in
8034 // error.(*googleapi.Error).Header. Use googleapi.IsNotModified to check
8035 // whether the returned error was because http.StatusNotModified was returned.
8036 func (c *BuyersProposalsSendRfpCall) Do(opts ...googleapi.CallOption) (*Proposal, error) {
8037 gensupport.SetOptions(c.urlParams_, opts...)
8038 res, err := c.doRequest("json")
8039 if res != nil && res.StatusCode == http.StatusNotModified {
8040 if res.Body != nil {
8041 res.Body.Close()
8042 }
8043 return nil, gensupport.WrapError(&googleapi.Error{
8044 Code: res.StatusCode,
8045 Header: res.Header,
8046 })
8047 }
8048 if err != nil {
8049 return nil, err
8050 }
8051 defer googleapi.CloseBody(res)
8052 if err := googleapi.CheckResponse(res); err != nil {
8053 return nil, gensupport.WrapError(err)
8054 }
8055 ret := &Proposal{
8056 ServerResponse: googleapi.ServerResponse{
8057 Header: res.Header,
8058 HTTPStatusCode: res.StatusCode,
8059 },
8060 }
8061 target := &ret
8062 b, err := gensupport.DecodeResponseBytes(target, res)
8063 if err != nil {
8064 return nil, err
8065 }
8066 c.s.logger.DebugContext(c.ctx_, "api response", "serviceName", apiName, "rpcName", "authorizedbuyersmarketplace.buyers.proposals.sendRfp", "response", internallog.HTTPResponse(res, b))
8067 return ret, nil
8068 }
8069
8070 type BuyersProposalsDealsBatchUpdateCall struct {
8071 s *Service
8072 parent string
8073 batchupdatedealsrequest *BatchUpdateDealsRequest
8074 urlParams_ gensupport.URLParams
8075 ctx_ context.Context
8076 header_ http.Header
8077 }
8078
8079 // BatchUpdate: Batch updates multiple deals in the same proposal.
8080 //
8081 // - parent: The name of the proposal containing the deals to batch update.
8082 // Format: buyers/{accountId}/proposals/{proposalId}.
8083 func (r *BuyersProposalsDealsService) BatchUpdate(parent string, batchupdatedealsrequest *BatchUpdateDealsRequest) *BuyersProposalsDealsBatchUpdateCall {
8084 c := &BuyersProposalsDealsBatchUpdateCall{s: r.s, urlParams_: make(gensupport.URLParams)}
8085 c.parent = parent
8086 c.batchupdatedealsrequest = batchupdatedealsrequest
8087 return c
8088 }
8089
8090 // Fields allows partial responses to be retrieved. See
8091 // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse for more
8092 // details.
8093 func (c *BuyersProposalsDealsBatchUpdateCall) Fields(s ...googleapi.Field) *BuyersProposalsDealsBatchUpdateCall {
8094 c.urlParams_.Set("fields", googleapi.CombineFields(s))
8095 return c
8096 }
8097
8098 // Context sets the context to be used in this call's Do method.
8099 func (c *BuyersProposalsDealsBatchUpdateCall) Context(ctx context.Context) *BuyersProposalsDealsBatchUpdateCall {
8100 c.ctx_ = ctx
8101 return c
8102 }
8103
8104 // Header returns a http.Header that can be modified by the caller to add
8105 // headers to the request.
8106 func (c *BuyersProposalsDealsBatchUpdateCall) Header() http.Header {
8107 if c.header_ == nil {
8108 c.header_ = make(http.Header)
8109 }
8110 return c.header_
8111 }
8112
8113 func (c *BuyersProposalsDealsBatchUpdateCall) doRequest(alt string) (*http.Response, error) {
8114 reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_)
8115 body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.batchupdatedealsrequest)
8116 if err != nil {
8117 return nil, err
8118 }
8119 c.urlParams_.Set("alt", alt)
8120 c.urlParams_.Set("prettyPrint", "false")
8121 urls := googleapi.ResolveRelative(c.s.BasePath, "v1alpha/{+parent}/deals:batchUpdate")
8122 urls += "?" + c.urlParams_.Encode()
8123 req, err := http.NewRequest("POST", urls, body)
8124 if err != nil {
8125 return nil, err
8126 }
8127 req.Header = reqHeaders
8128 googleapi.Expand(req.URL, map[string]string{
8129 "parent": c.parent,
8130 })
8131 c.s.logger.DebugContext(c.ctx_, "api request", "serviceName", apiName, "rpcName", "authorizedbuyersmarketplace.buyers.proposals.deals.batchUpdate", "request", internallog.HTTPRequest(req, body.Bytes()))
8132 return gensupport.SendRequest(c.ctx_, c.s.client, req)
8133 }
8134
8135 // Do executes the "authorizedbuyersmarketplace.buyers.proposals.deals.batchUpdate" call.
8136 // Any non-2xx status code is an error. Response headers are in either
8137 // *BatchUpdateDealsResponse.ServerResponse.Header or (if a response was
8138 // returned at all) in error.(*googleapi.Error).Header. Use
8139 // googleapi.IsNotModified to check whether the returned error was because
8140 // http.StatusNotModified was returned.
8141 func (c *BuyersProposalsDealsBatchUpdateCall) Do(opts ...googleapi.CallOption) (*BatchUpdateDealsResponse, error) {
8142 gensupport.SetOptions(c.urlParams_, opts...)
8143 res, err := c.doRequest("json")
8144 if res != nil && res.StatusCode == http.StatusNotModified {
8145 if res.Body != nil {
8146 res.Body.Close()
8147 }
8148 return nil, gensupport.WrapError(&googleapi.Error{
8149 Code: res.StatusCode,
8150 Header: res.Header,
8151 })
8152 }
8153 if err != nil {
8154 return nil, err
8155 }
8156 defer googleapi.CloseBody(res)
8157 if err := googleapi.CheckResponse(res); err != nil {
8158 return nil, gensupport.WrapError(err)
8159 }
8160 ret := &BatchUpdateDealsResponse{
8161 ServerResponse: googleapi.ServerResponse{
8162 Header: res.Header,
8163 HTTPStatusCode: res.StatusCode,
8164 },
8165 }
8166 target := &ret
8167 b, err := gensupport.DecodeResponseBytes(target, res)
8168 if err != nil {
8169 return nil, err
8170 }
8171 c.s.logger.DebugContext(c.ctx_, "api response", "serviceName", apiName, "rpcName", "authorizedbuyersmarketplace.buyers.proposals.deals.batchUpdate", "response", internallog.HTTPResponse(res, b))
8172 return ret, nil
8173 }
8174
8175 type BuyersProposalsDealsGetCall struct {
8176 s *Service
8177 name string
8178 urlParams_ gensupport.URLParams
8179 ifNoneMatch_ string
8180 ctx_ context.Context
8181 header_ http.Header
8182 }
8183
8184 // Get: Gets a deal given its name. The deal is returned at its head revision.
8185 //
8186 // - name: Format: buyers/{accountId}/proposals/{proposalId}/deals/{dealId}.
8187 func (r *BuyersProposalsDealsService) Get(name string) *BuyersProposalsDealsGetCall {
8188 c := &BuyersProposalsDealsGetCall{s: r.s, urlParams_: make(gensupport.URLParams)}
8189 c.name = name
8190 return c
8191 }
8192
8193 // Fields allows partial responses to be retrieved. See
8194 // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse for more
8195 // details.
8196 func (c *BuyersProposalsDealsGetCall) Fields(s ...googleapi.Field) *BuyersProposalsDealsGetCall {
8197 c.urlParams_.Set("fields", googleapi.CombineFields(s))
8198 return c
8199 }
8200
8201 // IfNoneMatch sets an optional parameter which makes the operation fail if the
8202 // object's ETag matches the given value. This is useful for getting updates
8203 // only after the object has changed since the last request.
8204 func (c *BuyersProposalsDealsGetCall) IfNoneMatch(entityTag string) *BuyersProposalsDealsGetCall {
8205 c.ifNoneMatch_ = entityTag
8206 return c
8207 }
8208
8209 // Context sets the context to be used in this call's Do method.
8210 func (c *BuyersProposalsDealsGetCall) Context(ctx context.Context) *BuyersProposalsDealsGetCall {
8211 c.ctx_ = ctx
8212 return c
8213 }
8214
8215 // Header returns a http.Header that can be modified by the caller to add
8216 // headers to the request.
8217 func (c *BuyersProposalsDealsGetCall) Header() http.Header {
8218 if c.header_ == nil {
8219 c.header_ = make(http.Header)
8220 }
8221 return c.header_
8222 }
8223
8224 func (c *BuyersProposalsDealsGetCall) doRequest(alt string) (*http.Response, error) {
8225 reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_)
8226 if c.ifNoneMatch_ != "" {
8227 reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
8228 }
8229 c.urlParams_.Set("alt", alt)
8230 c.urlParams_.Set("prettyPrint", "false")
8231 urls := googleapi.ResolveRelative(c.s.BasePath, "v1alpha/{+name}")
8232 urls += "?" + c.urlParams_.Encode()
8233 req, err := http.NewRequest("GET", urls, nil)
8234 if err != nil {
8235 return nil, err
8236 }
8237 req.Header = reqHeaders
8238 googleapi.Expand(req.URL, map[string]string{
8239 "name": c.name,
8240 })
8241 c.s.logger.DebugContext(c.ctx_, "api request", "serviceName", apiName, "rpcName", "authorizedbuyersmarketplace.buyers.proposals.deals.get", "request", internallog.HTTPRequest(req, nil))
8242 return gensupport.SendRequest(c.ctx_, c.s.client, req)
8243 }
8244
8245 // Do executes the "authorizedbuyersmarketplace.buyers.proposals.deals.get" call.
8246 // Any non-2xx status code is an error. Response headers are in either
8247 // *Deal.ServerResponse.Header or (if a response was returned at all) in
8248 // error.(*googleapi.Error).Header. Use googleapi.IsNotModified to check
8249 // whether the returned error was because http.StatusNotModified was returned.
8250 func (c *BuyersProposalsDealsGetCall) Do(opts ...googleapi.CallOption) (*Deal, error) {
8251 gensupport.SetOptions(c.urlParams_, opts...)
8252 res, err := c.doRequest("json")
8253 if res != nil && res.StatusCode == http.StatusNotModified {
8254 if res.Body != nil {
8255 res.Body.Close()
8256 }
8257 return nil, gensupport.WrapError(&googleapi.Error{
8258 Code: res.StatusCode,
8259 Header: res.Header,
8260 })
8261 }
8262 if err != nil {
8263 return nil, err
8264 }
8265 defer googleapi.CloseBody(res)
8266 if err := googleapi.CheckResponse(res); err != nil {
8267 return nil, gensupport.WrapError(err)
8268 }
8269 ret := &Deal{
8270 ServerResponse: googleapi.ServerResponse{
8271 Header: res.Header,
8272 HTTPStatusCode: res.StatusCode,
8273 },
8274 }
8275 target := &ret
8276 b, err := gensupport.DecodeResponseBytes(target, res)
8277 if err != nil {
8278 return nil, err
8279 }
8280 c.s.logger.DebugContext(c.ctx_, "api response", "serviceName", apiName, "rpcName", "authorizedbuyersmarketplace.buyers.proposals.deals.get", "response", internallog.HTTPResponse(res, b))
8281 return ret, nil
8282 }
8283
8284 type BuyersProposalsDealsListCall struct {
8285 s *Service
8286 parent string
8287 urlParams_ gensupport.URLParams
8288 ifNoneMatch_ string
8289 ctx_ context.Context
8290 header_ http.Header
8291 }
8292
8293 // List: Lists all deals in a proposal. To retrieve only the finalized revision
8294 // deals regardless if a deal is being renegotiated, see the FinalizedDeals
8295 // resource.
8296 //
8297 // - parent: The name of the proposal containing the deals to retrieve. Format:
8298 // buyers/{accountId}/proposals/{proposalId}.
8299 func (r *BuyersProposalsDealsService) List(parent string) *BuyersProposalsDealsListCall {
8300 c := &BuyersProposalsDealsListCall{s: r.s, urlParams_: make(gensupport.URLParams)}
8301 c.parent = parent
8302 return c
8303 }
8304
8305 // PageSize sets the optional parameter "pageSize": Requested page size. The
8306 // server may return fewer results than requested. If requested more than 500,
8307 // the server will return 500 results per page. If unspecified, the server will
8308 // pick a default page size of 100.
8309 func (c *BuyersProposalsDealsListCall) PageSize(pageSize int64) *BuyersProposalsDealsListCall {
8310 c.urlParams_.Set("pageSize", fmt.Sprint(pageSize))
8311 return c
8312 }
8313
8314 // PageToken sets the optional parameter "pageToken": The page token as
8315 // returned from ListDealsResponse.
8316 func (c *BuyersProposalsDealsListCall) PageToken(pageToken string) *BuyersProposalsDealsListCall {
8317 c.urlParams_.Set("pageToken", pageToken)
8318 return c
8319 }
8320
8321 // Fields allows partial responses to be retrieved. See
8322 // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse for more
8323 // details.
8324 func (c *BuyersProposalsDealsListCall) Fields(s ...googleapi.Field) *BuyersProposalsDealsListCall {
8325 c.urlParams_.Set("fields", googleapi.CombineFields(s))
8326 return c
8327 }
8328
8329 // IfNoneMatch sets an optional parameter which makes the operation fail if the
8330 // object's ETag matches the given value. This is useful for getting updates
8331 // only after the object has changed since the last request.
8332 func (c *BuyersProposalsDealsListCall) IfNoneMatch(entityTag string) *BuyersProposalsDealsListCall {
8333 c.ifNoneMatch_ = entityTag
8334 return c
8335 }
8336
8337 // Context sets the context to be used in this call's Do method.
8338 func (c *BuyersProposalsDealsListCall) Context(ctx context.Context) *BuyersProposalsDealsListCall {
8339 c.ctx_ = ctx
8340 return c
8341 }
8342
8343 // Header returns a http.Header that can be modified by the caller to add
8344 // headers to the request.
8345 func (c *BuyersProposalsDealsListCall) Header() http.Header {
8346 if c.header_ == nil {
8347 c.header_ = make(http.Header)
8348 }
8349 return c.header_
8350 }
8351
8352 func (c *BuyersProposalsDealsListCall) doRequest(alt string) (*http.Response, error) {
8353 reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_)
8354 if c.ifNoneMatch_ != "" {
8355 reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
8356 }
8357 c.urlParams_.Set("alt", alt)
8358 c.urlParams_.Set("prettyPrint", "false")
8359 urls := googleapi.ResolveRelative(c.s.BasePath, "v1alpha/{+parent}/deals")
8360 urls += "?" + c.urlParams_.Encode()
8361 req, err := http.NewRequest("GET", urls, nil)
8362 if err != nil {
8363 return nil, err
8364 }
8365 req.Header = reqHeaders
8366 googleapi.Expand(req.URL, map[string]string{
8367 "parent": c.parent,
8368 })
8369 c.s.logger.DebugContext(c.ctx_, "api request", "serviceName", apiName, "rpcName", "authorizedbuyersmarketplace.buyers.proposals.deals.list", "request", internallog.HTTPRequest(req, nil))
8370 return gensupport.SendRequest(c.ctx_, c.s.client, req)
8371 }
8372
8373 // Do executes the "authorizedbuyersmarketplace.buyers.proposals.deals.list" call.
8374 // Any non-2xx status code is an error. Response headers are in either
8375 // *ListDealsResponse.ServerResponse.Header or (if a response was returned at
8376 // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to
8377 // check whether the returned error was because http.StatusNotModified was
8378 // returned.
8379 func (c *BuyersProposalsDealsListCall) Do(opts ...googleapi.CallOption) (*ListDealsResponse, error) {
8380 gensupport.SetOptions(c.urlParams_, opts...)
8381 res, err := c.doRequest("json")
8382 if res != nil && res.StatusCode == http.StatusNotModified {
8383 if res.Body != nil {
8384 res.Body.Close()
8385 }
8386 return nil, gensupport.WrapError(&googleapi.Error{
8387 Code: res.StatusCode,
8388 Header: res.Header,
8389 })
8390 }
8391 if err != nil {
8392 return nil, err
8393 }
8394 defer googleapi.CloseBody(res)
8395 if err := googleapi.CheckResponse(res); err != nil {
8396 return nil, gensupport.WrapError(err)
8397 }
8398 ret := &ListDealsResponse{
8399 ServerResponse: googleapi.ServerResponse{
8400 Header: res.Header,
8401 HTTPStatusCode: res.StatusCode,
8402 },
8403 }
8404 target := &ret
8405 b, err := gensupport.DecodeResponseBytes(target, res)
8406 if err != nil {
8407 return nil, err
8408 }
8409 c.s.logger.DebugContext(c.ctx_, "api response", "serviceName", apiName, "rpcName", "authorizedbuyersmarketplace.buyers.proposals.deals.list", "response", internallog.HTTPResponse(res, b))
8410 return ret, nil
8411 }
8412
8413 // Pages invokes f for each page of results.
8414 // A non-nil error returned from f will halt the iteration.
8415 // The provided context supersedes any context provided to the Context method.
8416 func (c *BuyersProposalsDealsListCall) Pages(ctx context.Context, f func(*ListDealsResponse) error) error {
8417 c.ctx_ = ctx
8418 defer c.PageToken(c.urlParams_.Get("pageToken"))
8419 for {
8420 x, err := c.Do()
8421 if err != nil {
8422 return err
8423 }
8424 if err := f(x); err != nil {
8425 return err
8426 }
8427 if x.NextPageToken == "" {
8428 return nil
8429 }
8430 c.PageToken(x.NextPageToken)
8431 }
8432 }
8433
8434 type BuyersProposalsDealsPatchCall struct {
8435 s *Service
8436 nameid string
8437 deal *Deal
8438 urlParams_ gensupport.URLParams
8439 ctx_ context.Context
8440 header_ http.Header
8441 }
8442
8443 // Patch: Updates the given deal at the buyer known revision number. If the
8444 // server revision has advanced since the passed-in proposal.proposal_revision
8445 // an ABORTED error message will be returned. The revision number is
8446 // incremented by the server whenever the proposal or its constituent deals are
8447 // updated. Note: The revision number is kept at a proposal level. The buyer of
8448 // the API is expected to keep track of the revision number after the last
8449 // update operation and send it in as part of the next update request. This
8450 // way, if there are further changes on the server (for example, seller making
8451 // new updates), then the server can detect conflicts and reject the proposed
8452 // changes.
8453 //
8454 // - name: Immutable. The unique identifier of the deal. Auto-generated by the
8455 // server when a deal is created. Format:
8456 // buyers/{accountId}/proposals/{proposalId}/deals/{dealId}.
8457 func (r *BuyersProposalsDealsService) Patch(nameid string, deal *Deal) *BuyersProposalsDealsPatchCall {
8458 c := &BuyersProposalsDealsPatchCall{s: r.s, urlParams_: make(gensupport.URLParams)}
8459 c.nameid = nameid
8460 c.deal = deal
8461 return c
8462 }
8463
8464 // UpdateMask sets the optional parameter "updateMask": List of fields to be
8465 // updated. If empty or unspecified, the service will update all fields
8466 // populated in the update request excluding the output only fields and
8467 // primitive fields with default value. Note that explicit field mask is
8468 // required in order to reset a primitive field back to its default value, for
8469 // example, false for boolean fields, 0 for integer fields. A special field
8470 // mask consisting of a single path "*" can be used to indicate full
8471 // replacement(the equivalent of PUT method), updatable fields unset or
8472 // unspecified in the input will be cleared or set to default value. Output
8473 // only fields will be ignored regardless of the value of updateMask.
8474 func (c *BuyersProposalsDealsPatchCall) UpdateMask(updateMask string) *BuyersProposalsDealsPatchCall {
8475 c.urlParams_.Set("updateMask", updateMask)
8476 return c
8477 }
8478
8479 // Fields allows partial responses to be retrieved. See
8480 // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse for more
8481 // details.
8482 func (c *BuyersProposalsDealsPatchCall) Fields(s ...googleapi.Field) *BuyersProposalsDealsPatchCall {
8483 c.urlParams_.Set("fields", googleapi.CombineFields(s))
8484 return c
8485 }
8486
8487 // Context sets the context to be used in this call's Do method.
8488 func (c *BuyersProposalsDealsPatchCall) Context(ctx context.Context) *BuyersProposalsDealsPatchCall {
8489 c.ctx_ = ctx
8490 return c
8491 }
8492
8493 // Header returns a http.Header that can be modified by the caller to add
8494 // headers to the request.
8495 func (c *BuyersProposalsDealsPatchCall) Header() http.Header {
8496 if c.header_ == nil {
8497 c.header_ = make(http.Header)
8498 }
8499 return c.header_
8500 }
8501
8502 func (c *BuyersProposalsDealsPatchCall) doRequest(alt string) (*http.Response, error) {
8503 reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_)
8504 body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.deal)
8505 if err != nil {
8506 return nil, err
8507 }
8508 c.urlParams_.Set("alt", alt)
8509 c.urlParams_.Set("prettyPrint", "false")
8510 urls := googleapi.ResolveRelative(c.s.BasePath, "v1alpha/{+name}")
8511 urls += "?" + c.urlParams_.Encode()
8512 req, err := http.NewRequest("PATCH", urls, body)
8513 if err != nil {
8514 return nil, err
8515 }
8516 req.Header = reqHeaders
8517 googleapi.Expand(req.URL, map[string]string{
8518 "name": c.nameid,
8519 })
8520 c.s.logger.DebugContext(c.ctx_, "api request", "serviceName", apiName, "rpcName", "authorizedbuyersmarketplace.buyers.proposals.deals.patch", "request", internallog.HTTPRequest(req, body.Bytes()))
8521 return gensupport.SendRequest(c.ctx_, c.s.client, req)
8522 }
8523
8524 // Do executes the "authorizedbuyersmarketplace.buyers.proposals.deals.patch" call.
8525 // Any non-2xx status code is an error. Response headers are in either
8526 // *Deal.ServerResponse.Header or (if a response was returned at all) in
8527 // error.(*googleapi.Error).Header. Use googleapi.IsNotModified to check
8528 // whether the returned error was because http.StatusNotModified was returned.
8529 func (c *BuyersProposalsDealsPatchCall) Do(opts ...googleapi.CallOption) (*Deal, error) {
8530 gensupport.SetOptions(c.urlParams_, opts...)
8531 res, err := c.doRequest("json")
8532 if res != nil && res.StatusCode == http.StatusNotModified {
8533 if res.Body != nil {
8534 res.Body.Close()
8535 }
8536 return nil, gensupport.WrapError(&googleapi.Error{
8537 Code: res.StatusCode,
8538 Header: res.Header,
8539 })
8540 }
8541 if err != nil {
8542 return nil, err
8543 }
8544 defer googleapi.CloseBody(res)
8545 if err := googleapi.CheckResponse(res); err != nil {
8546 return nil, gensupport.WrapError(err)
8547 }
8548 ret := &Deal{
8549 ServerResponse: googleapi.ServerResponse{
8550 Header: res.Header,
8551 HTTPStatusCode: res.StatusCode,
8552 },
8553 }
8554 target := &ret
8555 b, err := gensupport.DecodeResponseBytes(target, res)
8556 if err != nil {
8557 return nil, err
8558 }
8559 c.s.logger.DebugContext(c.ctx_, "api response", "serviceName", apiName, "rpcName", "authorizedbuyersmarketplace.buyers.proposals.deals.patch", "response", internallog.HTTPResponse(res, b))
8560 return ret, nil
8561 }
8562
8563 type BuyersPublisherProfilesGetCall struct {
8564 s *Service
8565 name string
8566 urlParams_ gensupport.URLParams
8567 ifNoneMatch_ string
8568 ctx_ context.Context
8569 header_ http.Header
8570 }
8571
8572 // Get: Gets the requested publisher profile by name.
8573 //
8574 // - name: Name of the publisher profile. Format:
8575 // `buyers/{buyerId}/publisherProfiles/{publisherProfileId}`.
8576 func (r *BuyersPublisherProfilesService) Get(name string) *BuyersPublisherProfilesGetCall {
8577 c := &BuyersPublisherProfilesGetCall{s: r.s, urlParams_: make(gensupport.URLParams)}
8578 c.name = name
8579 return c
8580 }
8581
8582 // Fields allows partial responses to be retrieved. See
8583 // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse for more
8584 // details.
8585 func (c *BuyersPublisherProfilesGetCall) Fields(s ...googleapi.Field) *BuyersPublisherProfilesGetCall {
8586 c.urlParams_.Set("fields", googleapi.CombineFields(s))
8587 return c
8588 }
8589
8590 // IfNoneMatch sets an optional parameter which makes the operation fail if the
8591 // object's ETag matches the given value. This is useful for getting updates
8592 // only after the object has changed since the last request.
8593 func (c *BuyersPublisherProfilesGetCall) IfNoneMatch(entityTag string) *BuyersPublisherProfilesGetCall {
8594 c.ifNoneMatch_ = entityTag
8595 return c
8596 }
8597
8598 // Context sets the context to be used in this call's Do method.
8599 func (c *BuyersPublisherProfilesGetCall) Context(ctx context.Context) *BuyersPublisherProfilesGetCall {
8600 c.ctx_ = ctx
8601 return c
8602 }
8603
8604 // Header returns a http.Header that can be modified by the caller to add
8605 // headers to the request.
8606 func (c *BuyersPublisherProfilesGetCall) Header() http.Header {
8607 if c.header_ == nil {
8608 c.header_ = make(http.Header)
8609 }
8610 return c.header_
8611 }
8612
8613 func (c *BuyersPublisherProfilesGetCall) doRequest(alt string) (*http.Response, error) {
8614 reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_)
8615 if c.ifNoneMatch_ != "" {
8616 reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
8617 }
8618 c.urlParams_.Set("alt", alt)
8619 c.urlParams_.Set("prettyPrint", "false")
8620 urls := googleapi.ResolveRelative(c.s.BasePath, "v1alpha/{+name}")
8621 urls += "?" + c.urlParams_.Encode()
8622 req, err := http.NewRequest("GET", urls, nil)
8623 if err != nil {
8624 return nil, err
8625 }
8626 req.Header = reqHeaders
8627 googleapi.Expand(req.URL, map[string]string{
8628 "name": c.name,
8629 })
8630 c.s.logger.DebugContext(c.ctx_, "api request", "serviceName", apiName, "rpcName", "authorizedbuyersmarketplace.buyers.publisherProfiles.get", "request", internallog.HTTPRequest(req, nil))
8631 return gensupport.SendRequest(c.ctx_, c.s.client, req)
8632 }
8633
8634 // Do executes the "authorizedbuyersmarketplace.buyers.publisherProfiles.get" call.
8635 // Any non-2xx status code is an error. Response headers are in either
8636 // *PublisherProfile.ServerResponse.Header or (if a response was returned at
8637 // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to
8638 // check whether the returned error was because http.StatusNotModified was
8639 // returned.
8640 func (c *BuyersPublisherProfilesGetCall) Do(opts ...googleapi.CallOption) (*PublisherProfile, error) {
8641 gensupport.SetOptions(c.urlParams_, opts...)
8642 res, err := c.doRequest("json")
8643 if res != nil && res.StatusCode == http.StatusNotModified {
8644 if res.Body != nil {
8645 res.Body.Close()
8646 }
8647 return nil, gensupport.WrapError(&googleapi.Error{
8648 Code: res.StatusCode,
8649 Header: res.Header,
8650 })
8651 }
8652 if err != nil {
8653 return nil, err
8654 }
8655 defer googleapi.CloseBody(res)
8656 if err := googleapi.CheckResponse(res); err != nil {
8657 return nil, gensupport.WrapError(err)
8658 }
8659 ret := &PublisherProfile{
8660 ServerResponse: googleapi.ServerResponse{
8661 Header: res.Header,
8662 HTTPStatusCode: res.StatusCode,
8663 },
8664 }
8665 target := &ret
8666 b, err := gensupport.DecodeResponseBytes(target, res)
8667 if err != nil {
8668 return nil, err
8669 }
8670 c.s.logger.DebugContext(c.ctx_, "api response", "serviceName", apiName, "rpcName", "authorizedbuyersmarketplace.buyers.publisherProfiles.get", "response", internallog.HTTPResponse(res, b))
8671 return ret, nil
8672 }
8673
8674 type BuyersPublisherProfilesListCall struct {
8675 s *Service
8676 parent string
8677 urlParams_ gensupport.URLParams
8678 ifNoneMatch_ string
8679 ctx_ context.Context
8680 header_ http.Header
8681 }
8682
8683 // List: Lists publisher profiles. The returned publisher profiles aren't in
8684 // any defined order. The order of the results might change. A new publisher
8685 // profile can appear in any place in the list of returned results.
8686 //
8687 // - parent: Parent that owns the collection of publisher profiles Format:
8688 // `buyers/{buyerId}`.
8689 func (r *BuyersPublisherProfilesService) List(parent string) *BuyersPublisherProfilesListCall {
8690 c := &BuyersPublisherProfilesListCall{s: r.s, urlParams_: make(gensupport.URLParams)}
8691 c.parent = parent
8692 return c
8693 }
8694
8695 // Filter sets the optional parameter "filter": Optional query string using the
8696 // [Cloud API list filtering]
8697 // (https://developers.google.com/authorized-buyers/apis/guides/list-filters)
8698 // syntax.
8699 func (c *BuyersPublisherProfilesListCall) Filter(filter string) *BuyersPublisherProfilesListCall {
8700 c.urlParams_.Set("filter", filter)
8701 return c
8702 }
8703
8704 // PageSize sets the optional parameter "pageSize": Requested page size. The
8705 // server may return fewer results than requested. If requested more than 500,
8706 // the server will return 500 results per page. If unspecified, the server will
8707 // pick a default page size of 100.
8708 func (c *BuyersPublisherProfilesListCall) PageSize(pageSize int64) *BuyersPublisherProfilesListCall {
8709 c.urlParams_.Set("pageSize", fmt.Sprint(pageSize))
8710 return c
8711 }
8712
8713 // PageToken sets the optional parameter "pageToken": The page token as
8714 // returned from a previous ListPublisherProfilesResponse.
8715 func (c *BuyersPublisherProfilesListCall) PageToken(pageToken string) *BuyersPublisherProfilesListCall {
8716 c.urlParams_.Set("pageToken", pageToken)
8717 return c
8718 }
8719
8720 // Fields allows partial responses to be retrieved. See
8721 // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse for more
8722 // details.
8723 func (c *BuyersPublisherProfilesListCall) Fields(s ...googleapi.Field) *BuyersPublisherProfilesListCall {
8724 c.urlParams_.Set("fields", googleapi.CombineFields(s))
8725 return c
8726 }
8727
8728 // IfNoneMatch sets an optional parameter which makes the operation fail if the
8729 // object's ETag matches the given value. This is useful for getting updates
8730 // only after the object has changed since the last request.
8731 func (c *BuyersPublisherProfilesListCall) IfNoneMatch(entityTag string) *BuyersPublisherProfilesListCall {
8732 c.ifNoneMatch_ = entityTag
8733 return c
8734 }
8735
8736 // Context sets the context to be used in this call's Do method.
8737 func (c *BuyersPublisherProfilesListCall) Context(ctx context.Context) *BuyersPublisherProfilesListCall {
8738 c.ctx_ = ctx
8739 return c
8740 }
8741
8742 // Header returns a http.Header that can be modified by the caller to add
8743 // headers to the request.
8744 func (c *BuyersPublisherProfilesListCall) Header() http.Header {
8745 if c.header_ == nil {
8746 c.header_ = make(http.Header)
8747 }
8748 return c.header_
8749 }
8750
8751 func (c *BuyersPublisherProfilesListCall) doRequest(alt string) (*http.Response, error) {
8752 reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_)
8753 if c.ifNoneMatch_ != "" {
8754 reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
8755 }
8756 c.urlParams_.Set("alt", alt)
8757 c.urlParams_.Set("prettyPrint", "false")
8758 urls := googleapi.ResolveRelative(c.s.BasePath, "v1alpha/{+parent}/publisherProfiles")
8759 urls += "?" + c.urlParams_.Encode()
8760 req, err := http.NewRequest("GET", urls, nil)
8761 if err != nil {
8762 return nil, err
8763 }
8764 req.Header = reqHeaders
8765 googleapi.Expand(req.URL, map[string]string{
8766 "parent": c.parent,
8767 })
8768 c.s.logger.DebugContext(c.ctx_, "api request", "serviceName", apiName, "rpcName", "authorizedbuyersmarketplace.buyers.publisherProfiles.list", "request", internallog.HTTPRequest(req, nil))
8769 return gensupport.SendRequest(c.ctx_, c.s.client, req)
8770 }
8771
8772 // Do executes the "authorizedbuyersmarketplace.buyers.publisherProfiles.list" call.
8773 // Any non-2xx status code is an error. Response headers are in either
8774 // *ListPublisherProfilesResponse.ServerResponse.Header or (if a response was
8775 // returned at all) in error.(*googleapi.Error).Header. Use
8776 // googleapi.IsNotModified to check whether the returned error was because
8777 // http.StatusNotModified was returned.
8778 func (c *BuyersPublisherProfilesListCall) Do(opts ...googleapi.CallOption) (*ListPublisherProfilesResponse, error) {
8779 gensupport.SetOptions(c.urlParams_, opts...)
8780 res, err := c.doRequest("json")
8781 if res != nil && res.StatusCode == http.StatusNotModified {
8782 if res.Body != nil {
8783 res.Body.Close()
8784 }
8785 return nil, gensupport.WrapError(&googleapi.Error{
8786 Code: res.StatusCode,
8787 Header: res.Header,
8788 })
8789 }
8790 if err != nil {
8791 return nil, err
8792 }
8793 defer googleapi.CloseBody(res)
8794 if err := googleapi.CheckResponse(res); err != nil {
8795 return nil, gensupport.WrapError(err)
8796 }
8797 ret := &ListPublisherProfilesResponse{
8798 ServerResponse: googleapi.ServerResponse{
8799 Header: res.Header,
8800 HTTPStatusCode: res.StatusCode,
8801 },
8802 }
8803 target := &ret
8804 b, err := gensupport.DecodeResponseBytes(target, res)
8805 if err != nil {
8806 return nil, err
8807 }
8808 c.s.logger.DebugContext(c.ctx_, "api response", "serviceName", apiName, "rpcName", "authorizedbuyersmarketplace.buyers.publisherProfiles.list", "response", internallog.HTTPResponse(res, b))
8809 return ret, nil
8810 }
8811
8812 // Pages invokes f for each page of results.
8813 // A non-nil error returned from f will halt the iteration.
8814 // The provided context supersedes any context provided to the Context method.
8815 func (c *BuyersPublisherProfilesListCall) Pages(ctx context.Context, f func(*ListPublisherProfilesResponse) error) error {
8816 c.ctx_ = ctx
8817 defer c.PageToken(c.urlParams_.Get("pageToken"))
8818 for {
8819 x, err := c.Do()
8820 if err != nil {
8821 return err
8822 }
8823 if err := f(x); err != nil {
8824 return err
8825 }
8826 if x.NextPageToken == "" {
8827 return nil
8828 }
8829 c.PageToken(x.NextPageToken)
8830 }
8831 }
8832
8833 type CuratorsCuratedPackagesActivateCall struct {
8834 s *Service
8835 name string
8836 activatecuratedpackagerequest *ActivateCuratedPackageRequest
8837 urlParams_ gensupport.URLParams
8838 ctx_ context.Context
8839 header_ http.Header
8840 }
8841
8842 // Activate: Activates an existing curated package.
8843 //
8844 // - name: The name of the curated package to activate. Format:
8845 // `curators/{accountId}/curatedPackages/{curatedPackageId}`.
8846 func (r *CuratorsCuratedPackagesService) Activate(name string, activatecuratedpackagerequest *ActivateCuratedPackageRequest) *CuratorsCuratedPackagesActivateCall {
8847 c := &CuratorsCuratedPackagesActivateCall{s: r.s, urlParams_: make(gensupport.URLParams)}
8848 c.name = name
8849 c.activatecuratedpackagerequest = activatecuratedpackagerequest
8850 return c
8851 }
8852
8853 // Fields allows partial responses to be retrieved. See
8854 // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse for more
8855 // details.
8856 func (c *CuratorsCuratedPackagesActivateCall) Fields(s ...googleapi.Field) *CuratorsCuratedPackagesActivateCall {
8857 c.urlParams_.Set("fields", googleapi.CombineFields(s))
8858 return c
8859 }
8860
8861 // Context sets the context to be used in this call's Do method.
8862 func (c *CuratorsCuratedPackagesActivateCall) Context(ctx context.Context) *CuratorsCuratedPackagesActivateCall {
8863 c.ctx_ = ctx
8864 return c
8865 }
8866
8867 // Header returns a http.Header that can be modified by the caller to add
8868 // headers to the request.
8869 func (c *CuratorsCuratedPackagesActivateCall) Header() http.Header {
8870 if c.header_ == nil {
8871 c.header_ = make(http.Header)
8872 }
8873 return c.header_
8874 }
8875
8876 func (c *CuratorsCuratedPackagesActivateCall) doRequest(alt string) (*http.Response, error) {
8877 reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_)
8878 body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.activatecuratedpackagerequest)
8879 if err != nil {
8880 return nil, err
8881 }
8882 c.urlParams_.Set("alt", alt)
8883 c.urlParams_.Set("prettyPrint", "false")
8884 urls := googleapi.ResolveRelative(c.s.BasePath, "v1alpha/{+name}:activate")
8885 urls += "?" + c.urlParams_.Encode()
8886 req, err := http.NewRequest("POST", urls, body)
8887 if err != nil {
8888 return nil, err
8889 }
8890 req.Header = reqHeaders
8891 googleapi.Expand(req.URL, map[string]string{
8892 "name": c.name,
8893 })
8894 c.s.logger.DebugContext(c.ctx_, "api request", "serviceName", apiName, "rpcName", "authorizedbuyersmarketplace.curators.curatedPackages.activate", "request", internallog.HTTPRequest(req, body.Bytes()))
8895 return gensupport.SendRequest(c.ctx_, c.s.client, req)
8896 }
8897
8898 // Do executes the "authorizedbuyersmarketplace.curators.curatedPackages.activate" call.
8899 // Any non-2xx status code is an error. Response headers are in either
8900 // *CuratedPackage.ServerResponse.Header or (if a response was returned at all)
8901 // in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to check
8902 // whether the returned error was because http.StatusNotModified was returned.
8903 func (c *CuratorsCuratedPackagesActivateCall) Do(opts ...googleapi.CallOption) (*CuratedPackage, error) {
8904 gensupport.SetOptions(c.urlParams_, opts...)
8905 res, err := c.doRequest("json")
8906 if res != nil && res.StatusCode == http.StatusNotModified {
8907 if res.Body != nil {
8908 res.Body.Close()
8909 }
8910 return nil, gensupport.WrapError(&googleapi.Error{
8911 Code: res.StatusCode,
8912 Header: res.Header,
8913 })
8914 }
8915 if err != nil {
8916 return nil, err
8917 }
8918 defer googleapi.CloseBody(res)
8919 if err := googleapi.CheckResponse(res); err != nil {
8920 return nil, gensupport.WrapError(err)
8921 }
8922 ret := &CuratedPackage{
8923 ServerResponse: googleapi.ServerResponse{
8924 Header: res.Header,
8925 HTTPStatusCode: res.StatusCode,
8926 },
8927 }
8928 target := &ret
8929 b, err := gensupport.DecodeResponseBytes(target, res)
8930 if err != nil {
8931 return nil, err
8932 }
8933 c.s.logger.DebugContext(c.ctx_, "api response", "serviceName", apiName, "rpcName", "authorizedbuyersmarketplace.curators.curatedPackages.activate", "response", internallog.HTTPResponse(res, b))
8934 return ret, nil
8935 }
8936
8937 type CuratorsCuratedPackagesCreateCall struct {
8938 s *Service
8939 parent string
8940 curatedpackage *CuratedPackage
8941 urlParams_ gensupport.URLParams
8942 ctx_ context.Context
8943 header_ http.Header
8944 }
8945
8946 // Create: Creates a new curated package.
8947 //
8948 // - parent: The parent curator account where this curated package will be
8949 // created. Format: `curators/{accountId}`.
8950 func (r *CuratorsCuratedPackagesService) Create(parent string, curatedpackage *CuratedPackage) *CuratorsCuratedPackagesCreateCall {
8951 c := &CuratorsCuratedPackagesCreateCall{s: r.s, urlParams_: make(gensupport.URLParams)}
8952 c.parent = parent
8953 c.curatedpackage = curatedpackage
8954 return c
8955 }
8956
8957 // Fields allows partial responses to be retrieved. See
8958 // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse for more
8959 // details.
8960 func (c *CuratorsCuratedPackagesCreateCall) Fields(s ...googleapi.Field) *CuratorsCuratedPackagesCreateCall {
8961 c.urlParams_.Set("fields", googleapi.CombineFields(s))
8962 return c
8963 }
8964
8965 // Context sets the context to be used in this call's Do method.
8966 func (c *CuratorsCuratedPackagesCreateCall) Context(ctx context.Context) *CuratorsCuratedPackagesCreateCall {
8967 c.ctx_ = ctx
8968 return c
8969 }
8970
8971 // Header returns a http.Header that can be modified by the caller to add
8972 // headers to the request.
8973 func (c *CuratorsCuratedPackagesCreateCall) Header() http.Header {
8974 if c.header_ == nil {
8975 c.header_ = make(http.Header)
8976 }
8977 return c.header_
8978 }
8979
8980 func (c *CuratorsCuratedPackagesCreateCall) doRequest(alt string) (*http.Response, error) {
8981 reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_)
8982 body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.curatedpackage)
8983 if err != nil {
8984 return nil, err
8985 }
8986 c.urlParams_.Set("alt", alt)
8987 c.urlParams_.Set("prettyPrint", "false")
8988 urls := googleapi.ResolveRelative(c.s.BasePath, "v1alpha/{+parent}/curatedPackages")
8989 urls += "?" + c.urlParams_.Encode()
8990 req, err := http.NewRequest("POST", urls, body)
8991 if err != nil {
8992 return nil, err
8993 }
8994 req.Header = reqHeaders
8995 googleapi.Expand(req.URL, map[string]string{
8996 "parent": c.parent,
8997 })
8998 c.s.logger.DebugContext(c.ctx_, "api request", "serviceName", apiName, "rpcName", "authorizedbuyersmarketplace.curators.curatedPackages.create", "request", internallog.HTTPRequest(req, body.Bytes()))
8999 return gensupport.SendRequest(c.ctx_, c.s.client, req)
9000 }
9001
9002 // Do executes the "authorizedbuyersmarketplace.curators.curatedPackages.create" call.
9003 // Any non-2xx status code is an error. Response headers are in either
9004 // *CuratedPackage.ServerResponse.Header or (if a response was returned at all)
9005 // in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to check
9006 // whether the returned error was because http.StatusNotModified was returned.
9007 func (c *CuratorsCuratedPackagesCreateCall) Do(opts ...googleapi.CallOption) (*CuratedPackage, error) {
9008 gensupport.SetOptions(c.urlParams_, opts...)
9009 res, err := c.doRequest("json")
9010 if res != nil && res.StatusCode == http.StatusNotModified {
9011 if res.Body != nil {
9012 res.Body.Close()
9013 }
9014 return nil, gensupport.WrapError(&googleapi.Error{
9015 Code: res.StatusCode,
9016 Header: res.Header,
9017 })
9018 }
9019 if err != nil {
9020 return nil, err
9021 }
9022 defer googleapi.CloseBody(res)
9023 if err := googleapi.CheckResponse(res); err != nil {
9024 return nil, gensupport.WrapError(err)
9025 }
9026 ret := &CuratedPackage{
9027 ServerResponse: googleapi.ServerResponse{
9028 Header: res.Header,
9029 HTTPStatusCode: res.StatusCode,
9030 },
9031 }
9032 target := &ret
9033 b, err := gensupport.DecodeResponseBytes(target, res)
9034 if err != nil {
9035 return nil, err
9036 }
9037 c.s.logger.DebugContext(c.ctx_, "api response", "serviceName", apiName, "rpcName", "authorizedbuyersmarketplace.curators.curatedPackages.create", "response", internallog.HTTPResponse(res, b))
9038 return ret, nil
9039 }
9040
9041 type CuratorsCuratedPackagesDeactivateCall struct {
9042 s *Service
9043 name string
9044 deactivatecuratedpackagerequest *DeactivateCuratedPackageRequest
9045 urlParams_ gensupport.URLParams
9046 ctx_ context.Context
9047 header_ http.Header
9048 }
9049
9050 // Deactivate: Deactivates an existing curated package.
9051 //
9052 // - name: The name of the curated package to deactivate. Format:
9053 // `curators/{accountId}/curatedPackages/{curatedPackageId}`.
9054 func (r *CuratorsCuratedPackagesService) Deactivate(name string, deactivatecuratedpackagerequest *DeactivateCuratedPackageRequest) *CuratorsCuratedPackagesDeactivateCall {
9055 c := &CuratorsCuratedPackagesDeactivateCall{s: r.s, urlParams_: make(gensupport.URLParams)}
9056 c.name = name
9057 c.deactivatecuratedpackagerequest = deactivatecuratedpackagerequest
9058 return c
9059 }
9060
9061 // Fields allows partial responses to be retrieved. See
9062 // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse for more
9063 // details.
9064 func (c *CuratorsCuratedPackagesDeactivateCall) Fields(s ...googleapi.Field) *CuratorsCuratedPackagesDeactivateCall {
9065 c.urlParams_.Set("fields", googleapi.CombineFields(s))
9066 return c
9067 }
9068
9069 // Context sets the context to be used in this call's Do method.
9070 func (c *CuratorsCuratedPackagesDeactivateCall) Context(ctx context.Context) *CuratorsCuratedPackagesDeactivateCall {
9071 c.ctx_ = ctx
9072 return c
9073 }
9074
9075 // Header returns a http.Header that can be modified by the caller to add
9076 // headers to the request.
9077 func (c *CuratorsCuratedPackagesDeactivateCall) Header() http.Header {
9078 if c.header_ == nil {
9079 c.header_ = make(http.Header)
9080 }
9081 return c.header_
9082 }
9083
9084 func (c *CuratorsCuratedPackagesDeactivateCall) doRequest(alt string) (*http.Response, error) {
9085 reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_)
9086 body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.deactivatecuratedpackagerequest)
9087 if err != nil {
9088 return nil, err
9089 }
9090 c.urlParams_.Set("alt", alt)
9091 c.urlParams_.Set("prettyPrint", "false")
9092 urls := googleapi.ResolveRelative(c.s.BasePath, "v1alpha/{+name}:deactivate")
9093 urls += "?" + c.urlParams_.Encode()
9094 req, err := http.NewRequest("POST", urls, body)
9095 if err != nil {
9096 return nil, err
9097 }
9098 req.Header = reqHeaders
9099 googleapi.Expand(req.URL, map[string]string{
9100 "name": c.name,
9101 })
9102 c.s.logger.DebugContext(c.ctx_, "api request", "serviceName", apiName, "rpcName", "authorizedbuyersmarketplace.curators.curatedPackages.deactivate", "request", internallog.HTTPRequest(req, body.Bytes()))
9103 return gensupport.SendRequest(c.ctx_, c.s.client, req)
9104 }
9105
9106 // Do executes the "authorizedbuyersmarketplace.curators.curatedPackages.deactivate" call.
9107 // Any non-2xx status code is an error. Response headers are in either
9108 // *CuratedPackage.ServerResponse.Header or (if a response was returned at all)
9109 // in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to check
9110 // whether the returned error was because http.StatusNotModified was returned.
9111 func (c *CuratorsCuratedPackagesDeactivateCall) Do(opts ...googleapi.CallOption) (*CuratedPackage, error) {
9112 gensupport.SetOptions(c.urlParams_, opts...)
9113 res, err := c.doRequest("json")
9114 if res != nil && res.StatusCode == http.StatusNotModified {
9115 if res.Body != nil {
9116 res.Body.Close()
9117 }
9118 return nil, gensupport.WrapError(&googleapi.Error{
9119 Code: res.StatusCode,
9120 Header: res.Header,
9121 })
9122 }
9123 if err != nil {
9124 return nil, err
9125 }
9126 defer googleapi.CloseBody(res)
9127 if err := googleapi.CheckResponse(res); err != nil {
9128 return nil, gensupport.WrapError(err)
9129 }
9130 ret := &CuratedPackage{
9131 ServerResponse: googleapi.ServerResponse{
9132 Header: res.Header,
9133 HTTPStatusCode: res.StatusCode,
9134 },
9135 }
9136 target := &ret
9137 b, err := gensupport.DecodeResponseBytes(target, res)
9138 if err != nil {
9139 return nil, err
9140 }
9141 c.s.logger.DebugContext(c.ctx_, "api response", "serviceName", apiName, "rpcName", "authorizedbuyersmarketplace.curators.curatedPackages.deactivate", "response", internallog.HTTPResponse(res, b))
9142 return ret, nil
9143 }
9144
9145 type CuratorsCuratedPackagesGetCall struct {
9146 s *Service
9147 name string
9148 urlParams_ gensupport.URLParams
9149 ifNoneMatch_ string
9150 ctx_ context.Context
9151 header_ http.Header
9152 }
9153
9154 // Get: Gets a curated package given its resource name.
9155 //
9156 // - name: The name of the curated package to retrieve. Format:
9157 // `curators/{accountId}/curatedPackages/{curatedPackageId}`.
9158 func (r *CuratorsCuratedPackagesService) Get(name string) *CuratorsCuratedPackagesGetCall {
9159 c := &CuratorsCuratedPackagesGetCall{s: r.s, urlParams_: make(gensupport.URLParams)}
9160 c.name = name
9161 return c
9162 }
9163
9164 // Fields allows partial responses to be retrieved. See
9165 // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse for more
9166 // details.
9167 func (c *CuratorsCuratedPackagesGetCall) Fields(s ...googleapi.Field) *CuratorsCuratedPackagesGetCall {
9168 c.urlParams_.Set("fields", googleapi.CombineFields(s))
9169 return c
9170 }
9171
9172 // IfNoneMatch sets an optional parameter which makes the operation fail if the
9173 // object's ETag matches the given value. This is useful for getting updates
9174 // only after the object has changed since the last request.
9175 func (c *CuratorsCuratedPackagesGetCall) IfNoneMatch(entityTag string) *CuratorsCuratedPackagesGetCall {
9176 c.ifNoneMatch_ = entityTag
9177 return c
9178 }
9179
9180 // Context sets the context to be used in this call's Do method.
9181 func (c *CuratorsCuratedPackagesGetCall) Context(ctx context.Context) *CuratorsCuratedPackagesGetCall {
9182 c.ctx_ = ctx
9183 return c
9184 }
9185
9186 // Header returns a http.Header that can be modified by the caller to add
9187 // headers to the request.
9188 func (c *CuratorsCuratedPackagesGetCall) Header() http.Header {
9189 if c.header_ == nil {
9190 c.header_ = make(http.Header)
9191 }
9192 return c.header_
9193 }
9194
9195 func (c *CuratorsCuratedPackagesGetCall) doRequest(alt string) (*http.Response, error) {
9196 reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_)
9197 if c.ifNoneMatch_ != "" {
9198 reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
9199 }
9200 c.urlParams_.Set("alt", alt)
9201 c.urlParams_.Set("prettyPrint", "false")
9202 urls := googleapi.ResolveRelative(c.s.BasePath, "v1alpha/{+name}")
9203 urls += "?" + c.urlParams_.Encode()
9204 req, err := http.NewRequest("GET", urls, nil)
9205 if err != nil {
9206 return nil, err
9207 }
9208 req.Header = reqHeaders
9209 googleapi.Expand(req.URL, map[string]string{
9210 "name": c.name,
9211 })
9212 c.s.logger.DebugContext(c.ctx_, "api request", "serviceName", apiName, "rpcName", "authorizedbuyersmarketplace.curators.curatedPackages.get", "request", internallog.HTTPRequest(req, nil))
9213 return gensupport.SendRequest(c.ctx_, c.s.client, req)
9214 }
9215
9216 // Do executes the "authorizedbuyersmarketplace.curators.curatedPackages.get" call.
9217 // Any non-2xx status code is an error. Response headers are in either
9218 // *CuratedPackage.ServerResponse.Header or (if a response was returned at all)
9219 // in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to check
9220 // whether the returned error was because http.StatusNotModified was returned.
9221 func (c *CuratorsCuratedPackagesGetCall) Do(opts ...googleapi.CallOption) (*CuratedPackage, error) {
9222 gensupport.SetOptions(c.urlParams_, opts...)
9223 res, err := c.doRequest("json")
9224 if res != nil && res.StatusCode == http.StatusNotModified {
9225 if res.Body != nil {
9226 res.Body.Close()
9227 }
9228 return nil, gensupport.WrapError(&googleapi.Error{
9229 Code: res.StatusCode,
9230 Header: res.Header,
9231 })
9232 }
9233 if err != nil {
9234 return nil, err
9235 }
9236 defer googleapi.CloseBody(res)
9237 if err := googleapi.CheckResponse(res); err != nil {
9238 return nil, gensupport.WrapError(err)
9239 }
9240 ret := &CuratedPackage{
9241 ServerResponse: googleapi.ServerResponse{
9242 Header: res.Header,
9243 HTTPStatusCode: res.StatusCode,
9244 },
9245 }
9246 target := &ret
9247 b, err := gensupport.DecodeResponseBytes(target, res)
9248 if err != nil {
9249 return nil, err
9250 }
9251 c.s.logger.DebugContext(c.ctx_, "api response", "serviceName", apiName, "rpcName", "authorizedbuyersmarketplace.curators.curatedPackages.get", "response", internallog.HTTPResponse(res, b))
9252 return ret, nil
9253 }
9254
9255 type CuratorsCuratedPackagesListCall struct {
9256 s *Service
9257 parent string
9258 urlParams_ gensupport.URLParams
9259 ifNoneMatch_ string
9260 ctx_ context.Context
9261 header_ http.Header
9262 }
9263
9264 // List: Lists curated packages owned by the specified curator.
9265 //
9266 // - parent: The parent curator account which owns this collection of curated
9267 // packages. Format: `curators/{accountId}`.
9268 func (r *CuratorsCuratedPackagesService) List(parent string) *CuratorsCuratedPackagesListCall {
9269 c := &CuratorsCuratedPackagesListCall{s: r.s, urlParams_: make(gensupport.URLParams)}
9270 c.parent = parent
9271 return c
9272 }
9273
9274 // Filter sets the optional parameter "filter": Optional query string using the
9275 // Cloud API list filtering syntax
9276 // (/authorized-buyers/apis/guides/list-filters). Supported columns for
9277 // filtering are: * displayName * createTime * updateTime * state *
9278 // feeCpm.currencyCode * feeCpm.units * feeCpm.nanos *
9279 // floorPriceCpm.currencyCode * floorPriceCpm.units * floorPriceCpm.nanos
9280 func (c *CuratorsCuratedPackagesListCall) Filter(filter string) *CuratorsCuratedPackagesListCall {
9281 c.urlParams_.Set("filter", filter)
9282 return c
9283 }
9284
9285 // PageSize sets the optional parameter "pageSize": Requested page size. The
9286 // server may return fewer results than requested. Max allowed page size is
9287 // 500. If unspecified, the server will default to 500.
9288 func (c *CuratorsCuratedPackagesListCall) PageSize(pageSize int64) *CuratorsCuratedPackagesListCall {
9289 c.urlParams_.Set("pageSize", fmt.Sprint(pageSize))
9290 return c
9291 }
9292
9293 // PageToken sets the optional parameter "pageToken": A page token, received
9294 // from a previous `ListCuratedPackages` call. Provide this to retrieve the
9295 // subsequent page.
9296 func (c *CuratorsCuratedPackagesListCall) PageToken(pageToken string) *CuratorsCuratedPackagesListCall {
9297 c.urlParams_.Set("pageToken", pageToken)
9298 return c
9299 }
9300
9301 // Fields allows partial responses to be retrieved. See
9302 // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse for more
9303 // details.
9304 func (c *CuratorsCuratedPackagesListCall) Fields(s ...googleapi.Field) *CuratorsCuratedPackagesListCall {
9305 c.urlParams_.Set("fields", googleapi.CombineFields(s))
9306 return c
9307 }
9308
9309 // IfNoneMatch sets an optional parameter which makes the operation fail if the
9310 // object's ETag matches the given value. This is useful for getting updates
9311 // only after the object has changed since the last request.
9312 func (c *CuratorsCuratedPackagesListCall) IfNoneMatch(entityTag string) *CuratorsCuratedPackagesListCall {
9313 c.ifNoneMatch_ = entityTag
9314 return c
9315 }
9316
9317 // Context sets the context to be used in this call's Do method.
9318 func (c *CuratorsCuratedPackagesListCall) Context(ctx context.Context) *CuratorsCuratedPackagesListCall {
9319 c.ctx_ = ctx
9320 return c
9321 }
9322
9323 // Header returns a http.Header that can be modified by the caller to add
9324 // headers to the request.
9325 func (c *CuratorsCuratedPackagesListCall) Header() http.Header {
9326 if c.header_ == nil {
9327 c.header_ = make(http.Header)
9328 }
9329 return c.header_
9330 }
9331
9332 func (c *CuratorsCuratedPackagesListCall) doRequest(alt string) (*http.Response, error) {
9333 reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_)
9334 if c.ifNoneMatch_ != "" {
9335 reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
9336 }
9337 c.urlParams_.Set("alt", alt)
9338 c.urlParams_.Set("prettyPrint", "false")
9339 urls := googleapi.ResolveRelative(c.s.BasePath, "v1alpha/{+parent}/curatedPackages")
9340 urls += "?" + c.urlParams_.Encode()
9341 req, err := http.NewRequest("GET", urls, nil)
9342 if err != nil {
9343 return nil, err
9344 }
9345 req.Header = reqHeaders
9346 googleapi.Expand(req.URL, map[string]string{
9347 "parent": c.parent,
9348 })
9349 c.s.logger.DebugContext(c.ctx_, "api request", "serviceName", apiName, "rpcName", "authorizedbuyersmarketplace.curators.curatedPackages.list", "request", internallog.HTTPRequest(req, nil))
9350 return gensupport.SendRequest(c.ctx_, c.s.client, req)
9351 }
9352
9353 // Do executes the "authorizedbuyersmarketplace.curators.curatedPackages.list" call.
9354 // Any non-2xx status code is an error. Response headers are in either
9355 // *ListCuratedPackagesResponse.ServerResponse.Header or (if a response was
9356 // returned at all) in error.(*googleapi.Error).Header. Use
9357 // googleapi.IsNotModified to check whether the returned error was because
9358 // http.StatusNotModified was returned.
9359 func (c *CuratorsCuratedPackagesListCall) Do(opts ...googleapi.CallOption) (*ListCuratedPackagesResponse, error) {
9360 gensupport.SetOptions(c.urlParams_, opts...)
9361 res, err := c.doRequest("json")
9362 if res != nil && res.StatusCode == http.StatusNotModified {
9363 if res.Body != nil {
9364 res.Body.Close()
9365 }
9366 return nil, gensupport.WrapError(&googleapi.Error{
9367 Code: res.StatusCode,
9368 Header: res.Header,
9369 })
9370 }
9371 if err != nil {
9372 return nil, err
9373 }
9374 defer googleapi.CloseBody(res)
9375 if err := googleapi.CheckResponse(res); err != nil {
9376 return nil, gensupport.WrapError(err)
9377 }
9378 ret := &ListCuratedPackagesResponse{
9379 ServerResponse: googleapi.ServerResponse{
9380 Header: res.Header,
9381 HTTPStatusCode: res.StatusCode,
9382 },
9383 }
9384 target := &ret
9385 b, err := gensupport.DecodeResponseBytes(target, res)
9386 if err != nil {
9387 return nil, err
9388 }
9389 c.s.logger.DebugContext(c.ctx_, "api response", "serviceName", apiName, "rpcName", "authorizedbuyersmarketplace.curators.curatedPackages.list", "response", internallog.HTTPResponse(res, b))
9390 return ret, nil
9391 }
9392
9393 // Pages invokes f for each page of results.
9394 // A non-nil error returned from f will halt the iteration.
9395 // The provided context supersedes any context provided to the Context method.
9396 func (c *CuratorsCuratedPackagesListCall) Pages(ctx context.Context, f func(*ListCuratedPackagesResponse) error) error {
9397 c.ctx_ = ctx
9398 defer c.PageToken(c.urlParams_.Get("pageToken"))
9399 for {
9400 x, err := c.Do()
9401 if err != nil {
9402 return err
9403 }
9404 if err := f(x); err != nil {
9405 return err
9406 }
9407 if x.NextPageToken == "" {
9408 return nil
9409 }
9410 c.PageToken(x.NextPageToken)
9411 }
9412 }
9413
9414 type CuratorsCuratedPackagesPatchCall struct {
9415 s *Service
9416 name string
9417 curatedpackage *CuratedPackage
9418 urlParams_ gensupport.URLParams
9419 ctx_ context.Context
9420 header_ http.Header
9421 }
9422
9423 // Patch: Updates an existing curated package.
9424 //
9425 // - name: Identifier. The unique resource name for the curated package.
9426 // Format: `curators/{accountId}/curatedPackages/{curatedPackageId}`.
9427 func (r *CuratorsCuratedPackagesService) Patch(name string, curatedpackage *CuratedPackage) *CuratorsCuratedPackagesPatchCall {
9428 c := &CuratorsCuratedPackagesPatchCall{s: r.s, urlParams_: make(gensupport.URLParams)}
9429 c.name = name
9430 c.curatedpackage = curatedpackage
9431 return c
9432 }
9433
9434 // UpdateMask sets the optional parameter "updateMask": List of fields to be
9435 // updated. If empty or unspecified, the service will update all fields
9436 // populated in the update request excluding the output only fields and
9437 // primitive fields with default value. Note that explicit field mask is
9438 // required in order to reset a primitive field back to its default value, for
9439 // example, false for boolean fields, 0 for integer fields. A special field
9440 // mask consisting of a single path "*" can be used to indicate full
9441 // replacement (the equivalent of PUT method), updatable fields unset or
9442 // unspecified in the input will be cleared or set to default value. Output
9443 // only fields will be ignored regardless of the value of updateMask.
9444 func (c *CuratorsCuratedPackagesPatchCall) UpdateMask(updateMask string) *CuratorsCuratedPackagesPatchCall {
9445 c.urlParams_.Set("updateMask", updateMask)
9446 return c
9447 }
9448
9449 // Fields allows partial responses to be retrieved. See
9450 // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse for more
9451 // details.
9452 func (c *CuratorsCuratedPackagesPatchCall) Fields(s ...googleapi.Field) *CuratorsCuratedPackagesPatchCall {
9453 c.urlParams_.Set("fields", googleapi.CombineFields(s))
9454 return c
9455 }
9456
9457 // Context sets the context to be used in this call's Do method.
9458 func (c *CuratorsCuratedPackagesPatchCall) Context(ctx context.Context) *CuratorsCuratedPackagesPatchCall {
9459 c.ctx_ = ctx
9460 return c
9461 }
9462
9463 // Header returns a http.Header that can be modified by the caller to add
9464 // headers to the request.
9465 func (c *CuratorsCuratedPackagesPatchCall) Header() http.Header {
9466 if c.header_ == nil {
9467 c.header_ = make(http.Header)
9468 }
9469 return c.header_
9470 }
9471
9472 func (c *CuratorsCuratedPackagesPatchCall) doRequest(alt string) (*http.Response, error) {
9473 reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_)
9474 body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.curatedpackage)
9475 if err != nil {
9476 return nil, err
9477 }
9478 c.urlParams_.Set("alt", alt)
9479 c.urlParams_.Set("prettyPrint", "false")
9480 urls := googleapi.ResolveRelative(c.s.BasePath, "v1alpha/{+name}")
9481 urls += "?" + c.urlParams_.Encode()
9482 req, err := http.NewRequest("PATCH", urls, body)
9483 if err != nil {
9484 return nil, err
9485 }
9486 req.Header = reqHeaders
9487 googleapi.Expand(req.URL, map[string]string{
9488 "name": c.name,
9489 })
9490 c.s.logger.DebugContext(c.ctx_, "api request", "serviceName", apiName, "rpcName", "authorizedbuyersmarketplace.curators.curatedPackages.patch", "request", internallog.HTTPRequest(req, body.Bytes()))
9491 return gensupport.SendRequest(c.ctx_, c.s.client, req)
9492 }
9493
9494 // Do executes the "authorizedbuyersmarketplace.curators.curatedPackages.patch" call.
9495 // Any non-2xx status code is an error. Response headers are in either
9496 // *CuratedPackage.ServerResponse.Header or (if a response was returned at all)
9497 // in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to check
9498 // whether the returned error was because http.StatusNotModified was returned.
9499 func (c *CuratorsCuratedPackagesPatchCall) Do(opts ...googleapi.CallOption) (*CuratedPackage, error) {
9500 gensupport.SetOptions(c.urlParams_, opts...)
9501 res, err := c.doRequest("json")
9502 if res != nil && res.StatusCode == http.StatusNotModified {
9503 if res.Body != nil {
9504 res.Body.Close()
9505 }
9506 return nil, gensupport.WrapError(&googleapi.Error{
9507 Code: res.StatusCode,
9508 Header: res.Header,
9509 })
9510 }
9511 if err != nil {
9512 return nil, err
9513 }
9514 defer googleapi.CloseBody(res)
9515 if err := googleapi.CheckResponse(res); err != nil {
9516 return nil, gensupport.WrapError(err)
9517 }
9518 ret := &CuratedPackage{
9519 ServerResponse: googleapi.ServerResponse{
9520 Header: res.Header,
9521 HTTPStatusCode: res.StatusCode,
9522 },
9523 }
9524 target := &ret
9525 b, err := gensupport.DecodeResponseBytes(target, res)
9526 if err != nil {
9527 return nil, err
9528 }
9529 c.s.logger.DebugContext(c.ctx_, "api response", "serviceName", apiName, "rpcName", "authorizedbuyersmarketplace.curators.curatedPackages.patch", "response", internallog.HTTPResponse(res, b))
9530 return ret, nil
9531 }
9532
9533 type MediaPlannersListCall struct {
9534 s *Service
9535 urlParams_ gensupport.URLParams
9536 ifNoneMatch_ string
9537 ctx_ context.Context
9538 header_ http.Header
9539 }
9540
9541 // List: Lists all media planner accounts that the caller has access to. For
9542 // curators, this will return all media planners that have accepted curator
9543 // terms. For other accounts, attempting to list media planners will return an
9544 // error.
9545 func (r *MediaPlannersService) List() *MediaPlannersListCall {
9546 c := &MediaPlannersListCall{s: r.s, urlParams_: make(gensupport.URLParams)}
9547 return c
9548 }
9549
9550 // Filter sets the optional parameter "filter": Optional query string using the
9551 // Cloud API list filtering syntax
9552 // (/authorized-buyers/apis/guides/list-filters). Supported columns for
9553 // filtering are: * `name` * `displayName` * `ancestorNames`
9554 func (c *MediaPlannersListCall) Filter(filter string) *MediaPlannersListCall {
9555 c.urlParams_.Set("filter", filter)
9556 return c
9557 }
9558
9559 // PageSize sets the optional parameter "pageSize": The maximum number of media
9560 // planners to return. If unspecified, at most 100 media planners will be
9561 // returned. The maximum value is 500; values above 500 will be coerced to 500.
9562 func (c *MediaPlannersListCall) PageSize(pageSize int64) *MediaPlannersListCall {
9563 c.urlParams_.Set("pageSize", fmt.Sprint(pageSize))
9564 return c
9565 }
9566
9567 // PageToken sets the optional parameter "pageToken": A token identifying a
9568 // page of results the server should return. This value is received from a
9569 // previous `ListMediaPlanners` call in
9570 // ListMediaPlannersResponse.nextPageToken.
9571 func (c *MediaPlannersListCall) PageToken(pageToken string) *MediaPlannersListCall {
9572 c.urlParams_.Set("pageToken", pageToken)
9573 return c
9574 }
9575
9576 // Fields allows partial responses to be retrieved. See
9577 // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse for more
9578 // details.
9579 func (c *MediaPlannersListCall) Fields(s ...googleapi.Field) *MediaPlannersListCall {
9580 c.urlParams_.Set("fields", googleapi.CombineFields(s))
9581 return c
9582 }
9583
9584 // IfNoneMatch sets an optional parameter which makes the operation fail if the
9585 // object's ETag matches the given value. This is useful for getting updates
9586 // only after the object has changed since the last request.
9587 func (c *MediaPlannersListCall) IfNoneMatch(entityTag string) *MediaPlannersListCall {
9588 c.ifNoneMatch_ = entityTag
9589 return c
9590 }
9591
9592 // Context sets the context to be used in this call's Do method.
9593 func (c *MediaPlannersListCall) Context(ctx context.Context) *MediaPlannersListCall {
9594 c.ctx_ = ctx
9595 return c
9596 }
9597
9598 // Header returns a http.Header that can be modified by the caller to add
9599 // headers to the request.
9600 func (c *MediaPlannersListCall) Header() http.Header {
9601 if c.header_ == nil {
9602 c.header_ = make(http.Header)
9603 }
9604 return c.header_
9605 }
9606
9607 func (c *MediaPlannersListCall) doRequest(alt string) (*http.Response, error) {
9608 reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_)
9609 if c.ifNoneMatch_ != "" {
9610 reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
9611 }
9612 c.urlParams_.Set("alt", alt)
9613 c.urlParams_.Set("prettyPrint", "false")
9614 urls := googleapi.ResolveRelative(c.s.BasePath, "v1alpha/mediaPlanners")
9615 urls += "?" + c.urlParams_.Encode()
9616 req, err := http.NewRequest("GET", urls, nil)
9617 if err != nil {
9618 return nil, err
9619 }
9620 req.Header = reqHeaders
9621 c.s.logger.DebugContext(c.ctx_, "api request", "serviceName", apiName, "rpcName", "authorizedbuyersmarketplace.mediaPlanners.list", "request", internallog.HTTPRequest(req, nil))
9622 return gensupport.SendRequest(c.ctx_, c.s.client, req)
9623 }
9624
9625 // Do executes the "authorizedbuyersmarketplace.mediaPlanners.list" call.
9626 // Any non-2xx status code is an error. Response headers are in either
9627 // *ListMediaPlannersResponse.ServerResponse.Header or (if a response was
9628 // returned at all) in error.(*googleapi.Error).Header. Use
9629 // googleapi.IsNotModified to check whether the returned error was because
9630 // http.StatusNotModified was returned.
9631 func (c *MediaPlannersListCall) Do(opts ...googleapi.CallOption) (*ListMediaPlannersResponse, error) {
9632 gensupport.SetOptions(c.urlParams_, opts...)
9633 res, err := c.doRequest("json")
9634 if res != nil && res.StatusCode == http.StatusNotModified {
9635 if res.Body != nil {
9636 res.Body.Close()
9637 }
9638 return nil, gensupport.WrapError(&googleapi.Error{
9639 Code: res.StatusCode,
9640 Header: res.Header,
9641 })
9642 }
9643 if err != nil {
9644 return nil, err
9645 }
9646 defer googleapi.CloseBody(res)
9647 if err := googleapi.CheckResponse(res); err != nil {
9648 return nil, gensupport.WrapError(err)
9649 }
9650 ret := &ListMediaPlannersResponse{
9651 ServerResponse: googleapi.ServerResponse{
9652 Header: res.Header,
9653 HTTPStatusCode: res.StatusCode,
9654 },
9655 }
9656 target := &ret
9657 b, err := gensupport.DecodeResponseBytes(target, res)
9658 if err != nil {
9659 return nil, err
9660 }
9661 c.s.logger.DebugContext(c.ctx_, "api response", "serviceName", apiName, "rpcName", "authorizedbuyersmarketplace.mediaPlanners.list", "response", internallog.HTTPResponse(res, b))
9662 return ret, nil
9663 }
9664
9665 // Pages invokes f for each page of results.
9666 // A non-nil error returned from f will halt the iteration.
9667 // The provided context supersedes any context provided to the Context method.
9668 func (c *MediaPlannersListCall) Pages(ctx context.Context, f func(*ListMediaPlannersResponse) error) error {
9669 c.ctx_ = ctx
9670 defer c.PageToken(c.urlParams_.Get("pageToken"))
9671 for {
9672 x, err := c.Do()
9673 if err != nil {
9674 return err
9675 }
9676 if err := f(x); err != nil {
9677 return err
9678 }
9679 if x.NextPageToken == "" {
9680 return nil
9681 }
9682 c.PageToken(x.NextPageToken)
9683 }
9684 }