1// Copyright 2021 Google LLC. 2// Use of this source code is governed by a BSD-style 3// license that can be found in the LICENSE file. 4 5// Code generated file. DO NOT EDIT. 6 7// Package 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// Creating a client 12// 13// Usage example: 14// 15// import "google.golang.org/api/authorizedbuyersmarketplace/v1" 16// ... 17// ctx := context.Background() 18// authorizedbuyersmarketplaceService, err := authorizedbuyersmarketplace.NewService(ctx) 19// 20// In this example, Google Application Default Credentials are used for authentication. 21// 22// For information on how to create and obtain Application Default Credentials, see https://developers.google.com/identity/protocols/application-default-credentials. 23// 24// Other authentication options 25// 26// To use an API key for authentication (note: some APIs do not support API keys), use option.WithAPIKey: 27// 28// authorizedbuyersmarketplaceService, err := authorizedbuyersmarketplace.NewService(ctx, option.WithAPIKey("AIza...")) 29// 30// To use an OAuth token (e.g., a user token obtained via a three-legged OAuth flow), use option.WithTokenSource: 31// 32// config := &oauth2.Config{...} 33// // ... 34// token, err := config.Exchange(ctx, ...) 35// authorizedbuyersmarketplaceService, err := authorizedbuyersmarketplace.NewService(ctx, option.WithTokenSource(config.TokenSource(ctx, token))) 36// 37// See https://godoc.org/google.golang.org/api/option/ for details on options. 38package authorizedbuyersmarketplace // import "google.golang.org/api/authorizedbuyersmarketplace/v1" 39 40import ( 41 "bytes" 42 "context" 43 "encoding/json" 44 "errors" 45 "fmt" 46 "io" 47 "net/http" 48 "net/url" 49 "strconv" 50 "strings" 51 52 googleapi "google.golang.org/api/googleapi" 53 gensupport "google.golang.org/api/internal/gensupport" 54 option "google.golang.org/api/option" 55 internaloption "google.golang.org/api/option/internaloption" 56 htransport "google.golang.org/api/transport/http" 57) 58 59// Always reference these packages, just in case the auto-generated code 60// below doesn't. 61var _ = bytes.NewBuffer 62var _ = strconv.Itoa 63var _ = fmt.Sprintf 64var _ = json.NewDecoder 65var _ = io.Copy 66var _ = url.Parse 67var _ = gensupport.MarshalJSON 68var _ = googleapi.Version 69var _ = errors.New 70var _ = strings.Replace 71var _ = context.Canceled 72var _ = internaloption.WithDefaultEndpoint 73 74const apiId = "authorizedbuyersmarketplace:v1" 75const apiName = "authorizedbuyersmarketplace" 76const apiVersion = "v1" 77const basePath = "https://authorizedbuyersmarketplace.googleapis.com/" 78const mtlsBasePath = "https://authorizedbuyersmarketplace.mtls.googleapis.com/" 79 80// OAuth2 scopes used by this API. 81const ( 82 // See, create, edit, and delete your Authorized Buyers Marketplace 83 // entities. 84 AuthorizedBuyersMarketplaceScope = "https://www.googleapis.com/auth/authorized-buyers-marketplace" 85) 86 87// NewService creates a new Service. 88func NewService(ctx context.Context, opts ...option.ClientOption) (*Service, error) { 89 scopesOption := option.WithScopes( 90 "https://www.googleapis.com/auth/authorized-buyers-marketplace", 91 ) 92 // NOTE: prepend, so we don't override user-specified scopes. 93 opts = append([]option.ClientOption{scopesOption}, opts...) 94 opts = append(opts, internaloption.WithDefaultEndpoint(basePath)) 95 opts = append(opts, internaloption.WithDefaultMTLSEndpoint(mtlsBasePath)) 96 client, endpoint, err := htransport.NewClient(ctx, opts...) 97 if err != nil { 98 return nil, err 99 } 100 s, err := New(client) 101 if err != nil { 102 return nil, err 103 } 104 if endpoint != "" { 105 s.BasePath = endpoint 106 } 107 return s, nil 108} 109 110// New creates a new Service. It uses the provided http.Client for requests. 111// 112// Deprecated: please use NewService instead. 113// To provide a custom HTTP client, use option.WithHTTPClient. 114// If you are using google.golang.org/api/googleapis/transport.APIKey, use option.WithAPIKey with NewService instead. 115func New(client *http.Client) (*Service, error) { 116 if client == nil { 117 return nil, errors.New("client is nil") 118 } 119 s := &Service{client: client, BasePath: basePath} 120 s.Bidders = NewBiddersService(s) 121 s.Buyers = NewBuyersService(s) 122 return s, nil 123} 124 125type Service struct { 126 client *http.Client 127 BasePath string // API endpoint base URL 128 UserAgent string // optional additional User-Agent fragment 129 130 Bidders *BiddersService 131 132 Buyers *BuyersService 133} 134 135func (s *Service) userAgent() string { 136 if s.UserAgent == "" { 137 return googleapi.UserAgent 138 } 139 return googleapi.UserAgent + " " + s.UserAgent 140} 141 142func NewBiddersService(s *Service) *BiddersService { 143 rs := &BiddersService{s: s} 144 rs.FinalizedDeals = NewBiddersFinalizedDealsService(s) 145 return rs 146} 147 148type BiddersService struct { 149 s *Service 150 151 FinalizedDeals *BiddersFinalizedDealsService 152} 153 154func NewBiddersFinalizedDealsService(s *Service) *BiddersFinalizedDealsService { 155 rs := &BiddersFinalizedDealsService{s: s} 156 return rs 157} 158 159type BiddersFinalizedDealsService struct { 160 s *Service 161} 162 163func NewBuyersService(s *Service) *BuyersService { 164 rs := &BuyersService{s: s} 165 rs.AuctionPackages = NewBuyersAuctionPackagesService(s) 166 rs.Clients = NewBuyersClientsService(s) 167 rs.FinalizedDeals = NewBuyersFinalizedDealsService(s) 168 rs.Proposals = NewBuyersProposalsService(s) 169 rs.PublisherProfiles = NewBuyersPublisherProfilesService(s) 170 return rs 171} 172 173type BuyersService struct { 174 s *Service 175 176 AuctionPackages *BuyersAuctionPackagesService 177 178 Clients *BuyersClientsService 179 180 FinalizedDeals *BuyersFinalizedDealsService 181 182 Proposals *BuyersProposalsService 183 184 PublisherProfiles *BuyersPublisherProfilesService 185} 186 187func NewBuyersAuctionPackagesService(s *Service) *BuyersAuctionPackagesService { 188 rs := &BuyersAuctionPackagesService{s: s} 189 return rs 190} 191 192type BuyersAuctionPackagesService struct { 193 s *Service 194} 195 196func NewBuyersClientsService(s *Service) *BuyersClientsService { 197 rs := &BuyersClientsService{s: s} 198 rs.Users = NewBuyersClientsUsersService(s) 199 return rs 200} 201 202type BuyersClientsService struct { 203 s *Service 204 205 Users *BuyersClientsUsersService 206} 207 208func NewBuyersClientsUsersService(s *Service) *BuyersClientsUsersService { 209 rs := &BuyersClientsUsersService{s: s} 210 return rs 211} 212 213type BuyersClientsUsersService struct { 214 s *Service 215} 216 217func NewBuyersFinalizedDealsService(s *Service) *BuyersFinalizedDealsService { 218 rs := &BuyersFinalizedDealsService{s: s} 219 return rs 220} 221 222type BuyersFinalizedDealsService struct { 223 s *Service 224} 225 226func NewBuyersProposalsService(s *Service) *BuyersProposalsService { 227 rs := &BuyersProposalsService{s: s} 228 rs.Deals = NewBuyersProposalsDealsService(s) 229 return rs 230} 231 232type BuyersProposalsService struct { 233 s *Service 234 235 Deals *BuyersProposalsDealsService 236} 237 238func NewBuyersProposalsDealsService(s *Service) *BuyersProposalsDealsService { 239 rs := &BuyersProposalsDealsService{s: s} 240 return rs 241} 242 243type BuyersProposalsDealsService struct { 244 s *Service 245} 246 247func NewBuyersPublisherProfilesService(s *Service) *BuyersPublisherProfilesService { 248 rs := &BuyersPublisherProfilesService{s: s} 249 return rs 250} 251 252type BuyersPublisherProfilesService struct { 253 s *Service 254} 255 256// AcceptProposalRequest: Request to accept a proposal. Accepting a 257// proposal implies acceptance of the publisher terms_and_conditions, if 258// any. 259type AcceptProposalRequest struct { 260 // ProposalRevision: The last known client revision number of the 261 // proposal. 262 ProposalRevision int64 `json:"proposalRevision,omitempty,string"` 263 264 // ForceSendFields is a list of field names (e.g. "ProposalRevision") to 265 // unconditionally include in API requests. By default, fields with 266 // empty or default values are omitted from API requests. However, any 267 // non-pointer, non-interface field appearing in ForceSendFields will be 268 // sent to the server regardless of whether the field is empty or not. 269 // This may be used to include empty fields in Patch requests. 270 ForceSendFields []string `json:"-"` 271 272 // NullFields is a list of field names (e.g. "ProposalRevision") to 273 // include in API requests with the JSON null value. By default, fields 274 // with empty values are omitted from API requests. However, any field 275 // with an empty value appearing in NullFields will be sent to the 276 // server as null. It is an error if a field in this list has a 277 // non-empty value. This may be used to include null fields in Patch 278 // requests. 279 NullFields []string `json:"-"` 280} 281 282func (s *AcceptProposalRequest) MarshalJSON() ([]byte, error) { 283 type NoMethod AcceptProposalRequest 284 raw := NoMethod(*s) 285 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 286} 287 288// ActivateClientRequest: Request message for activating a client. 289type ActivateClientRequest struct { 290} 291 292// ActivateClientUserRequest: Request message for activating a client 293// user. 294type ActivateClientUserRequest struct { 295} 296 297// AdSize: Represents size of a single ad slot, or a creative. 298type AdSize struct { 299 // Height: The height of the ad slot in pixels. This field will be 300 // present only when size type is `PIXEL`. 301 Height int64 `json:"height,omitempty,string"` 302 303 // Type: The type of the ad slot size. 304 // 305 // Possible values: 306 // "TYPE_UNSPECIFIED" - A placeholder for an undefined size type. 307 // "PIXEL" - Ad slot with size specified by height and width in 308 // pixels. 309 // "INTERSTITIAL" - Special size to describe an interstitial ad slot. 310 // "NATIVE" - Native (mobile) ads rendered by the publisher. 311 // "FLUID" - Fluid size (i.e., responsive size) can be resized 312 // automatically with the change of outside environment. 313 Type string `json:"type,omitempty"` 314 315 // Width: The width of the ad slot in pixels. This field will be present 316 // only when size type is `PIXEL`. 317 Width int64 `json:"width,omitempty,string"` 318 319 // ForceSendFields is a list of field names (e.g. "Height") to 320 // unconditionally include in API requests. By default, fields with 321 // empty or default values are omitted from API requests. However, any 322 // non-pointer, non-interface field appearing in ForceSendFields will be 323 // sent to the server regardless of whether the field is empty or not. 324 // This may be used to include empty fields in Patch requests. 325 ForceSendFields []string `json:"-"` 326 327 // NullFields is a list of field names (e.g. "Height") to include in API 328 // requests with the JSON null value. By default, fields with empty 329 // values are omitted from API requests. However, any field with an 330 // empty value appearing in NullFields will be sent to the server as 331 // null. It is an error if a field in this list has a non-empty value. 332 // This may be used to include null fields in Patch requests. 333 NullFields []string `json:"-"` 334} 335 336func (s *AdSize) MarshalJSON() ([]byte, error) { 337 type NoMethod AdSize 338 raw := NoMethod(*s) 339 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 340} 341 342// AddCreativeRequest: Request message for adding creative to be used in 343// the bidding process for the finalized deal. 344type AddCreativeRequest struct { 345 // Creative: Name of the creative to add to the finalized deal, in the 346 // format `buyers/{buyerAccountId}/creatives/{creativeId}`. See 347 // creative.name. 348 Creative string `json:"creative,omitempty"` 349 350 // ForceSendFields is a list of field names (e.g. "Creative") to 351 // unconditionally include in API requests. By default, fields with 352 // empty or default values are omitted from API requests. However, any 353 // non-pointer, non-interface field appearing in ForceSendFields will be 354 // sent to the server regardless of whether the field is empty or not. 355 // This may be used to include empty fields in Patch requests. 356 ForceSendFields []string `json:"-"` 357 358 // NullFields is a list of field names (e.g. "Creative") to include in 359 // API requests with the JSON null value. By default, fields with empty 360 // values are omitted from API requests. However, any field with an 361 // empty value appearing in NullFields will be sent to the server as 362 // null. It is an error if a field in this list has a non-empty value. 363 // This may be used to include null fields in Patch requests. 364 NullFields []string `json:"-"` 365} 366 367func (s *AddCreativeRequest) MarshalJSON() ([]byte, error) { 368 type NoMethod AddCreativeRequest 369 raw := NoMethod(*s) 370 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 371} 372 373// AddNoteRequest: Request to add a note. 374type AddNoteRequest struct { 375 // Note: The note to add. 376 Note *Note `json:"note,omitempty"` 377 378 // ForceSendFields is a list of field names (e.g. "Note") to 379 // unconditionally include in API requests. By default, fields with 380 // empty or default values are omitted from API requests. However, any 381 // non-pointer, non-interface field appearing in ForceSendFields will be 382 // sent to the server regardless of whether the field is empty or not. 383 // This may be used to include empty fields in Patch requests. 384 ForceSendFields []string `json:"-"` 385 386 // NullFields is a list of field names (e.g. "Note") to include in API 387 // requests with the JSON null value. By default, fields with empty 388 // values are omitted from API requests. However, any field with an 389 // empty value appearing in NullFields will be sent to the server as 390 // null. It is an error if a field in this list has a non-empty value. 391 // This may be used to include null fields in Patch requests. 392 NullFields []string `json:"-"` 393} 394 395func (s *AddNoteRequest) MarshalJSON() ([]byte, error) { 396 type NoMethod AddNoteRequest 397 raw := NoMethod(*s) 398 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 399} 400 401// AuctionPackage: Defines a segment of inventory that buyer wants to 402// buy. It's created by buyer and could be shared with multiple buyers. 403type AuctionPackage struct { 404 // CreateTime: Output only. Time the auction package was created. 405 CreateTime string `json:"createTime,omitempty"` 406 407 // Creator: Output only. The buyer that created this auction package. 408 // Format: `buyers/{buyerAccountId}` 409 Creator string `json:"creator,omitempty"` 410 411 // Description: Output only. A description of the auction package. 412 Description string `json:"description,omitempty"` 413 414 // DisplayName: The display_name assigned to the auction package. 415 DisplayName string `json:"displayName,omitempty"` 416 417 // Name: Immutable. The unique identifier for the auction package. 418 // Format: `buyers/{accountId}/auctionPackages/{auctionPackageId}` The 419 // auction_package_id part of name is sent in the BidRequest to all RTB 420 // bidders and is returned as deal_id by the bidder in the BidResponse. 421 Name string `json:"name,omitempty"` 422 423 // SubscribedClients: Output only. The list of clients of the current 424 // buyer that are subscribed to the AuctionPackage. Format: 425 // `buyers/{buyerAccountId}/clients/{clientAccountId}` 426 SubscribedClients []string `json:"subscribedClients,omitempty"` 427 428 // UpdateTime: Output only. Time the auction package was last updated. 429 // This value is only increased when this auction package is updated but 430 // never when a buyer subscribed. 431 UpdateTime string `json:"updateTime,omitempty"` 432 433 // ServerResponse contains the HTTP response code and headers from the 434 // server. 435 googleapi.ServerResponse `json:"-"` 436 437 // ForceSendFields is a list of field names (e.g. "CreateTime") to 438 // unconditionally include in API requests. By default, fields with 439 // empty or default values are omitted from API requests. However, any 440 // non-pointer, non-interface field appearing in ForceSendFields will be 441 // sent to the server regardless of whether the field is empty or not. 442 // This may be used to include empty fields in Patch requests. 443 ForceSendFields []string `json:"-"` 444 445 // NullFields is a list of field names (e.g. "CreateTime") to include in 446 // API requests with the JSON null value. By default, fields with empty 447 // values are omitted from API requests. However, any field with an 448 // empty value appearing in NullFields will be sent to the server as 449 // null. It is an error if a field in this list has a non-empty value. 450 // This may be used to include null fields in Patch requests. 451 NullFields []string `json:"-"` 452} 453 454func (s *AuctionPackage) MarshalJSON() ([]byte, error) { 455 type NoMethod AuctionPackage 456 raw := NoMethod(*s) 457 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 458} 459 460// BatchUpdateDealsRequest: Request message for batch updating deals. 461type BatchUpdateDealsRequest struct { 462 // Requests: Required. List of request messages to update deals. 463 Requests []*UpdateDealRequest `json:"requests,omitempty"` 464 465 // ForceSendFields is a list of field names (e.g. "Requests") to 466 // unconditionally include in API requests. By default, fields with 467 // empty or default values are omitted from API requests. However, any 468 // non-pointer, non-interface field appearing in ForceSendFields will be 469 // sent to the server regardless of whether the field is empty or not. 470 // This may be used to include empty fields in Patch requests. 471 ForceSendFields []string `json:"-"` 472 473 // NullFields is a list of field names (e.g. "Requests") to include in 474 // API requests with the JSON null value. By default, fields with empty 475 // values are omitted from API requests. However, any field with an 476 // empty value appearing in NullFields will be sent to the server as 477 // null. It is an error if a field in this list has a non-empty value. 478 // This may be used to include null fields in Patch requests. 479 NullFields []string `json:"-"` 480} 481 482func (s *BatchUpdateDealsRequest) MarshalJSON() ([]byte, error) { 483 type NoMethod BatchUpdateDealsRequest 484 raw := NoMethod(*s) 485 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 486} 487 488// BatchUpdateDealsResponse: Response message for batch updating deals. 489type BatchUpdateDealsResponse struct { 490 // Deals: Deals updated. 491 Deals []*Deal `json:"deals,omitempty"` 492 493 // ServerResponse contains the HTTP response code and headers from the 494 // server. 495 googleapi.ServerResponse `json:"-"` 496 497 // ForceSendFields is a list of field names (e.g. "Deals") to 498 // unconditionally include in API requests. By default, fields with 499 // empty or default values are omitted from API requests. However, any 500 // non-pointer, non-interface field appearing in ForceSendFields will be 501 // sent to the server regardless of whether the field is empty or not. 502 // This may be used to include empty fields in Patch requests. 503 ForceSendFields []string `json:"-"` 504 505 // NullFields is a list of field names (e.g. "Deals") to include in API 506 // requests with the JSON null value. By default, fields with empty 507 // values are omitted from API requests. However, any field with an 508 // empty value appearing in NullFields will be sent to the server as 509 // null. It is an error if a field in this list has a non-empty value. 510 // This may be used to include null fields in Patch requests. 511 NullFields []string `json:"-"` 512} 513 514func (s *BatchUpdateDealsResponse) MarshalJSON() ([]byte, error) { 515 type NoMethod BatchUpdateDealsResponse 516 raw := NoMethod(*s) 517 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 518} 519 520// CancelNegotiationRequest: Request to cancel an ongoing negotiation. 521type CancelNegotiationRequest struct { 522} 523 524// Client: A client represents an agency, a brand, or an advertiser 525// customer of the buyer. Based on the client's role, its client users 526// will have varying levels of restricted access to the Marketplace and 527// certain other sections of the Authorized Buyers UI. 528type Client struct { 529 // DisplayName: Required. Display name shown to publishers. Must be 530 // unique for clients without partnerClientId specified. Maximum length 531 // of 255 characters is allowed. 532 DisplayName string `json:"displayName,omitempty"` 533 534 // Name: Output only. The resource name of the client. Format: 535 // `buyers/{accountId}/clients/{clientAccountId}` 536 Name string `json:"name,omitempty"` 537 538 // PartnerClientId: Arbitrary unique identifier provided by the buyer. 539 // This field can be used to associate a client with an identifier in 540 // the namespace of the buyer, lookup clients by that identifier and 541 // verify whether an Authorized Buyers account of the client already 542 // exists. If present, must be unique across all the clients. 543 PartnerClientId string `json:"partnerClientId,omitempty"` 544 545 // Role: Required. The role assigned to the client. Each role implies a 546 // set of permissions granted to the client. 547 // 548 // Possible values: 549 // "CLIENT_ROLE_UNSPECIFIED" - A placeholder for an undefined client 550 // role. This value should never be specified in user input for create 551 // or update method, otherwise an error will be returned. 552 // "CLIENT_DEAL_VIEWER" - Users associated with this client role can 553 // only view proposals and deals in the Marketplace UI. They cannot 554 // negotiate or approve proposals and deals sent from publishers or send 555 // RFP to publishers. 556 // "CLIENT_DEAL_NEGOTIATOR" - Users associated with this client role 557 // can view and negotiate on the proposals and deals in the Marketplace 558 // UI sent from publishers and send RFP to publishers, but cannot 559 // approve the proposals and deals by themselves. The buyer can approve 560 // the proposals and deals on behalf of the client. 561 // "CLIENT_DEAL_APPROVER" - Users associated with this client role can 562 // view, negotiate and approve proposals and deals in the Marketplace UI 563 // and send RFP to publishers. 564 Role string `json:"role,omitempty"` 565 566 // SellerVisible: Whether the client will be visible to sellers. 567 SellerVisible bool `json:"sellerVisible,omitempty"` 568 569 // State: Output only. The state of the client. 570 // 571 // Possible values: 572 // "STATE_UNSPECIFIED" - A placeholder for an undefined client state. 573 // Should not be used. 574 // "ACTIVE" - A client that is currently active and allowed to access 575 // the Authorized Buyers UI. 576 // "INACTIVE" - A client that is currently inactive and not allowed to 577 // access the Authorized Buyers UI. 578 State string `json:"state,omitempty"` 579 580 // ServerResponse contains the HTTP response code and headers from the 581 // server. 582 googleapi.ServerResponse `json:"-"` 583 584 // ForceSendFields is a list of field names (e.g. "DisplayName") to 585 // unconditionally include in API requests. By default, fields with 586 // empty or default values are omitted from API requests. However, any 587 // non-pointer, non-interface field appearing in ForceSendFields will be 588 // sent to the server regardless of whether the field is empty or not. 589 // This may be used to include empty fields in Patch requests. 590 ForceSendFields []string `json:"-"` 591 592 // NullFields is a list of field names (e.g. "DisplayName") to include 593 // in API requests with the JSON null value. By default, fields with 594 // empty values are omitted from API requests. However, any field with 595 // an empty value appearing in NullFields will be sent to the server as 596 // null. It is an error if a field in this list has a non-empty value. 597 // This may be used to include null fields in Patch requests. 598 NullFields []string `json:"-"` 599} 600 601func (s *Client) MarshalJSON() ([]byte, error) { 602 type NoMethod Client 603 raw := NoMethod(*s) 604 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 605} 606 607// ClientUser: A user of a client who has restricted access to the 608// Marketplace and certain other sections of the Authorized Buyers UI 609// based on the role granted to the associated client. 610type ClientUser struct { 611 // Email: Required. The client user's email address that has to be 612 // unique across all users for the same client. 613 Email string `json:"email,omitempty"` 614 615 // Name: Output only. The resource name of the client user. Format: 616 // `buyers/{accountId}/clients/{clientAccountId}/users/{userId}` 617 Name string `json:"name,omitempty"` 618 619 // State: Output only. The state of the client user. 620 // 621 // Possible values: 622 // "STATE_UNSPECIFIED" - A placeholder for an undefined user state. 623 // "INVITED" - A user who was created but hasn't accepted the 624 // invitation yet, not allowed to access the Authorized Buyers UI. 625 // "ACTIVE" - A user that is currently active and allowed to access 626 // the Authorized Buyers UI. 627 // "INACTIVE" - A user that is currently inactive and not allowed to 628 // access the Authorized Buyers UI. 629 State string `json:"state,omitempty"` 630 631 // ServerResponse contains the HTTP response code and headers from the 632 // server. 633 googleapi.ServerResponse `json:"-"` 634 635 // ForceSendFields is a list of field names (e.g. "Email") to 636 // unconditionally include in API requests. By default, fields with 637 // empty or default values are omitted from API requests. However, any 638 // non-pointer, non-interface field appearing in ForceSendFields will be 639 // sent to the server regardless of whether the field is empty or not. 640 // This may be used to include empty fields in Patch requests. 641 ForceSendFields []string `json:"-"` 642 643 // NullFields is a list of field names (e.g. "Email") to include in API 644 // requests with the JSON null value. By default, fields with empty 645 // values are omitted from API requests. However, any field with an 646 // empty value appearing in NullFields will be sent to the server as 647 // null. It is an error if a field in this list has a non-empty value. 648 // This may be used to include null fields in Patch requests. 649 NullFields []string `json:"-"` 650} 651 652func (s *ClientUser) MarshalJSON() ([]byte, error) { 653 type NoMethod ClientUser 654 raw := NoMethod(*s) 655 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 656} 657 658// Contact: Contains information on how a buyer or seller can be 659// reached. 660type Contact struct { 661 // DisplayName: The display_name of the contact. 662 DisplayName string `json:"displayName,omitempty"` 663 664 // Email: Email address for the contact. 665 Email string `json:"email,omitempty"` 666 667 // ForceSendFields is a list of field names (e.g. "DisplayName") to 668 // unconditionally include in API requests. By default, fields with 669 // empty or default values are omitted from API requests. However, any 670 // non-pointer, non-interface field appearing in ForceSendFields will be 671 // sent to the server regardless of whether the field is empty or not. 672 // This may be used to include empty fields in Patch requests. 673 ForceSendFields []string `json:"-"` 674 675 // NullFields is a list of field names (e.g. "DisplayName") to include 676 // in API requests with the JSON null value. By default, fields with 677 // empty values are omitted from API requests. However, any field with 678 // an empty value appearing in NullFields will be sent to the server as 679 // null. It is an error if a field in this list has a non-empty value. 680 // This may be used to include null fields in Patch requests. 681 NullFields []string `json:"-"` 682} 683 684func (s *Contact) MarshalJSON() ([]byte, error) { 685 type NoMethod Contact 686 raw := NoMethod(*s) 687 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 688} 689 690// CreativeRequirements: Message captures data about the creatives in 691// the deal. 692type CreativeRequirements struct { 693 // CreativePreApprovalPolicy: Output only. Specifies the creative 694 // pre-approval policy. 695 // 696 // Possible values: 697 // "CREATIVE_PRE_APPROVAL_POLICY_UNSPECIFIED" - A placeholder for an 698 // undefined creative pre-approval policy. 699 // "SELLER_PRE_APPROVAL_REQUIRED" - The seller needs to approve each 700 // creative before it can serve. 701 // "SELLER_PRE_APPROVAL_NOT_REQUIRED" - The seller does not need to 702 // approve each creative before it can serve. 703 CreativePreApprovalPolicy string `json:"creativePreApprovalPolicy,omitempty"` 704 705 // CreativeSafeFrameCompatibility: Output only. Specifies whether the 706 // creative is safeFrame compatible. 707 // 708 // Possible values: 709 // "CREATIVE_SAFE_FRAME_COMPATIBILITY_UNSPECIFIED" - A placeholder for 710 // an undefined creative safe-frame compatibility. 711 // "COMPATIBLE" - The creatives need to be compatible with the safe 712 // frame option. 713 // "INCOMPATIBLE" - The creatives can be incompatible with the safe 714 // frame option. 715 CreativeSafeFrameCompatibility string `json:"creativeSafeFrameCompatibility,omitempty"` 716 717 // ProgrammaticCreativeSource: Output only. Specifies the creative 718 // source for programmatic deals. PUBLISHER means creative is provided 719 // by seller and ADVERTISER means creative is provided by the buyer. 720 // 721 // Possible values: 722 // "PROGRAMMATIC_CREATIVE_SOURCE_UNSPECIFIED" - A placeholder for an 723 // undefined programmatic creative source. 724 // "ADVERTISER" - The advertiser provides the creatives. 725 // "PUBLISHER" - The publisher provides the creatives to be served. 726 ProgrammaticCreativeSource string `json:"programmaticCreativeSource,omitempty"` 727 728 // ForceSendFields is a list of field names (e.g. 729 // "CreativePreApprovalPolicy") to unconditionally include in API 730 // requests. By default, fields with empty or default values are omitted 731 // from API requests. However, any non-pointer, non-interface field 732 // appearing in ForceSendFields will be sent to the server regardless of 733 // whether the field is empty or not. This may be used to include empty 734 // fields in Patch requests. 735 ForceSendFields []string `json:"-"` 736 737 // NullFields is a list of field names (e.g. 738 // "CreativePreApprovalPolicy") to include in API requests with the JSON 739 // null value. By default, fields with empty values are omitted from API 740 // requests. However, any field with an empty value appearing in 741 // NullFields will be sent to the server as null. It is an error if a 742 // field in this list has a non-empty value. This may be used to include 743 // null fields in Patch requests. 744 NullFields []string `json:"-"` 745} 746 747func (s *CreativeRequirements) MarshalJSON() ([]byte, error) { 748 type NoMethod CreativeRequirements 749 raw := NoMethod(*s) 750 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 751} 752 753// CriteriaTargeting: Generic targeting used for targeting dimensions 754// that contains a list of included and excluded numeric IDs. This 755// cannot be filtered using list filter syntax. 756type CriteriaTargeting struct { 757 // ExcludedCriteriaIds: A list of numeric IDs to be excluded. 758 ExcludedCriteriaIds googleapi.Int64s `json:"excludedCriteriaIds,omitempty"` 759 760 // TargetedCriteriaIds: A list of numeric IDs to be included. 761 TargetedCriteriaIds googleapi.Int64s `json:"targetedCriteriaIds,omitempty"` 762 763 // ForceSendFields is a list of field names (e.g. "ExcludedCriteriaIds") 764 // to unconditionally include in API requests. By default, fields with 765 // empty or default values are omitted from API requests. However, any 766 // non-pointer, non-interface field appearing in ForceSendFields will be 767 // sent to the server regardless of whether the field is empty or not. 768 // This may be used to include empty fields in Patch requests. 769 ForceSendFields []string `json:"-"` 770 771 // NullFields is a list of field names (e.g. "ExcludedCriteriaIds") to 772 // include in API requests with the JSON null value. By default, fields 773 // with empty values are omitted from API requests. However, any field 774 // with an empty value appearing in NullFields will be sent to the 775 // server as null. It is an error if a field in this list has a 776 // non-empty value. This may be used to include null fields in Patch 777 // requests. 778 NullFields []string `json:"-"` 779} 780 781func (s *CriteriaTargeting) MarshalJSON() ([]byte, error) { 782 type NoMethod CriteriaTargeting 783 raw := NoMethod(*s) 784 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 785} 786 787// DayPart: Defines targeting for a period of time on a specific week 788// day. 789type DayPart struct { 790 // DayOfWeek: Day of week for the period. 791 // 792 // Possible values: 793 // "DAY_OF_WEEK_UNSPECIFIED" - The day of the week is unspecified. 794 // "MONDAY" - Monday 795 // "TUESDAY" - Tuesday 796 // "WEDNESDAY" - Wednesday 797 // "THURSDAY" - Thursday 798 // "FRIDAY" - Friday 799 // "SATURDAY" - Saturday 800 // "SUNDAY" - Sunday 801 DayOfWeek string `json:"dayOfWeek,omitempty"` 802 803 // EndTime: Hours in 24 hour time between 0 and 24, inclusive. Note: 24 804 // is logically equivalent to 0, but is supported since in some cases 805 // there may need to be differentiation made between midnight on one day 806 // and midnight on the next day. Accepted values for minutes are [0, 15, 807 // 30, 45]. 0 is the only acceptable minute value for hour 24. Seconds 808 // and nanos are ignored. 809 EndTime *TimeOfDay `json:"endTime,omitempty"` 810 811 // StartTime: Hours in 24 hour time between 0 and 24, inclusive. Note: 812 // 24 is logically equivalent to 0, but is supported since in some cases 813 // there may need to be differentiation made between midnight on one day 814 // and midnight on the next day. Accepted values for minutes are [0, 15, 815 // 30, 45]. 0 is the only acceptable minute value for hour 24. Seconds 816 // and nanos are ignored. 817 StartTime *TimeOfDay `json:"startTime,omitempty"` 818 819 // ForceSendFields is a list of field names (e.g. "DayOfWeek") to 820 // unconditionally include in API requests. By default, fields with 821 // empty or default values are omitted from API requests. However, any 822 // non-pointer, non-interface field appearing in ForceSendFields will be 823 // sent to the server regardless of whether the field is empty or not. 824 // This may be used to include empty fields in Patch requests. 825 ForceSendFields []string `json:"-"` 826 827 // NullFields is a list of field names (e.g. "DayOfWeek") to include in 828 // API requests with the JSON null value. By default, fields with empty 829 // values are omitted from API requests. However, any field with an 830 // empty value appearing in NullFields will be sent to the server as 831 // null. It is an error if a field in this list has a non-empty value. 832 // This may be used to include null fields in Patch requests. 833 NullFields []string `json:"-"` 834} 835 836func (s *DayPart) MarshalJSON() ([]byte, error) { 837 type NoMethod DayPart 838 raw := NoMethod(*s) 839 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 840} 841 842// DayPartTargeting: Represents Daypart targeting. 843type DayPartTargeting struct { 844 // DayParts: The targeted weekdays and times 845 DayParts []*DayPart `json:"dayParts,omitempty"` 846 847 // TimeZoneType: The time zone type of the day parts 848 // 849 // Possible values: 850 // "TIME_ZONE_TYPE_UNSPECIFIED" - Default value. This field is unused. 851 // "SELLER" - The publisher's time zone 852 // "USER" - The user's time zone 853 TimeZoneType string `json:"timeZoneType,omitempty"` 854 855 // ForceSendFields is a list of field names (e.g. "DayParts") to 856 // unconditionally include in API requests. By default, fields with 857 // empty or default values are omitted from API requests. However, any 858 // non-pointer, non-interface field appearing in ForceSendFields will be 859 // sent to the server regardless of whether the field is empty or not. 860 // This may be used to include empty fields in Patch requests. 861 ForceSendFields []string `json:"-"` 862 863 // NullFields is a list of field names (e.g. "DayParts") to include in 864 // API requests with the JSON null value. By default, fields with empty 865 // values are omitted from API requests. However, any field with an 866 // empty value appearing in NullFields will be sent to the server as 867 // null. It is an error if a field in this list has a non-empty value. 868 // This may be used to include null fields in Patch requests. 869 NullFields []string `json:"-"` 870} 871 872func (s *DayPartTargeting) MarshalJSON() ([]byte, error) { 873 type NoMethod DayPartTargeting 874 raw := NoMethod(*s) 875 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 876} 877 878// DeactivateClientRequest: Request message for disabling a client. 879type DeactivateClientRequest struct { 880} 881 882// DeactivateClientUserRequest: Request message for deactivating a 883// client user. 884type DeactivateClientUserRequest struct { 885} 886 887// Deal: A deal represents a segment of inventory for displaying ads 888// that contains the terms and targeting information that is used for 889// serving as well as the deal stats and status. Note: A proposal may 890// contain multiple deals. 891type Deal struct { 892 // BilledBuyer: Output only. When the client field is populated, this 893 // field refers to the buyer who creates and manages the client buyer 894 // and gets billed on behalf of the client buyer; when the buyer field 895 // is populated, this field is the same value as buyer. Format : 896 // `buyers/{buyerAccountId}` 897 BilledBuyer string `json:"billedBuyer,omitempty"` 898 899 // Buyer: Output only. Refers to a buyer in The Realtime-bidding API. 900 // Format: `buyers/{buyerAccountId}` 901 Buyer string `json:"buyer,omitempty"` 902 903 // Client: Output only. Refers to a Client. Format: 904 // `buyers/{buyerAccountId}/clients/{clientAccountid}` 905 Client string `json:"client,omitempty"` 906 907 // CreateTime: Output only. The time of the deal creation. 908 CreateTime string `json:"createTime,omitempty"` 909 910 // CreativeRequirements: Output only. Metadata about the creatives of 911 // this deal. 912 CreativeRequirements *CreativeRequirements `json:"creativeRequirements,omitempty"` 913 914 // DealType: Output only. Type of deal. 915 // 916 // Possible values: 917 // "DEAL_TYPE_UNSPECIFIED" - Default, unspecified deal type. 918 // "PREFERRED_DEAL" - Preferred deals. 919 // "PRIVATE_AUCTION" - Private auction deals. 920 // "PROGRAMMATIC_GUARANTEED" - Programmatic guaranteed deals. 921 DealType string `json:"dealType,omitempty"` 922 923 // DeliveryControl: Output only. Specifies the pacing set by the 924 // publisher. 925 DeliveryControl *DeliveryControl `json:"deliveryControl,omitempty"` 926 927 // Description: Output only. Free text description for the deal terms. 928 Description string `json:"description,omitempty"` 929 930 // DisplayName: Output only. The name of the deal. Maximum length of 255 931 // unicode characters is allowed. Control characters are not allowed. 932 // Buyers cannot update this field. Note: Not to be confused with name, 933 // which is a unique identifier of the deal. 934 DisplayName string `json:"displayName,omitempty"` 935 936 // EstimatedGrossSpend: Specified by buyers in request for proposal 937 // (RFP) to notify publisher the total estimated spend for the proposal. 938 // Publishers will receive this information and send back proposed deals 939 // accordingly. 940 EstimatedGrossSpend *Money `json:"estimatedGrossSpend,omitempty"` 941 942 // FlightEndTime: Proposed flight end time of the deal. This will 943 // generally be stored in a granularity of a second. A value is not 944 // necessary for Private Auction deals. 945 FlightEndTime string `json:"flightEndTime,omitempty"` 946 947 // FlightStartTime: Proposed flight start time of the deal. This will 948 // generally be stored in the granularity of one second since deal 949 // serving starts at seconds boundary. Any time specified with more 950 // granularity (e.g., in milliseconds) will be truncated towards the 951 // start of time in seconds. 952 FlightStartTime string `json:"flightStartTime,omitempty"` 953 954 // Name: Immutable. The unique identifier of the deal. Auto-generated by 955 // the server when a deal is created. Format: 956 // buyers/{accountId}/proposals/{proposalId}/deals/{dealId} 957 Name string `json:"name,omitempty"` 958 959 // PreferredDealTerms: The terms for preferred deals. 960 PreferredDealTerms *PreferredDealTerms `json:"preferredDealTerms,omitempty"` 961 962 // PrivateAuctionTerms: The terms for private auction deals. 963 PrivateAuctionTerms *PrivateAuctionTerms `json:"privateAuctionTerms,omitempty"` 964 965 // ProgrammaticGuaranteedTerms: The terms for programmatic guaranteed 966 // deals. 967 ProgrammaticGuaranteedTerms *ProgrammaticGuaranteedTerms `json:"programmaticGuaranteedTerms,omitempty"` 968 969 // ProposalRevision: Output only. The revision number for the proposal 970 // and is the same value as proposal.proposal_revision. Each update to 971 // deal causes the proposal revision number to auto-increment. The buyer 972 // keeps track of the last revision number they know of and pass it in 973 // when making an update. If the head revision number on the server has 974 // since incremented, then an ABORTED error is returned during the 975 // update operation to let the buyer know that a subsequent update was 976 // made. 977 ProposalRevision int64 `json:"proposalRevision,omitempty,string"` 978 979 // PublisherProfile: Immutable. Reference to the seller on the deal. 980 // Format: 981 // `buyers/{buyerAccountId}/publisherProfiles/{publisherProfileId}` 982 PublisherProfile string `json:"publisherProfile,omitempty"` 983 984 // SellerTimeZone: Output only. Time zone of the seller used to mark the 985 // boundaries of a day for daypart targeting and CPD billing. 986 SellerTimeZone *TimeZone `json:"sellerTimeZone,omitempty"` 987 988 // Targeting: Specifies the subset of inventory targeted by the deal. 989 // Can be updated by the buyer before the deal is finalized. 990 Targeting *MarketplaceTargeting `json:"targeting,omitempty"` 991 992 // UpdateTime: Output only. The time when the deal was last updated. 993 UpdateTime string `json:"updateTime,omitempty"` 994 995 // ServerResponse contains the HTTP response code and headers from the 996 // server. 997 googleapi.ServerResponse `json:"-"` 998 999 // ForceSendFields is a list of field names (e.g. "BilledBuyer") to 1000 // unconditionally include in API requests. By default, fields with 1001 // empty or default values are omitted from API requests. However, any 1002 // non-pointer, non-interface field appearing in ForceSendFields will be 1003 // sent to the server regardless of whether the field is empty or not. 1004 // This may be used to include empty fields in Patch requests. 1005 ForceSendFields []string `json:"-"` 1006 1007 // NullFields is a list of field names (e.g. "BilledBuyer") to include 1008 // in API requests with the JSON null value. By default, fields with 1009 // empty values are omitted from API requests. However, any field with 1010 // an empty value appearing in NullFields will be sent to the server as 1011 // null. It is an error if a field in this list has a non-empty value. 1012 // This may be used to include null fields in Patch requests. 1013 NullFields []string `json:"-"` 1014} 1015 1016func (s *Deal) MarshalJSON() ([]byte, error) { 1017 type NoMethod Deal 1018 raw := NoMethod(*s) 1019 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 1020} 1021 1022// DealPausingInfo: Information related to deal pausing. 1023type DealPausingInfo struct { 1024 // PauseReason: The reason for the pausing of the deal; empty for active 1025 // deals. 1026 PauseReason string `json:"pauseReason,omitempty"` 1027 1028 // PauseRole: The party that first paused the deal; unspecified for 1029 // active deals. 1030 // 1031 // Possible values: 1032 // "BUYER_SELLER_ROLE_UNSPECIFIED" - A placeholder for an undefined 1033 // buyer/seller role. 1034 // "BUYER" - Specifies the role as buyer. 1035 // "SELLER" - Specifies the role as seller. 1036 PauseRole string `json:"pauseRole,omitempty"` 1037 1038 // PausingConsented: Whether pausing is consented between buyer and 1039 // seller for the deal. 1040 PausingConsented bool `json:"pausingConsented,omitempty"` 1041 1042 // ForceSendFields is a list of field names (e.g. "PauseReason") to 1043 // unconditionally include in API requests. By default, fields with 1044 // empty or default values are omitted from API requests. However, any 1045 // non-pointer, non-interface field appearing in ForceSendFields will be 1046 // sent to the server regardless of whether the field is empty or not. 1047 // This may be used to include empty fields in Patch requests. 1048 ForceSendFields []string `json:"-"` 1049 1050 // NullFields is a list of field names (e.g. "PauseReason") to include 1051 // in API requests with the JSON null value. By default, fields with 1052 // empty values are omitted from API requests. However, any field with 1053 // an empty value appearing in NullFields will be sent to the server as 1054 // null. It is an error if a field in this list has a non-empty value. 1055 // This may be used to include null fields in Patch requests. 1056 NullFields []string `json:"-"` 1057} 1058 1059func (s *DealPausingInfo) MarshalJSON() ([]byte, error) { 1060 type NoMethod DealPausingInfo 1061 raw := NoMethod(*s) 1062 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 1063} 1064 1065// DeliveryControl: Message contains details about how the deal will be 1066// paced. 1067type DeliveryControl struct { 1068 // CompanionDeliveryType: Output only. Specifies roadblocking in a 1069 // master companion lineitem. 1070 // 1071 // Possible values: 1072 // "COMPANION_DELIVERY_TYPE_UNSPECIFIED" - A placeholder for an 1073 // unspecified companion delivery type. 1074 // "DELIVERY_OPTIONAL" - Companions are not required to serve a 1075 // creative set. The creative set can serve an inventory that has zero 1076 // or more matching companions. 1077 // "DELIVERY_AT_LEAST_ONE" - At least one companion must be served in 1078 // order for the creative set to be used. 1079 // "DELIVERY_ALL" - All companions in the set must be served in order 1080 // for the creative set to be used. This can still serve to inventory 1081 // that has more companions than can be filled. 1082 CompanionDeliveryType string `json:"companionDeliveryType,omitempty"` 1083 1084 // CreativeRotationType: Output only. Specifies strategy to use for 1085 // selecting a creative when multiple creatives of the same size are 1086 // available. 1087 // 1088 // Possible values: 1089 // "CREATIVE_ROTATION_TYPE_UNSPECIFIED" - Creatives are displayed 1090 // roughly the same number of times over the duration of the deal. 1091 // "ROTATION_EVEN" - Creatives are displayed roughly the same number 1092 // of times over the duration of the deal. 1093 // "ROTATION_OPTIMIZED" - Creatives are served roughly proportionally 1094 // to their performance. 1095 // "ROTATION_MANUAL" - Creatives are served roughly proportionally to 1096 // their weights. 1097 // "ROTATION_SEQUENTIAL" - Creatives are served exactly in sequential 1098 // order, aka Storyboarding. 1099 CreativeRotationType string `json:"creativeRotationType,omitempty"` 1100 1101 // DeliveryRateType: Output only. Specifies how the impression delivery 1102 // will be paced. 1103 // 1104 // Possible values: 1105 // "DELIVERY_RATE_TYPE_UNSPECIFIED" - A placeholder for an undefined 1106 // delivery rate type. 1107 // "EVENLY" - Impressions are served uniformly over the life of the 1108 // deal. 1109 // "FRONT_LOADED" - Impressions are served front-loaded. 1110 // "AS_FAST_AS_POSSIBLE" - Impressions are served as fast as possible. 1111 DeliveryRateType string `json:"deliveryRateType,omitempty"` 1112 1113 // FrequencyCap: Output only. Specifies any frequency caps. Cannot be 1114 // filtered within ListDealsRequest. 1115 FrequencyCap []*FrequencyCap `json:"frequencyCap,omitempty"` 1116 1117 // RoadblockingType: Output only. Specifies the roadblocking type in 1118 // display creatives. 1119 // 1120 // Possible values: 1121 // "ROADBLOCKING_TYPE_UNSPECIFIED" - A placeholder for an unspecified 1122 // roadblocking type. 1123 // "ONLY_ONE" - Only one creative from a deal can serve per ad 1124 // request. https://support.google.com/admanager/answer/177277. 1125 // "ONE_OR_MORE" - Any number of creatives from a deal can serve 1126 // together per ad request. 1127 // "AS_MANY_AS_POSSIBLE" - As many creatives from a deal as can fit on 1128 // a page will serve. This could mean anywhere from one to all of a 1129 // deal's creatives given the size constraints of ad slots on a page. 1130 // "ALL_ROADBLOCK" - All or none of the creatives from a deal will 1131 // serve. 1132 // "CREATIVE_SET" - A master/companion creative set roadblocking type. 1133 RoadblockingType string `json:"roadblockingType,omitempty"` 1134 1135 // ForceSendFields is a list of field names (e.g. 1136 // "CompanionDeliveryType") to unconditionally include in API requests. 1137 // By default, fields with empty or default values are omitted from API 1138 // requests. However, any non-pointer, non-interface field appearing in 1139 // ForceSendFields will be sent to the server regardless of whether the 1140 // field is empty or not. This may be used to include empty fields in 1141 // Patch requests. 1142 ForceSendFields []string `json:"-"` 1143 1144 // NullFields is a list of field names (e.g. "CompanionDeliveryType") to 1145 // include in API requests with the JSON null value. By default, fields 1146 // with empty values are omitted from API requests. However, any field 1147 // with an empty value appearing in NullFields will be sent to the 1148 // server as null. It is an error if a field in this list has a 1149 // non-empty value. This may be used to include null fields in Patch 1150 // requests. 1151 NullFields []string `json:"-"` 1152} 1153 1154func (s *DeliveryControl) MarshalJSON() ([]byte, error) { 1155 type NoMethod DeliveryControl 1156 raw := NoMethod(*s) 1157 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 1158} 1159 1160// Empty: A generic empty message that you can re-use to avoid defining 1161// duplicated empty messages in your APIs. A typical example is to use 1162// it as the request or the response type of an API method. For 1163// instance: service Foo { rpc Bar(google.protobuf.Empty) returns 1164// (google.protobuf.Empty); } The JSON representation for `Empty` is 1165// empty JSON object `{}`. 1166type Empty struct { 1167 // ServerResponse contains the HTTP response code and headers from the 1168 // server. 1169 googleapi.ServerResponse `json:"-"` 1170} 1171 1172// FinalizedDeal: A finalized deal is a snapshot of the deal when both 1173// buyer and seller accept the deal. The buyer or seller can update the 1174// deal after it's been finalized and renegotiate on the deal targeting, 1175// terms and other fields, while at the same time the finalized snapshot 1176// of the deal can still be retrieved via this API. The finalized deal 1177// contains a copy of the deal as it existed when most recently 1178// finalized, as well as fields related to deal serving such as 1179// pause/resume status, RTB metrics, etc. 1180type FinalizedDeal struct { 1181 // Deal: A copy of the Deal made upon finalization. During 1182 // renegotiation, this will reflect the last finalized deal before 1183 // renegotiation was initiated. 1184 Deal *Deal `json:"deal,omitempty"` 1185 1186 // DealPausingInfo: Information related to deal pausing for the deal. 1187 DealPausingInfo *DealPausingInfo `json:"dealPausingInfo,omitempty"` 1188 1189 // DealServingStatus: Serving status of the deal. 1190 // 1191 // Possible values: 1192 // "DEAL_SERVING_STATUS_UNSPECIFIED" - Unspecified. 1193 // "ACTIVE" - The deal is actively serving or ready to serve when the 1194 // start date is reached. 1195 // "ENDED" - The deal serving has ended. 1196 // "PAUSED_BY_BUYER" - The deal serving is paused by buyer. 1197 // "PAUSED_BY_SELLER" - The deal serving is paused by seller. 1198 DealServingStatus string `json:"dealServingStatus,omitempty"` 1199 1200 // Name: The resource name of the finalized deal. Format: 1201 // `buyers/{accountId}/finalizeddeals/{finalizedDealId}` 1202 Name string `json:"name,omitempty"` 1203 1204 // ReadyToServe: Whether the Programmatic Guaranteed deal is ready for 1205 // serving. 1206 ReadyToServe bool `json:"readyToServe,omitempty"` 1207 1208 // RtbMetrics: Real-time bidding metrics for this deal. 1209 RtbMetrics *RtbMetrics `json:"rtbMetrics,omitempty"` 1210 1211 // ServerResponse contains the HTTP response code and headers from the 1212 // server. 1213 googleapi.ServerResponse `json:"-"` 1214 1215 // ForceSendFields is a list of field names (e.g. "Deal") to 1216 // unconditionally include in API requests. By default, fields with 1217 // empty or default values are omitted from API requests. However, any 1218 // non-pointer, non-interface field appearing in ForceSendFields will be 1219 // sent to the server regardless of whether the field is empty or not. 1220 // This may be used to include empty fields in Patch requests. 1221 ForceSendFields []string `json:"-"` 1222 1223 // NullFields is a list of field names (e.g. "Deal") to include in API 1224 // requests with the JSON null value. By default, fields with empty 1225 // values are omitted from API requests. However, any field with an 1226 // empty value appearing in NullFields will be sent to the server as 1227 // null. It is an error if a field in this list has a non-empty value. 1228 // This may be used to include null fields in Patch requests. 1229 NullFields []string `json:"-"` 1230} 1231 1232func (s *FinalizedDeal) MarshalJSON() ([]byte, error) { 1233 type NoMethod FinalizedDeal 1234 raw := NoMethod(*s) 1235 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 1236} 1237 1238// FirstPartyMobileApplicationTargeting: Represents a list of targeted 1239// and excluded mobile application IDs that publishers own. Android App 1240// ID, for example, com.google.android.apps.maps, can be found in Google 1241// Play Store URL. iOS App ID (which is a number) can be found at the 1242// end of iTunes store URL. First party mobile applications is either 1243// included or excluded. 1244type FirstPartyMobileApplicationTargeting struct { 1245 // ExcludedAppIds: A list of application IDs to be excluded. 1246 ExcludedAppIds []string `json:"excludedAppIds,omitempty"` 1247 1248 // TargetedAppIds: A list of application IDs to be included. 1249 TargetedAppIds []string `json:"targetedAppIds,omitempty"` 1250 1251 // ForceSendFields is a list of field names (e.g. "ExcludedAppIds") to 1252 // unconditionally include in API requests. By default, fields with 1253 // empty or default values are omitted from API requests. However, any 1254 // non-pointer, non-interface field appearing in ForceSendFields will be 1255 // sent to the server regardless of whether the field is empty or not. 1256 // This may be used to include empty fields in Patch requests. 1257 ForceSendFields []string `json:"-"` 1258 1259 // NullFields is a list of field names (e.g. "ExcludedAppIds") to 1260 // include in API requests with the JSON null value. By default, fields 1261 // with empty values are omitted from API requests. However, any field 1262 // with an empty value appearing in NullFields will be sent to the 1263 // server as null. It is an error if a field in this list has a 1264 // non-empty value. This may be used to include null fields in Patch 1265 // requests. 1266 NullFields []string `json:"-"` 1267} 1268 1269func (s *FirstPartyMobileApplicationTargeting) MarshalJSON() ([]byte, error) { 1270 type NoMethod FirstPartyMobileApplicationTargeting 1271 raw := NoMethod(*s) 1272 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 1273} 1274 1275// FrequencyCap: Message contains details about publisher-set frequency 1276// caps of the delivery. 1277type FrequencyCap struct { 1278 // MaxImpressions: The maximum number of impressions that can be served 1279 // to a user within the specified time period. 1280 MaxImpressions int64 `json:"maxImpressions,omitempty"` 1281 1282 // TimeUnitType: The time unit. Along with num_time_units defines the 1283 // amount of time over which impressions per user are counted and 1284 // capped. 1285 // 1286 // Possible values: 1287 // "TIME_UNIT_TYPE_UNSPECIFIED" - A placeholder for an undefined time 1288 // unit type. This just indicates the variable with this value hasn't 1289 // been initialized. 1290 // "MINUTE" - Minute unit. 1291 // "HOUR" - Hour unit. 1292 // "DAY" - Day unit. 1293 // "WEEK" - Week unit. 1294 // "MONTH" - Month unit. 1295 // "LIFETIME" - Lifecycle/Lifetime unit. 1296 // "POD" - Pod unit. 1297 // "STREAM" - Stream unit. 1298 TimeUnitType string `json:"timeUnitType,omitempty"` 1299 1300 // TimeUnitsCount: The amount of time, in the units specified by 1301 // time_unit_type. Defines the amount of time over which impressions per 1302 // user are counted and capped. 1303 TimeUnitsCount int64 `json:"timeUnitsCount,omitempty"` 1304 1305 // ForceSendFields is a list of field names (e.g. "MaxImpressions") to 1306 // unconditionally include in API requests. By default, fields with 1307 // empty or default values are omitted from API requests. However, any 1308 // non-pointer, non-interface field appearing in ForceSendFields will be 1309 // sent to the server regardless of whether the field is empty or not. 1310 // This may be used to include empty fields in Patch requests. 1311 ForceSendFields []string `json:"-"` 1312 1313 // NullFields is a list of field names (e.g. "MaxImpressions") to 1314 // include in API requests with the JSON null value. By default, fields 1315 // with empty values are omitted from API requests. However, any field 1316 // with an empty value appearing in NullFields will be sent to the 1317 // server as null. It is an error if a field in this list has a 1318 // non-empty value. This may be used to include null fields in Patch 1319 // requests. 1320 NullFields []string `json:"-"` 1321} 1322 1323func (s *FrequencyCap) MarshalJSON() ([]byte, error) { 1324 type NoMethod FrequencyCap 1325 raw := NoMethod(*s) 1326 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 1327} 1328 1329// InventorySizeTargeting: Represents the size of an ad unit that can be 1330// targeted on a bid request. 1331type InventorySizeTargeting struct { 1332 // ExcludedInventorySizes: A list of inventory sizes to be excluded. 1333 ExcludedInventorySizes []*AdSize `json:"excludedInventorySizes,omitempty"` 1334 1335 // TargetedInventorySizes: A list of inventory sizes to be included. 1336 TargetedInventorySizes []*AdSize `json:"targetedInventorySizes,omitempty"` 1337 1338 // ForceSendFields is a list of field names (e.g. 1339 // "ExcludedInventorySizes") to unconditionally include in API requests. 1340 // By default, fields with empty or default values are omitted from API 1341 // requests. However, any non-pointer, non-interface field appearing in 1342 // ForceSendFields will be sent to the server regardless of whether the 1343 // field is empty or not. This may be used to include empty fields in 1344 // Patch requests. 1345 ForceSendFields []string `json:"-"` 1346 1347 // NullFields is a list of field names (e.g. "ExcludedInventorySizes") 1348 // to include in API requests with the JSON null value. By default, 1349 // fields with empty values are omitted from API requests. However, any 1350 // field with an empty value appearing in NullFields will be sent to the 1351 // server as null. It is an error if a field in this list has a 1352 // non-empty value. This may be used to include null fields in Patch 1353 // requests. 1354 NullFields []string `json:"-"` 1355} 1356 1357func (s *InventorySizeTargeting) MarshalJSON() ([]byte, error) { 1358 type NoMethod InventorySizeTargeting 1359 raw := NoMethod(*s) 1360 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 1361} 1362 1363// ListAuctionPackagesResponse: Response message for listing auction 1364// packages. 1365type ListAuctionPackagesResponse struct { 1366 // AuctionPackages: The list of auction packages. 1367 AuctionPackages []*AuctionPackage `json:"auctionPackages,omitempty"` 1368 1369 // NextPageToken: Continuation token for fetching the next page of 1370 // results. Pass this value in the ListAuctionPackagesRequest.pageToken 1371 // field in the subsequent call to the `ListAuctionPackages` method to 1372 // retrieve the next page of results. 1373 NextPageToken string `json:"nextPageToken,omitempty"` 1374 1375 // ServerResponse contains the HTTP response code and headers from the 1376 // server. 1377 googleapi.ServerResponse `json:"-"` 1378 1379 // ForceSendFields is a list of field names (e.g. "AuctionPackages") to 1380 // unconditionally include in API requests. By default, fields with 1381 // empty or default values are omitted from API requests. However, any 1382 // non-pointer, non-interface field appearing in ForceSendFields will be 1383 // sent to the server regardless of whether the field is empty or not. 1384 // This may be used to include empty fields in Patch requests. 1385 ForceSendFields []string `json:"-"` 1386 1387 // NullFields is a list of field names (e.g. "AuctionPackages") to 1388 // include in API requests with the JSON null value. By default, fields 1389 // with empty values are omitted from API requests. However, any field 1390 // with an empty value appearing in NullFields will be sent to the 1391 // server as null. It is an error if a field in this list has a 1392 // non-empty value. This may be used to include null fields in Patch 1393 // requests. 1394 NullFields []string `json:"-"` 1395} 1396 1397func (s *ListAuctionPackagesResponse) MarshalJSON() ([]byte, error) { 1398 type NoMethod ListAuctionPackagesResponse 1399 raw := NoMethod(*s) 1400 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 1401} 1402 1403// ListClientUsersResponse: Response message for the list method. 1404type ListClientUsersResponse struct { 1405 // ClientUsers: The returned list of client users. 1406 ClientUsers []*ClientUser `json:"clientUsers,omitempty"` 1407 1408 // NextPageToken: A token to retrieve the next page of results. Pass 1409 // this value in the ListClientUsersRequest.pageToken field in the 1410 // subsequent call to the list method to retrieve the next page of 1411 // results. 1412 NextPageToken string `json:"nextPageToken,omitempty"` 1413 1414 // ServerResponse contains the HTTP response code and headers from the 1415 // server. 1416 googleapi.ServerResponse `json:"-"` 1417 1418 // ForceSendFields is a list of field names (e.g. "ClientUsers") to 1419 // unconditionally include in API requests. By default, fields with 1420 // empty or default values are omitted from API requests. However, any 1421 // non-pointer, non-interface field appearing in ForceSendFields will be 1422 // sent to the server regardless of whether the field is empty or not. 1423 // This may be used to include empty fields in Patch requests. 1424 ForceSendFields []string `json:"-"` 1425 1426 // NullFields is a list of field names (e.g. "ClientUsers") to include 1427 // in API requests with the JSON null value. By default, fields with 1428 // empty values are omitted from API requests. However, any field with 1429 // an empty value appearing in NullFields will be sent to the server as 1430 // null. It is an error if a field in this list has a non-empty value. 1431 // This may be used to include null fields in Patch requests. 1432 NullFields []string `json:"-"` 1433} 1434 1435func (s *ListClientUsersResponse) MarshalJSON() ([]byte, error) { 1436 type NoMethod ListClientUsersResponse 1437 raw := NoMethod(*s) 1438 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 1439} 1440 1441// ListClientsResponse: Response message for the list method. 1442type ListClientsResponse struct { 1443 // Clients: The returned list of clients. 1444 Clients []*Client `json:"clients,omitempty"` 1445 1446 // NextPageToken: A token to retrieve the next page of results. Pass 1447 // this value in the ListClientsRequest.pageToken field in the 1448 // subsequent call to the list method to retrieve the next page of 1449 // results. 1450 NextPageToken string `json:"nextPageToken,omitempty"` 1451 1452 // ServerResponse contains the HTTP response code and headers from the 1453 // server. 1454 googleapi.ServerResponse `json:"-"` 1455 1456 // ForceSendFields is a list of field names (e.g. "Clients") to 1457 // unconditionally include in API requests. By default, fields with 1458 // empty or default values are omitted from API requests. However, any 1459 // non-pointer, non-interface field appearing in ForceSendFields will be 1460 // sent to the server regardless of whether the field is empty or not. 1461 // This may be used to include empty fields in Patch requests. 1462 ForceSendFields []string `json:"-"` 1463 1464 // NullFields is a list of field names (e.g. "Clients") to include in 1465 // API requests with the JSON null value. By default, fields with empty 1466 // values are omitted from API requests. However, any field with an 1467 // empty value appearing in NullFields will be sent to the server as 1468 // null. It is an error if a field in this list has a non-empty value. 1469 // This may be used to include null fields in Patch requests. 1470 NullFields []string `json:"-"` 1471} 1472 1473func (s *ListClientsResponse) MarshalJSON() ([]byte, error) { 1474 type NoMethod ListClientsResponse 1475 raw := NoMethod(*s) 1476 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 1477} 1478 1479// ListDealsResponse: Response message for listing deals in a proposal. 1480type ListDealsResponse struct { 1481 // Deals: The list of deals. 1482 Deals []*Deal `json:"deals,omitempty"` 1483 1484 // NextPageToken: Token to fetch the next page of results. 1485 NextPageToken string `json:"nextPageToken,omitempty"` 1486 1487 // ServerResponse contains the HTTP response code and headers from the 1488 // server. 1489 googleapi.ServerResponse `json:"-"` 1490 1491 // ForceSendFields is a list of field names (e.g. "Deals") to 1492 // unconditionally include in API requests. By default, fields with 1493 // empty or default values are omitted from API requests. However, any 1494 // non-pointer, non-interface field appearing in ForceSendFields will be 1495 // sent to the server regardless of whether the field is empty or not. 1496 // This may be used to include empty fields in Patch requests. 1497 ForceSendFields []string `json:"-"` 1498 1499 // NullFields is a list of field names (e.g. "Deals") to include in API 1500 // requests with the JSON null value. By default, fields with empty 1501 // values are omitted from API requests. However, any field with an 1502 // empty value appearing in NullFields will be sent to the server as 1503 // null. It is an error if a field in this list has a non-empty value. 1504 // This may be used to include null fields in Patch requests. 1505 NullFields []string `json:"-"` 1506} 1507 1508func (s *ListDealsResponse) MarshalJSON() ([]byte, error) { 1509 type NoMethod ListDealsResponse 1510 raw := NoMethod(*s) 1511 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 1512} 1513 1514// ListFinalizedDealsResponse: Response message for listing finalized 1515// deals. 1516type ListFinalizedDealsResponse struct { 1517 // FinalizedDeals: The list of finalized deals. 1518 FinalizedDeals []*FinalizedDeal `json:"finalizedDeals,omitempty"` 1519 1520 // NextPageToken: Token to fetch the next page of results. 1521 NextPageToken string `json:"nextPageToken,omitempty"` 1522 1523 // ServerResponse contains the HTTP response code and headers from the 1524 // server. 1525 googleapi.ServerResponse `json:"-"` 1526 1527 // ForceSendFields is a list of field names (e.g. "FinalizedDeals") to 1528 // unconditionally include in API requests. By default, fields with 1529 // empty or default values are omitted from API requests. However, any 1530 // non-pointer, non-interface field appearing in ForceSendFields will be 1531 // sent to the server regardless of whether the field is empty or not. 1532 // This may be used to include empty fields in Patch requests. 1533 ForceSendFields []string `json:"-"` 1534 1535 // NullFields is a list of field names (e.g. "FinalizedDeals") to 1536 // include in API requests with the JSON null value. By default, fields 1537 // with empty values are omitted from API requests. However, any field 1538 // with an empty value appearing in NullFields will be sent to the 1539 // server as null. It is an error if a field in this list has a 1540 // non-empty value. This may be used to include null fields in Patch 1541 // requests. 1542 NullFields []string `json:"-"` 1543} 1544 1545func (s *ListFinalizedDealsResponse) MarshalJSON() ([]byte, error) { 1546 type NoMethod ListFinalizedDealsResponse 1547 raw := NoMethod(*s) 1548 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 1549} 1550 1551// ListProposalsResponse: Response message for listing proposals. 1552type ListProposalsResponse struct { 1553 // NextPageToken: Continuation token for fetching the next page of 1554 // results. 1555 NextPageToken string `json:"nextPageToken,omitempty"` 1556 1557 // Proposals: The list of proposals. 1558 Proposals []*Proposal `json:"proposals,omitempty"` 1559 1560 // ServerResponse contains the HTTP response code and headers from the 1561 // server. 1562 googleapi.ServerResponse `json:"-"` 1563 1564 // ForceSendFields is a list of field names (e.g. "NextPageToken") to 1565 // unconditionally include in API requests. By default, fields with 1566 // empty or default values are omitted from API requests. However, any 1567 // non-pointer, non-interface field appearing in ForceSendFields will be 1568 // sent to the server regardless of whether the field is empty or not. 1569 // This may be used to include empty fields in Patch requests. 1570 ForceSendFields []string `json:"-"` 1571 1572 // NullFields is a list of field names (e.g. "NextPageToken") to include 1573 // in API requests with the JSON null value. By default, fields with 1574 // empty values are omitted from API requests. However, any field with 1575 // an empty value appearing in NullFields will be sent to the server as 1576 // null. It is an error if a field in this list has a non-empty value. 1577 // This may be used to include null fields in Patch requests. 1578 NullFields []string `json:"-"` 1579} 1580 1581func (s *ListProposalsResponse) MarshalJSON() ([]byte, error) { 1582 type NoMethod ListProposalsResponse 1583 raw := NoMethod(*s) 1584 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 1585} 1586 1587// ListPublisherProfilesResponse: Response message for profiles visible 1588// to the buyer. 1589type ListPublisherProfilesResponse struct { 1590 // NextPageToken: Token to fetch the next page of results. 1591 NextPageToken string `json:"nextPageToken,omitempty"` 1592 1593 // PublisherProfiles: The list of matching publisher profiles. 1594 PublisherProfiles []*PublisherProfile `json:"publisherProfiles,omitempty"` 1595 1596 // ServerResponse contains the HTTP response code and headers from the 1597 // server. 1598 googleapi.ServerResponse `json:"-"` 1599 1600 // ForceSendFields is a list of field names (e.g. "NextPageToken") to 1601 // unconditionally include in API requests. By default, fields with 1602 // empty or default values are omitted from API requests. However, any 1603 // non-pointer, non-interface field appearing in ForceSendFields will be 1604 // sent to the server regardless of whether the field is empty or not. 1605 // This may be used to include empty fields in Patch requests. 1606 ForceSendFields []string `json:"-"` 1607 1608 // NullFields is a list of field names (e.g. "NextPageToken") to include 1609 // in API requests with the JSON null value. By default, fields with 1610 // empty values are omitted from API requests. However, any field with 1611 // an empty value appearing in NullFields will be sent to the server as 1612 // null. It is an error if a field in this list has a non-empty value. 1613 // This may be used to include null fields in Patch requests. 1614 NullFields []string `json:"-"` 1615} 1616 1617func (s *ListPublisherProfilesResponse) MarshalJSON() ([]byte, error) { 1618 type NoMethod ListPublisherProfilesResponse 1619 raw := NoMethod(*s) 1620 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 1621} 1622 1623// MarketplaceTargeting: Targeting represents different criteria that 1624// can be used to target inventory. For example, they can choose to 1625// target inventory only if the user is in the US. Multiple types of 1626// targeting are always applied as a logical AND, unless noted 1627// otherwise. 1628type MarketplaceTargeting struct { 1629 // DaypartTargeting: Daypart targeting information. 1630 DaypartTargeting *DayPartTargeting `json:"daypartTargeting,omitempty"` 1631 1632 // GeoTargeting: Output only. Geo criteria IDs to be included/excluded. 1633 GeoTargeting *CriteriaTargeting `json:"geoTargeting,omitempty"` 1634 1635 // InventorySizeTargeting: Output only. Inventory sizes to be 1636 // included/excluded. 1637 InventorySizeTargeting *InventorySizeTargeting `json:"inventorySizeTargeting,omitempty"` 1638 1639 // PlacementTargeting: Output only. Placement targeting information, 1640 // e.g., URL, mobile applications. 1641 PlacementTargeting *PlacementTargeting `json:"placementTargeting,omitempty"` 1642 1643 // TechnologyTargeting: Output only. Technology targeting information, 1644 // e.g., operating system, device category. 1645 TechnologyTargeting *TechnologyTargeting `json:"technologyTargeting,omitempty"` 1646 1647 // UserListTargeting: Buyer user list targeting information. User lists 1648 // can be uploaded via 1649 // https://developers.google.com/authorized-buyers/rtb/bulk-uploader. 1650 UserListTargeting *CriteriaTargeting `json:"userListTargeting,omitempty"` 1651 1652 // VideoTargeting: Output only. Video targeting information. 1653 VideoTargeting *VideoTargeting `json:"videoTargeting,omitempty"` 1654 1655 // ForceSendFields is a list of field names (e.g. "DaypartTargeting") to 1656 // unconditionally include in API requests. By default, fields with 1657 // empty or default values are omitted from API requests. However, any 1658 // non-pointer, non-interface field appearing in ForceSendFields will be 1659 // sent to the server regardless of whether the field is empty or not. 1660 // This may be used to include empty fields in Patch requests. 1661 ForceSendFields []string `json:"-"` 1662 1663 // NullFields is a list of field names (e.g. "DaypartTargeting") to 1664 // include in API requests with the JSON null value. By default, fields 1665 // with empty values are omitted from API requests. However, any field 1666 // with an empty value appearing in NullFields will be sent to the 1667 // server as null. It is an error if a field in this list has a 1668 // non-empty value. This may be used to include null fields in Patch 1669 // requests. 1670 NullFields []string `json:"-"` 1671} 1672 1673func (s *MarketplaceTargeting) MarshalJSON() ([]byte, error) { 1674 type NoMethod MarketplaceTargeting 1675 raw := NoMethod(*s) 1676 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 1677} 1678 1679// MobileApplicationTargeting: Mobile application targeting settings. 1680type MobileApplicationTargeting struct { 1681 // FirstPartyTargeting: Publisher owned apps to be targeted or excluded 1682 // by the publisher to display the ads in. 1683 FirstPartyTargeting *FirstPartyMobileApplicationTargeting `json:"firstPartyTargeting,omitempty"` 1684 1685 // ForceSendFields is a list of field names (e.g. "FirstPartyTargeting") 1686 // to unconditionally include in API requests. By default, fields with 1687 // empty or default values are omitted from API requests. However, any 1688 // non-pointer, non-interface field appearing in ForceSendFields will be 1689 // sent to the server regardless of whether the field is empty or not. 1690 // This may be used to include empty fields in Patch requests. 1691 ForceSendFields []string `json:"-"` 1692 1693 // NullFields is a list of field names (e.g. "FirstPartyTargeting") to 1694 // include in API requests with the JSON null value. By default, fields 1695 // with empty values are omitted from API requests. However, any field 1696 // with an empty value appearing in NullFields will be sent to the 1697 // server as null. It is an error if a field in this list has a 1698 // non-empty value. This may be used to include null fields in Patch 1699 // requests. 1700 NullFields []string `json:"-"` 1701} 1702 1703func (s *MobileApplicationTargeting) MarshalJSON() ([]byte, error) { 1704 type NoMethod MobileApplicationTargeting 1705 raw := NoMethod(*s) 1706 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 1707} 1708 1709// Money: Represents an amount of money with its currency type. 1710type Money struct { 1711 // CurrencyCode: The three-letter currency code defined in ISO 4217. 1712 CurrencyCode string `json:"currencyCode,omitempty"` 1713 1714 // Nanos: Number of nano (10^-9) units of the amount. The value must be 1715 // between -999,999,999 and +999,999,999 inclusive. If `units` is 1716 // positive, `nanos` must be positive or zero. If `units` is zero, 1717 // `nanos` can be positive, zero, or negative. If `units` is negative, 1718 // `nanos` must be negative or zero. For example $-1.75 is represented 1719 // as `units`=-1 and `nanos`=-750,000,000. 1720 Nanos int64 `json:"nanos,omitempty"` 1721 1722 // Units: The whole units of the amount. For example if `currencyCode` 1723 // is "USD", then 1 unit is one US dollar. 1724 Units int64 `json:"units,omitempty,string"` 1725 1726 // ForceSendFields is a list of field names (e.g. "CurrencyCode") to 1727 // unconditionally include in API requests. By default, fields with 1728 // empty or default values are omitted from API requests. However, any 1729 // non-pointer, non-interface field appearing in ForceSendFields will be 1730 // sent to the server regardless of whether the field is empty or not. 1731 // This may be used to include empty fields in Patch requests. 1732 ForceSendFields []string `json:"-"` 1733 1734 // NullFields is a list of field names (e.g. "CurrencyCode") to include 1735 // in API requests with the JSON null value. By default, fields with 1736 // empty values are omitted from API requests. However, any field with 1737 // an empty value appearing in NullFields will be sent to the server as 1738 // null. It is an error if a field in this list has a non-empty value. 1739 // This may be used to include null fields in Patch requests. 1740 NullFields []string `json:"-"` 1741} 1742 1743func (s *Money) MarshalJSON() ([]byte, error) { 1744 type NoMethod Money 1745 raw := NoMethod(*s) 1746 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 1747} 1748 1749// Note: A text note attached to the proposal to facilitate the 1750// communication between buyers and sellers. 1751type Note struct { 1752 // CreateTime: Output only. When this note was created. 1753 CreateTime string `json:"createTime,omitempty"` 1754 1755 // CreatorRole: Output only. The role who created the note. 1756 // 1757 // Possible values: 1758 // "BUYER_SELLER_ROLE_UNSPECIFIED" - A placeholder for an undefined 1759 // buyer/seller role. 1760 // "BUYER" - Specifies the role as buyer. 1761 // "SELLER" - Specifies the role as seller. 1762 CreatorRole string `json:"creatorRole,omitempty"` 1763 1764 // Note: The text of the note. Maximum length is 1024 characters. 1765 Note string `json:"note,omitempty"` 1766 1767 // ForceSendFields is a list of field names (e.g. "CreateTime") to 1768 // unconditionally include in API requests. By default, fields with 1769 // empty or default values are omitted from API requests. However, any 1770 // non-pointer, non-interface field appearing in ForceSendFields will be 1771 // sent to the server regardless of whether the field is empty or not. 1772 // This may be used to include empty fields in Patch requests. 1773 ForceSendFields []string `json:"-"` 1774 1775 // NullFields is a list of field names (e.g. "CreateTime") to include in 1776 // API requests with the JSON null value. By default, fields with empty 1777 // values are omitted from API requests. However, any field with an 1778 // empty value appearing in NullFields will be sent to the server as 1779 // null. It is an error if a field in this list has a non-empty value. 1780 // This may be used to include null fields in Patch requests. 1781 NullFields []string `json:"-"` 1782} 1783 1784func (s *Note) MarshalJSON() ([]byte, error) { 1785 type NoMethod Note 1786 raw := NoMethod(*s) 1787 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 1788} 1789 1790// OperatingSystemTargeting: Represents targeting information for 1791// operating systems. 1792type OperatingSystemTargeting struct { 1793 // OperatingSystemCriteria: IDs of operating systems to be 1794 // included/excluded. 1795 OperatingSystemCriteria *CriteriaTargeting `json:"operatingSystemCriteria,omitempty"` 1796 1797 // OperatingSystemVersionCriteria: IDs of operating system versions to 1798 // be included/excluded. 1799 OperatingSystemVersionCriteria *CriteriaTargeting `json:"operatingSystemVersionCriteria,omitempty"` 1800 1801 // ForceSendFields is a list of field names (e.g. 1802 // "OperatingSystemCriteria") to unconditionally include in API 1803 // requests. By default, fields with empty or default values are omitted 1804 // from API requests. However, any non-pointer, non-interface field 1805 // appearing in ForceSendFields will be sent to the server regardless of 1806 // whether the field is empty or not. This may be used to include empty 1807 // fields in Patch requests. 1808 ForceSendFields []string `json:"-"` 1809 1810 // NullFields is a list of field names (e.g. "OperatingSystemCriteria") 1811 // to include in API requests with the JSON null value. By default, 1812 // fields with empty values are omitted from API requests. However, any 1813 // field with an empty value appearing in NullFields will be sent to the 1814 // server as null. It is an error if a field in this list has a 1815 // non-empty value. This may be used to include null fields in Patch 1816 // requests. 1817 NullFields []string `json:"-"` 1818} 1819 1820func (s *OperatingSystemTargeting) MarshalJSON() ([]byte, error) { 1821 type NoMethod OperatingSystemTargeting 1822 raw := NoMethod(*s) 1823 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 1824} 1825 1826// PauseFinalizedDealRequest: Request message for pausing a finalized 1827// deal. 1828type PauseFinalizedDealRequest struct { 1829 // Reason: The reason to pause the finalized deal, will be displayed to 1830 // the seller. Maximum length is 1000 characters. 1831 Reason string `json:"reason,omitempty"` 1832 1833 // ForceSendFields is a list of field names (e.g. "Reason") to 1834 // unconditionally include in API requests. By default, fields with 1835 // empty or default values are omitted from API requests. However, any 1836 // non-pointer, non-interface field appearing in ForceSendFields will be 1837 // sent to the server regardless of whether the field is empty or not. 1838 // This may be used to include empty fields in Patch requests. 1839 ForceSendFields []string `json:"-"` 1840 1841 // NullFields is a list of field names (e.g. "Reason") to include in API 1842 // requests with the JSON null value. By default, fields with empty 1843 // values are omitted from API requests. However, any field with an 1844 // empty value appearing in NullFields will be sent to the server as 1845 // null. It is an error if a field in this list has a non-empty value. 1846 // This may be used to include null fields in Patch requests. 1847 NullFields []string `json:"-"` 1848} 1849 1850func (s *PauseFinalizedDealRequest) MarshalJSON() ([]byte, error) { 1851 type NoMethod PauseFinalizedDealRequest 1852 raw := NoMethod(*s) 1853 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 1854} 1855 1856// PlacementTargeting: Represents targeting about where the ads can 1857// appear, e.g., certain sites or mobile applications. Different 1858// placement targeting types will be logically OR'ed. 1859type PlacementTargeting struct { 1860 // MobileApplicationTargeting: Mobile application targeting information 1861 // in a deal. This doesn't apply to Auction Packages. 1862 MobileApplicationTargeting *MobileApplicationTargeting `json:"mobileApplicationTargeting,omitempty"` 1863 1864 // UriTargeting: URLs to be included/excluded. 1865 UriTargeting *UriTargeting `json:"uriTargeting,omitempty"` 1866 1867 // ForceSendFields is a list of field names (e.g. 1868 // "MobileApplicationTargeting") to unconditionally include in API 1869 // requests. By default, fields with empty or default values are omitted 1870 // from API requests. However, any non-pointer, non-interface field 1871 // appearing in ForceSendFields will be sent to the server regardless of 1872 // whether the field is empty or not. This may be used to include empty 1873 // fields in Patch requests. 1874 ForceSendFields []string `json:"-"` 1875 1876 // NullFields is a list of field names (e.g. 1877 // "MobileApplicationTargeting") to include in API requests with the 1878 // JSON null value. By default, fields with empty values are omitted 1879 // from API requests. However, any field with an empty value appearing 1880 // in NullFields will be sent to the server as null. It is an error if a 1881 // field in this list has a non-empty value. This may be used to include 1882 // null fields in Patch requests. 1883 NullFields []string `json:"-"` 1884} 1885 1886func (s *PlacementTargeting) MarshalJSON() ([]byte, error) { 1887 type NoMethod PlacementTargeting 1888 raw := NoMethod(*s) 1889 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 1890} 1891 1892// PreferredDealTerms: Pricing terms for Preferred Deals. 1893type PreferredDealTerms struct { 1894 // FixedPrice: Fixed price for the deal. 1895 FixedPrice *Price `json:"fixedPrice,omitempty"` 1896 1897 // ForceSendFields is a list of field names (e.g. "FixedPrice") to 1898 // unconditionally include in API requests. By default, fields with 1899 // empty or default values are omitted from API requests. However, any 1900 // non-pointer, non-interface field appearing in ForceSendFields will be 1901 // sent to the server regardless of whether the field is empty or not. 1902 // This may be used to include empty fields in Patch requests. 1903 ForceSendFields []string `json:"-"` 1904 1905 // NullFields is a list of field names (e.g. "FixedPrice") to include in 1906 // API requests with the JSON null value. By default, fields with empty 1907 // values are omitted from API requests. However, any field with an 1908 // empty value appearing in NullFields will be sent to the server as 1909 // null. It is an error if a field in this list has a non-empty value. 1910 // This may be used to include null fields in Patch requests. 1911 NullFields []string `json:"-"` 1912} 1913 1914func (s *PreferredDealTerms) MarshalJSON() ([]byte, error) { 1915 type NoMethod PreferredDealTerms 1916 raw := NoMethod(*s) 1917 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 1918} 1919 1920// Price: Represents a price and a pricing type for a deal. 1921type Price struct { 1922 // Amount: The actual price with currency specified. 1923 Amount *Money `json:"amount,omitempty"` 1924 1925 // Type: The pricing type for the deal. 1926 // 1927 // Possible values: 1928 // "TYPE_UNSPECIFIED" - A placeholder for an undefined pricing type. 1929 // If the pricing type is unspecified, CPM will be used instead. 1930 // "CPM" - Cost per thousand impressions. 1931 // "CPD" - Cost per day. 1932 Type string `json:"type,omitempty"` 1933 1934 // ForceSendFields is a list of field names (e.g. "Amount") to 1935 // unconditionally include in API requests. By default, fields with 1936 // empty or default values are omitted from API requests. However, any 1937 // non-pointer, non-interface field appearing in ForceSendFields will be 1938 // sent to the server regardless of whether the field is empty or not. 1939 // This may be used to include empty fields in Patch requests. 1940 ForceSendFields []string `json:"-"` 1941 1942 // NullFields is a list of field names (e.g. "Amount") to include in API 1943 // requests with the JSON null value. By default, fields with empty 1944 // values are omitted from API requests. However, any field with an 1945 // empty value appearing in NullFields will be sent to the server as 1946 // null. It is an error if a field in this list has a non-empty value. 1947 // This may be used to include null fields in Patch requests. 1948 NullFields []string `json:"-"` 1949} 1950 1951func (s *Price) MarshalJSON() ([]byte, error) { 1952 type NoMethod Price 1953 raw := NoMethod(*s) 1954 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 1955} 1956 1957// PrivateAuctionTerms: Pricing terms for Private Auctions. 1958type PrivateAuctionTerms struct { 1959 // FloorPrice: The minimum price buyer has to bid to compete in the 1960 // private auction. 1961 FloorPrice *Price `json:"floorPrice,omitempty"` 1962 1963 // OpenAuctionAllowed: Output only. True if open auction buyers are 1964 // allowed to compete with invited buyers in this private auction. 1965 OpenAuctionAllowed bool `json:"openAuctionAllowed,omitempty"` 1966 1967 // ForceSendFields is a list of field names (e.g. "FloorPrice") to 1968 // unconditionally include in API requests. By default, fields with 1969 // empty or default values are omitted from API requests. However, any 1970 // non-pointer, non-interface field appearing in ForceSendFields will be 1971 // sent to the server regardless of whether the field is empty or not. 1972 // This may be used to include empty fields in Patch requests. 1973 ForceSendFields []string `json:"-"` 1974 1975 // NullFields is a list of field names (e.g. "FloorPrice") to include in 1976 // API requests with the JSON null value. By default, fields with empty 1977 // values are omitted from API requests. However, any field with an 1978 // empty value appearing in NullFields will be sent to the server as 1979 // null. It is an error if a field in this list has a non-empty value. 1980 // This may be used to include null fields in Patch requests. 1981 NullFields []string `json:"-"` 1982} 1983 1984func (s *PrivateAuctionTerms) MarshalJSON() ([]byte, error) { 1985 type NoMethod PrivateAuctionTerms 1986 raw := NoMethod(*s) 1987 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 1988} 1989 1990// PrivateData: Buyers are allowed to store certain types of private 1991// data in a proposal or deal. 1992type PrivateData struct { 1993 // ReferenceId: A buyer specified reference ID. This can be queried in 1994 // the list operations (max-length: 1024 unicode code units). 1995 ReferenceId string `json:"referenceId,omitempty"` 1996 1997 // ForceSendFields is a list of field names (e.g. "ReferenceId") to 1998 // unconditionally include in API requests. By default, fields with 1999 // empty or default values are omitted from API requests. However, any 2000 // non-pointer, non-interface field appearing in ForceSendFields will be 2001 // sent to the server regardless of whether the field is empty or not. 2002 // This may be used to include empty fields in Patch requests. 2003 ForceSendFields []string `json:"-"` 2004 2005 // NullFields is a list of field names (e.g. "ReferenceId") to include 2006 // in API requests with the JSON null value. By default, fields with 2007 // empty values are omitted from API requests. However, any field with 2008 // an empty value appearing in NullFields will be sent to the server as 2009 // null. It is an error if a field in this list has a non-empty value. 2010 // This may be used to include null fields in Patch requests. 2011 NullFields []string `json:"-"` 2012} 2013 2014func (s *PrivateData) MarshalJSON() ([]byte, error) { 2015 type NoMethod PrivateData 2016 raw := NoMethod(*s) 2017 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 2018} 2019 2020// ProgrammaticGuaranteedTerms: Pricing terms for Programmatic 2021// Guaranteed Deals. 2022type ProgrammaticGuaranteedTerms struct { 2023 // FixedPrice: Fixed price for the deal. 2024 FixedPrice *Price `json:"fixedPrice,omitempty"` 2025 2026 // GuaranteedLooks: Count of guaranteed looks. 2027 GuaranteedLooks int64 `json:"guaranteedLooks,omitempty,string"` 2028 2029 // ImpressionCap: The lifetime impression cap for CPM Sponsorship deals. 2030 // Deal will stop serving when cap is reached. 2031 ImpressionCap int64 `json:"impressionCap,omitempty,string"` 2032 2033 // MinimumDailyLooks: Daily minimum looks for CPD deal types. 2034 MinimumDailyLooks int64 `json:"minimumDailyLooks,omitempty,string"` 2035 2036 // PercentShareOfVoice: For sponsorship deals, this is the percentage of 2037 // the seller's eligible impressions that the deal will serve until the 2038 // cap is reached. Valid value is within range 0~100. 2039 PercentShareOfVoice int64 `json:"percentShareOfVoice,omitempty,string"` 2040 2041 // ReservationType: The reservation type for a Programmatic Guaranteed 2042 // deal. This indicates whether the number of impressions is fixed, or a 2043 // percent of available impressions. If not specified, the default 2044 // reservation type is STANDARD. 2045 // 2046 // Possible values: 2047 // "RESERVATION_TYPE_UNSPECIFIED" - An unspecified reservation type. 2048 // "STANDARD" - Non-sponsorship deal. 2049 // "SPONSORSHIP" - Sponsorship deals don't have impression goal 2050 // (guaranteed_looks) and they are served based on the flight dates. For 2051 // CPM Sponsorship deals, impression_cap is the lifetime impression 2052 // limit. 2053 ReservationType string `json:"reservationType,omitempty"` 2054 2055 // ForceSendFields is a list of field names (e.g. "FixedPrice") to 2056 // unconditionally include in API requests. By default, fields with 2057 // empty or default values are omitted from API requests. However, any 2058 // non-pointer, non-interface field appearing in ForceSendFields will be 2059 // sent to the server regardless of whether the field is empty or not. 2060 // This may be used to include empty fields in Patch requests. 2061 ForceSendFields []string `json:"-"` 2062 2063 // NullFields is a list of field names (e.g. "FixedPrice") to include in 2064 // API requests with the JSON null value. By default, fields with empty 2065 // values are omitted from API requests. However, any field with an 2066 // empty value appearing in NullFields will be sent to the server as 2067 // null. It is an error if a field in this list has a non-empty value. 2068 // This may be used to include null fields in Patch requests. 2069 NullFields []string `json:"-"` 2070} 2071 2072func (s *ProgrammaticGuaranteedTerms) MarshalJSON() ([]byte, error) { 2073 type NoMethod ProgrammaticGuaranteedTerms 2074 raw := NoMethod(*s) 2075 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 2076} 2077 2078// Proposal: Represents a proposal in the Marketplace. A proposal is the 2079// unit of negotiation between a seller and a buyer. 2080type Proposal struct { 2081 // BilledBuyer: Output only. When the client field is populated, this 2082 // field refers to the buyer who creates and manages the client buyer 2083 // and gets billed on behalf of the client buyer; when the buyer field 2084 // is populated, this field is the same value as buyer. Format : 2085 // `buyers/{buyerAccountId}` 2086 BilledBuyer string `json:"billedBuyer,omitempty"` 2087 2088 // Buyer: Output only. Refers to a buyer in The Realtime-bidding API. 2089 // Format: `buyers/{buyerAccountId}` 2090 Buyer string `json:"buyer,omitempty"` 2091 2092 // BuyerContacts: Contact information for the buyer. 2093 BuyerContacts []*Contact `json:"buyerContacts,omitempty"` 2094 2095 // BuyerPrivateData: Buyer private data (hidden from seller). 2096 BuyerPrivateData *PrivateData `json:"buyerPrivateData,omitempty"` 2097 2098 // Client: Output only. Refers to a Client. Format: 2099 // `buyers/{buyerAccountId}/clients/{clientAccountid}` 2100 Client string `json:"client,omitempty"` 2101 2102 // DealType: Output only. Type of deal the proposal contains. 2103 // 2104 // Possible values: 2105 // "DEAL_TYPE_UNSPECIFIED" - Default, unspecified deal type. 2106 // "PREFERRED_DEAL" - Preferred deals. 2107 // "PRIVATE_AUCTION" - Private auction deals. 2108 // "PROGRAMMATIC_GUARANTEED" - Programmatic guaranteed deals. 2109 DealType string `json:"dealType,omitempty"` 2110 2111 // DisplayName: Output only. The descriptive name for the proposal. 2112 // Maximum length of 255 unicode characters is allowed. Control 2113 // characters are not allowed. Buyers cannot update this field. Note: 2114 // Not to be confused with name, which is a unique identifier of the 2115 // proposal. 2116 DisplayName string `json:"displayName,omitempty"` 2117 2118 // IsRenegotiating: Output only. True if the proposal was previously 2119 // finalized and is now being renegotiated. 2120 IsRenegotiating bool `json:"isRenegotiating,omitempty"` 2121 2122 // LastUpdaterOrCommentorRole: Output only. The role of the last user 2123 // that either updated the proposal or left a comment. 2124 // 2125 // Possible values: 2126 // "BUYER_SELLER_ROLE_UNSPECIFIED" - A placeholder for an undefined 2127 // buyer/seller role. 2128 // "BUYER" - Specifies the role as buyer. 2129 // "SELLER" - Specifies the role as seller. 2130 LastUpdaterOrCommentorRole string `json:"lastUpdaterOrCommentorRole,omitempty"` 2131 2132 // Name: Immutable. The name of the proposal serving as a unique 2133 // identifier. Format: buyers/{accountId}/proposals/{proposalId} 2134 Name string `json:"name,omitempty"` 2135 2136 // Notes: A list of notes from the buyer and the seller attached to this 2137 // proposal. 2138 Notes []*Note `json:"notes,omitempty"` 2139 2140 // OriginatorRole: Output only. Indicates whether the buyer/seller 2141 // created the proposal. 2142 // 2143 // Possible values: 2144 // "BUYER_SELLER_ROLE_UNSPECIFIED" - A placeholder for an undefined 2145 // buyer/seller role. 2146 // "BUYER" - Specifies the role as buyer. 2147 // "SELLER" - Specifies the role as seller. 2148 OriginatorRole string `json:"originatorRole,omitempty"` 2149 2150 // PausingConsented: Whether pausing is allowed for the proposal. This 2151 // is a negotiable term between buyers and publishers. 2152 PausingConsented bool `json:"pausingConsented,omitempty"` 2153 2154 // ProposalRevision: Output only. The revision number for the proposal. 2155 // Each update to the proposal or deal causes the proposal revision 2156 // number to auto-increment. The buyer keeps track of the last revision 2157 // number they know of and pass it in when making an update. If the head 2158 // revision number on the server has since incremented, then an ABORTED 2159 // error is returned during the update operation to let the buyer know 2160 // that a subsequent update was made. 2161 ProposalRevision int64 `json:"proposalRevision,omitempty,string"` 2162 2163 // PublisherProfile: Immutable. Reference to the seller on the proposal. 2164 // Format: 2165 // `buyers/{buyerAccountId}/publisherProfiles/{publisherProfileId}` 2166 // Note: This field may be set only when creating the resource. 2167 // Modifying this field while updating the resource will result in an 2168 // error. 2169 PublisherProfile string `json:"publisherProfile,omitempty"` 2170 2171 // SellerContacts: Output only. Contact information for the seller. 2172 SellerContacts []*Contact `json:"sellerContacts,omitempty"` 2173 2174 // State: Output only. Indicates the state of the proposal. 2175 // 2176 // Possible values: 2177 // "STATE_UNSPECIFIED" - Unspecified proposal state 2178 // "BUYER_REVIEW_REQUESTED" - When a proposal is waiting for buyer to 2179 // review. 2180 // "SELLER_REVIEW_REQUESTED" - When the proposal is waiting for the 2181 // seller to review. 2182 // "BUYER_ACCEPTANCE_REQUESTED" - When the seller accepted the 2183 // proposal and sent it to the buyer for review. 2184 // "FINALIZED" - When both buyer and seller has accepted the proposal 2185 // "TERMINATED" - When either buyer or seller has cancelled the 2186 // proposal 2187 State string `json:"state,omitempty"` 2188 2189 // TermsAndConditions: Output only. The terms and conditions associated 2190 // with this proposal. Accepting a proposal implies acceptance of this 2191 // field. This is created by the seller, the buyer can only view it. 2192 TermsAndConditions string `json:"termsAndConditions,omitempty"` 2193 2194 // UpdateTime: Output only. The time when the proposal was last revised. 2195 UpdateTime string `json:"updateTime,omitempty"` 2196 2197 // ServerResponse contains the HTTP response code and headers from the 2198 // server. 2199 googleapi.ServerResponse `json:"-"` 2200 2201 // ForceSendFields is a list of field names (e.g. "BilledBuyer") to 2202 // unconditionally include in API requests. By default, fields with 2203 // empty or default values are omitted from API requests. However, any 2204 // non-pointer, non-interface field appearing in ForceSendFields will be 2205 // sent to the server regardless of whether the field is empty or not. 2206 // This may be used to include empty fields in Patch requests. 2207 ForceSendFields []string `json:"-"` 2208 2209 // NullFields is a list of field names (e.g. "BilledBuyer") to include 2210 // in API requests with the JSON null value. By default, fields with 2211 // empty values are omitted from API requests. However, any field with 2212 // an empty value appearing in NullFields will be sent to the server as 2213 // null. It is an error if a field in this list has a non-empty value. 2214 // This may be used to include null fields in Patch requests. 2215 NullFields []string `json:"-"` 2216} 2217 2218func (s *Proposal) MarshalJSON() ([]byte, error) { 2219 type NoMethod Proposal 2220 raw := NoMethod(*s) 2221 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 2222} 2223 2224// PublisherProfile: The values in the publisher profile are supplied by 2225// the publisher. All fields are not filterable unless stated otherwise. 2226type PublisherProfile struct { 2227 // AudienceDescription: Description on the publisher's audience. 2228 AudienceDescription string `json:"audienceDescription,omitempty"` 2229 2230 // DirectDealsContact: Contact information for direct reservation deals. 2231 // This is free text entered by the publisher and may include 2232 // information like names, phone numbers and email addresses. 2233 DirectDealsContact string `json:"directDealsContact,omitempty"` 2234 2235 // DisplayName: Display name of the publisher profile. Can be used to 2236 // filter the response of the publisherProfiles.list method. 2237 DisplayName string `json:"displayName,omitempty"` 2238 2239 // Domains: The list of domains represented in this publisher profile. 2240 // Empty if this is a parent profile. These are top private domains, 2241 // meaning that these will not contain a string like 2242 // "photos.google.co.uk/123", but will instead contain "google.co.uk". 2243 // Can be used to filter the response of the publisherProfiles.list 2244 // method. 2245 Domains []string `json:"domains,omitempty"` 2246 2247 // IsParent: Indicates if this profile is the parent profile of the 2248 // seller. A parent profile represents all the inventory from the 2249 // seller, as opposed to child profile that is created to brand a 2250 // portion of inventory. One seller has only one parent publisher 2251 // profile, and can have multiple child profiles. See 2252 // https://support.google.com/admanager/answer/6035806 for details. Can 2253 // be used to filter the response of the publisherProfiles.list method 2254 // by setting the filter to "is_parent: true". 2255 IsParent bool `json:"isParent,omitempty"` 2256 2257 // LogoUrl: A Google public URL to the logo for this publisher profile. 2258 // The logo is stored as a PNG, JPG, or GIF image. 2259 LogoUrl string `json:"logoUrl,omitempty"` 2260 2261 // MediaKitUrl: URL to additional marketing and sales materials. 2262 MediaKitUrl string `json:"mediaKitUrl,omitempty"` 2263 2264 // MobileApps: The list of apps represented in this publisher profile. 2265 // Empty if this is a parent profile. 2266 MobileApps []*PublisherProfileMobileApplication `json:"mobileApps,omitempty"` 2267 2268 // Name: Name of the publisher profile. Format: 2269 // `buyers/{buyer}/publisherProfiles/{publisher_profile}` 2270 Name string `json:"name,omitempty"` 2271 2272 // Overview: Overview of the publisher. 2273 Overview string `json:"overview,omitempty"` 2274 2275 // PitchStatement: Statement explaining what's unique about publisher's 2276 // business, and why buyers should partner with the publisher. 2277 PitchStatement string `json:"pitchStatement,omitempty"` 2278 2279 // ProgrammaticDealsContact: Contact information for programmatic deals. 2280 // This is free text entered by the publisher and may include 2281 // information like names, phone numbers and email addresses. 2282 ProgrammaticDealsContact string `json:"programmaticDealsContact,omitempty"` 2283 2284 // PublisherCode: A unique identifying code for the seller. This value 2285 // is the same for all of the seller's parent and child publisher 2286 // profiles. Can be used to filter the response of the 2287 // publisherProfiles.list method. 2288 PublisherCode string `json:"publisherCode,omitempty"` 2289 2290 // SamplePageUrl: URL to a sample content page. 2291 SamplePageUrl string `json:"samplePageUrl,omitempty"` 2292 2293 // TopHeadlines: Up to three key metrics and rankings. For example "#1 2294 // Mobile News Site for 20 Straight Months". 2295 TopHeadlines []string `json:"topHeadlines,omitempty"` 2296 2297 // ServerResponse contains the HTTP response code and headers from the 2298 // server. 2299 googleapi.ServerResponse `json:"-"` 2300 2301 // ForceSendFields is a list of field names (e.g. "AudienceDescription") 2302 // to unconditionally include in API requests. By default, fields with 2303 // empty or default values are omitted from API requests. However, any 2304 // non-pointer, non-interface field appearing in ForceSendFields will be 2305 // sent to the server regardless of whether the field is empty or not. 2306 // This may be used to include empty fields in Patch requests. 2307 ForceSendFields []string `json:"-"` 2308 2309 // NullFields is a list of field names (e.g. "AudienceDescription") to 2310 // include in API requests with the JSON null value. By default, fields 2311 // with empty values are omitted from API requests. However, any field 2312 // with an empty value appearing in NullFields will be sent to the 2313 // server as null. It is an error if a field in this list has a 2314 // non-empty value. This may be used to include null fields in Patch 2315 // requests. 2316 NullFields []string `json:"-"` 2317} 2318 2319func (s *PublisherProfile) MarshalJSON() ([]byte, error) { 2320 type NoMethod PublisherProfile 2321 raw := NoMethod(*s) 2322 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 2323} 2324 2325// PublisherProfileMobileApplication: A mobile application that contains 2326// a external app ID, name, and app store. 2327type PublisherProfileMobileApplication struct { 2328 // AppStore: The app store the app belongs to. Can be used to filter the 2329 // response of the publisherProfiles.list method. 2330 // 2331 // Possible values: 2332 // "APP_STORE_TYPE_UNSPECIFIED" - A placeholder for an unknown app 2333 // store. 2334 // "APPLE_ITUNES" - Apple iTunes 2335 // "GOOGLE_PLAY" - Google Play 2336 // "ROKU" - Roku 2337 // "AMAZON_FIRE_TV" - Amazon Fire TV 2338 // "PLAYSTATION" - PlayStation 2339 // "XBOX" - Xbox 2340 // "SAMSUNG_TV" - Samsung TV 2341 // "AMAZON" - Amazon Appstore 2342 // "OPPO" - OPPO App Market 2343 // "SAMSUNG" - Samsung Galaxy Store 2344 // "VIVO" - VIVO App Store 2345 // "XIAOMI" - Xiaomi GetApps 2346 AppStore string `json:"appStore,omitempty"` 2347 2348 // ExternalAppId: The external ID for the app from its app store. Can be 2349 // used to filter the response of the publisherProfiles.list method. 2350 ExternalAppId string `json:"externalAppId,omitempty"` 2351 2352 // Name: The name of the app. 2353 Name string `json:"name,omitempty"` 2354 2355 // ForceSendFields is a list of field names (e.g. "AppStore") to 2356 // unconditionally include in API requests. By default, fields with 2357 // empty or default values are omitted from API requests. However, any 2358 // non-pointer, non-interface field appearing in ForceSendFields will be 2359 // sent to the server regardless of whether the field is empty or not. 2360 // This may be used to include empty fields in Patch requests. 2361 ForceSendFields []string `json:"-"` 2362 2363 // NullFields is a list of field names (e.g. "AppStore") to include in 2364 // API requests with the JSON null value. By default, fields with empty 2365 // values are omitted from API requests. However, any field with an 2366 // empty value appearing in NullFields will be sent to the server as 2367 // null. It is an error if a field in this list has a non-empty value. 2368 // This may be used to include null fields in Patch requests. 2369 NullFields []string `json:"-"` 2370} 2371 2372func (s *PublisherProfileMobileApplication) MarshalJSON() ([]byte, error) { 2373 type NoMethod PublisherProfileMobileApplication 2374 raw := NoMethod(*s) 2375 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 2376} 2377 2378// ResumeFinalizedDealRequest: Request message for resuming a finalized 2379// deal. 2380type ResumeFinalizedDealRequest struct { 2381} 2382 2383// RtbMetrics: Real-time bidding metrics. For what each metric means 2384// refer to Report metrics 2385// (https://support.google.com/adxbuyer/answer/6115195#report-metrics) 2386type RtbMetrics struct { 2387 // AdImpressions7Days: Ad impressions in last 7 days. 2388 AdImpressions7Days int64 `json:"adImpressions7Days,omitempty,string"` 2389 2390 // BidRate7Days: Bid rate in last 7 days, calculated by (bids / bid 2391 // requests). 2392 BidRate7Days float64 `json:"bidRate7Days,omitempty"` 2393 2394 // BidRequests7Days: Bid requests in last 7 days. 2395 BidRequests7Days int64 `json:"bidRequests7Days,omitempty,string"` 2396 2397 // Bids7Days: Bids in last 7 days. 2398 Bids7Days int64 `json:"bids7Days,omitempty,string"` 2399 2400 // FilteredBidRate7Days: Filtered bid rate in last 7 days, calculated by 2401 // (filtered bids / bids). 2402 FilteredBidRate7Days float64 `json:"filteredBidRate7Days,omitempty"` 2403 2404 // MustBidRateCurrentMonth: Must bid rate for current month. 2405 MustBidRateCurrentMonth float64 `json:"mustBidRateCurrentMonth,omitempty"` 2406 2407 // ForceSendFields is a list of field names (e.g. "AdImpressions7Days") 2408 // to unconditionally include in API requests. By default, fields with 2409 // empty or default values are omitted from API requests. However, any 2410 // non-pointer, non-interface field appearing in ForceSendFields will be 2411 // sent to the server regardless of whether the field is empty or not. 2412 // This may be used to include empty fields in Patch requests. 2413 ForceSendFields []string `json:"-"` 2414 2415 // NullFields is a list of field names (e.g. "AdImpressions7Days") to 2416 // include in API requests with the JSON null value. By default, fields 2417 // with empty values are omitted from API requests. However, any field 2418 // with an empty value appearing in NullFields will be sent to the 2419 // server as null. It is an error if a field in this list has a 2420 // non-empty value. This may be used to include null fields in Patch 2421 // requests. 2422 NullFields []string `json:"-"` 2423} 2424 2425func (s *RtbMetrics) MarshalJSON() ([]byte, error) { 2426 type NoMethod RtbMetrics 2427 raw := NoMethod(*s) 2428 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 2429} 2430 2431func (s *RtbMetrics) UnmarshalJSON(data []byte) error { 2432 type NoMethod RtbMetrics 2433 var s1 struct { 2434 BidRate7Days gensupport.JSONFloat64 `json:"bidRate7Days"` 2435 FilteredBidRate7Days gensupport.JSONFloat64 `json:"filteredBidRate7Days"` 2436 MustBidRateCurrentMonth gensupport.JSONFloat64 `json:"mustBidRateCurrentMonth"` 2437 *NoMethod 2438 } 2439 s1.NoMethod = (*NoMethod)(s) 2440 if err := json.Unmarshal(data, &s1); err != nil { 2441 return err 2442 } 2443 s.BidRate7Days = float64(s1.BidRate7Days) 2444 s.FilteredBidRate7Days = float64(s1.FilteredBidRate7Days) 2445 s.MustBidRateCurrentMonth = float64(s1.MustBidRateCurrentMonth) 2446 return nil 2447} 2448 2449// SendRfpRequest: Request to send an RFP. All fields in this request 2450// are proposed to publisher and subject to changes by publisher during 2451// later negotiation. 2452type SendRfpRequest struct { 2453 // BuyerContacts: Contact information for the buyer. 2454 BuyerContacts []*Contact `json:"buyerContacts,omitempty"` 2455 2456 // Client: If the current buyer is sending the RFP on behalf of its 2457 // client, use this field to specify the name of the client in the 2458 // format: `buyers/{accountId}/clients/{clientAccountid}`. 2459 Client string `json:"client,omitempty"` 2460 2461 // DisplayName: Required. The display name of the proposal being created 2462 // by this RFP. 2463 DisplayName string `json:"displayName,omitempty"` 2464 2465 // EstimatedGrossSpend: Specified by buyers in request for proposal 2466 // (RFP) to notify publisher the total estimated spend for the proposal. 2467 // Publishers will receive this information and send back proposed deals 2468 // accordingly. 2469 EstimatedGrossSpend *Money `json:"estimatedGrossSpend,omitempty"` 2470 2471 // FlightEndTime: Required. Proposed flight end time of the RFP. A 2472 // timestamp in RFC3339 UTC "Zulu" format. Note that the specified value 2473 // will be truncated to a granularity of one second. 2474 FlightEndTime string `json:"flightEndTime,omitempty"` 2475 2476 // FlightStartTime: Required. Proposed flight start time of the RFP. A 2477 // timestamp in RFC3339 UTC "Zulu" format. Note that the specified value 2478 // will be truncated to a granularity of one second. 2479 FlightStartTime string `json:"flightStartTime,omitempty"` 2480 2481 // GeoTargeting: Geo criteria IDs to be targeted. Refer to Geo tables. 2482 GeoTargeting *CriteriaTargeting `json:"geoTargeting,omitempty"` 2483 2484 // InventorySizeTargeting: Inventory sizes to be targeted. 2485 InventorySizeTargeting *InventorySizeTargeting `json:"inventorySizeTargeting,omitempty"` 2486 2487 // Note: A message that is sent to the publisher. Maximum length is 1024 2488 // characters. 2489 Note string `json:"note,omitempty"` 2490 2491 // PreferredDealTerms: The terms for preferred deals. 2492 PreferredDealTerms *PreferredDealTerms `json:"preferredDealTerms,omitempty"` 2493 2494 // ProgrammaticGuaranteedTerms: The terms for programmatic guaranteed 2495 // deals. 2496 ProgrammaticGuaranteedTerms *ProgrammaticGuaranteedTerms `json:"programmaticGuaranteedTerms,omitempty"` 2497 2498 // PublisherProfile: Required. The profile of the publisher who will 2499 // receive this RFP in the format: 2500 // `buyers/{accountId}/publisherProfiles/{publisherProfileId}`. 2501 PublisherProfile string `json:"publisherProfile,omitempty"` 2502 2503 // ForceSendFields is a list of field names (e.g. "BuyerContacts") to 2504 // unconditionally include in API requests. By default, fields with 2505 // empty or default values are omitted from API requests. However, any 2506 // non-pointer, non-interface field appearing in ForceSendFields will be 2507 // sent to the server regardless of whether the field is empty or not. 2508 // This may be used to include empty fields in Patch requests. 2509 ForceSendFields []string `json:"-"` 2510 2511 // NullFields is a list of field names (e.g. "BuyerContacts") to include 2512 // in API requests with the JSON null value. By default, fields with 2513 // empty values are omitted from API requests. However, any field with 2514 // an empty value appearing in NullFields will be sent to the server as 2515 // null. It is an error if a field in this list has a non-empty value. 2516 // This may be used to include null fields in Patch requests. 2517 NullFields []string `json:"-"` 2518} 2519 2520func (s *SendRfpRequest) MarshalJSON() ([]byte, error) { 2521 type NoMethod SendRfpRequest 2522 raw := NoMethod(*s) 2523 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 2524} 2525 2526// SetReadyToServeRequest: Request message for setting ready to serve 2527// for a finalized deal. 2528type SetReadyToServeRequest struct { 2529} 2530 2531// SubscribeAuctionPackageRequest: Request message for 2532// SubscribeAuctionPackage. 2533type SubscribeAuctionPackageRequest struct { 2534} 2535 2536// SubscribeClientsRequest: Request message for 2537// SubscribeAuctionPackageClients. 2538type SubscribeClientsRequest struct { 2539 // Clients: Optional. A list of client buyers to subscribe to the 2540 // auction package, with client buyer in the format 2541 // `buyers/{accountId}/clients/{clientAccountId}`. The current buyer 2542 // will be subscribed to the auction package regardless of the list 2543 // contents if not already. 2544 Clients []string `json:"clients,omitempty"` 2545 2546 // ForceSendFields is a list of field names (e.g. "Clients") to 2547 // unconditionally include in API requests. By default, fields with 2548 // empty or default values are omitted from API requests. However, any 2549 // non-pointer, non-interface field appearing in ForceSendFields will be 2550 // sent to the server regardless of whether the field is empty or not. 2551 // This may be used to include empty fields in Patch requests. 2552 ForceSendFields []string `json:"-"` 2553 2554 // NullFields is a list of field names (e.g. "Clients") to include in 2555 // API requests with the JSON null value. By default, fields with empty 2556 // values are omitted from API requests. However, any field with an 2557 // empty value appearing in NullFields will be sent to the server as 2558 // null. It is an error if a field in this list has a non-empty value. 2559 // This may be used to include null fields in Patch requests. 2560 NullFields []string `json:"-"` 2561} 2562 2563func (s *SubscribeClientsRequest) MarshalJSON() ([]byte, error) { 2564 type NoMethod SubscribeClientsRequest 2565 raw := NoMethod(*s) 2566 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 2567} 2568 2569// TechnologyTargeting: Represents targeting about various types of 2570// technology. 2571type TechnologyTargeting struct { 2572 // DeviceCapabilityTargeting: IDs of device capabilities to be 2573 // included/excluded. 2574 DeviceCapabilityTargeting *CriteriaTargeting `json:"deviceCapabilityTargeting,omitempty"` 2575 2576 // DeviceCategoryTargeting: IDs of device categories to be 2577 // included/excluded. 2578 DeviceCategoryTargeting *CriteriaTargeting `json:"deviceCategoryTargeting,omitempty"` 2579 2580 // OperatingSystemTargeting: Operating system related targeting 2581 // information. 2582 OperatingSystemTargeting *OperatingSystemTargeting `json:"operatingSystemTargeting,omitempty"` 2583 2584 // ForceSendFields is a list of field names (e.g. 2585 // "DeviceCapabilityTargeting") to unconditionally include in API 2586 // requests. By default, fields with empty or default values are omitted 2587 // from API requests. However, any non-pointer, non-interface field 2588 // appearing in ForceSendFields will be sent to the server regardless of 2589 // whether the field is empty or not. This may be used to include empty 2590 // fields in Patch requests. 2591 ForceSendFields []string `json:"-"` 2592 2593 // NullFields is a list of field names (e.g. 2594 // "DeviceCapabilityTargeting") to include in API requests with the JSON 2595 // null value. By default, fields with empty values are omitted from API 2596 // requests. However, any field with an empty value appearing in 2597 // NullFields will be sent to the server as null. It is an error if a 2598 // field in this list has a non-empty value. This may be used to include 2599 // null fields in Patch requests. 2600 NullFields []string `json:"-"` 2601} 2602 2603func (s *TechnologyTargeting) MarshalJSON() ([]byte, error) { 2604 type NoMethod TechnologyTargeting 2605 raw := NoMethod(*s) 2606 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 2607} 2608 2609// TimeOfDay: Represents a time of day. The date and time zone are 2610// either not significant or are specified elsewhere. An API may choose 2611// to allow leap seconds. Related types are google.type.Date and 2612// `google.protobuf.Timestamp`. 2613type TimeOfDay struct { 2614 // Hours: Hours of day in 24 hour format. Should be from 0 to 23. An API 2615 // may choose to allow the value "24:00:00" for scenarios like business 2616 // closing time. 2617 Hours int64 `json:"hours,omitempty"` 2618 2619 // Minutes: Minutes of hour of day. Must be from 0 to 59. 2620 Minutes int64 `json:"minutes,omitempty"` 2621 2622 // Nanos: Fractions of seconds in nanoseconds. Must be from 0 to 2623 // 999,999,999. 2624 Nanos int64 `json:"nanos,omitempty"` 2625 2626 // Seconds: Seconds of minutes of the time. Must normally be from 0 to 2627 // 59. An API may allow the value 60 if it allows leap-seconds. 2628 Seconds int64 `json:"seconds,omitempty"` 2629 2630 // ForceSendFields is a list of field names (e.g. "Hours") to 2631 // unconditionally include in API requests. By default, fields with 2632 // empty or default values are omitted from API requests. However, any 2633 // non-pointer, non-interface field appearing in ForceSendFields will be 2634 // sent to the server regardless of whether the field is empty or not. 2635 // This may be used to include empty fields in Patch requests. 2636 ForceSendFields []string `json:"-"` 2637 2638 // NullFields is a list of field names (e.g. "Hours") to include in API 2639 // requests with the JSON null value. By default, fields with empty 2640 // values are omitted from API requests. However, any field with an 2641 // empty value appearing in NullFields will be sent to the server as 2642 // null. It is an error if a field in this list has a non-empty value. 2643 // This may be used to include null fields in Patch requests. 2644 NullFields []string `json:"-"` 2645} 2646 2647func (s *TimeOfDay) MarshalJSON() ([]byte, error) { 2648 type NoMethod TimeOfDay 2649 raw := NoMethod(*s) 2650 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 2651} 2652 2653// TimeZone: Represents a time zone from the IANA Time Zone Database 2654// (https://www.iana.org/time-zones). 2655type TimeZone struct { 2656 // Id: IANA Time Zone Database time zone, e.g. "America/New_York". 2657 Id string `json:"id,omitempty"` 2658 2659 // Version: Optional. IANA Time Zone Database version number, e.g. 2660 // "2019a". 2661 Version string `json:"version,omitempty"` 2662 2663 // ForceSendFields is a list of field names (e.g. "Id") to 2664 // unconditionally include in API requests. By default, fields with 2665 // empty or default values are omitted from API requests. However, any 2666 // non-pointer, non-interface field appearing in ForceSendFields will be 2667 // sent to the server regardless of whether the field is empty or not. 2668 // This may be used to include empty fields in Patch requests. 2669 ForceSendFields []string `json:"-"` 2670 2671 // NullFields is a list of field names (e.g. "Id") to include in API 2672 // requests with the JSON null value. By default, fields with empty 2673 // values are omitted from API requests. However, any field with an 2674 // empty value appearing in NullFields will be sent to the server as 2675 // null. It is an error if a field in this list has a non-empty value. 2676 // This may be used to include null fields in Patch requests. 2677 NullFields []string `json:"-"` 2678} 2679 2680func (s *TimeZone) MarshalJSON() ([]byte, error) { 2681 type NoMethod TimeZone 2682 raw := NoMethod(*s) 2683 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 2684} 2685 2686// UnsubscribeAuctionPackageRequest: Request message for 2687// UnsubscribeAuctionPackage. 2688type UnsubscribeAuctionPackageRequest struct { 2689} 2690 2691// UnsubscribeClientsRequest: Request message for 2692// UnsubscribeAuctionPackage. 2693type UnsubscribeClientsRequest struct { 2694 // Clients: Optional. A list of client buyers to unsubscribe from the 2695 // auction package, with client buyer in the format 2696 // `buyers/{accountId}/clients/{clientAccountId}`. 2697 Clients []string `json:"clients,omitempty"` 2698 2699 // ForceSendFields is a list of field names (e.g. "Clients") to 2700 // unconditionally include in API requests. By default, fields with 2701 // empty or default values are omitted from API requests. However, any 2702 // non-pointer, non-interface field appearing in ForceSendFields will be 2703 // sent to the server regardless of whether the field is empty or not. 2704 // This may be used to include empty fields in Patch requests. 2705 ForceSendFields []string `json:"-"` 2706 2707 // NullFields is a list of field names (e.g. "Clients") to include in 2708 // API requests with the JSON null value. By default, fields with empty 2709 // values are omitted from API requests. However, any field with an 2710 // empty value appearing in NullFields will be sent to the server as 2711 // null. It is an error if a field in this list has a non-empty value. 2712 // This may be used to include null fields in Patch requests. 2713 NullFields []string `json:"-"` 2714} 2715 2716func (s *UnsubscribeClientsRequest) MarshalJSON() ([]byte, error) { 2717 type NoMethod UnsubscribeClientsRequest 2718 raw := NoMethod(*s) 2719 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 2720} 2721 2722// UpdateDealRequest: Request message for updating the deal at the given 2723// revision number. 2724type UpdateDealRequest struct { 2725 // Deal: Required. The deal to update. The deal's `name` field is used 2726 // to identify the deal to be updated. Note: proposal_revision will have 2727 // to be provided within the resource or else an error will be thrown. 2728 // Format: buyers/{accountId}/proposals/{proposalId}/deals/{dealId} 2729 Deal *Deal `json:"deal,omitempty"` 2730 2731 // UpdateMask: List of fields to be updated. If empty or unspecified, 2732 // the service will update all fields populated in the update request 2733 // excluding the output only fields and primitive fields with default 2734 // value. Note that explicit field mask is required in order to reset a 2735 // primitive field back to its default value, e.g. false for boolean 2736 // fields, 0 for integer fields. A special field mask consisting of a 2737 // single path "*" can be used to indicate full replacement(the 2738 // equivalent of PUT method), updatable fields unset or unspecified in 2739 // the input will be cleared or set to default value. Output only fields 2740 // will be ignored regardless of the value of updateMask. 2741 UpdateMask string `json:"updateMask,omitempty"` 2742 2743 // ForceSendFields is a list of field names (e.g. "Deal") to 2744 // unconditionally include in API requests. By default, fields with 2745 // empty or default values are omitted from API requests. However, any 2746 // non-pointer, non-interface field appearing in ForceSendFields will be 2747 // sent to the server regardless of whether the field is empty or not. 2748 // This may be used to include empty fields in Patch requests. 2749 ForceSendFields []string `json:"-"` 2750 2751 // NullFields is a list of field names (e.g. "Deal") to include in API 2752 // requests with the JSON null value. By default, fields with empty 2753 // values are omitted from API requests. However, any field with an 2754 // empty value appearing in NullFields will be sent to the server as 2755 // null. It is an error if a field in this list has a non-empty value. 2756 // This may be used to include null fields in Patch requests. 2757 NullFields []string `json:"-"` 2758} 2759 2760func (s *UpdateDealRequest) MarshalJSON() ([]byte, error) { 2761 type NoMethod UpdateDealRequest 2762 raw := NoMethod(*s) 2763 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 2764} 2765 2766// UriTargeting: Represents a list of targeted and excluded URLs (e.g., 2767// google.com). For Private Auction Deals, URLs are either included or 2768// excluded. For Programmatic Guaranteed and Preferred Deals, this 2769// doesn't apply. 2770type UriTargeting struct { 2771 // ExcludedUris: A list of URLs to be excluded. 2772 ExcludedUris []string `json:"excludedUris,omitempty"` 2773 2774 // TargetedUris: A list of URLs to be included. 2775 TargetedUris []string `json:"targetedUris,omitempty"` 2776 2777 // ForceSendFields is a list of field names (e.g. "ExcludedUris") to 2778 // unconditionally include in API requests. By default, fields with 2779 // empty or default values are omitted from API requests. However, any 2780 // non-pointer, non-interface field appearing in ForceSendFields will be 2781 // sent to the server regardless of whether the field is empty or not. 2782 // This may be used to include empty fields in Patch requests. 2783 ForceSendFields []string `json:"-"` 2784 2785 // NullFields is a list of field names (e.g. "ExcludedUris") to include 2786 // in API requests with the JSON null value. By default, fields with 2787 // empty values are omitted from API requests. However, any field with 2788 // an empty value appearing in NullFields will be sent to the server as 2789 // null. It is an error if a field in this list has a non-empty value. 2790 // This may be used to include null fields in Patch requests. 2791 NullFields []string `json:"-"` 2792} 2793 2794func (s *UriTargeting) MarshalJSON() ([]byte, error) { 2795 type NoMethod UriTargeting 2796 raw := NoMethod(*s) 2797 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 2798} 2799 2800// VideoTargeting: Represents targeting information about video. 2801type VideoTargeting struct { 2802 // ExcludedPositionTypes: A list of video positions to be excluded. When 2803 // this field is populated, the targeted_position_types field must be 2804 // empty. 2805 // 2806 // Possible values: 2807 // "POSITION_TYPE_UNSPECIFIED" - A placeholder for an undefined video 2808 // position. 2809 // "PREROLL" - Ad is played before the video. 2810 // "MIDROLL" - Ad is played during the video. 2811 // "POSTROLL" - Ad is played after the video. 2812 ExcludedPositionTypes []string `json:"excludedPositionTypes,omitempty"` 2813 2814 // TargetedPositionTypes: A list of video positions to be included. When 2815 // this field is populated, the excluded_position_types field must be 2816 // empty. 2817 // 2818 // Possible values: 2819 // "POSITION_TYPE_UNSPECIFIED" - A placeholder for an undefined video 2820 // position. 2821 // "PREROLL" - Ad is played before the video. 2822 // "MIDROLL" - Ad is played during the video. 2823 // "POSTROLL" - Ad is played after the video. 2824 TargetedPositionTypes []string `json:"targetedPositionTypes,omitempty"` 2825 2826 // ForceSendFields is a list of field names (e.g. 2827 // "ExcludedPositionTypes") to unconditionally include in API requests. 2828 // By default, fields with empty or default values are omitted from API 2829 // requests. However, any non-pointer, non-interface field appearing in 2830 // ForceSendFields will be sent to the server regardless of whether the 2831 // field is empty or not. This may be used to include empty fields in 2832 // Patch requests. 2833 ForceSendFields []string `json:"-"` 2834 2835 // NullFields is a list of field names (e.g. "ExcludedPositionTypes") to 2836 // include in API requests with the JSON null value. By default, fields 2837 // with empty values are omitted from API requests. However, any field 2838 // with an empty value appearing in NullFields will be sent to the 2839 // server as null. It is an error if a field in this list has a 2840 // non-empty value. This may be used to include null fields in Patch 2841 // requests. 2842 NullFields []string `json:"-"` 2843} 2844 2845func (s *VideoTargeting) MarshalJSON() ([]byte, error) { 2846 type NoMethod VideoTargeting 2847 raw := NoMethod(*s) 2848 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 2849} 2850 2851// method id "authorizedbuyersmarketplace.bidders.finalizedDeals.list": 2852 2853type BiddersFinalizedDealsListCall struct { 2854 s *Service 2855 parent string 2856 urlParams_ gensupport.URLParams 2857 ifNoneMatch_ string 2858 ctx_ context.Context 2859 header_ http.Header 2860} 2861 2862// List: Lists finalized deals. Use the URL path 2863// "/v1/buyers/{accountId}/finalizedDeals" to list finalized deals for 2864// the current buyer and its clients. Bidders can use the URL path 2865// "/v1/bidders/{accountId}/finalizedDeals" to list finalized deals for 2866// the bidder, its buyers and all their clients. 2867// 2868// - parent: The buyer to list the finalized deals for, in the format: 2869// `buyers/{accountId}`. When used to list finalized deals for a 2870// bidder, its buyers and clients, in the format 2871// `bidders/{accountId}`. 2872func (r *BiddersFinalizedDealsService) List(parent string) *BiddersFinalizedDealsListCall { 2873 c := &BiddersFinalizedDealsListCall{s: r.s, urlParams_: make(gensupport.URLParams)} 2874 c.parent = parent 2875 return c 2876} 2877 2878// Filter sets the optional parameter "filter": Optional query string 2879// using the Cloud API list filtering syntax 2880// (https://developers.google.com/authorized-buyers/apis/guides/v2/list-filters) 2881// Supported columns for filtering are: * deal.displayName * 2882// deal.dealType * deal.createTime * deal.updateTime * 2883// deal.flightStartTime * deal.flightEndTime * dealServingStatus 2884func (c *BiddersFinalizedDealsListCall) Filter(filter string) *BiddersFinalizedDealsListCall { 2885 c.urlParams_.Set("filter", filter) 2886 return c 2887} 2888 2889// OrderBy sets the optional parameter "orderBy": An optional query 2890// string to sort finalized deals using the Cloud API sorting syntax 2891// (https://cloud.google.com/apis/design/design_patterns#sorting_order). 2892// If no sort order is specified, results will be returned in an 2893// arbitrary order. Supported columns for sorting are: * 2894// deal.displayName * deal.createTime * deal.updateTime * 2895// deal.flightStartTime * deal.flightEndTime * 2896// rtbMetrics.bidRequests7Days * rtbMetrics.bids7Days * 2897// rtbMetrics.adImpressions7Days * rtbMetrics.bidRate7Days * 2898// rtbMetrics.filteredBidRate7Days * rtbMetrics.mustBidRateCurrentMonth 2899// Example: 'deal.displayName, deal.updateTime desc' 2900func (c *BiddersFinalizedDealsListCall) OrderBy(orderBy string) *BiddersFinalizedDealsListCall { 2901 c.urlParams_.Set("orderBy", orderBy) 2902 return c 2903} 2904 2905// PageSize sets the optional parameter "pageSize": Requested page size. 2906// The server may return fewer results than requested. If requested more 2907// than 500, the server will return 500 results per page. If 2908// unspecified, the server will pick a default page size of 100. 2909func (c *BiddersFinalizedDealsListCall) PageSize(pageSize int64) *BiddersFinalizedDealsListCall { 2910 c.urlParams_.Set("pageSize", fmt.Sprint(pageSize)) 2911 return c 2912} 2913 2914// PageToken sets the optional parameter "pageToken": The page token as 2915// returned from ListFinalizedDealsResponse. 2916func (c *BiddersFinalizedDealsListCall) PageToken(pageToken string) *BiddersFinalizedDealsListCall { 2917 c.urlParams_.Set("pageToken", pageToken) 2918 return c 2919} 2920 2921// Fields allows partial responses to be retrieved. See 2922// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse 2923// for more information. 2924func (c *BiddersFinalizedDealsListCall) Fields(s ...googleapi.Field) *BiddersFinalizedDealsListCall { 2925 c.urlParams_.Set("fields", googleapi.CombineFields(s)) 2926 return c 2927} 2928 2929// IfNoneMatch sets the optional parameter which makes the operation 2930// fail if the object's ETag matches the given value. This is useful for 2931// getting updates only after the object has changed since the last 2932// request. Use googleapi.IsNotModified to check whether the response 2933// error from Do is the result of In-None-Match. 2934func (c *BiddersFinalizedDealsListCall) IfNoneMatch(entityTag string) *BiddersFinalizedDealsListCall { 2935 c.ifNoneMatch_ = entityTag 2936 return c 2937} 2938 2939// Context sets the context to be used in this call's Do method. Any 2940// pending HTTP request will be aborted if the provided context is 2941// canceled. 2942func (c *BiddersFinalizedDealsListCall) Context(ctx context.Context) *BiddersFinalizedDealsListCall { 2943 c.ctx_ = ctx 2944 return c 2945} 2946 2947// Header returns an http.Header that can be modified by the caller to 2948// add HTTP headers to the request. 2949func (c *BiddersFinalizedDealsListCall) Header() http.Header { 2950 if c.header_ == nil { 2951 c.header_ = make(http.Header) 2952 } 2953 return c.header_ 2954} 2955 2956func (c *BiddersFinalizedDealsListCall) doRequest(alt string) (*http.Response, error) { 2957 reqHeaders := make(http.Header) 2958 reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/20211027") 2959 for k, v := range c.header_ { 2960 reqHeaders[k] = v 2961 } 2962 reqHeaders.Set("User-Agent", c.s.userAgent()) 2963 if c.ifNoneMatch_ != "" { 2964 reqHeaders.Set("If-None-Match", c.ifNoneMatch_) 2965 } 2966 var body io.Reader = nil 2967 c.urlParams_.Set("alt", alt) 2968 c.urlParams_.Set("prettyPrint", "false") 2969 urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+parent}/finalizedDeals") 2970 urls += "?" + c.urlParams_.Encode() 2971 req, err := http.NewRequest("GET", urls, body) 2972 if err != nil { 2973 return nil, err 2974 } 2975 req.Header = reqHeaders 2976 googleapi.Expand(req.URL, map[string]string{ 2977 "parent": c.parent, 2978 }) 2979 return gensupport.SendRequest(c.ctx_, c.s.client, req) 2980} 2981 2982// Do executes the "authorizedbuyersmarketplace.bidders.finalizedDeals.list" call. 2983// Exactly one of *ListFinalizedDealsResponse or error will be non-nil. 2984// Any non-2xx status code is an error. Response headers are in either 2985// *ListFinalizedDealsResponse.ServerResponse.Header or (if a response 2986// was returned at all) in error.(*googleapi.Error).Header. Use 2987// googleapi.IsNotModified to check whether the returned error was 2988// because http.StatusNotModified was returned. 2989func (c *BiddersFinalizedDealsListCall) Do(opts ...googleapi.CallOption) (*ListFinalizedDealsResponse, error) { 2990 gensupport.SetOptions(c.urlParams_, opts...) 2991 res, err := c.doRequest("json") 2992 if res != nil && res.StatusCode == http.StatusNotModified { 2993 if res.Body != nil { 2994 res.Body.Close() 2995 } 2996 return nil, &googleapi.Error{ 2997 Code: res.StatusCode, 2998 Header: res.Header, 2999 } 3000 } 3001 if err != nil { 3002 return nil, err 3003 } 3004 defer googleapi.CloseBody(res) 3005 if err := googleapi.CheckResponse(res); err != nil { 3006 return nil, err 3007 } 3008 ret := &ListFinalizedDealsResponse{ 3009 ServerResponse: googleapi.ServerResponse{ 3010 Header: res.Header, 3011 HTTPStatusCode: res.StatusCode, 3012 }, 3013 } 3014 target := &ret 3015 if err := gensupport.DecodeResponse(target, res); err != nil { 3016 return nil, err 3017 } 3018 return ret, nil 3019 // { 3020 // "description": "Lists finalized deals. Use the URL path \"/v1/buyers/{accountId}/finalizedDeals\" to list finalized deals for the current buyer and its clients. Bidders can use the URL path \"/v1/bidders/{accountId}/finalizedDeals\" to list finalized deals for the bidder, its buyers and all their clients.", 3021 // "flatPath": "v1/bidders/{biddersId}/finalizedDeals", 3022 // "httpMethod": "GET", 3023 // "id": "authorizedbuyersmarketplace.bidders.finalizedDeals.list", 3024 // "parameterOrder": [ 3025 // "parent" 3026 // ], 3027 // "parameters": { 3028 // "filter": { 3029 // "description": "Optional query string using the [Cloud API list filtering syntax](https://developers.google.com/authorized-buyers/apis/guides/v2/list-filters) Supported columns for filtering are: * deal.displayName * deal.dealType * deal.createTime * deal.updateTime * deal.flightStartTime * deal.flightEndTime * dealServingStatus", 3030 // "location": "query", 3031 // "type": "string" 3032 // }, 3033 // "orderBy": { 3034 // "description": "An optional query string to sort finalized deals using the [Cloud API sorting syntax](https://cloud.google.com/apis/design/design_patterns#sorting_order). If no sort order is specified, results will be returned in an arbitrary order. Supported columns for sorting are: * deal.displayName * deal.createTime * deal.updateTime * deal.flightStartTime * deal.flightEndTime * rtbMetrics.bidRequests7Days * rtbMetrics.bids7Days * rtbMetrics.adImpressions7Days * rtbMetrics.bidRate7Days * rtbMetrics.filteredBidRate7Days * rtbMetrics.mustBidRateCurrentMonth Example: 'deal.displayName, deal.updateTime desc'", 3035 // "location": "query", 3036 // "type": "string" 3037 // }, 3038 // "pageSize": { 3039 // "description": "Requested page size. The server may return fewer results than requested. If requested more than 500, the server will return 500 results per page. If unspecified, the server will pick a default page size of 100.", 3040 // "format": "int32", 3041 // "location": "query", 3042 // "type": "integer" 3043 // }, 3044 // "pageToken": { 3045 // "description": "The page token as returned from ListFinalizedDealsResponse.", 3046 // "location": "query", 3047 // "type": "string" 3048 // }, 3049 // "parent": { 3050 // "description": "Required. The buyer to list the finalized deals for, in the format: `buyers/{accountId}`. When used to list finalized deals for a bidder, its buyers and clients, in the format `bidders/{accountId}`.", 3051 // "location": "path", 3052 // "pattern": "^bidders/[^/]+$", 3053 // "required": true, 3054 // "type": "string" 3055 // } 3056 // }, 3057 // "path": "v1/{+parent}/finalizedDeals", 3058 // "response": { 3059 // "$ref": "ListFinalizedDealsResponse" 3060 // }, 3061 // "scopes": [ 3062 // "https://www.googleapis.com/auth/authorized-buyers-marketplace" 3063 // ] 3064 // } 3065 3066} 3067 3068// Pages invokes f for each page of results. 3069// A non-nil error returned from f will halt the iteration. 3070// The provided context supersedes any context provided to the Context method. 3071func (c *BiddersFinalizedDealsListCall) Pages(ctx context.Context, f func(*ListFinalizedDealsResponse) error) error { 3072 c.ctx_ = ctx 3073 defer c.PageToken(c.urlParams_.Get("pageToken")) // reset paging to original point 3074 for { 3075 x, err := c.Do() 3076 if err != nil { 3077 return err 3078 } 3079 if err := f(x); err != nil { 3080 return err 3081 } 3082 if x.NextPageToken == "" { 3083 return nil 3084 } 3085 c.PageToken(x.NextPageToken) 3086 } 3087} 3088 3089// method id "authorizedbuyersmarketplace.buyers.auctionPackages.get": 3090 3091type BuyersAuctionPackagesGetCall struct { 3092 s *Service 3093 name string 3094 urlParams_ gensupport.URLParams 3095 ifNoneMatch_ string 3096 ctx_ context.Context 3097 header_ http.Header 3098} 3099 3100// Get: Gets an auction package given its name. 3101// 3102// - name: Name of auction package to get. Format: 3103// `buyers/{accountId}/auctionPackages/{auctionPackageId}`. 3104func (r *BuyersAuctionPackagesService) Get(name string) *BuyersAuctionPackagesGetCall { 3105 c := &BuyersAuctionPackagesGetCall{s: r.s, urlParams_: make(gensupport.URLParams)} 3106 c.name = name 3107 return c 3108} 3109 3110// Fields allows partial responses to be retrieved. See 3111// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse 3112// for more information. 3113func (c *BuyersAuctionPackagesGetCall) Fields(s ...googleapi.Field) *BuyersAuctionPackagesGetCall { 3114 c.urlParams_.Set("fields", googleapi.CombineFields(s)) 3115 return c 3116} 3117 3118// IfNoneMatch sets the optional parameter which makes the operation 3119// fail if the object's ETag matches the given value. This is useful for 3120// getting updates only after the object has changed since the last 3121// request. Use googleapi.IsNotModified to check whether the response 3122// error from Do is the result of In-None-Match. 3123func (c *BuyersAuctionPackagesGetCall) IfNoneMatch(entityTag string) *BuyersAuctionPackagesGetCall { 3124 c.ifNoneMatch_ = entityTag 3125 return c 3126} 3127 3128// Context sets the context to be used in this call's Do method. Any 3129// pending HTTP request will be aborted if the provided context is 3130// canceled. 3131func (c *BuyersAuctionPackagesGetCall) Context(ctx context.Context) *BuyersAuctionPackagesGetCall { 3132 c.ctx_ = ctx 3133 return c 3134} 3135 3136// Header returns an http.Header that can be modified by the caller to 3137// add HTTP headers to the request. 3138func (c *BuyersAuctionPackagesGetCall) Header() http.Header { 3139 if c.header_ == nil { 3140 c.header_ = make(http.Header) 3141 } 3142 return c.header_ 3143} 3144 3145func (c *BuyersAuctionPackagesGetCall) doRequest(alt string) (*http.Response, error) { 3146 reqHeaders := make(http.Header) 3147 reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/20211027") 3148 for k, v := range c.header_ { 3149 reqHeaders[k] = v 3150 } 3151 reqHeaders.Set("User-Agent", c.s.userAgent()) 3152 if c.ifNoneMatch_ != "" { 3153 reqHeaders.Set("If-None-Match", c.ifNoneMatch_) 3154 } 3155 var body io.Reader = nil 3156 c.urlParams_.Set("alt", alt) 3157 c.urlParams_.Set("prettyPrint", "false") 3158 urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+name}") 3159 urls += "?" + c.urlParams_.Encode() 3160 req, err := http.NewRequest("GET", urls, body) 3161 if err != nil { 3162 return nil, err 3163 } 3164 req.Header = reqHeaders 3165 googleapi.Expand(req.URL, map[string]string{ 3166 "name": c.name, 3167 }) 3168 return gensupport.SendRequest(c.ctx_, c.s.client, req) 3169} 3170 3171// Do executes the "authorizedbuyersmarketplace.buyers.auctionPackages.get" call. 3172// Exactly one of *AuctionPackage or error will be non-nil. Any non-2xx 3173// status code is an error. Response headers are in either 3174// *AuctionPackage.ServerResponse.Header or (if a response was returned 3175// at all) in error.(*googleapi.Error).Header. Use 3176// googleapi.IsNotModified to check whether the returned error was 3177// because http.StatusNotModified was returned. 3178func (c *BuyersAuctionPackagesGetCall) Do(opts ...googleapi.CallOption) (*AuctionPackage, error) { 3179 gensupport.SetOptions(c.urlParams_, opts...) 3180 res, err := c.doRequest("json") 3181 if res != nil && res.StatusCode == http.StatusNotModified { 3182 if res.Body != nil { 3183 res.Body.Close() 3184 } 3185 return nil, &googleapi.Error{ 3186 Code: res.StatusCode, 3187 Header: res.Header, 3188 } 3189 } 3190 if err != nil { 3191 return nil, err 3192 } 3193 defer googleapi.CloseBody(res) 3194 if err := googleapi.CheckResponse(res); err != nil { 3195 return nil, err 3196 } 3197 ret := &AuctionPackage{ 3198 ServerResponse: googleapi.ServerResponse{ 3199 Header: res.Header, 3200 HTTPStatusCode: res.StatusCode, 3201 }, 3202 } 3203 target := &ret 3204 if err := gensupport.DecodeResponse(target, res); err != nil { 3205 return nil, err 3206 } 3207 return ret, nil 3208 // { 3209 // "description": "Gets an auction package given its name.", 3210 // "flatPath": "v1/buyers/{buyersId}/auctionPackages/{auctionPackagesId}", 3211 // "httpMethod": "GET", 3212 // "id": "authorizedbuyersmarketplace.buyers.auctionPackages.get", 3213 // "parameterOrder": [ 3214 // "name" 3215 // ], 3216 // "parameters": { 3217 // "name": { 3218 // "description": "Required. Name of auction package to get. Format: `buyers/{accountId}/auctionPackages/{auctionPackageId}`", 3219 // "location": "path", 3220 // "pattern": "^buyers/[^/]+/auctionPackages/[^/]+$", 3221 // "required": true, 3222 // "type": "string" 3223 // } 3224 // }, 3225 // "path": "v1/{+name}", 3226 // "response": { 3227 // "$ref": "AuctionPackage" 3228 // }, 3229 // "scopes": [ 3230 // "https://www.googleapis.com/auth/authorized-buyers-marketplace" 3231 // ] 3232 // } 3233 3234} 3235 3236// method id "authorizedbuyersmarketplace.buyers.auctionPackages.list": 3237 3238type BuyersAuctionPackagesListCall struct { 3239 s *Service 3240 parent string 3241 urlParams_ gensupport.URLParams 3242 ifNoneMatch_ string 3243 ctx_ context.Context 3244 header_ http.Header 3245} 3246 3247// List: List the auction packages subscribed by a buyer and its 3248// clients. 3249// 3250// - parent: Name of the parent buyer that can access the auction 3251// package. Format: `buyers/{accountId}`. 3252func (r *BuyersAuctionPackagesService) List(parent string) *BuyersAuctionPackagesListCall { 3253 c := &BuyersAuctionPackagesListCall{s: r.s, urlParams_: make(gensupport.URLParams)} 3254 c.parent = parent 3255 return c 3256} 3257 3258// PageSize sets the optional parameter "pageSize": Requested page size. 3259// The server may return fewer results than requested. Max allowed page 3260// size is 500. 3261func (c *BuyersAuctionPackagesListCall) PageSize(pageSize int64) *BuyersAuctionPackagesListCall { 3262 c.urlParams_.Set("pageSize", fmt.Sprint(pageSize)) 3263 return c 3264} 3265 3266// PageToken sets the optional parameter "pageToken": The page token as 3267// returned. ListAuctionPackagesResponse.nextPageToken 3268func (c *BuyersAuctionPackagesListCall) PageToken(pageToken string) *BuyersAuctionPackagesListCall { 3269 c.urlParams_.Set("pageToken", pageToken) 3270 return c 3271} 3272 3273// Fields allows partial responses to be retrieved. See 3274// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse 3275// for more information. 3276func (c *BuyersAuctionPackagesListCall) Fields(s ...googleapi.Field) *BuyersAuctionPackagesListCall { 3277 c.urlParams_.Set("fields", googleapi.CombineFields(s)) 3278 return c 3279} 3280 3281// IfNoneMatch sets the optional parameter which makes the operation 3282// fail if the object's ETag matches the given value. This is useful for 3283// getting updates only after the object has changed since the last 3284// request. Use googleapi.IsNotModified to check whether the response 3285// error from Do is the result of In-None-Match. 3286func (c *BuyersAuctionPackagesListCall) IfNoneMatch(entityTag string) *BuyersAuctionPackagesListCall { 3287 c.ifNoneMatch_ = entityTag 3288 return c 3289} 3290 3291// Context sets the context to be used in this call's Do method. Any 3292// pending HTTP request will be aborted if the provided context is 3293// canceled. 3294func (c *BuyersAuctionPackagesListCall) Context(ctx context.Context) *BuyersAuctionPackagesListCall { 3295 c.ctx_ = ctx 3296 return c 3297} 3298 3299// Header returns an http.Header that can be modified by the caller to 3300// add HTTP headers to the request. 3301func (c *BuyersAuctionPackagesListCall) Header() http.Header { 3302 if c.header_ == nil { 3303 c.header_ = make(http.Header) 3304 } 3305 return c.header_ 3306} 3307 3308func (c *BuyersAuctionPackagesListCall) doRequest(alt string) (*http.Response, error) { 3309 reqHeaders := make(http.Header) 3310 reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/20211027") 3311 for k, v := range c.header_ { 3312 reqHeaders[k] = v 3313 } 3314 reqHeaders.Set("User-Agent", c.s.userAgent()) 3315 if c.ifNoneMatch_ != "" { 3316 reqHeaders.Set("If-None-Match", c.ifNoneMatch_) 3317 } 3318 var body io.Reader = nil 3319 c.urlParams_.Set("alt", alt) 3320 c.urlParams_.Set("prettyPrint", "false") 3321 urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+parent}/auctionPackages") 3322 urls += "?" + c.urlParams_.Encode() 3323 req, err := http.NewRequest("GET", urls, body) 3324 if err != nil { 3325 return nil, err 3326 } 3327 req.Header = reqHeaders 3328 googleapi.Expand(req.URL, map[string]string{ 3329 "parent": c.parent, 3330 }) 3331 return gensupport.SendRequest(c.ctx_, c.s.client, req) 3332} 3333 3334// Do executes the "authorizedbuyersmarketplace.buyers.auctionPackages.list" call. 3335// Exactly one of *ListAuctionPackagesResponse or error will be non-nil. 3336// Any non-2xx status code is an error. Response headers are in either 3337// *ListAuctionPackagesResponse.ServerResponse.Header or (if a response 3338// was returned at all) in error.(*googleapi.Error).Header. Use 3339// googleapi.IsNotModified to check whether the returned error was 3340// because http.StatusNotModified was returned. 3341func (c *BuyersAuctionPackagesListCall) Do(opts ...googleapi.CallOption) (*ListAuctionPackagesResponse, error) { 3342 gensupport.SetOptions(c.urlParams_, opts...) 3343 res, err := c.doRequest("json") 3344 if res != nil && res.StatusCode == http.StatusNotModified { 3345 if res.Body != nil { 3346 res.Body.Close() 3347 } 3348 return nil, &googleapi.Error{ 3349 Code: res.StatusCode, 3350 Header: res.Header, 3351 } 3352 } 3353 if err != nil { 3354 return nil, err 3355 } 3356 defer googleapi.CloseBody(res) 3357 if err := googleapi.CheckResponse(res); err != nil { 3358 return nil, err 3359 } 3360 ret := &ListAuctionPackagesResponse{ 3361 ServerResponse: googleapi.ServerResponse{ 3362 Header: res.Header, 3363 HTTPStatusCode: res.StatusCode, 3364 }, 3365 } 3366 target := &ret 3367 if err := gensupport.DecodeResponse(target, res); err != nil { 3368 return nil, err 3369 } 3370 return ret, nil 3371 // { 3372 // "description": "List the auction packages subscribed by a buyer and its clients.", 3373 // "flatPath": "v1/buyers/{buyersId}/auctionPackages", 3374 // "httpMethod": "GET", 3375 // "id": "authorizedbuyersmarketplace.buyers.auctionPackages.list", 3376 // "parameterOrder": [ 3377 // "parent" 3378 // ], 3379 // "parameters": { 3380 // "pageSize": { 3381 // "description": "Requested page size. The server may return fewer results than requested. Max allowed page size is 500.", 3382 // "format": "int32", 3383 // "location": "query", 3384 // "type": "integer" 3385 // }, 3386 // "pageToken": { 3387 // "description": "The page token as returned. ListAuctionPackagesResponse.nextPageToken", 3388 // "location": "query", 3389 // "type": "string" 3390 // }, 3391 // "parent": { 3392 // "description": "Required. Name of the parent buyer that can access the auction package. Format: `buyers/{accountId}`", 3393 // "location": "path", 3394 // "pattern": "^buyers/[^/]+$", 3395 // "required": true, 3396 // "type": "string" 3397 // } 3398 // }, 3399 // "path": "v1/{+parent}/auctionPackages", 3400 // "response": { 3401 // "$ref": "ListAuctionPackagesResponse" 3402 // }, 3403 // "scopes": [ 3404 // "https://www.googleapis.com/auth/authorized-buyers-marketplace" 3405 // ] 3406 // } 3407 3408} 3409 3410// Pages invokes f for each page of results. 3411// A non-nil error returned from f will halt the iteration. 3412// The provided context supersedes any context provided to the Context method. 3413func (c *BuyersAuctionPackagesListCall) Pages(ctx context.Context, f func(*ListAuctionPackagesResponse) error) error { 3414 c.ctx_ = ctx 3415 defer c.PageToken(c.urlParams_.Get("pageToken")) // reset paging to original point 3416 for { 3417 x, err := c.Do() 3418 if err != nil { 3419 return err 3420 } 3421 if err := f(x); err != nil { 3422 return err 3423 } 3424 if x.NextPageToken == "" { 3425 return nil 3426 } 3427 c.PageToken(x.NextPageToken) 3428 } 3429} 3430 3431// method id "authorizedbuyersmarketplace.buyers.auctionPackages.subscribe": 3432 3433type BuyersAuctionPackagesSubscribeCall struct { 3434 s *Service 3435 name string 3436 subscribeauctionpackagerequest *SubscribeAuctionPackageRequest 3437 urlParams_ gensupport.URLParams 3438 ctx_ context.Context 3439 header_ http.Header 3440} 3441 3442// Subscribe: Subscribe to the auction package for the specified buyer. 3443// Once subscribed, the bidder will receive a call out for inventory 3444// matching the auction package targeting criteria with the auction 3445// package deal ID and the specified buyer. 3446// 3447// - name: Name of the auction package. Format: 3448// `buyers/{accountId}/auctionPackages/{auctionPackageId}`. 3449func (r *BuyersAuctionPackagesService) Subscribe(name string, subscribeauctionpackagerequest *SubscribeAuctionPackageRequest) *BuyersAuctionPackagesSubscribeCall { 3450 c := &BuyersAuctionPackagesSubscribeCall{s: r.s, urlParams_: make(gensupport.URLParams)} 3451 c.name = name 3452 c.subscribeauctionpackagerequest = subscribeauctionpackagerequest 3453 return c 3454} 3455 3456// Fields allows partial responses to be retrieved. See 3457// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse 3458// for more information. 3459func (c *BuyersAuctionPackagesSubscribeCall) Fields(s ...googleapi.Field) *BuyersAuctionPackagesSubscribeCall { 3460 c.urlParams_.Set("fields", googleapi.CombineFields(s)) 3461 return c 3462} 3463 3464// Context sets the context to be used in this call's Do method. Any 3465// pending HTTP request will be aborted if the provided context is 3466// canceled. 3467func (c *BuyersAuctionPackagesSubscribeCall) Context(ctx context.Context) *BuyersAuctionPackagesSubscribeCall { 3468 c.ctx_ = ctx 3469 return c 3470} 3471 3472// Header returns an http.Header that can be modified by the caller to 3473// add HTTP headers to the request. 3474func (c *BuyersAuctionPackagesSubscribeCall) Header() http.Header { 3475 if c.header_ == nil { 3476 c.header_ = make(http.Header) 3477 } 3478 return c.header_ 3479} 3480 3481func (c *BuyersAuctionPackagesSubscribeCall) doRequest(alt string) (*http.Response, error) { 3482 reqHeaders := make(http.Header) 3483 reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/20211027") 3484 for k, v := range c.header_ { 3485 reqHeaders[k] = v 3486 } 3487 reqHeaders.Set("User-Agent", c.s.userAgent()) 3488 var body io.Reader = nil 3489 body, err := googleapi.WithoutDataWrapper.JSONReader(c.subscribeauctionpackagerequest) 3490 if err != nil { 3491 return nil, err 3492 } 3493 reqHeaders.Set("Content-Type", "application/json") 3494 c.urlParams_.Set("alt", alt) 3495 c.urlParams_.Set("prettyPrint", "false") 3496 urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+name}:subscribe") 3497 urls += "?" + c.urlParams_.Encode() 3498 req, err := http.NewRequest("POST", urls, body) 3499 if err != nil { 3500 return nil, err 3501 } 3502 req.Header = reqHeaders 3503 googleapi.Expand(req.URL, map[string]string{ 3504 "name": c.name, 3505 }) 3506 return gensupport.SendRequest(c.ctx_, c.s.client, req) 3507} 3508 3509// Do executes the "authorizedbuyersmarketplace.buyers.auctionPackages.subscribe" call. 3510// Exactly one of *AuctionPackage or error will be non-nil. Any non-2xx 3511// status code is an error. Response headers are in either 3512// *AuctionPackage.ServerResponse.Header or (if a response was returned 3513// at all) in error.(*googleapi.Error).Header. Use 3514// googleapi.IsNotModified to check whether the returned error was 3515// because http.StatusNotModified was returned. 3516func (c *BuyersAuctionPackagesSubscribeCall) Do(opts ...googleapi.CallOption) (*AuctionPackage, error) { 3517 gensupport.SetOptions(c.urlParams_, opts...) 3518 res, err := c.doRequest("json") 3519 if res != nil && res.StatusCode == http.StatusNotModified { 3520 if res.Body != nil { 3521 res.Body.Close() 3522 } 3523 return nil, &googleapi.Error{ 3524 Code: res.StatusCode, 3525 Header: res.Header, 3526 } 3527 } 3528 if err != nil { 3529 return nil, err 3530 } 3531 defer googleapi.CloseBody(res) 3532 if err := googleapi.CheckResponse(res); err != nil { 3533 return nil, err 3534 } 3535 ret := &AuctionPackage{ 3536 ServerResponse: googleapi.ServerResponse{ 3537 Header: res.Header, 3538 HTTPStatusCode: res.StatusCode, 3539 }, 3540 } 3541 target := &ret 3542 if err := gensupport.DecodeResponse(target, res); err != nil { 3543 return nil, err 3544 } 3545 return ret, nil 3546 // { 3547 // "description": "Subscribe to the auction package for the specified buyer. Once subscribed, the bidder will receive a call out for inventory matching the auction package targeting criteria with the auction package deal ID and the specified buyer.", 3548 // "flatPath": "v1/buyers/{buyersId}/auctionPackages/{auctionPackagesId}:subscribe", 3549 // "httpMethod": "POST", 3550 // "id": "authorizedbuyersmarketplace.buyers.auctionPackages.subscribe", 3551 // "parameterOrder": [ 3552 // "name" 3553 // ], 3554 // "parameters": { 3555 // "name": { 3556 // "description": "Required. Name of the auction package. Format: `buyers/{accountId}/auctionPackages/{auctionPackageId}`", 3557 // "location": "path", 3558 // "pattern": "^buyers/[^/]+/auctionPackages/[^/]+$", 3559 // "required": true, 3560 // "type": "string" 3561 // } 3562 // }, 3563 // "path": "v1/{+name}:subscribe", 3564 // "request": { 3565 // "$ref": "SubscribeAuctionPackageRequest" 3566 // }, 3567 // "response": { 3568 // "$ref": "AuctionPackage" 3569 // }, 3570 // "scopes": [ 3571 // "https://www.googleapis.com/auth/authorized-buyers-marketplace" 3572 // ] 3573 // } 3574 3575} 3576 3577// method id "authorizedbuyersmarketplace.buyers.auctionPackages.subscribeClients": 3578 3579type BuyersAuctionPackagesSubscribeClientsCall struct { 3580 s *Service 3581 auctionPackage string 3582 subscribeclientsrequest *SubscribeClientsRequest 3583 urlParams_ gensupport.URLParams 3584 ctx_ context.Context 3585 header_ http.Header 3586} 3587 3588// SubscribeClients: Subscribe the specified clients of the buyer to the 3589// auction package. If a client in the list does not belong to the 3590// buyer, an error response will be returned, and all of the following 3591// clients in the list will not be subscribed. Subscribing an already 3592// subscribed client will have no effect. 3593// 3594// - auctionPackage: Name of the auction package. Format: 3595// `buyers/{accountId}/auctionPackages/{auctionPackageId}`. 3596func (r *BuyersAuctionPackagesService) SubscribeClients(auctionPackage string, subscribeclientsrequest *SubscribeClientsRequest) *BuyersAuctionPackagesSubscribeClientsCall { 3597 c := &BuyersAuctionPackagesSubscribeClientsCall{s: r.s, urlParams_: make(gensupport.URLParams)} 3598 c.auctionPackage = auctionPackage 3599 c.subscribeclientsrequest = subscribeclientsrequest 3600 return c 3601} 3602 3603// Fields allows partial responses to be retrieved. See 3604// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse 3605// for more information. 3606func (c *BuyersAuctionPackagesSubscribeClientsCall) Fields(s ...googleapi.Field) *BuyersAuctionPackagesSubscribeClientsCall { 3607 c.urlParams_.Set("fields", googleapi.CombineFields(s)) 3608 return c 3609} 3610 3611// Context sets the context to be used in this call's Do method. Any 3612// pending HTTP request will be aborted if the provided context is 3613// canceled. 3614func (c *BuyersAuctionPackagesSubscribeClientsCall) Context(ctx context.Context) *BuyersAuctionPackagesSubscribeClientsCall { 3615 c.ctx_ = ctx 3616 return c 3617} 3618 3619// Header returns an http.Header that can be modified by the caller to 3620// add HTTP headers to the request. 3621func (c *BuyersAuctionPackagesSubscribeClientsCall) Header() http.Header { 3622 if c.header_ == nil { 3623 c.header_ = make(http.Header) 3624 } 3625 return c.header_ 3626} 3627 3628func (c *BuyersAuctionPackagesSubscribeClientsCall) doRequest(alt string) (*http.Response, error) { 3629 reqHeaders := make(http.Header) 3630 reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/20211027") 3631 for k, v := range c.header_ { 3632 reqHeaders[k] = v 3633 } 3634 reqHeaders.Set("User-Agent", c.s.userAgent()) 3635 var body io.Reader = nil 3636 body, err := googleapi.WithoutDataWrapper.JSONReader(c.subscribeclientsrequest) 3637 if err != nil { 3638 return nil, err 3639 } 3640 reqHeaders.Set("Content-Type", "application/json") 3641 c.urlParams_.Set("alt", alt) 3642 c.urlParams_.Set("prettyPrint", "false") 3643 urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+auctionPackage}:subscribeClients") 3644 urls += "?" + c.urlParams_.Encode() 3645 req, err := http.NewRequest("POST", urls, body) 3646 if err != nil { 3647 return nil, err 3648 } 3649 req.Header = reqHeaders 3650 googleapi.Expand(req.URL, map[string]string{ 3651 "auctionPackage": c.auctionPackage, 3652 }) 3653 return gensupport.SendRequest(c.ctx_, c.s.client, req) 3654} 3655 3656// Do executes the "authorizedbuyersmarketplace.buyers.auctionPackages.subscribeClients" call. 3657// Exactly one of *AuctionPackage or error will be non-nil. Any non-2xx 3658// status code is an error. Response headers are in either 3659// *AuctionPackage.ServerResponse.Header or (if a response was returned 3660// at all) in error.(*googleapi.Error).Header. Use 3661// googleapi.IsNotModified to check whether the returned error was 3662// because http.StatusNotModified was returned. 3663func (c *BuyersAuctionPackagesSubscribeClientsCall) Do(opts ...googleapi.CallOption) (*AuctionPackage, error) { 3664 gensupport.SetOptions(c.urlParams_, opts...) 3665 res, err := c.doRequest("json") 3666 if res != nil && res.StatusCode == http.StatusNotModified { 3667 if res.Body != nil { 3668 res.Body.Close() 3669 } 3670 return nil, &googleapi.Error{ 3671 Code: res.StatusCode, 3672 Header: res.Header, 3673 } 3674 } 3675 if err != nil { 3676 return nil, err 3677 } 3678 defer googleapi.CloseBody(res) 3679 if err := googleapi.CheckResponse(res); err != nil { 3680 return nil, err 3681 } 3682 ret := &AuctionPackage{ 3683 ServerResponse: googleapi.ServerResponse{ 3684 Header: res.Header, 3685 HTTPStatusCode: res.StatusCode, 3686 }, 3687 } 3688 target := &ret 3689 if err := gensupport.DecodeResponse(target, res); err != nil { 3690 return nil, err 3691 } 3692 return ret, nil 3693 // { 3694 // "description": "Subscribe the specified clients of the buyer to the auction package. If a client in the list does not belong to the buyer, an error response will be returned, and all of the following clients in the list will not be subscribed. Subscribing an already subscribed client will have no effect.", 3695 // "flatPath": "v1/buyers/{buyersId}/auctionPackages/{auctionPackagesId}:subscribeClients", 3696 // "httpMethod": "POST", 3697 // "id": "authorizedbuyersmarketplace.buyers.auctionPackages.subscribeClients", 3698 // "parameterOrder": [ 3699 // "auctionPackage" 3700 // ], 3701 // "parameters": { 3702 // "auctionPackage": { 3703 // "description": "Required. Name of the auction package. Format: `buyers/{accountId}/auctionPackages/{auctionPackageId}`", 3704 // "location": "path", 3705 // "pattern": "^buyers/[^/]+/auctionPackages/[^/]+$", 3706 // "required": true, 3707 // "type": "string" 3708 // } 3709 // }, 3710 // "path": "v1/{+auctionPackage}:subscribeClients", 3711 // "request": { 3712 // "$ref": "SubscribeClientsRequest" 3713 // }, 3714 // "response": { 3715 // "$ref": "AuctionPackage" 3716 // }, 3717 // "scopes": [ 3718 // "https://www.googleapis.com/auth/authorized-buyers-marketplace" 3719 // ] 3720 // } 3721 3722} 3723 3724// method id "authorizedbuyersmarketplace.buyers.auctionPackages.unsubscribe": 3725 3726type BuyersAuctionPackagesUnsubscribeCall struct { 3727 s *Service 3728 name string 3729 unsubscribeauctionpackagerequest *UnsubscribeAuctionPackageRequest 3730 urlParams_ gensupport.URLParams 3731 ctx_ context.Context 3732 header_ http.Header 3733} 3734 3735// Unsubscribe: Unsubscribe from the auction package for the specified 3736// buyer. Once unsubscribed, the bidder will no longer receive a call 3737// out for the auction package deal ID and the specified buyer. 3738// 3739// - name: Name of the auction package. Format: 3740// `buyers/{accountId}/auctionPackages/{auctionPackageId}`. 3741func (r *BuyersAuctionPackagesService) Unsubscribe(name string, unsubscribeauctionpackagerequest *UnsubscribeAuctionPackageRequest) *BuyersAuctionPackagesUnsubscribeCall { 3742 c := &BuyersAuctionPackagesUnsubscribeCall{s: r.s, urlParams_: make(gensupport.URLParams)} 3743 c.name = name 3744 c.unsubscribeauctionpackagerequest = unsubscribeauctionpackagerequest 3745 return c 3746} 3747 3748// Fields allows partial responses to be retrieved. See 3749// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse 3750// for more information. 3751func (c *BuyersAuctionPackagesUnsubscribeCall) Fields(s ...googleapi.Field) *BuyersAuctionPackagesUnsubscribeCall { 3752 c.urlParams_.Set("fields", googleapi.CombineFields(s)) 3753 return c 3754} 3755 3756// Context sets the context to be used in this call's Do method. Any 3757// pending HTTP request will be aborted if the provided context is 3758// canceled. 3759func (c *BuyersAuctionPackagesUnsubscribeCall) Context(ctx context.Context) *BuyersAuctionPackagesUnsubscribeCall { 3760 c.ctx_ = ctx 3761 return c 3762} 3763 3764// Header returns an http.Header that can be modified by the caller to 3765// add HTTP headers to the request. 3766func (c *BuyersAuctionPackagesUnsubscribeCall) Header() http.Header { 3767 if c.header_ == nil { 3768 c.header_ = make(http.Header) 3769 } 3770 return c.header_ 3771} 3772 3773func (c *BuyersAuctionPackagesUnsubscribeCall) doRequest(alt string) (*http.Response, error) { 3774 reqHeaders := make(http.Header) 3775 reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/20211027") 3776 for k, v := range c.header_ { 3777 reqHeaders[k] = v 3778 } 3779 reqHeaders.Set("User-Agent", c.s.userAgent()) 3780 var body io.Reader = nil 3781 body, err := googleapi.WithoutDataWrapper.JSONReader(c.unsubscribeauctionpackagerequest) 3782 if err != nil { 3783 return nil, err 3784 } 3785 reqHeaders.Set("Content-Type", "application/json") 3786 c.urlParams_.Set("alt", alt) 3787 c.urlParams_.Set("prettyPrint", "false") 3788 urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+name}:unsubscribe") 3789 urls += "?" + c.urlParams_.Encode() 3790 req, err := http.NewRequest("POST", urls, body) 3791 if err != nil { 3792 return nil, err 3793 } 3794 req.Header = reqHeaders 3795 googleapi.Expand(req.URL, map[string]string{ 3796 "name": c.name, 3797 }) 3798 return gensupport.SendRequest(c.ctx_, c.s.client, req) 3799} 3800 3801// Do executes the "authorizedbuyersmarketplace.buyers.auctionPackages.unsubscribe" call. 3802// Exactly one of *AuctionPackage or error will be non-nil. Any non-2xx 3803// status code is an error. Response headers are in either 3804// *AuctionPackage.ServerResponse.Header or (if a response was returned 3805// at all) in error.(*googleapi.Error).Header. Use 3806// googleapi.IsNotModified to check whether the returned error was 3807// because http.StatusNotModified was returned. 3808func (c *BuyersAuctionPackagesUnsubscribeCall) Do(opts ...googleapi.CallOption) (*AuctionPackage, error) { 3809 gensupport.SetOptions(c.urlParams_, opts...) 3810 res, err := c.doRequest("json") 3811 if res != nil && res.StatusCode == http.StatusNotModified { 3812 if res.Body != nil { 3813 res.Body.Close() 3814 } 3815 return nil, &googleapi.Error{ 3816 Code: res.StatusCode, 3817 Header: res.Header, 3818 } 3819 } 3820 if err != nil { 3821 return nil, err 3822 } 3823 defer googleapi.CloseBody(res) 3824 if err := googleapi.CheckResponse(res); err != nil { 3825 return nil, err 3826 } 3827 ret := &AuctionPackage{ 3828 ServerResponse: googleapi.ServerResponse{ 3829 Header: res.Header, 3830 HTTPStatusCode: res.StatusCode, 3831 }, 3832 } 3833 target := &ret 3834 if err := gensupport.DecodeResponse(target, res); err != nil { 3835 return nil, err 3836 } 3837 return ret, nil 3838 // { 3839 // "description": "Unsubscribe from the auction package for the specified buyer. Once unsubscribed, the bidder will no longer receive a call out for the auction package deal ID and the specified buyer.", 3840 // "flatPath": "v1/buyers/{buyersId}/auctionPackages/{auctionPackagesId}:unsubscribe", 3841 // "httpMethod": "POST", 3842 // "id": "authorizedbuyersmarketplace.buyers.auctionPackages.unsubscribe", 3843 // "parameterOrder": [ 3844 // "name" 3845 // ], 3846 // "parameters": { 3847 // "name": { 3848 // "description": "Required. Name of the auction package. Format: `buyers/{accountId}/auctionPackages/{auctionPackageId}`", 3849 // "location": "path", 3850 // "pattern": "^buyers/[^/]+/auctionPackages/[^/]+$", 3851 // "required": true, 3852 // "type": "string" 3853 // } 3854 // }, 3855 // "path": "v1/{+name}:unsubscribe", 3856 // "request": { 3857 // "$ref": "UnsubscribeAuctionPackageRequest" 3858 // }, 3859 // "response": { 3860 // "$ref": "AuctionPackage" 3861 // }, 3862 // "scopes": [ 3863 // "https://www.googleapis.com/auth/authorized-buyers-marketplace" 3864 // ] 3865 // } 3866 3867} 3868 3869// method id "authorizedbuyersmarketplace.buyers.auctionPackages.unsubscribeClients": 3870 3871type BuyersAuctionPackagesUnsubscribeClientsCall struct { 3872 s *Service 3873 auctionPackage string 3874 unsubscribeclientsrequest *UnsubscribeClientsRequest 3875 urlParams_ gensupport.URLParams 3876 ctx_ context.Context 3877 header_ http.Header 3878} 3879 3880// UnsubscribeClients: Unsubscribe from the auction package for the 3881// specified clients of the buyer. Unsubscribing a client that is not 3882// subscribed will have no effect. 3883// 3884// - auctionPackage: Name of the auction package. Format: 3885// `buyers/{accountId}/auctionPackages/{auctionPackageId}`. 3886func (r *BuyersAuctionPackagesService) UnsubscribeClients(auctionPackage string, unsubscribeclientsrequest *UnsubscribeClientsRequest) *BuyersAuctionPackagesUnsubscribeClientsCall { 3887 c := &BuyersAuctionPackagesUnsubscribeClientsCall{s: r.s, urlParams_: make(gensupport.URLParams)} 3888 c.auctionPackage = auctionPackage 3889 c.unsubscribeclientsrequest = unsubscribeclientsrequest 3890 return c 3891} 3892 3893// Fields allows partial responses to be retrieved. See 3894// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse 3895// for more information. 3896func (c *BuyersAuctionPackagesUnsubscribeClientsCall) Fields(s ...googleapi.Field) *BuyersAuctionPackagesUnsubscribeClientsCall { 3897 c.urlParams_.Set("fields", googleapi.CombineFields(s)) 3898 return c 3899} 3900 3901// Context sets the context to be used in this call's Do method. Any 3902// pending HTTP request will be aborted if the provided context is 3903// canceled. 3904func (c *BuyersAuctionPackagesUnsubscribeClientsCall) Context(ctx context.Context) *BuyersAuctionPackagesUnsubscribeClientsCall { 3905 c.ctx_ = ctx 3906 return c 3907} 3908 3909// Header returns an http.Header that can be modified by the caller to 3910// add HTTP headers to the request. 3911func (c *BuyersAuctionPackagesUnsubscribeClientsCall) Header() http.Header { 3912 if c.header_ == nil { 3913 c.header_ = make(http.Header) 3914 } 3915 return c.header_ 3916} 3917 3918func (c *BuyersAuctionPackagesUnsubscribeClientsCall) doRequest(alt string) (*http.Response, error) { 3919 reqHeaders := make(http.Header) 3920 reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/20211027") 3921 for k, v := range c.header_ { 3922 reqHeaders[k] = v 3923 } 3924 reqHeaders.Set("User-Agent", c.s.userAgent()) 3925 var body io.Reader = nil 3926 body, err := googleapi.WithoutDataWrapper.JSONReader(c.unsubscribeclientsrequest) 3927 if err != nil { 3928 return nil, err 3929 } 3930 reqHeaders.Set("Content-Type", "application/json") 3931 c.urlParams_.Set("alt", alt) 3932 c.urlParams_.Set("prettyPrint", "false") 3933 urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+auctionPackage}:unsubscribeClients") 3934 urls += "?" + c.urlParams_.Encode() 3935 req, err := http.NewRequest("POST", urls, body) 3936 if err != nil { 3937 return nil, err 3938 } 3939 req.Header = reqHeaders 3940 googleapi.Expand(req.URL, map[string]string{ 3941 "auctionPackage": c.auctionPackage, 3942 }) 3943 return gensupport.SendRequest(c.ctx_, c.s.client, req) 3944} 3945 3946// Do executes the "authorizedbuyersmarketplace.buyers.auctionPackages.unsubscribeClients" call. 3947// Exactly one of *AuctionPackage or error will be non-nil. Any non-2xx 3948// status code is an error. Response headers are in either 3949// *AuctionPackage.ServerResponse.Header or (if a response was returned 3950// at all) in error.(*googleapi.Error).Header. Use 3951// googleapi.IsNotModified to check whether the returned error was 3952// because http.StatusNotModified was returned. 3953func (c *BuyersAuctionPackagesUnsubscribeClientsCall) Do(opts ...googleapi.CallOption) (*AuctionPackage, error) { 3954 gensupport.SetOptions(c.urlParams_, opts...) 3955 res, err := c.doRequest("json") 3956 if res != nil && res.StatusCode == http.StatusNotModified { 3957 if res.Body != nil { 3958 res.Body.Close() 3959 } 3960 return nil, &googleapi.Error{ 3961 Code: res.StatusCode, 3962 Header: res.Header, 3963 } 3964 } 3965 if err != nil { 3966 return nil, err 3967 } 3968 defer googleapi.CloseBody(res) 3969 if err := googleapi.CheckResponse(res); err != nil { 3970 return nil, err 3971 } 3972 ret := &AuctionPackage{ 3973 ServerResponse: googleapi.ServerResponse{ 3974 Header: res.Header, 3975 HTTPStatusCode: res.StatusCode, 3976 }, 3977 } 3978 target := &ret 3979 if err := gensupport.DecodeResponse(target, res); err != nil { 3980 return nil, err 3981 } 3982 return ret, nil 3983 // { 3984 // "description": "Unsubscribe from the auction package for the specified clients of the buyer. Unsubscribing a client that is not subscribed will have no effect.", 3985 // "flatPath": "v1/buyers/{buyersId}/auctionPackages/{auctionPackagesId}:unsubscribeClients", 3986 // "httpMethod": "POST", 3987 // "id": "authorizedbuyersmarketplace.buyers.auctionPackages.unsubscribeClients", 3988 // "parameterOrder": [ 3989 // "auctionPackage" 3990 // ], 3991 // "parameters": { 3992 // "auctionPackage": { 3993 // "description": "Required. Name of the auction package. Format: `buyers/{accountId}/auctionPackages/{auctionPackageId}`", 3994 // "location": "path", 3995 // "pattern": "^buyers/[^/]+/auctionPackages/[^/]+$", 3996 // "required": true, 3997 // "type": "string" 3998 // } 3999 // }, 4000 // "path": "v1/{+auctionPackage}:unsubscribeClients", 4001 // "request": { 4002 // "$ref": "UnsubscribeClientsRequest" 4003 // }, 4004 // "response": { 4005 // "$ref": "AuctionPackage" 4006 // }, 4007 // "scopes": [ 4008 // "https://www.googleapis.com/auth/authorized-buyers-marketplace" 4009 // ] 4010 // } 4011 4012} 4013 4014// method id "authorizedbuyersmarketplace.buyers.clients.activate": 4015 4016type BuyersClientsActivateCall struct { 4017 s *Service 4018 name string 4019 activateclientrequest *ActivateClientRequest 4020 urlParams_ gensupport.URLParams 4021 ctx_ context.Context 4022 header_ http.Header 4023} 4024 4025// Activate: Activates an existing client. The state of the client will 4026// be updated to "ACTIVE". This method has no effect if the client is 4027// already in "ACTIVE" state. 4028// 4029// - name: Format: `buyers/{buyerAccountId}/clients/{clientAccountId}`. 4030func (r *BuyersClientsService) Activate(name string, activateclientrequest *ActivateClientRequest) *BuyersClientsActivateCall { 4031 c := &BuyersClientsActivateCall{s: r.s, urlParams_: make(gensupport.URLParams)} 4032 c.name = name 4033 c.activateclientrequest = activateclientrequest 4034 return c 4035} 4036 4037// Fields allows partial responses to be retrieved. See 4038// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse 4039// for more information. 4040func (c *BuyersClientsActivateCall) Fields(s ...googleapi.Field) *BuyersClientsActivateCall { 4041 c.urlParams_.Set("fields", googleapi.CombineFields(s)) 4042 return c 4043} 4044 4045// Context sets the context to be used in this call's Do method. Any 4046// pending HTTP request will be aborted if the provided context is 4047// canceled. 4048func (c *BuyersClientsActivateCall) Context(ctx context.Context) *BuyersClientsActivateCall { 4049 c.ctx_ = ctx 4050 return c 4051} 4052 4053// Header returns an http.Header that can be modified by the caller to 4054// add HTTP headers to the request. 4055func (c *BuyersClientsActivateCall) Header() http.Header { 4056 if c.header_ == nil { 4057 c.header_ = make(http.Header) 4058 } 4059 return c.header_ 4060} 4061 4062func (c *BuyersClientsActivateCall) doRequest(alt string) (*http.Response, error) { 4063 reqHeaders := make(http.Header) 4064 reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/20211027") 4065 for k, v := range c.header_ { 4066 reqHeaders[k] = v 4067 } 4068 reqHeaders.Set("User-Agent", c.s.userAgent()) 4069 var body io.Reader = nil 4070 body, err := googleapi.WithoutDataWrapper.JSONReader(c.activateclientrequest) 4071 if err != nil { 4072 return nil, err 4073 } 4074 reqHeaders.Set("Content-Type", "application/json") 4075 c.urlParams_.Set("alt", alt) 4076 c.urlParams_.Set("prettyPrint", "false") 4077 urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+name}:activate") 4078 urls += "?" + c.urlParams_.Encode() 4079 req, err := http.NewRequest("POST", urls, body) 4080 if err != nil { 4081 return nil, err 4082 } 4083 req.Header = reqHeaders 4084 googleapi.Expand(req.URL, map[string]string{ 4085 "name": c.name, 4086 }) 4087 return gensupport.SendRequest(c.ctx_, c.s.client, req) 4088} 4089 4090// Do executes the "authorizedbuyersmarketplace.buyers.clients.activate" call. 4091// Exactly one of *Client or error will be non-nil. Any non-2xx status 4092// code is an error. Response headers are in either 4093// *Client.ServerResponse.Header or (if a response was returned at all) 4094// in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to 4095// check whether the returned error was because http.StatusNotModified 4096// was returned. 4097func (c *BuyersClientsActivateCall) Do(opts ...googleapi.CallOption) (*Client, error) { 4098 gensupport.SetOptions(c.urlParams_, opts...) 4099 res, err := c.doRequest("json") 4100 if res != nil && res.StatusCode == http.StatusNotModified { 4101 if res.Body != nil { 4102 res.Body.Close() 4103 } 4104 return nil, &googleapi.Error{ 4105 Code: res.StatusCode, 4106 Header: res.Header, 4107 } 4108 } 4109 if err != nil { 4110 return nil, err 4111 } 4112 defer googleapi.CloseBody(res) 4113 if err := googleapi.CheckResponse(res); err != nil { 4114 return nil, err 4115 } 4116 ret := &Client{ 4117 ServerResponse: googleapi.ServerResponse{ 4118 Header: res.Header, 4119 HTTPStatusCode: res.StatusCode, 4120 }, 4121 } 4122 target := &ret 4123 if err := gensupport.DecodeResponse(target, res); err != nil { 4124 return nil, err 4125 } 4126 return ret, nil 4127 // { 4128 // "description": "Activates an existing client. The state of the client will be updated to \"ACTIVE\". This method has no effect if the client is already in \"ACTIVE\" state.", 4129 // "flatPath": "v1/buyers/{buyersId}/clients/{clientsId}:activate", 4130 // "httpMethod": "POST", 4131 // "id": "authorizedbuyersmarketplace.buyers.clients.activate", 4132 // "parameterOrder": [ 4133 // "name" 4134 // ], 4135 // "parameters": { 4136 // "name": { 4137 // "description": "Required. Format: `buyers/{buyerAccountId}/clients/{clientAccountId}`", 4138 // "location": "path", 4139 // "pattern": "^buyers/[^/]+/clients/[^/]+$", 4140 // "required": true, 4141 // "type": "string" 4142 // } 4143 // }, 4144 // "path": "v1/{+name}:activate", 4145 // "request": { 4146 // "$ref": "ActivateClientRequest" 4147 // }, 4148 // "response": { 4149 // "$ref": "Client" 4150 // }, 4151 // "scopes": [ 4152 // "https://www.googleapis.com/auth/authorized-buyers-marketplace" 4153 // ] 4154 // } 4155 4156} 4157 4158// method id "authorizedbuyersmarketplace.buyers.clients.create": 4159 4160type BuyersClientsCreateCall struct { 4161 s *Service 4162 parent string 4163 client *Client 4164 urlParams_ gensupport.URLParams 4165 ctx_ context.Context 4166 header_ http.Header 4167} 4168 4169// Create: Creates a new client. 4170// 4171// - parent: The name of the buyer. Format: `buyers/{accountId}`. 4172func (r *BuyersClientsService) Create(parent string, client *Client) *BuyersClientsCreateCall { 4173 c := &BuyersClientsCreateCall{s: r.s, urlParams_: make(gensupport.URLParams)} 4174 c.parent = parent 4175 c.client = client 4176 return c 4177} 4178 4179// Fields allows partial responses to be retrieved. See 4180// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse 4181// for more information. 4182func (c *BuyersClientsCreateCall) Fields(s ...googleapi.Field) *BuyersClientsCreateCall { 4183 c.urlParams_.Set("fields", googleapi.CombineFields(s)) 4184 return c 4185} 4186 4187// Context sets the context to be used in this call's Do method. Any 4188// pending HTTP request will be aborted if the provided context is 4189// canceled. 4190func (c *BuyersClientsCreateCall) Context(ctx context.Context) *BuyersClientsCreateCall { 4191 c.ctx_ = ctx 4192 return c 4193} 4194 4195// Header returns an http.Header that can be modified by the caller to 4196// add HTTP headers to the request. 4197func (c *BuyersClientsCreateCall) Header() http.Header { 4198 if c.header_ == nil { 4199 c.header_ = make(http.Header) 4200 } 4201 return c.header_ 4202} 4203 4204func (c *BuyersClientsCreateCall) doRequest(alt string) (*http.Response, error) { 4205 reqHeaders := make(http.Header) 4206 reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/20211027") 4207 for k, v := range c.header_ { 4208 reqHeaders[k] = v 4209 } 4210 reqHeaders.Set("User-Agent", c.s.userAgent()) 4211 var body io.Reader = nil 4212 body, err := googleapi.WithoutDataWrapper.JSONReader(c.client) 4213 if err != nil { 4214 return nil, err 4215 } 4216 reqHeaders.Set("Content-Type", "application/json") 4217 c.urlParams_.Set("alt", alt) 4218 c.urlParams_.Set("prettyPrint", "false") 4219 urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+parent}/clients") 4220 urls += "?" + c.urlParams_.Encode() 4221 req, err := http.NewRequest("POST", urls, body) 4222 if err != nil { 4223 return nil, err 4224 } 4225 req.Header = reqHeaders 4226 googleapi.Expand(req.URL, map[string]string{ 4227 "parent": c.parent, 4228 }) 4229 return gensupport.SendRequest(c.ctx_, c.s.client, req) 4230} 4231 4232// Do executes the "authorizedbuyersmarketplace.buyers.clients.create" call. 4233// Exactly one of *Client or error will be non-nil. Any non-2xx status 4234// code is an error. Response headers are in either 4235// *Client.ServerResponse.Header or (if a response was returned at all) 4236// in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to 4237// check whether the returned error was because http.StatusNotModified 4238// was returned. 4239func (c *BuyersClientsCreateCall) Do(opts ...googleapi.CallOption) (*Client, error) { 4240 gensupport.SetOptions(c.urlParams_, opts...) 4241 res, err := c.doRequest("json") 4242 if res != nil && res.StatusCode == http.StatusNotModified { 4243 if res.Body != nil { 4244 res.Body.Close() 4245 } 4246 return nil, &googleapi.Error{ 4247 Code: res.StatusCode, 4248 Header: res.Header, 4249 } 4250 } 4251 if err != nil { 4252 return nil, err 4253 } 4254 defer googleapi.CloseBody(res) 4255 if err := googleapi.CheckResponse(res); err != nil { 4256 return nil, err 4257 } 4258 ret := &Client{ 4259 ServerResponse: googleapi.ServerResponse{ 4260 Header: res.Header, 4261 HTTPStatusCode: res.StatusCode, 4262 }, 4263 } 4264 target := &ret 4265 if err := gensupport.DecodeResponse(target, res); err != nil { 4266 return nil, err 4267 } 4268 return ret, nil 4269 // { 4270 // "description": "Creates a new client.", 4271 // "flatPath": "v1/buyers/{buyersId}/clients", 4272 // "httpMethod": "POST", 4273 // "id": "authorizedbuyersmarketplace.buyers.clients.create", 4274 // "parameterOrder": [ 4275 // "parent" 4276 // ], 4277 // "parameters": { 4278 // "parent": { 4279 // "description": "Required. The name of the buyer. Format: `buyers/{accountId}`", 4280 // "location": "path", 4281 // "pattern": "^buyers/[^/]+$", 4282 // "required": true, 4283 // "type": "string" 4284 // } 4285 // }, 4286 // "path": "v1/{+parent}/clients", 4287 // "request": { 4288 // "$ref": "Client" 4289 // }, 4290 // "response": { 4291 // "$ref": "Client" 4292 // }, 4293 // "scopes": [ 4294 // "https://www.googleapis.com/auth/authorized-buyers-marketplace" 4295 // ] 4296 // } 4297 4298} 4299 4300// method id "authorizedbuyersmarketplace.buyers.clients.deactivate": 4301 4302type BuyersClientsDeactivateCall struct { 4303 s *Service 4304 name string 4305 deactivateclientrequest *DeactivateClientRequest 4306 urlParams_ gensupport.URLParams 4307 ctx_ context.Context 4308 header_ http.Header 4309} 4310 4311// Deactivate: Deactivates an existing client. The state of the client 4312// will be updated to "INACTIVE". This method has no effect if the 4313// client is already in "INACTIVE" state. 4314// 4315// - name: Format: `buyers/{buyerAccountId}/clients/{clientAccountId}`. 4316func (r *BuyersClientsService) Deactivate(name string, deactivateclientrequest *DeactivateClientRequest) *BuyersClientsDeactivateCall { 4317 c := &BuyersClientsDeactivateCall{s: r.s, urlParams_: make(gensupport.URLParams)} 4318 c.name = name 4319 c.deactivateclientrequest = deactivateclientrequest 4320 return c 4321} 4322 4323// Fields allows partial responses to be retrieved. See 4324// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse 4325// for more information. 4326func (c *BuyersClientsDeactivateCall) Fields(s ...googleapi.Field) *BuyersClientsDeactivateCall { 4327 c.urlParams_.Set("fields", googleapi.CombineFields(s)) 4328 return c 4329} 4330 4331// Context sets the context to be used in this call's Do method. Any 4332// pending HTTP request will be aborted if the provided context is 4333// canceled. 4334func (c *BuyersClientsDeactivateCall) Context(ctx context.Context) *BuyersClientsDeactivateCall { 4335 c.ctx_ = ctx 4336 return c 4337} 4338 4339// Header returns an http.Header that can be modified by the caller to 4340// add HTTP headers to the request. 4341func (c *BuyersClientsDeactivateCall) Header() http.Header { 4342 if c.header_ == nil { 4343 c.header_ = make(http.Header) 4344 } 4345 return c.header_ 4346} 4347 4348func (c *BuyersClientsDeactivateCall) doRequest(alt string) (*http.Response, error) { 4349 reqHeaders := make(http.Header) 4350 reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/20211027") 4351 for k, v := range c.header_ { 4352 reqHeaders[k] = v 4353 } 4354 reqHeaders.Set("User-Agent", c.s.userAgent()) 4355 var body io.Reader = nil 4356 body, err := googleapi.WithoutDataWrapper.JSONReader(c.deactivateclientrequest) 4357 if err != nil { 4358 return nil, err 4359 } 4360 reqHeaders.Set("Content-Type", "application/json") 4361 c.urlParams_.Set("alt", alt) 4362 c.urlParams_.Set("prettyPrint", "false") 4363 urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+name}:deactivate") 4364 urls += "?" + c.urlParams_.Encode() 4365 req, err := http.NewRequest("POST", urls, body) 4366 if err != nil { 4367 return nil, err 4368 } 4369 req.Header = reqHeaders 4370 googleapi.Expand(req.URL, map[string]string{ 4371 "name": c.name, 4372 }) 4373 return gensupport.SendRequest(c.ctx_, c.s.client, req) 4374} 4375 4376// Do executes the "authorizedbuyersmarketplace.buyers.clients.deactivate" call. 4377// Exactly one of *Client or error will be non-nil. Any non-2xx status 4378// code is an error. Response headers are in either 4379// *Client.ServerResponse.Header or (if a response was returned at all) 4380// in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to 4381// check whether the returned error was because http.StatusNotModified 4382// was returned. 4383func (c *BuyersClientsDeactivateCall) Do(opts ...googleapi.CallOption) (*Client, error) { 4384 gensupport.SetOptions(c.urlParams_, opts...) 4385 res, err := c.doRequest("json") 4386 if res != nil && res.StatusCode == http.StatusNotModified { 4387 if res.Body != nil { 4388 res.Body.Close() 4389 } 4390 return nil, &googleapi.Error{ 4391 Code: res.StatusCode, 4392 Header: res.Header, 4393 } 4394 } 4395 if err != nil { 4396 return nil, err 4397 } 4398 defer googleapi.CloseBody(res) 4399 if err := googleapi.CheckResponse(res); err != nil { 4400 return nil, err 4401 } 4402 ret := &Client{ 4403 ServerResponse: googleapi.ServerResponse{ 4404 Header: res.Header, 4405 HTTPStatusCode: res.StatusCode, 4406 }, 4407 } 4408 target := &ret 4409 if err := gensupport.DecodeResponse(target, res); err != nil { 4410 return nil, err 4411 } 4412 return ret, nil 4413 // { 4414 // "description": "Deactivates an existing client. The state of the client will be updated to \"INACTIVE\". This method has no effect if the client is already in \"INACTIVE\" state.", 4415 // "flatPath": "v1/buyers/{buyersId}/clients/{clientsId}:deactivate", 4416 // "httpMethod": "POST", 4417 // "id": "authorizedbuyersmarketplace.buyers.clients.deactivate", 4418 // "parameterOrder": [ 4419 // "name" 4420 // ], 4421 // "parameters": { 4422 // "name": { 4423 // "description": "Required. Format: `buyers/{buyerAccountId}/clients/{clientAccountId}`", 4424 // "location": "path", 4425 // "pattern": "^buyers/[^/]+/clients/[^/]+$", 4426 // "required": true, 4427 // "type": "string" 4428 // } 4429 // }, 4430 // "path": "v1/{+name}:deactivate", 4431 // "request": { 4432 // "$ref": "DeactivateClientRequest" 4433 // }, 4434 // "response": { 4435 // "$ref": "Client" 4436 // }, 4437 // "scopes": [ 4438 // "https://www.googleapis.com/auth/authorized-buyers-marketplace" 4439 // ] 4440 // } 4441 4442} 4443 4444// method id "authorizedbuyersmarketplace.buyers.clients.get": 4445 4446type BuyersClientsGetCall struct { 4447 s *Service 4448 name string 4449 urlParams_ gensupport.URLParams 4450 ifNoneMatch_ string 4451 ctx_ context.Context 4452 header_ http.Header 4453} 4454 4455// Get: Gets a client with a given resource name. 4456// 4457// - name: Format: `buyers/{accountId}/clients/{clientAccountId}`. 4458func (r *BuyersClientsService) Get(name string) *BuyersClientsGetCall { 4459 c := &BuyersClientsGetCall{s: r.s, urlParams_: make(gensupport.URLParams)} 4460 c.name = name 4461 return c 4462} 4463 4464// Fields allows partial responses to be retrieved. See 4465// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse 4466// for more information. 4467func (c *BuyersClientsGetCall) Fields(s ...googleapi.Field) *BuyersClientsGetCall { 4468 c.urlParams_.Set("fields", googleapi.CombineFields(s)) 4469 return c 4470} 4471 4472// IfNoneMatch sets the optional parameter which makes the operation 4473// fail if the object's ETag matches the given value. This is useful for 4474// getting updates only after the object has changed since the last 4475// request. Use googleapi.IsNotModified to check whether the response 4476// error from Do is the result of In-None-Match. 4477func (c *BuyersClientsGetCall) IfNoneMatch(entityTag string) *BuyersClientsGetCall { 4478 c.ifNoneMatch_ = entityTag 4479 return c 4480} 4481 4482// Context sets the context to be used in this call's Do method. Any 4483// pending HTTP request will be aborted if the provided context is 4484// canceled. 4485func (c *BuyersClientsGetCall) Context(ctx context.Context) *BuyersClientsGetCall { 4486 c.ctx_ = ctx 4487 return c 4488} 4489 4490// Header returns an http.Header that can be modified by the caller to 4491// add HTTP headers to the request. 4492func (c *BuyersClientsGetCall) Header() http.Header { 4493 if c.header_ == nil { 4494 c.header_ = make(http.Header) 4495 } 4496 return c.header_ 4497} 4498 4499func (c *BuyersClientsGetCall) doRequest(alt string) (*http.Response, error) { 4500 reqHeaders := make(http.Header) 4501 reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/20211027") 4502 for k, v := range c.header_ { 4503 reqHeaders[k] = v 4504 } 4505 reqHeaders.Set("User-Agent", c.s.userAgent()) 4506 if c.ifNoneMatch_ != "" { 4507 reqHeaders.Set("If-None-Match", c.ifNoneMatch_) 4508 } 4509 var body io.Reader = nil 4510 c.urlParams_.Set("alt", alt) 4511 c.urlParams_.Set("prettyPrint", "false") 4512 urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+name}") 4513 urls += "?" + c.urlParams_.Encode() 4514 req, err := http.NewRequest("GET", urls, body) 4515 if err != nil { 4516 return nil, err 4517 } 4518 req.Header = reqHeaders 4519 googleapi.Expand(req.URL, map[string]string{ 4520 "name": c.name, 4521 }) 4522 return gensupport.SendRequest(c.ctx_, c.s.client, req) 4523} 4524 4525// Do executes the "authorizedbuyersmarketplace.buyers.clients.get" call. 4526// Exactly one of *Client or error will be non-nil. Any non-2xx status 4527// code is an error. Response headers are in either 4528// *Client.ServerResponse.Header or (if a response was returned at all) 4529// in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to 4530// check whether the returned error was because http.StatusNotModified 4531// was returned. 4532func (c *BuyersClientsGetCall) Do(opts ...googleapi.CallOption) (*Client, error) { 4533 gensupport.SetOptions(c.urlParams_, opts...) 4534 res, err := c.doRequest("json") 4535 if res != nil && res.StatusCode == http.StatusNotModified { 4536 if res.Body != nil { 4537 res.Body.Close() 4538 } 4539 return nil, &googleapi.Error{ 4540 Code: res.StatusCode, 4541 Header: res.Header, 4542 } 4543 } 4544 if err != nil { 4545 return nil, err 4546 } 4547 defer googleapi.CloseBody(res) 4548 if err := googleapi.CheckResponse(res); err != nil { 4549 return nil, err 4550 } 4551 ret := &Client{ 4552 ServerResponse: googleapi.ServerResponse{ 4553 Header: res.Header, 4554 HTTPStatusCode: res.StatusCode, 4555 }, 4556 } 4557 target := &ret 4558 if err := gensupport.DecodeResponse(target, res); err != nil { 4559 return nil, err 4560 } 4561 return ret, nil 4562 // { 4563 // "description": "Gets a client with a given resource name.", 4564 // "flatPath": "v1/buyers/{buyersId}/clients/{clientsId}", 4565 // "httpMethod": "GET", 4566 // "id": "authorizedbuyersmarketplace.buyers.clients.get", 4567 // "parameterOrder": [ 4568 // "name" 4569 // ], 4570 // "parameters": { 4571 // "name": { 4572 // "description": "Required. Format: `buyers/{accountId}/clients/{clientAccountId}`", 4573 // "location": "path", 4574 // "pattern": "^buyers/[^/]+/clients/[^/]+$", 4575 // "required": true, 4576 // "type": "string" 4577 // } 4578 // }, 4579 // "path": "v1/{+name}", 4580 // "response": { 4581 // "$ref": "Client" 4582 // }, 4583 // "scopes": [ 4584 // "https://www.googleapis.com/auth/authorized-buyers-marketplace" 4585 // ] 4586 // } 4587 4588} 4589 4590// method id "authorizedbuyersmarketplace.buyers.clients.list": 4591 4592type BuyersClientsListCall struct { 4593 s *Service 4594 parent string 4595 urlParams_ gensupport.URLParams 4596 ifNoneMatch_ string 4597 ctx_ context.Context 4598 header_ http.Header 4599} 4600 4601// List: Lists all the clients for the current buyer. 4602// 4603// - parent: The name of the buyer. Format: `buyers/{accountId}`. 4604func (r *BuyersClientsService) List(parent string) *BuyersClientsListCall { 4605 c := &BuyersClientsListCall{s: r.s, urlParams_: make(gensupport.URLParams)} 4606 c.parent = parent 4607 return c 4608} 4609 4610// Filter sets the optional parameter "filter": Query string using the 4611// Filtering Syntax 4612// (https://developers.google.com/authorized-buyers/apis/guides/v2/list-filters) 4613// Supported fields for filtering are: * partnerClientId Use this field 4614// to filter the clients by the partnerClientId. For example, if the 4615// partnerClientId of the client is "1234", the value of this field 4616// should be `partnerClientId = "1234", in order to get only the client 4617// whose partnerClientId is "1234" in the response. 4618func (c *BuyersClientsListCall) Filter(filter string) *BuyersClientsListCall { 4619 c.urlParams_.Set("filter", filter) 4620 return c 4621} 4622 4623// PageSize sets the optional parameter "pageSize": Requested page size. 4624// If left blank, a default page size of 500 will be applied. 4625func (c *BuyersClientsListCall) PageSize(pageSize int64) *BuyersClientsListCall { 4626 c.urlParams_.Set("pageSize", fmt.Sprint(pageSize)) 4627 return c 4628} 4629 4630// PageToken sets the optional parameter "pageToken": A token 4631// identifying a page of results the server should return. Typically, 4632// this is the value of ListClientsResponse.nextPageToken returned from 4633// the previous call to the list method. 4634func (c *BuyersClientsListCall) PageToken(pageToken string) *BuyersClientsListCall { 4635 c.urlParams_.Set("pageToken", pageToken) 4636 return c 4637} 4638 4639// Fields allows partial responses to be retrieved. See 4640// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse 4641// for more information. 4642func (c *BuyersClientsListCall) Fields(s ...googleapi.Field) *BuyersClientsListCall { 4643 c.urlParams_.Set("fields", googleapi.CombineFields(s)) 4644 return c 4645} 4646 4647// IfNoneMatch sets the optional parameter which makes the operation 4648// fail if the object's ETag matches the given value. This is useful for 4649// getting updates only after the object has changed since the last 4650// request. Use googleapi.IsNotModified to check whether the response 4651// error from Do is the result of In-None-Match. 4652func (c *BuyersClientsListCall) IfNoneMatch(entityTag string) *BuyersClientsListCall { 4653 c.ifNoneMatch_ = entityTag 4654 return c 4655} 4656 4657// Context sets the context to be used in this call's Do method. Any 4658// pending HTTP request will be aborted if the provided context is 4659// canceled. 4660func (c *BuyersClientsListCall) Context(ctx context.Context) *BuyersClientsListCall { 4661 c.ctx_ = ctx 4662 return c 4663} 4664 4665// Header returns an http.Header that can be modified by the caller to 4666// add HTTP headers to the request. 4667func (c *BuyersClientsListCall) Header() http.Header { 4668 if c.header_ == nil { 4669 c.header_ = make(http.Header) 4670 } 4671 return c.header_ 4672} 4673 4674func (c *BuyersClientsListCall) doRequest(alt string) (*http.Response, error) { 4675 reqHeaders := make(http.Header) 4676 reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/20211027") 4677 for k, v := range c.header_ { 4678 reqHeaders[k] = v 4679 } 4680 reqHeaders.Set("User-Agent", c.s.userAgent()) 4681 if c.ifNoneMatch_ != "" { 4682 reqHeaders.Set("If-None-Match", c.ifNoneMatch_) 4683 } 4684 var body io.Reader = nil 4685 c.urlParams_.Set("alt", alt) 4686 c.urlParams_.Set("prettyPrint", "false") 4687 urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+parent}/clients") 4688 urls += "?" + c.urlParams_.Encode() 4689 req, err := http.NewRequest("GET", urls, body) 4690 if err != nil { 4691 return nil, err 4692 } 4693 req.Header = reqHeaders 4694 googleapi.Expand(req.URL, map[string]string{ 4695 "parent": c.parent, 4696 }) 4697 return gensupport.SendRequest(c.ctx_, c.s.client, req) 4698} 4699 4700// Do executes the "authorizedbuyersmarketplace.buyers.clients.list" call. 4701// Exactly one of *ListClientsResponse or error will be non-nil. Any 4702// non-2xx status code is an error. Response headers are in either 4703// *ListClientsResponse.ServerResponse.Header or (if a response was 4704// returned at all) in error.(*googleapi.Error).Header. Use 4705// googleapi.IsNotModified to check whether the returned error was 4706// because http.StatusNotModified was returned. 4707func (c *BuyersClientsListCall) Do(opts ...googleapi.CallOption) (*ListClientsResponse, error) { 4708 gensupport.SetOptions(c.urlParams_, opts...) 4709 res, err := c.doRequest("json") 4710 if res != nil && res.StatusCode == http.StatusNotModified { 4711 if res.Body != nil { 4712 res.Body.Close() 4713 } 4714 return nil, &googleapi.Error{ 4715 Code: res.StatusCode, 4716 Header: res.Header, 4717 } 4718 } 4719 if err != nil { 4720 return nil, err 4721 } 4722 defer googleapi.CloseBody(res) 4723 if err := googleapi.CheckResponse(res); err != nil { 4724 return nil, err 4725 } 4726 ret := &ListClientsResponse{ 4727 ServerResponse: googleapi.ServerResponse{ 4728 Header: res.Header, 4729 HTTPStatusCode: res.StatusCode, 4730 }, 4731 } 4732 target := &ret 4733 if err := gensupport.DecodeResponse(target, res); err != nil { 4734 return nil, err 4735 } 4736 return ret, nil 4737 // { 4738 // "description": "Lists all the clients for the current buyer.", 4739 // "flatPath": "v1/buyers/{buyersId}/clients", 4740 // "httpMethod": "GET", 4741 // "id": "authorizedbuyersmarketplace.buyers.clients.list", 4742 // "parameterOrder": [ 4743 // "parent" 4744 // ], 4745 // "parameters": { 4746 // "filter": { 4747 // "description": "Query string using the [Filtering Syntax](https://developers.google.com/authorized-buyers/apis/guides/v2/list-filters) Supported fields for filtering are: * partnerClientId Use this field to filter the clients by the partnerClientId. For example, if the partnerClientId of the client is \"1234\", the value of this field should be `partnerClientId = \"1234\"`, in order to get only the client whose partnerClientId is \"1234\" in the response.", 4748 // "location": "query", 4749 // "type": "string" 4750 // }, 4751 // "pageSize": { 4752 // "description": "Requested page size. If left blank, a default page size of 500 will be applied.", 4753 // "format": "int32", 4754 // "location": "query", 4755 // "type": "integer" 4756 // }, 4757 // "pageToken": { 4758 // "description": "A token identifying a page of results the server should return. Typically, this is the value of ListClientsResponse.nextPageToken returned from the previous call to the list method.", 4759 // "location": "query", 4760 // "type": "string" 4761 // }, 4762 // "parent": { 4763 // "description": "Required. The name of the buyer. Format: `buyers/{accountId}`", 4764 // "location": "path", 4765 // "pattern": "^buyers/[^/]+$", 4766 // "required": true, 4767 // "type": "string" 4768 // } 4769 // }, 4770 // "path": "v1/{+parent}/clients", 4771 // "response": { 4772 // "$ref": "ListClientsResponse" 4773 // }, 4774 // "scopes": [ 4775 // "https://www.googleapis.com/auth/authorized-buyers-marketplace" 4776 // ] 4777 // } 4778 4779} 4780 4781// Pages invokes f for each page of results. 4782// A non-nil error returned from f will halt the iteration. 4783// The provided context supersedes any context provided to the Context method. 4784func (c *BuyersClientsListCall) Pages(ctx context.Context, f func(*ListClientsResponse) error) error { 4785 c.ctx_ = ctx 4786 defer c.PageToken(c.urlParams_.Get("pageToken")) // reset paging to original point 4787 for { 4788 x, err := c.Do() 4789 if err != nil { 4790 return err 4791 } 4792 if err := f(x); err != nil { 4793 return err 4794 } 4795 if x.NextPageToken == "" { 4796 return nil 4797 } 4798 c.PageToken(x.NextPageToken) 4799 } 4800} 4801 4802// method id "authorizedbuyersmarketplace.buyers.clients.patch": 4803 4804type BuyersClientsPatchCall struct { 4805 s *Service 4806 name string 4807 client *Client 4808 urlParams_ gensupport.URLParams 4809 ctx_ context.Context 4810 header_ http.Header 4811} 4812 4813// Patch: Updates an existing client. 4814// 4815// - name: Output only. The resource name of the client. Format: 4816// `buyers/{accountId}/clients/{clientAccountId}`. 4817func (r *BuyersClientsService) Patch(name string, client *Client) *BuyersClientsPatchCall { 4818 c := &BuyersClientsPatchCall{s: r.s, urlParams_: make(gensupport.URLParams)} 4819 c.name = name 4820 c.client = client 4821 return c 4822} 4823 4824// UpdateMask sets the optional parameter "updateMask": List of fields 4825// to be updated. If empty or unspecified, the service will update all 4826// fields populated in the update request excluding the output only 4827// fields and primitive fields with default value. Note that explicit 4828// field mask is required in order to reset a primitive field back to 4829// its default value, e.g. false for boolean fields, 0 for integer 4830// fields. A special field mask consisting of a single path "*" can be 4831// used to indicate full replacement(the equivalent of PUT method), 4832// updatable fields unset or unspecified in the input will be cleared or 4833// set to default value. Output only fields will be ignored regardless 4834// of the value of updateMask. 4835func (c *BuyersClientsPatchCall) UpdateMask(updateMask string) *BuyersClientsPatchCall { 4836 c.urlParams_.Set("updateMask", updateMask) 4837 return c 4838} 4839 4840// Fields allows partial responses to be retrieved. See 4841// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse 4842// for more information. 4843func (c *BuyersClientsPatchCall) Fields(s ...googleapi.Field) *BuyersClientsPatchCall { 4844 c.urlParams_.Set("fields", googleapi.CombineFields(s)) 4845 return c 4846} 4847 4848// Context sets the context to be used in this call's Do method. Any 4849// pending HTTP request will be aborted if the provided context is 4850// canceled. 4851func (c *BuyersClientsPatchCall) Context(ctx context.Context) *BuyersClientsPatchCall { 4852 c.ctx_ = ctx 4853 return c 4854} 4855 4856// Header returns an http.Header that can be modified by the caller to 4857// add HTTP headers to the request. 4858func (c *BuyersClientsPatchCall) Header() http.Header { 4859 if c.header_ == nil { 4860 c.header_ = make(http.Header) 4861 } 4862 return c.header_ 4863} 4864 4865func (c *BuyersClientsPatchCall) doRequest(alt string) (*http.Response, error) { 4866 reqHeaders := make(http.Header) 4867 reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/20211027") 4868 for k, v := range c.header_ { 4869 reqHeaders[k] = v 4870 } 4871 reqHeaders.Set("User-Agent", c.s.userAgent()) 4872 var body io.Reader = nil 4873 body, err := googleapi.WithoutDataWrapper.JSONReader(c.client) 4874 if err != nil { 4875 return nil, err 4876 } 4877 reqHeaders.Set("Content-Type", "application/json") 4878 c.urlParams_.Set("alt", alt) 4879 c.urlParams_.Set("prettyPrint", "false") 4880 urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+name}") 4881 urls += "?" + c.urlParams_.Encode() 4882 req, err := http.NewRequest("PATCH", urls, body) 4883 if err != nil { 4884 return nil, err 4885 } 4886 req.Header = reqHeaders 4887 googleapi.Expand(req.URL, map[string]string{ 4888 "name": c.name, 4889 }) 4890 return gensupport.SendRequest(c.ctx_, c.s.client, req) 4891} 4892 4893// Do executes the "authorizedbuyersmarketplace.buyers.clients.patch" call. 4894// Exactly one of *Client or error will be non-nil. Any non-2xx status 4895// code is an error. Response headers are in either 4896// *Client.ServerResponse.Header or (if a response was returned at all) 4897// in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to 4898// check whether the returned error was because http.StatusNotModified 4899// was returned. 4900func (c *BuyersClientsPatchCall) Do(opts ...googleapi.CallOption) (*Client, error) { 4901 gensupport.SetOptions(c.urlParams_, opts...) 4902 res, err := c.doRequest("json") 4903 if res != nil && res.StatusCode == http.StatusNotModified { 4904 if res.Body != nil { 4905 res.Body.Close() 4906 } 4907 return nil, &googleapi.Error{ 4908 Code: res.StatusCode, 4909 Header: res.Header, 4910 } 4911 } 4912 if err != nil { 4913 return nil, err 4914 } 4915 defer googleapi.CloseBody(res) 4916 if err := googleapi.CheckResponse(res); err != nil { 4917 return nil, err 4918 } 4919 ret := &Client{ 4920 ServerResponse: googleapi.ServerResponse{ 4921 Header: res.Header, 4922 HTTPStatusCode: res.StatusCode, 4923 }, 4924 } 4925 target := &ret 4926 if err := gensupport.DecodeResponse(target, res); err != nil { 4927 return nil, err 4928 } 4929 return ret, nil 4930 // { 4931 // "description": "Updates an existing client.", 4932 // "flatPath": "v1/buyers/{buyersId}/clients/{clientsId}", 4933 // "httpMethod": "PATCH", 4934 // "id": "authorizedbuyersmarketplace.buyers.clients.patch", 4935 // "parameterOrder": [ 4936 // "name" 4937 // ], 4938 // "parameters": { 4939 // "name": { 4940 // "description": "Output only. The resource name of the client. Format: `buyers/{accountId}/clients/{clientAccountId}`", 4941 // "location": "path", 4942 // "pattern": "^buyers/[^/]+/clients/[^/]+$", 4943 // "required": true, 4944 // "type": "string" 4945 // }, 4946 // "updateMask": { 4947 // "description": "List of fields to be updated. If empty or unspecified, the service will update all fields populated in the update request excluding the output only fields and primitive fields with default value. Note that explicit field mask is required in order to reset a primitive field back to its default value, e.g. false for boolean fields, 0 for integer fields. A special field mask consisting of a single path \"*\" can be used to indicate full replacement(the equivalent of PUT method), updatable fields unset or unspecified in the input will be cleared or set to default value. Output only fields will be ignored regardless of the value of updateMask.", 4948 // "format": "google-fieldmask", 4949 // "location": "query", 4950 // "type": "string" 4951 // } 4952 // }, 4953 // "path": "v1/{+name}", 4954 // "request": { 4955 // "$ref": "Client" 4956 // }, 4957 // "response": { 4958 // "$ref": "Client" 4959 // }, 4960 // "scopes": [ 4961 // "https://www.googleapis.com/auth/authorized-buyers-marketplace" 4962 // ] 4963 // } 4964 4965} 4966 4967// method id "authorizedbuyersmarketplace.buyers.clients.users.activate": 4968 4969type BuyersClientsUsersActivateCall struct { 4970 s *Service 4971 name string 4972 activateclientuserrequest *ActivateClientUserRequest 4973 urlParams_ gensupport.URLParams 4974 ctx_ context.Context 4975 header_ http.Header 4976} 4977 4978// Activate: Activates an existing client user. The state of the client 4979// user will be updated from "INACTIVE" to "ACTIVE". This method has no 4980// effect if the client user is already in "ACTIVE" state. An error will 4981// be returned if the client user to activate is still in "INVITED" 4982// state. 4983// 4984// - name: Format: 4985// `buyers/{buyerAccountId}/clients/{clientAccountId}/clientUsers/{user 4986// Id}`. 4987func (r *BuyersClientsUsersService) Activate(name string, activateclientuserrequest *ActivateClientUserRequest) *BuyersClientsUsersActivateCall { 4988 c := &BuyersClientsUsersActivateCall{s: r.s, urlParams_: make(gensupport.URLParams)} 4989 c.name = name 4990 c.activateclientuserrequest = activateclientuserrequest 4991 return c 4992} 4993 4994// Fields allows partial responses to be retrieved. See 4995// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse 4996// for more information. 4997func (c *BuyersClientsUsersActivateCall) Fields(s ...googleapi.Field) *BuyersClientsUsersActivateCall { 4998 c.urlParams_.Set("fields", googleapi.CombineFields(s)) 4999 return c 5000} 5001 5002// Context sets the context to be used in this call's Do method. Any 5003// pending HTTP request will be aborted if the provided context is 5004// canceled. 5005func (c *BuyersClientsUsersActivateCall) Context(ctx context.Context) *BuyersClientsUsersActivateCall { 5006 c.ctx_ = ctx 5007 return c 5008} 5009 5010// Header returns an http.Header that can be modified by the caller to 5011// add HTTP headers to the request. 5012func (c *BuyersClientsUsersActivateCall) Header() http.Header { 5013 if c.header_ == nil { 5014 c.header_ = make(http.Header) 5015 } 5016 return c.header_ 5017} 5018 5019func (c *BuyersClientsUsersActivateCall) doRequest(alt string) (*http.Response, error) { 5020 reqHeaders := make(http.Header) 5021 reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/20211027") 5022 for k, v := range c.header_ { 5023 reqHeaders[k] = v 5024 } 5025 reqHeaders.Set("User-Agent", c.s.userAgent()) 5026 var body io.Reader = nil 5027 body, err := googleapi.WithoutDataWrapper.JSONReader(c.activateclientuserrequest) 5028 if err != nil { 5029 return nil, err 5030 } 5031 reqHeaders.Set("Content-Type", "application/json") 5032 c.urlParams_.Set("alt", alt) 5033 c.urlParams_.Set("prettyPrint", "false") 5034 urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+name}:activate") 5035 urls += "?" + c.urlParams_.Encode() 5036 req, err := http.NewRequest("POST", urls, body) 5037 if err != nil { 5038 return nil, err 5039 } 5040 req.Header = reqHeaders 5041 googleapi.Expand(req.URL, map[string]string{ 5042 "name": c.name, 5043 }) 5044 return gensupport.SendRequest(c.ctx_, c.s.client, req) 5045} 5046 5047// Do executes the "authorizedbuyersmarketplace.buyers.clients.users.activate" call. 5048// Exactly one of *ClientUser or error will be non-nil. Any non-2xx 5049// status code is an error. Response headers are in either 5050// *ClientUser.ServerResponse.Header or (if a response was returned at 5051// all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified 5052// to check whether the returned error was because 5053// http.StatusNotModified was returned. 5054func (c *BuyersClientsUsersActivateCall) Do(opts ...googleapi.CallOption) (*ClientUser, error) { 5055 gensupport.SetOptions(c.urlParams_, opts...) 5056 res, err := c.doRequest("json") 5057 if res != nil && res.StatusCode == http.StatusNotModified { 5058 if res.Body != nil { 5059 res.Body.Close() 5060 } 5061 return nil, &googleapi.Error{ 5062 Code: res.StatusCode, 5063 Header: res.Header, 5064 } 5065 } 5066 if err != nil { 5067 return nil, err 5068 } 5069 defer googleapi.CloseBody(res) 5070 if err := googleapi.CheckResponse(res); err != nil { 5071 return nil, err 5072 } 5073 ret := &ClientUser{ 5074 ServerResponse: googleapi.ServerResponse{ 5075 Header: res.Header, 5076 HTTPStatusCode: res.StatusCode, 5077 }, 5078 } 5079 target := &ret 5080 if err := gensupport.DecodeResponse(target, res); err != nil { 5081 return nil, err 5082 } 5083 return ret, nil 5084 // { 5085 // "description": "Activates an existing client user. The state of the client user will be updated from \"INACTIVE\" to \"ACTIVE\". This method has no effect if the client user is already in \"ACTIVE\" state. An error will be returned if the client user to activate is still in \"INVITED\" state.", 5086 // "flatPath": "v1/buyers/{buyersId}/clients/{clientsId}/users/{usersId}:activate", 5087 // "httpMethod": "POST", 5088 // "id": "authorizedbuyersmarketplace.buyers.clients.users.activate", 5089 // "parameterOrder": [ 5090 // "name" 5091 // ], 5092 // "parameters": { 5093 // "name": { 5094 // "description": "Required. Format: `buyers/{buyerAccountId}/clients/{clientAccountId}/clientUsers/{userId}`", 5095 // "location": "path", 5096 // "pattern": "^buyers/[^/]+/clients/[^/]+/users/[^/]+$", 5097 // "required": true, 5098 // "type": "string" 5099 // } 5100 // }, 5101 // "path": "v1/{+name}:activate", 5102 // "request": { 5103 // "$ref": "ActivateClientUserRequest" 5104 // }, 5105 // "response": { 5106 // "$ref": "ClientUser" 5107 // }, 5108 // "scopes": [ 5109 // "https://www.googleapis.com/auth/authorized-buyers-marketplace" 5110 // ] 5111 // } 5112 5113} 5114 5115// method id "authorizedbuyersmarketplace.buyers.clients.users.create": 5116 5117type BuyersClientsUsersCreateCall struct { 5118 s *Service 5119 parent string 5120 clientuser *ClientUser 5121 urlParams_ gensupport.URLParams 5122 ctx_ context.Context 5123 header_ http.Header 5124} 5125 5126// Create: Creates a new client user in "INVITED" state. An email 5127// invitation will be sent to the new user, once accepted the user will 5128// become active. 5129// 5130// - parent: The name of the client. Format: 5131// `buyers/{accountId}/clients/{clientAccountId}`. 5132func (r *BuyersClientsUsersService) Create(parent string, clientuser *ClientUser) *BuyersClientsUsersCreateCall { 5133 c := &BuyersClientsUsersCreateCall{s: r.s, urlParams_: make(gensupport.URLParams)} 5134 c.parent = parent 5135 c.clientuser = clientuser 5136 return c 5137} 5138 5139// Fields allows partial responses to be retrieved. See 5140// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse 5141// for more information. 5142func (c *BuyersClientsUsersCreateCall) Fields(s ...googleapi.Field) *BuyersClientsUsersCreateCall { 5143 c.urlParams_.Set("fields", googleapi.CombineFields(s)) 5144 return c 5145} 5146 5147// Context sets the context to be used in this call's Do method. Any 5148// pending HTTP request will be aborted if the provided context is 5149// canceled. 5150func (c *BuyersClientsUsersCreateCall) Context(ctx context.Context) *BuyersClientsUsersCreateCall { 5151 c.ctx_ = ctx 5152 return c 5153} 5154 5155// Header returns an http.Header that can be modified by the caller to 5156// add HTTP headers to the request. 5157func (c *BuyersClientsUsersCreateCall) Header() http.Header { 5158 if c.header_ == nil { 5159 c.header_ = make(http.Header) 5160 } 5161 return c.header_ 5162} 5163 5164func (c *BuyersClientsUsersCreateCall) doRequest(alt string) (*http.Response, error) { 5165 reqHeaders := make(http.Header) 5166 reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/20211027") 5167 for k, v := range c.header_ { 5168 reqHeaders[k] = v 5169 } 5170 reqHeaders.Set("User-Agent", c.s.userAgent()) 5171 var body io.Reader = nil 5172 body, err := googleapi.WithoutDataWrapper.JSONReader(c.clientuser) 5173 if err != nil { 5174 return nil, err 5175 } 5176 reqHeaders.Set("Content-Type", "application/json") 5177 c.urlParams_.Set("alt", alt) 5178 c.urlParams_.Set("prettyPrint", "false") 5179 urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+parent}/users") 5180 urls += "?" + c.urlParams_.Encode() 5181 req, err := http.NewRequest("POST", urls, body) 5182 if err != nil { 5183 return nil, err 5184 } 5185 req.Header = reqHeaders 5186 googleapi.Expand(req.URL, map[string]string{ 5187 "parent": c.parent, 5188 }) 5189 return gensupport.SendRequest(c.ctx_, c.s.client, req) 5190} 5191 5192// Do executes the "authorizedbuyersmarketplace.buyers.clients.users.create" call. 5193// Exactly one of *ClientUser or error will be non-nil. Any non-2xx 5194// status code is an error. Response headers are in either 5195// *ClientUser.ServerResponse.Header or (if a response was returned at 5196// all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified 5197// to check whether the returned error was because 5198// http.StatusNotModified was returned. 5199func (c *BuyersClientsUsersCreateCall) Do(opts ...googleapi.CallOption) (*ClientUser, error) { 5200 gensupport.SetOptions(c.urlParams_, opts...) 5201 res, err := c.doRequest("json") 5202 if res != nil && res.StatusCode == http.StatusNotModified { 5203 if res.Body != nil { 5204 res.Body.Close() 5205 } 5206 return nil, &googleapi.Error{ 5207 Code: res.StatusCode, 5208 Header: res.Header, 5209 } 5210 } 5211 if err != nil { 5212 return nil, err 5213 } 5214 defer googleapi.CloseBody(res) 5215 if err := googleapi.CheckResponse(res); err != nil { 5216 return nil, err 5217 } 5218 ret := &ClientUser{ 5219 ServerResponse: googleapi.ServerResponse{ 5220 Header: res.Header, 5221 HTTPStatusCode: res.StatusCode, 5222 }, 5223 } 5224 target := &ret 5225 if err := gensupport.DecodeResponse(target, res); err != nil { 5226 return nil, err 5227 } 5228 return ret, nil 5229 // { 5230 // "description": "Creates a new client user in \"INVITED\" state. An email invitation will be sent to the new user, once accepted the user will become active.", 5231 // "flatPath": "v1/buyers/{buyersId}/clients/{clientsId}/users", 5232 // "httpMethod": "POST", 5233 // "id": "authorizedbuyersmarketplace.buyers.clients.users.create", 5234 // "parameterOrder": [ 5235 // "parent" 5236 // ], 5237 // "parameters": { 5238 // "parent": { 5239 // "description": "Required. The name of the client. Format: `buyers/{accountId}/clients/{clientAccountId}`", 5240 // "location": "path", 5241 // "pattern": "^buyers/[^/]+/clients/[^/]+$", 5242 // "required": true, 5243 // "type": "string" 5244 // } 5245 // }, 5246 // "path": "v1/{+parent}/users", 5247 // "request": { 5248 // "$ref": "ClientUser" 5249 // }, 5250 // "response": { 5251 // "$ref": "ClientUser" 5252 // }, 5253 // "scopes": [ 5254 // "https://www.googleapis.com/auth/authorized-buyers-marketplace" 5255 // ] 5256 // } 5257 5258} 5259 5260// method id "authorizedbuyersmarketplace.buyers.clients.users.deactivate": 5261 5262type BuyersClientsUsersDeactivateCall struct { 5263 s *Service 5264 name string 5265 deactivateclientuserrequest *DeactivateClientUserRequest 5266 urlParams_ gensupport.URLParams 5267 ctx_ context.Context 5268 header_ http.Header 5269} 5270 5271// Deactivate: Deactivates an existing client user. The state of the 5272// client user will be updated from "ACTIVE" to "INACTIVE". This method 5273// has no effect if the client user is already in "INACTIVE" state. An 5274// error will be returned if the client user to deactivate is still in 5275// "INVITED" state. 5276// 5277// - name: Format: 5278// `buyers/{buyerAccountId}/clients/{clientAccountId}/clientUsers/{user 5279// Id}`. 5280func (r *BuyersClientsUsersService) Deactivate(name string, deactivateclientuserrequest *DeactivateClientUserRequest) *BuyersClientsUsersDeactivateCall { 5281 c := &BuyersClientsUsersDeactivateCall{s: r.s, urlParams_: make(gensupport.URLParams)} 5282 c.name = name 5283 c.deactivateclientuserrequest = deactivateclientuserrequest 5284 return c 5285} 5286 5287// Fields allows partial responses to be retrieved. See 5288// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse 5289// for more information. 5290func (c *BuyersClientsUsersDeactivateCall) Fields(s ...googleapi.Field) *BuyersClientsUsersDeactivateCall { 5291 c.urlParams_.Set("fields", googleapi.CombineFields(s)) 5292 return c 5293} 5294 5295// Context sets the context to be used in this call's Do method. Any 5296// pending HTTP request will be aborted if the provided context is 5297// canceled. 5298func (c *BuyersClientsUsersDeactivateCall) Context(ctx context.Context) *BuyersClientsUsersDeactivateCall { 5299 c.ctx_ = ctx 5300 return c 5301} 5302 5303// Header returns an http.Header that can be modified by the caller to 5304// add HTTP headers to the request. 5305func (c *BuyersClientsUsersDeactivateCall) Header() http.Header { 5306 if c.header_ == nil { 5307 c.header_ = make(http.Header) 5308 } 5309 return c.header_ 5310} 5311 5312func (c *BuyersClientsUsersDeactivateCall) doRequest(alt string) (*http.Response, error) { 5313 reqHeaders := make(http.Header) 5314 reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/20211027") 5315 for k, v := range c.header_ { 5316 reqHeaders[k] = v 5317 } 5318 reqHeaders.Set("User-Agent", c.s.userAgent()) 5319 var body io.Reader = nil 5320 body, err := googleapi.WithoutDataWrapper.JSONReader(c.deactivateclientuserrequest) 5321 if err != nil { 5322 return nil, err 5323 } 5324 reqHeaders.Set("Content-Type", "application/json") 5325 c.urlParams_.Set("alt", alt) 5326 c.urlParams_.Set("prettyPrint", "false") 5327 urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+name}:deactivate") 5328 urls += "?" + c.urlParams_.Encode() 5329 req, err := http.NewRequest("POST", urls, body) 5330 if err != nil { 5331 return nil, err 5332 } 5333 req.Header = reqHeaders 5334 googleapi.Expand(req.URL, map[string]string{ 5335 "name": c.name, 5336 }) 5337 return gensupport.SendRequest(c.ctx_, c.s.client, req) 5338} 5339 5340// Do executes the "authorizedbuyersmarketplace.buyers.clients.users.deactivate" call. 5341// Exactly one of *ClientUser or error will be non-nil. Any non-2xx 5342// status code is an error. Response headers are in either 5343// *ClientUser.ServerResponse.Header or (if a response was returned at 5344// all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified 5345// to check whether the returned error was because 5346// http.StatusNotModified was returned. 5347func (c *BuyersClientsUsersDeactivateCall) Do(opts ...googleapi.CallOption) (*ClientUser, error) { 5348 gensupport.SetOptions(c.urlParams_, opts...) 5349 res, err := c.doRequest("json") 5350 if res != nil && res.StatusCode == http.StatusNotModified { 5351 if res.Body != nil { 5352 res.Body.Close() 5353 } 5354 return nil, &googleapi.Error{ 5355 Code: res.StatusCode, 5356 Header: res.Header, 5357 } 5358 } 5359 if err != nil { 5360 return nil, err 5361 } 5362 defer googleapi.CloseBody(res) 5363 if err := googleapi.CheckResponse(res); err != nil { 5364 return nil, err 5365 } 5366 ret := &ClientUser{ 5367 ServerResponse: googleapi.ServerResponse{ 5368 Header: res.Header, 5369 HTTPStatusCode: res.StatusCode, 5370 }, 5371 } 5372 target := &ret 5373 if err := gensupport.DecodeResponse(target, res); err != nil { 5374 return nil, err 5375 } 5376 return ret, nil 5377 // { 5378 // "description": "Deactivates an existing client user. The state of the client user will be updated from \"ACTIVE\" to \"INACTIVE\". This method has no effect if the client user is already in \"INACTIVE\" state. An error will be returned if the client user to deactivate is still in \"INVITED\" state.", 5379 // "flatPath": "v1/buyers/{buyersId}/clients/{clientsId}/users/{usersId}:deactivate", 5380 // "httpMethod": "POST", 5381 // "id": "authorizedbuyersmarketplace.buyers.clients.users.deactivate", 5382 // "parameterOrder": [ 5383 // "name" 5384 // ], 5385 // "parameters": { 5386 // "name": { 5387 // "description": "Required. Format: `buyers/{buyerAccountId}/clients/{clientAccountId}/clientUsers/{userId}`", 5388 // "location": "path", 5389 // "pattern": "^buyers/[^/]+/clients/[^/]+/users/[^/]+$", 5390 // "required": true, 5391 // "type": "string" 5392 // } 5393 // }, 5394 // "path": "v1/{+name}:deactivate", 5395 // "request": { 5396 // "$ref": "DeactivateClientUserRequest" 5397 // }, 5398 // "response": { 5399 // "$ref": "ClientUser" 5400 // }, 5401 // "scopes": [ 5402 // "https://www.googleapis.com/auth/authorized-buyers-marketplace" 5403 // ] 5404 // } 5405 5406} 5407 5408// method id "authorizedbuyersmarketplace.buyers.clients.users.delete": 5409 5410type BuyersClientsUsersDeleteCall struct { 5411 s *Service 5412 name string 5413 urlParams_ gensupport.URLParams 5414 ctx_ context.Context 5415 header_ http.Header 5416} 5417 5418// Delete: Deletes an existing client user. The client user will lose 5419// access to the Authorized Buyers UI. Note that if a client user is 5420// deleted, the user's access to the UI can't be restored unless a new 5421// client user is created and activated. 5422// 5423// - name: Format: 5424// `buyers/{buyerAccountId}/clients/{clientAccountId}/clientUsers/{user 5425// Id}`. 5426func (r *BuyersClientsUsersService) Delete(name string) *BuyersClientsUsersDeleteCall { 5427 c := &BuyersClientsUsersDeleteCall{s: r.s, urlParams_: make(gensupport.URLParams)} 5428 c.name = name 5429 return c 5430} 5431 5432// Fields allows partial responses to be retrieved. See 5433// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse 5434// for more information. 5435func (c *BuyersClientsUsersDeleteCall) Fields(s ...googleapi.Field) *BuyersClientsUsersDeleteCall { 5436 c.urlParams_.Set("fields", googleapi.CombineFields(s)) 5437 return c 5438} 5439 5440// Context sets the context to be used in this call's Do method. Any 5441// pending HTTP request will be aborted if the provided context is 5442// canceled. 5443func (c *BuyersClientsUsersDeleteCall) Context(ctx context.Context) *BuyersClientsUsersDeleteCall { 5444 c.ctx_ = ctx 5445 return c 5446} 5447 5448// Header returns an http.Header that can be modified by the caller to 5449// add HTTP headers to the request. 5450func (c *BuyersClientsUsersDeleteCall) Header() http.Header { 5451 if c.header_ == nil { 5452 c.header_ = make(http.Header) 5453 } 5454 return c.header_ 5455} 5456 5457func (c *BuyersClientsUsersDeleteCall) doRequest(alt string) (*http.Response, error) { 5458 reqHeaders := make(http.Header) 5459 reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/20211027") 5460 for k, v := range c.header_ { 5461 reqHeaders[k] = v 5462 } 5463 reqHeaders.Set("User-Agent", c.s.userAgent()) 5464 var body io.Reader = nil 5465 c.urlParams_.Set("alt", alt) 5466 c.urlParams_.Set("prettyPrint", "false") 5467 urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+name}") 5468 urls += "?" + c.urlParams_.Encode() 5469 req, err := http.NewRequest("DELETE", urls, body) 5470 if err != nil { 5471 return nil, err 5472 } 5473 req.Header = reqHeaders 5474 googleapi.Expand(req.URL, map[string]string{ 5475 "name": c.name, 5476 }) 5477 return gensupport.SendRequest(c.ctx_, c.s.client, req) 5478} 5479 5480// Do executes the "authorizedbuyersmarketplace.buyers.clients.users.delete" call. 5481// Exactly one of *Empty or error will be non-nil. Any non-2xx status 5482// code is an error. Response headers are in either 5483// *Empty.ServerResponse.Header or (if a response was returned at all) 5484// in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to 5485// check whether the returned error was because http.StatusNotModified 5486// was returned. 5487func (c *BuyersClientsUsersDeleteCall) Do(opts ...googleapi.CallOption) (*Empty, error) { 5488 gensupport.SetOptions(c.urlParams_, opts...) 5489 res, err := c.doRequest("json") 5490 if res != nil && res.StatusCode == http.StatusNotModified { 5491 if res.Body != nil { 5492 res.Body.Close() 5493 } 5494 return nil, &googleapi.Error{ 5495 Code: res.StatusCode, 5496 Header: res.Header, 5497 } 5498 } 5499 if err != nil { 5500 return nil, err 5501 } 5502 defer googleapi.CloseBody(res) 5503 if err := googleapi.CheckResponse(res); err != nil { 5504 return nil, err 5505 } 5506 ret := &Empty{ 5507 ServerResponse: googleapi.ServerResponse{ 5508 Header: res.Header, 5509 HTTPStatusCode: res.StatusCode, 5510 }, 5511 } 5512 target := &ret 5513 if err := gensupport.DecodeResponse(target, res); err != nil { 5514 return nil, err 5515 } 5516 return ret, nil 5517 // { 5518 // "description": "Deletes an existing client user. The client user will lose access to the Authorized Buyers UI. Note that if a client user is deleted, the user's access to the UI can't be restored unless a new client user is created and activated.", 5519 // "flatPath": "v1/buyers/{buyersId}/clients/{clientsId}/users/{usersId}", 5520 // "httpMethod": "DELETE", 5521 // "id": "authorizedbuyersmarketplace.buyers.clients.users.delete", 5522 // "parameterOrder": [ 5523 // "name" 5524 // ], 5525 // "parameters": { 5526 // "name": { 5527 // "description": "Required. Format: `buyers/{buyerAccountId}/clients/{clientAccountId}/clientUsers/{userId}`", 5528 // "location": "path", 5529 // "pattern": "^buyers/[^/]+/clients/[^/]+/users/[^/]+$", 5530 // "required": true, 5531 // "type": "string" 5532 // } 5533 // }, 5534 // "path": "v1/{+name}", 5535 // "response": { 5536 // "$ref": "Empty" 5537 // }, 5538 // "scopes": [ 5539 // "https://www.googleapis.com/auth/authorized-buyers-marketplace" 5540 // ] 5541 // } 5542 5543} 5544 5545// method id "authorizedbuyersmarketplace.buyers.clients.users.get": 5546 5547type BuyersClientsUsersGetCall struct { 5548 s *Service 5549 name string 5550 urlParams_ gensupport.URLParams 5551 ifNoneMatch_ string 5552 ctx_ context.Context 5553 header_ http.Header 5554} 5555 5556// Get: Retrieves an existing client user. 5557// 5558// - name: Format: 5559// `buyers/{buyerAccountId}/clients/{clientAccountId}/clientUsers/{user 5560// Id}`. 5561func (r *BuyersClientsUsersService) Get(name string) *BuyersClientsUsersGetCall { 5562 c := &BuyersClientsUsersGetCall{s: r.s, urlParams_: make(gensupport.URLParams)} 5563 c.name = name 5564 return c 5565} 5566 5567// Fields allows partial responses to be retrieved. See 5568// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse 5569// for more information. 5570func (c *BuyersClientsUsersGetCall) Fields(s ...googleapi.Field) *BuyersClientsUsersGetCall { 5571 c.urlParams_.Set("fields", googleapi.CombineFields(s)) 5572 return c 5573} 5574 5575// IfNoneMatch sets the optional parameter which makes the operation 5576// fail if the object's ETag matches the given value. This is useful for 5577// getting updates only after the object has changed since the last 5578// request. Use googleapi.IsNotModified to check whether the response 5579// error from Do is the result of In-None-Match. 5580func (c *BuyersClientsUsersGetCall) IfNoneMatch(entityTag string) *BuyersClientsUsersGetCall { 5581 c.ifNoneMatch_ = entityTag 5582 return c 5583} 5584 5585// Context sets the context to be used in this call's Do method. Any 5586// pending HTTP request will be aborted if the provided context is 5587// canceled. 5588func (c *BuyersClientsUsersGetCall) Context(ctx context.Context) *BuyersClientsUsersGetCall { 5589 c.ctx_ = ctx 5590 return c 5591} 5592 5593// Header returns an http.Header that can be modified by the caller to 5594// add HTTP headers to the request. 5595func (c *BuyersClientsUsersGetCall) Header() http.Header { 5596 if c.header_ == nil { 5597 c.header_ = make(http.Header) 5598 } 5599 return c.header_ 5600} 5601 5602func (c *BuyersClientsUsersGetCall) doRequest(alt string) (*http.Response, error) { 5603 reqHeaders := make(http.Header) 5604 reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/20211027") 5605 for k, v := range c.header_ { 5606 reqHeaders[k] = v 5607 } 5608 reqHeaders.Set("User-Agent", c.s.userAgent()) 5609 if c.ifNoneMatch_ != "" { 5610 reqHeaders.Set("If-None-Match", c.ifNoneMatch_) 5611 } 5612 var body io.Reader = nil 5613 c.urlParams_.Set("alt", alt) 5614 c.urlParams_.Set("prettyPrint", "false") 5615 urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+name}") 5616 urls += "?" + c.urlParams_.Encode() 5617 req, err := http.NewRequest("GET", urls, body) 5618 if err != nil { 5619 return nil, err 5620 } 5621 req.Header = reqHeaders 5622 googleapi.Expand(req.URL, map[string]string{ 5623 "name": c.name, 5624 }) 5625 return gensupport.SendRequest(c.ctx_, c.s.client, req) 5626} 5627 5628// Do executes the "authorizedbuyersmarketplace.buyers.clients.users.get" call. 5629// Exactly one of *ClientUser or error will be non-nil. Any non-2xx 5630// status code is an error. Response headers are in either 5631// *ClientUser.ServerResponse.Header or (if a response was returned at 5632// all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified 5633// to check whether the returned error was because 5634// http.StatusNotModified was returned. 5635func (c *BuyersClientsUsersGetCall) Do(opts ...googleapi.CallOption) (*ClientUser, error) { 5636 gensupport.SetOptions(c.urlParams_, opts...) 5637 res, err := c.doRequest("json") 5638 if res != nil && res.StatusCode == http.StatusNotModified { 5639 if res.Body != nil { 5640 res.Body.Close() 5641 } 5642 return nil, &googleapi.Error{ 5643 Code: res.StatusCode, 5644 Header: res.Header, 5645 } 5646 } 5647 if err != nil { 5648 return nil, err 5649 } 5650 defer googleapi.CloseBody(res) 5651 if err := googleapi.CheckResponse(res); err != nil { 5652 return nil, err 5653 } 5654 ret := &ClientUser{ 5655 ServerResponse: googleapi.ServerResponse{ 5656 Header: res.Header, 5657 HTTPStatusCode: res.StatusCode, 5658 }, 5659 } 5660 target := &ret 5661 if err := gensupport.DecodeResponse(target, res); err != nil { 5662 return nil, err 5663 } 5664 return ret, nil 5665 // { 5666 // "description": "Retrieves an existing client user.", 5667 // "flatPath": "v1/buyers/{buyersId}/clients/{clientsId}/users/{usersId}", 5668 // "httpMethod": "GET", 5669 // "id": "authorizedbuyersmarketplace.buyers.clients.users.get", 5670 // "parameterOrder": [ 5671 // "name" 5672 // ], 5673 // "parameters": { 5674 // "name": { 5675 // "description": "Required. Format: `buyers/{buyerAccountId}/clients/{clientAccountId}/clientUsers/{userId}`", 5676 // "location": "path", 5677 // "pattern": "^buyers/[^/]+/clients/[^/]+/users/[^/]+$", 5678 // "required": true, 5679 // "type": "string" 5680 // } 5681 // }, 5682 // "path": "v1/{+name}", 5683 // "response": { 5684 // "$ref": "ClientUser" 5685 // }, 5686 // "scopes": [ 5687 // "https://www.googleapis.com/auth/authorized-buyers-marketplace" 5688 // ] 5689 // } 5690 5691} 5692 5693// method id "authorizedbuyersmarketplace.buyers.clients.users.list": 5694 5695type BuyersClientsUsersListCall struct { 5696 s *Service 5697 parent string 5698 urlParams_ gensupport.URLParams 5699 ifNoneMatch_ string 5700 ctx_ context.Context 5701 header_ http.Header 5702} 5703 5704// List: Lists all client users for a specified client. 5705// 5706// - parent: The name of the client. Format: 5707// `buyers/{buyerAccountId}/clients/{clientAccountId}`. 5708func (r *BuyersClientsUsersService) List(parent string) *BuyersClientsUsersListCall { 5709 c := &BuyersClientsUsersListCall{s: r.s, urlParams_: make(gensupport.URLParams)} 5710 c.parent = parent 5711 return c 5712} 5713 5714// PageSize sets the optional parameter "pageSize": Requested page size. 5715// If left blank, a default page size of 500 will be applied. 5716func (c *BuyersClientsUsersListCall) PageSize(pageSize int64) *BuyersClientsUsersListCall { 5717 c.urlParams_.Set("pageSize", fmt.Sprint(pageSize)) 5718 return c 5719} 5720 5721// PageToken sets the optional parameter "pageToken": A token 5722// identifying a page of results the server should return. Typically, 5723// this is the value of ListClientUsersResponse.nextPageToken returned 5724// from the previous call to the list method. 5725func (c *BuyersClientsUsersListCall) PageToken(pageToken string) *BuyersClientsUsersListCall { 5726 c.urlParams_.Set("pageToken", pageToken) 5727 return c 5728} 5729 5730// Fields allows partial responses to be retrieved. See 5731// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse 5732// for more information. 5733func (c *BuyersClientsUsersListCall) Fields(s ...googleapi.Field) *BuyersClientsUsersListCall { 5734 c.urlParams_.Set("fields", googleapi.CombineFields(s)) 5735 return c 5736} 5737 5738// IfNoneMatch sets the optional parameter which makes the operation 5739// fail if the object's ETag matches the given value. This is useful for 5740// getting updates only after the object has changed since the last 5741// request. Use googleapi.IsNotModified to check whether the response 5742// error from Do is the result of In-None-Match. 5743func (c *BuyersClientsUsersListCall) IfNoneMatch(entityTag string) *BuyersClientsUsersListCall { 5744 c.ifNoneMatch_ = entityTag 5745 return c 5746} 5747 5748// Context sets the context to be used in this call's Do method. Any 5749// pending HTTP request will be aborted if the provided context is 5750// canceled. 5751func (c *BuyersClientsUsersListCall) Context(ctx context.Context) *BuyersClientsUsersListCall { 5752 c.ctx_ = ctx 5753 return c 5754} 5755 5756// Header returns an http.Header that can be modified by the caller to 5757// add HTTP headers to the request. 5758func (c *BuyersClientsUsersListCall) Header() http.Header { 5759 if c.header_ == nil { 5760 c.header_ = make(http.Header) 5761 } 5762 return c.header_ 5763} 5764 5765func (c *BuyersClientsUsersListCall) doRequest(alt string) (*http.Response, error) { 5766 reqHeaders := make(http.Header) 5767 reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/20211027") 5768 for k, v := range c.header_ { 5769 reqHeaders[k] = v 5770 } 5771 reqHeaders.Set("User-Agent", c.s.userAgent()) 5772 if c.ifNoneMatch_ != "" { 5773 reqHeaders.Set("If-None-Match", c.ifNoneMatch_) 5774 } 5775 var body io.Reader = nil 5776 c.urlParams_.Set("alt", alt) 5777 c.urlParams_.Set("prettyPrint", "false") 5778 urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+parent}/users") 5779 urls += "?" + c.urlParams_.Encode() 5780 req, err := http.NewRequest("GET", urls, body) 5781 if err != nil { 5782 return nil, err 5783 } 5784 req.Header = reqHeaders 5785 googleapi.Expand(req.URL, map[string]string{ 5786 "parent": c.parent, 5787 }) 5788 return gensupport.SendRequest(c.ctx_, c.s.client, req) 5789} 5790 5791// Do executes the "authorizedbuyersmarketplace.buyers.clients.users.list" call. 5792// Exactly one of *ListClientUsersResponse or error will be non-nil. Any 5793// non-2xx status code is an error. Response headers are in either 5794// *ListClientUsersResponse.ServerResponse.Header or (if a response was 5795// returned at all) in error.(*googleapi.Error).Header. Use 5796// googleapi.IsNotModified to check whether the returned error was 5797// because http.StatusNotModified was returned. 5798func (c *BuyersClientsUsersListCall) Do(opts ...googleapi.CallOption) (*ListClientUsersResponse, error) { 5799 gensupport.SetOptions(c.urlParams_, opts...) 5800 res, err := c.doRequest("json") 5801 if res != nil && res.StatusCode == http.StatusNotModified { 5802 if res.Body != nil { 5803 res.Body.Close() 5804 } 5805 return nil, &googleapi.Error{ 5806 Code: res.StatusCode, 5807 Header: res.Header, 5808 } 5809 } 5810 if err != nil { 5811 return nil, err 5812 } 5813 defer googleapi.CloseBody(res) 5814 if err := googleapi.CheckResponse(res); err != nil { 5815 return nil, err 5816 } 5817 ret := &ListClientUsersResponse{ 5818 ServerResponse: googleapi.ServerResponse{ 5819 Header: res.Header, 5820 HTTPStatusCode: res.StatusCode, 5821 }, 5822 } 5823 target := &ret 5824 if err := gensupport.DecodeResponse(target, res); err != nil { 5825 return nil, err 5826 } 5827 return ret, nil 5828 // { 5829 // "description": "Lists all client users for a specified client.", 5830 // "flatPath": "v1/buyers/{buyersId}/clients/{clientsId}/users", 5831 // "httpMethod": "GET", 5832 // "id": "authorizedbuyersmarketplace.buyers.clients.users.list", 5833 // "parameterOrder": [ 5834 // "parent" 5835 // ], 5836 // "parameters": { 5837 // "pageSize": { 5838 // "description": "Requested page size. If left blank, a default page size of 500 will be applied.", 5839 // "format": "int32", 5840 // "location": "query", 5841 // "type": "integer" 5842 // }, 5843 // "pageToken": { 5844 // "description": "A token identifying a page of results the server should return. Typically, this is the value of ListClientUsersResponse.nextPageToken returned from the previous call to the list method.", 5845 // "location": "query", 5846 // "type": "string" 5847 // }, 5848 // "parent": { 5849 // "description": "Required. The name of the client. Format: `buyers/{buyerAccountId}/clients/{clientAccountId}`", 5850 // "location": "path", 5851 // "pattern": "^buyers/[^/]+/clients/[^/]+$", 5852 // "required": true, 5853 // "type": "string" 5854 // } 5855 // }, 5856 // "path": "v1/{+parent}/users", 5857 // "response": { 5858 // "$ref": "ListClientUsersResponse" 5859 // }, 5860 // "scopes": [ 5861 // "https://www.googleapis.com/auth/authorized-buyers-marketplace" 5862 // ] 5863 // } 5864 5865} 5866 5867// Pages invokes f for each page of results. 5868// A non-nil error returned from f will halt the iteration. 5869// The provided context supersedes any context provided to the Context method. 5870func (c *BuyersClientsUsersListCall) Pages(ctx context.Context, f func(*ListClientUsersResponse) error) error { 5871 c.ctx_ = ctx 5872 defer c.PageToken(c.urlParams_.Get("pageToken")) // reset paging to original point 5873 for { 5874 x, err := c.Do() 5875 if err != nil { 5876 return err 5877 } 5878 if err := f(x); err != nil { 5879 return err 5880 } 5881 if x.NextPageToken == "" { 5882 return nil 5883 } 5884 c.PageToken(x.NextPageToken) 5885 } 5886} 5887 5888// method id "authorizedbuyersmarketplace.buyers.finalizedDeals.addCreative": 5889 5890type BuyersFinalizedDealsAddCreativeCall struct { 5891 s *Service 5892 deal string 5893 addcreativerequest *AddCreativeRequest 5894 urlParams_ gensupport.URLParams 5895 ctx_ context.Context 5896 header_ http.Header 5897} 5898 5899// AddCreative: Add creative to be used in the bidding process for a 5900// finalized deal. For programmatic guaranteed deals, it's recommended 5901// that you associate at least one approved creative with the deal 5902// before calling SetReadyToServe, to help reduce the number of bid 5903// responses filtered because they don't contain approved creatives. 5904// Creatives successfully added to a deal can be found in the 5905// Realtime-bidding Creatives API creative.deal_ids. This method only 5906// applies to programmatic guaranteed deals. Maximum number of 1000 5907// creatives can be added to a finalized deal. 5908// 5909// - deal: Name of the finalized deal in the format of: 5910// `buyers/{accountId}/finalizedDeals/{dealId}`. 5911func (r *BuyersFinalizedDealsService) AddCreative(deal string, addcreativerequest *AddCreativeRequest) *BuyersFinalizedDealsAddCreativeCall { 5912 c := &BuyersFinalizedDealsAddCreativeCall{s: r.s, urlParams_: make(gensupport.URLParams)} 5913 c.deal = deal 5914 c.addcreativerequest = addcreativerequest 5915 return c 5916} 5917 5918// Fields allows partial responses to be retrieved. See 5919// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse 5920// for more information. 5921func (c *BuyersFinalizedDealsAddCreativeCall) Fields(s ...googleapi.Field) *BuyersFinalizedDealsAddCreativeCall { 5922 c.urlParams_.Set("fields", googleapi.CombineFields(s)) 5923 return c 5924} 5925 5926// Context sets the context to be used in this call's Do method. Any 5927// pending HTTP request will be aborted if the provided context is 5928// canceled. 5929func (c *BuyersFinalizedDealsAddCreativeCall) Context(ctx context.Context) *BuyersFinalizedDealsAddCreativeCall { 5930 c.ctx_ = ctx 5931 return c 5932} 5933 5934// Header returns an http.Header that can be modified by the caller to 5935// add HTTP headers to the request. 5936func (c *BuyersFinalizedDealsAddCreativeCall) Header() http.Header { 5937 if c.header_ == nil { 5938 c.header_ = make(http.Header) 5939 } 5940 return c.header_ 5941} 5942 5943func (c *BuyersFinalizedDealsAddCreativeCall) doRequest(alt string) (*http.Response, error) { 5944 reqHeaders := make(http.Header) 5945 reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/20211027") 5946 for k, v := range c.header_ { 5947 reqHeaders[k] = v 5948 } 5949 reqHeaders.Set("User-Agent", c.s.userAgent()) 5950 var body io.Reader = nil 5951 body, err := googleapi.WithoutDataWrapper.JSONReader(c.addcreativerequest) 5952 if err != nil { 5953 return nil, err 5954 } 5955 reqHeaders.Set("Content-Type", "application/json") 5956 c.urlParams_.Set("alt", alt) 5957 c.urlParams_.Set("prettyPrint", "false") 5958 urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+deal}:addCreative") 5959 urls += "?" + c.urlParams_.Encode() 5960 req, err := http.NewRequest("POST", urls, body) 5961 if err != nil { 5962 return nil, err 5963 } 5964 req.Header = reqHeaders 5965 googleapi.Expand(req.URL, map[string]string{ 5966 "deal": c.deal, 5967 }) 5968 return gensupport.SendRequest(c.ctx_, c.s.client, req) 5969} 5970 5971// Do executes the "authorizedbuyersmarketplace.buyers.finalizedDeals.addCreative" call. 5972// Exactly one of *FinalizedDeal or error will be non-nil. Any non-2xx 5973// status code is an error. Response headers are in either 5974// *FinalizedDeal.ServerResponse.Header or (if a response was returned 5975// at all) in error.(*googleapi.Error).Header. Use 5976// googleapi.IsNotModified to check whether the returned error was 5977// because http.StatusNotModified was returned. 5978func (c *BuyersFinalizedDealsAddCreativeCall) Do(opts ...googleapi.CallOption) (*FinalizedDeal, error) { 5979 gensupport.SetOptions(c.urlParams_, opts...) 5980 res, err := c.doRequest("json") 5981 if res != nil && res.StatusCode == http.StatusNotModified { 5982 if res.Body != nil { 5983 res.Body.Close() 5984 } 5985 return nil, &googleapi.Error{ 5986 Code: res.StatusCode, 5987 Header: res.Header, 5988 } 5989 } 5990 if err != nil { 5991 return nil, err 5992 } 5993 defer googleapi.CloseBody(res) 5994 if err := googleapi.CheckResponse(res); err != nil { 5995 return nil, err 5996 } 5997 ret := &FinalizedDeal{ 5998 ServerResponse: googleapi.ServerResponse{ 5999 Header: res.Header, 6000 HTTPStatusCode: res.StatusCode, 6001 }, 6002 } 6003 target := &ret 6004 if err := gensupport.DecodeResponse(target, res); err != nil { 6005 return nil, err 6006 } 6007 return ret, nil 6008 // { 6009 // "description": "Add creative to be used in the bidding process for a finalized deal. For programmatic guaranteed deals, it's recommended that you associate at least one approved creative with the deal before calling SetReadyToServe, to help reduce the number of bid responses filtered because they don't contain approved creatives. Creatives successfully added to a deal can be found in the Realtime-bidding Creatives API creative.deal_ids. This method only applies to programmatic guaranteed deals. Maximum number of 1000 creatives can be added to a finalized deal.", 6010 // "flatPath": "v1/buyers/{buyersId}/finalizedDeals/{finalizedDealsId}:addCreative", 6011 // "httpMethod": "POST", 6012 // "id": "authorizedbuyersmarketplace.buyers.finalizedDeals.addCreative", 6013 // "parameterOrder": [ 6014 // "deal" 6015 // ], 6016 // "parameters": { 6017 // "deal": { 6018 // "description": "Required. Name of the finalized deal in the format of: `buyers/{accountId}/finalizedDeals/{dealId}`", 6019 // "location": "path", 6020 // "pattern": "^buyers/[^/]+/finalizedDeals/[^/]+$", 6021 // "required": true, 6022 // "type": "string" 6023 // } 6024 // }, 6025 // "path": "v1/{+deal}:addCreative", 6026 // "request": { 6027 // "$ref": "AddCreativeRequest" 6028 // }, 6029 // "response": { 6030 // "$ref": "FinalizedDeal" 6031 // }, 6032 // "scopes": [ 6033 // "https://www.googleapis.com/auth/authorized-buyers-marketplace" 6034 // ] 6035 // } 6036 6037} 6038 6039// method id "authorizedbuyersmarketplace.buyers.finalizedDeals.get": 6040 6041type BuyersFinalizedDealsGetCall struct { 6042 s *Service 6043 name string 6044 urlParams_ gensupport.URLParams 6045 ifNoneMatch_ string 6046 ctx_ context.Context 6047 header_ http.Header 6048} 6049 6050// Get: Gets a finalized deal given its name. 6051// 6052// - name: Format: `buyers/{accountId}/finalizedDeals/{dealId}`. 6053func (r *BuyersFinalizedDealsService) Get(name string) *BuyersFinalizedDealsGetCall { 6054 c := &BuyersFinalizedDealsGetCall{s: r.s, urlParams_: make(gensupport.URLParams)} 6055 c.name = name 6056 return c 6057} 6058 6059// Fields allows partial responses to be retrieved. See 6060// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse 6061// for more information. 6062func (c *BuyersFinalizedDealsGetCall) Fields(s ...googleapi.Field) *BuyersFinalizedDealsGetCall { 6063 c.urlParams_.Set("fields", googleapi.CombineFields(s)) 6064 return c 6065} 6066 6067// IfNoneMatch sets the optional parameter which makes the operation 6068// fail if the object's ETag matches the given value. This is useful for 6069// getting updates only after the object has changed since the last 6070// request. Use googleapi.IsNotModified to check whether the response 6071// error from Do is the result of In-None-Match. 6072func (c *BuyersFinalizedDealsGetCall) IfNoneMatch(entityTag string) *BuyersFinalizedDealsGetCall { 6073 c.ifNoneMatch_ = entityTag 6074 return c 6075} 6076 6077// Context sets the context to be used in this call's Do method. Any 6078// pending HTTP request will be aborted if the provided context is 6079// canceled. 6080func (c *BuyersFinalizedDealsGetCall) Context(ctx context.Context) *BuyersFinalizedDealsGetCall { 6081 c.ctx_ = ctx 6082 return c 6083} 6084 6085// Header returns an http.Header that can be modified by the caller to 6086// add HTTP headers to the request. 6087func (c *BuyersFinalizedDealsGetCall) Header() http.Header { 6088 if c.header_ == nil { 6089 c.header_ = make(http.Header) 6090 } 6091 return c.header_ 6092} 6093 6094func (c *BuyersFinalizedDealsGetCall) doRequest(alt string) (*http.Response, error) { 6095 reqHeaders := make(http.Header) 6096 reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/20211027") 6097 for k, v := range c.header_ { 6098 reqHeaders[k] = v 6099 } 6100 reqHeaders.Set("User-Agent", c.s.userAgent()) 6101 if c.ifNoneMatch_ != "" { 6102 reqHeaders.Set("If-None-Match", c.ifNoneMatch_) 6103 } 6104 var body io.Reader = nil 6105 c.urlParams_.Set("alt", alt) 6106 c.urlParams_.Set("prettyPrint", "false") 6107 urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+name}") 6108 urls += "?" + c.urlParams_.Encode() 6109 req, err := http.NewRequest("GET", urls, body) 6110 if err != nil { 6111 return nil, err 6112 } 6113 req.Header = reqHeaders 6114 googleapi.Expand(req.URL, map[string]string{ 6115 "name": c.name, 6116 }) 6117 return gensupport.SendRequest(c.ctx_, c.s.client, req) 6118} 6119 6120// Do executes the "authorizedbuyersmarketplace.buyers.finalizedDeals.get" call. 6121// Exactly one of *FinalizedDeal or error will be non-nil. Any non-2xx 6122// status code is an error. Response headers are in either 6123// *FinalizedDeal.ServerResponse.Header or (if a response was returned 6124// at all) in error.(*googleapi.Error).Header. Use 6125// googleapi.IsNotModified to check whether the returned error was 6126// because http.StatusNotModified was returned. 6127func (c *BuyersFinalizedDealsGetCall) Do(opts ...googleapi.CallOption) (*FinalizedDeal, error) { 6128 gensupport.SetOptions(c.urlParams_, opts...) 6129 res, err := c.doRequest("json") 6130 if res != nil && res.StatusCode == http.StatusNotModified { 6131 if res.Body != nil { 6132 res.Body.Close() 6133 } 6134 return nil, &googleapi.Error{ 6135 Code: res.StatusCode, 6136 Header: res.Header, 6137 } 6138 } 6139 if err != nil { 6140 return nil, err 6141 } 6142 defer googleapi.CloseBody(res) 6143 if err := googleapi.CheckResponse(res); err != nil { 6144 return nil, err 6145 } 6146 ret := &FinalizedDeal{ 6147 ServerResponse: googleapi.ServerResponse{ 6148 Header: res.Header, 6149 HTTPStatusCode: res.StatusCode, 6150 }, 6151 } 6152 target := &ret 6153 if err := gensupport.DecodeResponse(target, res); err != nil { 6154 return nil, err 6155 } 6156 return ret, nil 6157 // { 6158 // "description": "Gets a finalized deal given its name.", 6159 // "flatPath": "v1/buyers/{buyersId}/finalizedDeals/{finalizedDealsId}", 6160 // "httpMethod": "GET", 6161 // "id": "authorizedbuyersmarketplace.buyers.finalizedDeals.get", 6162 // "parameterOrder": [ 6163 // "name" 6164 // ], 6165 // "parameters": { 6166 // "name": { 6167 // "description": "Required. Format: `buyers/{accountId}/finalizedDeals/{dealId}`", 6168 // "location": "path", 6169 // "pattern": "^buyers/[^/]+/finalizedDeals/[^/]+$", 6170 // "required": true, 6171 // "type": "string" 6172 // } 6173 // }, 6174 // "path": "v1/{+name}", 6175 // "response": { 6176 // "$ref": "FinalizedDeal" 6177 // }, 6178 // "scopes": [ 6179 // "https://www.googleapis.com/auth/authorized-buyers-marketplace" 6180 // ] 6181 // } 6182 6183} 6184 6185// method id "authorizedbuyersmarketplace.buyers.finalizedDeals.list": 6186 6187type BuyersFinalizedDealsListCall struct { 6188 s *Service 6189 parent string 6190 urlParams_ gensupport.URLParams 6191 ifNoneMatch_ string 6192 ctx_ context.Context 6193 header_ http.Header 6194} 6195 6196// List: Lists finalized deals. Use the URL path 6197// "/v1/buyers/{accountId}/finalizedDeals" to list finalized deals for 6198// the current buyer and its clients. Bidders can use the URL path 6199// "/v1/bidders/{accountId}/finalizedDeals" to list finalized deals for 6200// the bidder, its buyers and all their clients. 6201// 6202// - parent: The buyer to list the finalized deals for, in the format: 6203// `buyers/{accountId}`. When used to list finalized deals for a 6204// bidder, its buyers and clients, in the format 6205// `bidders/{accountId}`. 6206func (r *BuyersFinalizedDealsService) List(parent string) *BuyersFinalizedDealsListCall { 6207 c := &BuyersFinalizedDealsListCall{s: r.s, urlParams_: make(gensupport.URLParams)} 6208 c.parent = parent 6209 return c 6210} 6211 6212// Filter sets the optional parameter "filter": Optional query string 6213// using the Cloud API list filtering syntax 6214// (https://developers.google.com/authorized-buyers/apis/guides/v2/list-filters) 6215// Supported columns for filtering are: * deal.displayName * 6216// deal.dealType * deal.createTime * deal.updateTime * 6217// deal.flightStartTime * deal.flightEndTime * dealServingStatus 6218func (c *BuyersFinalizedDealsListCall) Filter(filter string) *BuyersFinalizedDealsListCall { 6219 c.urlParams_.Set("filter", filter) 6220 return c 6221} 6222 6223// OrderBy sets the optional parameter "orderBy": An optional query 6224// string to sort finalized deals using the Cloud API sorting syntax 6225// (https://cloud.google.com/apis/design/design_patterns#sorting_order). 6226// If no sort order is specified, results will be returned in an 6227// arbitrary order. Supported columns for sorting are: * 6228// deal.displayName * deal.createTime * deal.updateTime * 6229// deal.flightStartTime * deal.flightEndTime * 6230// rtbMetrics.bidRequests7Days * rtbMetrics.bids7Days * 6231// rtbMetrics.adImpressions7Days * rtbMetrics.bidRate7Days * 6232// rtbMetrics.filteredBidRate7Days * rtbMetrics.mustBidRateCurrentMonth 6233// Example: 'deal.displayName, deal.updateTime desc' 6234func (c *BuyersFinalizedDealsListCall) OrderBy(orderBy string) *BuyersFinalizedDealsListCall { 6235 c.urlParams_.Set("orderBy", orderBy) 6236 return c 6237} 6238 6239// PageSize sets the optional parameter "pageSize": Requested page size. 6240// The server may return fewer results than requested. If requested more 6241// than 500, the server will return 500 results per page. If 6242// unspecified, the server will pick a default page size of 100. 6243func (c *BuyersFinalizedDealsListCall) PageSize(pageSize int64) *BuyersFinalizedDealsListCall { 6244 c.urlParams_.Set("pageSize", fmt.Sprint(pageSize)) 6245 return c 6246} 6247 6248// PageToken sets the optional parameter "pageToken": The page token as 6249// returned from ListFinalizedDealsResponse. 6250func (c *BuyersFinalizedDealsListCall) PageToken(pageToken string) *BuyersFinalizedDealsListCall { 6251 c.urlParams_.Set("pageToken", pageToken) 6252 return c 6253} 6254 6255// Fields allows partial responses to be retrieved. See 6256// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse 6257// for more information. 6258func (c *BuyersFinalizedDealsListCall) Fields(s ...googleapi.Field) *BuyersFinalizedDealsListCall { 6259 c.urlParams_.Set("fields", googleapi.CombineFields(s)) 6260 return c 6261} 6262 6263// IfNoneMatch sets the optional parameter which makes the operation 6264// fail if the object's ETag matches the given value. This is useful for 6265// getting updates only after the object has changed since the last 6266// request. Use googleapi.IsNotModified to check whether the response 6267// error from Do is the result of In-None-Match. 6268func (c *BuyersFinalizedDealsListCall) IfNoneMatch(entityTag string) *BuyersFinalizedDealsListCall { 6269 c.ifNoneMatch_ = entityTag 6270 return c 6271} 6272 6273// Context sets the context to be used in this call's Do method. Any 6274// pending HTTP request will be aborted if the provided context is 6275// canceled. 6276func (c *BuyersFinalizedDealsListCall) Context(ctx context.Context) *BuyersFinalizedDealsListCall { 6277 c.ctx_ = ctx 6278 return c 6279} 6280 6281// Header returns an http.Header that can be modified by the caller to 6282// add HTTP headers to the request. 6283func (c *BuyersFinalizedDealsListCall) Header() http.Header { 6284 if c.header_ == nil { 6285 c.header_ = make(http.Header) 6286 } 6287 return c.header_ 6288} 6289 6290func (c *BuyersFinalizedDealsListCall) doRequest(alt string) (*http.Response, error) { 6291 reqHeaders := make(http.Header) 6292 reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/20211027") 6293 for k, v := range c.header_ { 6294 reqHeaders[k] = v 6295 } 6296 reqHeaders.Set("User-Agent", c.s.userAgent()) 6297 if c.ifNoneMatch_ != "" { 6298 reqHeaders.Set("If-None-Match", c.ifNoneMatch_) 6299 } 6300 var body io.Reader = nil 6301 c.urlParams_.Set("alt", alt) 6302 c.urlParams_.Set("prettyPrint", "false") 6303 urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+parent}/finalizedDeals") 6304 urls += "?" + c.urlParams_.Encode() 6305 req, err := http.NewRequest("GET", urls, body) 6306 if err != nil { 6307 return nil, err 6308 } 6309 req.Header = reqHeaders 6310 googleapi.Expand(req.URL, map[string]string{ 6311 "parent": c.parent, 6312 }) 6313 return gensupport.SendRequest(c.ctx_, c.s.client, req) 6314} 6315 6316// Do executes the "authorizedbuyersmarketplace.buyers.finalizedDeals.list" call. 6317// Exactly one of *ListFinalizedDealsResponse or error will be non-nil. 6318// Any non-2xx status code is an error. Response headers are in either 6319// *ListFinalizedDealsResponse.ServerResponse.Header or (if a response 6320// was returned at all) in error.(*googleapi.Error).Header. Use 6321// googleapi.IsNotModified to check whether the returned error was 6322// because http.StatusNotModified was returned. 6323func (c *BuyersFinalizedDealsListCall) Do(opts ...googleapi.CallOption) (*ListFinalizedDealsResponse, error) { 6324 gensupport.SetOptions(c.urlParams_, opts...) 6325 res, err := c.doRequest("json") 6326 if res != nil && res.StatusCode == http.StatusNotModified { 6327 if res.Body != nil { 6328 res.Body.Close() 6329 } 6330 return nil, &googleapi.Error{ 6331 Code: res.StatusCode, 6332 Header: res.Header, 6333 } 6334 } 6335 if err != nil { 6336 return nil, err 6337 } 6338 defer googleapi.CloseBody(res) 6339 if err := googleapi.CheckResponse(res); err != nil { 6340 return nil, err 6341 } 6342 ret := &ListFinalizedDealsResponse{ 6343 ServerResponse: googleapi.ServerResponse{ 6344 Header: res.Header, 6345 HTTPStatusCode: res.StatusCode, 6346 }, 6347 } 6348 target := &ret 6349 if err := gensupport.DecodeResponse(target, res); err != nil { 6350 return nil, err 6351 } 6352 return ret, nil 6353 // { 6354 // "description": "Lists finalized deals. Use the URL path \"/v1/buyers/{accountId}/finalizedDeals\" to list finalized deals for the current buyer and its clients. Bidders can use the URL path \"/v1/bidders/{accountId}/finalizedDeals\" to list finalized deals for the bidder, its buyers and all their clients.", 6355 // "flatPath": "v1/buyers/{buyersId}/finalizedDeals", 6356 // "httpMethod": "GET", 6357 // "id": "authorizedbuyersmarketplace.buyers.finalizedDeals.list", 6358 // "parameterOrder": [ 6359 // "parent" 6360 // ], 6361 // "parameters": { 6362 // "filter": { 6363 // "description": "Optional query string using the [Cloud API list filtering syntax](https://developers.google.com/authorized-buyers/apis/guides/v2/list-filters) Supported columns for filtering are: * deal.displayName * deal.dealType * deal.createTime * deal.updateTime * deal.flightStartTime * deal.flightEndTime * dealServingStatus", 6364 // "location": "query", 6365 // "type": "string" 6366 // }, 6367 // "orderBy": { 6368 // "description": "An optional query string to sort finalized deals using the [Cloud API sorting syntax](https://cloud.google.com/apis/design/design_patterns#sorting_order). If no sort order is specified, results will be returned in an arbitrary order. Supported columns for sorting are: * deal.displayName * deal.createTime * deal.updateTime * deal.flightStartTime * deal.flightEndTime * rtbMetrics.bidRequests7Days * rtbMetrics.bids7Days * rtbMetrics.adImpressions7Days * rtbMetrics.bidRate7Days * rtbMetrics.filteredBidRate7Days * rtbMetrics.mustBidRateCurrentMonth Example: 'deal.displayName, deal.updateTime desc'", 6369 // "location": "query", 6370 // "type": "string" 6371 // }, 6372 // "pageSize": { 6373 // "description": "Requested page size. The server may return fewer results than requested. If requested more than 500, the server will return 500 results per page. If unspecified, the server will pick a default page size of 100.", 6374 // "format": "int32", 6375 // "location": "query", 6376 // "type": "integer" 6377 // }, 6378 // "pageToken": { 6379 // "description": "The page token as returned from ListFinalizedDealsResponse.", 6380 // "location": "query", 6381 // "type": "string" 6382 // }, 6383 // "parent": { 6384 // "description": "Required. The buyer to list the finalized deals for, in the format: `buyers/{accountId}`. When used to list finalized deals for a bidder, its buyers and clients, in the format `bidders/{accountId}`.", 6385 // "location": "path", 6386 // "pattern": "^buyers/[^/]+$", 6387 // "required": true, 6388 // "type": "string" 6389 // } 6390 // }, 6391 // "path": "v1/{+parent}/finalizedDeals", 6392 // "response": { 6393 // "$ref": "ListFinalizedDealsResponse" 6394 // }, 6395 // "scopes": [ 6396 // "https://www.googleapis.com/auth/authorized-buyers-marketplace" 6397 // ] 6398 // } 6399 6400} 6401 6402// Pages invokes f for each page of results. 6403// A non-nil error returned from f will halt the iteration. 6404// The provided context supersedes any context provided to the Context method. 6405func (c *BuyersFinalizedDealsListCall) Pages(ctx context.Context, f func(*ListFinalizedDealsResponse) error) error { 6406 c.ctx_ = ctx 6407 defer c.PageToken(c.urlParams_.Get("pageToken")) // reset paging to original point 6408 for { 6409 x, err := c.Do() 6410 if err != nil { 6411 return err 6412 } 6413 if err := f(x); err != nil { 6414 return err 6415 } 6416 if x.NextPageToken == "" { 6417 return nil 6418 } 6419 c.PageToken(x.NextPageToken) 6420 } 6421} 6422 6423// method id "authorizedbuyersmarketplace.buyers.finalizedDeals.pause": 6424 6425type BuyersFinalizedDealsPauseCall struct { 6426 s *Service 6427 name string 6428 pausefinalizeddealrequest *PauseFinalizedDealRequest 6429 urlParams_ gensupport.URLParams 6430 ctx_ context.Context 6431 header_ http.Header 6432} 6433 6434// Pause: Pauses serving of the given finalized deal. This call only 6435// pauses the serving status, and does not affect other fields of the 6436// finalized deal. Calling this method for an already paused deal has no 6437// effect. This method only applies to programmatic guaranteed deals. 6438// 6439// - name: Format: `buyers/{accountId}/finalizedDeals/{dealId}`. 6440func (r *BuyersFinalizedDealsService) Pause(name string, pausefinalizeddealrequest *PauseFinalizedDealRequest) *BuyersFinalizedDealsPauseCall { 6441 c := &BuyersFinalizedDealsPauseCall{s: r.s, urlParams_: make(gensupport.URLParams)} 6442 c.name = name 6443 c.pausefinalizeddealrequest = pausefinalizeddealrequest 6444 return c 6445} 6446 6447// Fields allows partial responses to be retrieved. See 6448// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse 6449// for more information. 6450func (c *BuyersFinalizedDealsPauseCall) Fields(s ...googleapi.Field) *BuyersFinalizedDealsPauseCall { 6451 c.urlParams_.Set("fields", googleapi.CombineFields(s)) 6452 return c 6453} 6454 6455// Context sets the context to be used in this call's Do method. Any 6456// pending HTTP request will be aborted if the provided context is 6457// canceled. 6458func (c *BuyersFinalizedDealsPauseCall) Context(ctx context.Context) *BuyersFinalizedDealsPauseCall { 6459 c.ctx_ = ctx 6460 return c 6461} 6462 6463// Header returns an http.Header that can be modified by the caller to 6464// add HTTP headers to the request. 6465func (c *BuyersFinalizedDealsPauseCall) Header() http.Header { 6466 if c.header_ == nil { 6467 c.header_ = make(http.Header) 6468 } 6469 return c.header_ 6470} 6471 6472func (c *BuyersFinalizedDealsPauseCall) doRequest(alt string) (*http.Response, error) { 6473 reqHeaders := make(http.Header) 6474 reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/20211027") 6475 for k, v := range c.header_ { 6476 reqHeaders[k] = v 6477 } 6478 reqHeaders.Set("User-Agent", c.s.userAgent()) 6479 var body io.Reader = nil 6480 body, err := googleapi.WithoutDataWrapper.JSONReader(c.pausefinalizeddealrequest) 6481 if err != nil { 6482 return nil, err 6483 } 6484 reqHeaders.Set("Content-Type", "application/json") 6485 c.urlParams_.Set("alt", alt) 6486 c.urlParams_.Set("prettyPrint", "false") 6487 urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+name}:pause") 6488 urls += "?" + c.urlParams_.Encode() 6489 req, err := http.NewRequest("POST", urls, body) 6490 if err != nil { 6491 return nil, err 6492 } 6493 req.Header = reqHeaders 6494 googleapi.Expand(req.URL, map[string]string{ 6495 "name": c.name, 6496 }) 6497 return gensupport.SendRequest(c.ctx_, c.s.client, req) 6498} 6499 6500// Do executes the "authorizedbuyersmarketplace.buyers.finalizedDeals.pause" call. 6501// Exactly one of *FinalizedDeal or error will be non-nil. Any non-2xx 6502// status code is an error. Response headers are in either 6503// *FinalizedDeal.ServerResponse.Header or (if a response was returned 6504// at all) in error.(*googleapi.Error).Header. Use 6505// googleapi.IsNotModified to check whether the returned error was 6506// because http.StatusNotModified was returned. 6507func (c *BuyersFinalizedDealsPauseCall) Do(opts ...googleapi.CallOption) (*FinalizedDeal, error) { 6508 gensupport.SetOptions(c.urlParams_, opts...) 6509 res, err := c.doRequest("json") 6510 if res != nil && res.StatusCode == http.StatusNotModified { 6511 if res.Body != nil { 6512 res.Body.Close() 6513 } 6514 return nil, &googleapi.Error{ 6515 Code: res.StatusCode, 6516 Header: res.Header, 6517 } 6518 } 6519 if err != nil { 6520 return nil, err 6521 } 6522 defer googleapi.CloseBody(res) 6523 if err := googleapi.CheckResponse(res); err != nil { 6524 return nil, err 6525 } 6526 ret := &FinalizedDeal{ 6527 ServerResponse: googleapi.ServerResponse{ 6528 Header: res.Header, 6529 HTTPStatusCode: res.StatusCode, 6530 }, 6531 } 6532 target := &ret 6533 if err := gensupport.DecodeResponse(target, res); err != nil { 6534 return nil, err 6535 } 6536 return ret, nil 6537 // { 6538 // "description": "Pauses serving of the given finalized deal. This call only pauses the serving status, and does not affect other fields of the finalized deal. Calling this method for an already paused deal has no effect. This method only applies to programmatic guaranteed deals.", 6539 // "flatPath": "v1/buyers/{buyersId}/finalizedDeals/{finalizedDealsId}:pause", 6540 // "httpMethod": "POST", 6541 // "id": "authorizedbuyersmarketplace.buyers.finalizedDeals.pause", 6542 // "parameterOrder": [ 6543 // "name" 6544 // ], 6545 // "parameters": { 6546 // "name": { 6547 // "description": "Required. Format: `buyers/{accountId}/finalizedDeals/{dealId}`", 6548 // "location": "path", 6549 // "pattern": "^buyers/[^/]+/finalizedDeals/[^/]+$", 6550 // "required": true, 6551 // "type": "string" 6552 // } 6553 // }, 6554 // "path": "v1/{+name}:pause", 6555 // "request": { 6556 // "$ref": "PauseFinalizedDealRequest" 6557 // }, 6558 // "response": { 6559 // "$ref": "FinalizedDeal" 6560 // }, 6561 // "scopes": [ 6562 // "https://www.googleapis.com/auth/authorized-buyers-marketplace" 6563 // ] 6564 // } 6565 6566} 6567 6568// method id "authorizedbuyersmarketplace.buyers.finalizedDeals.resume": 6569 6570type BuyersFinalizedDealsResumeCall struct { 6571 s *Service 6572 name string 6573 resumefinalizeddealrequest *ResumeFinalizedDealRequest 6574 urlParams_ gensupport.URLParams 6575 ctx_ context.Context 6576 header_ http.Header 6577} 6578 6579// Resume: Resumes serving of the given finalized deal. Calling this 6580// method for an running deal has no effect. If a deal is initially 6581// paused by the seller, calling this method will not resume serving of 6582// the deal until the seller also resumes the deal. This method only 6583// applies to programmatic guaranteed deals. 6584// 6585// - name: Format: `buyers/{accountId}/finalizedDeals/{dealId}`. 6586func (r *BuyersFinalizedDealsService) Resume(name string, resumefinalizeddealrequest *ResumeFinalizedDealRequest) *BuyersFinalizedDealsResumeCall { 6587 c := &BuyersFinalizedDealsResumeCall{s: r.s, urlParams_: make(gensupport.URLParams)} 6588 c.name = name 6589 c.resumefinalizeddealrequest = resumefinalizeddealrequest 6590 return c 6591} 6592 6593// Fields allows partial responses to be retrieved. See 6594// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse 6595// for more information. 6596func (c *BuyersFinalizedDealsResumeCall) Fields(s ...googleapi.Field) *BuyersFinalizedDealsResumeCall { 6597 c.urlParams_.Set("fields", googleapi.CombineFields(s)) 6598 return c 6599} 6600 6601// Context sets the context to be used in this call's Do method. Any 6602// pending HTTP request will be aborted if the provided context is 6603// canceled. 6604func (c *BuyersFinalizedDealsResumeCall) Context(ctx context.Context) *BuyersFinalizedDealsResumeCall { 6605 c.ctx_ = ctx 6606 return c 6607} 6608 6609// Header returns an http.Header that can be modified by the caller to 6610// add HTTP headers to the request. 6611func (c *BuyersFinalizedDealsResumeCall) Header() http.Header { 6612 if c.header_ == nil { 6613 c.header_ = make(http.Header) 6614 } 6615 return c.header_ 6616} 6617 6618func (c *BuyersFinalizedDealsResumeCall) doRequest(alt string) (*http.Response, error) { 6619 reqHeaders := make(http.Header) 6620 reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/20211027") 6621 for k, v := range c.header_ { 6622 reqHeaders[k] = v 6623 } 6624 reqHeaders.Set("User-Agent", c.s.userAgent()) 6625 var body io.Reader = nil 6626 body, err := googleapi.WithoutDataWrapper.JSONReader(c.resumefinalizeddealrequest) 6627 if err != nil { 6628 return nil, err 6629 } 6630 reqHeaders.Set("Content-Type", "application/json") 6631 c.urlParams_.Set("alt", alt) 6632 c.urlParams_.Set("prettyPrint", "false") 6633 urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+name}:resume") 6634 urls += "?" + c.urlParams_.Encode() 6635 req, err := http.NewRequest("POST", urls, body) 6636 if err != nil { 6637 return nil, err 6638 } 6639 req.Header = reqHeaders 6640 googleapi.Expand(req.URL, map[string]string{ 6641 "name": c.name, 6642 }) 6643 return gensupport.SendRequest(c.ctx_, c.s.client, req) 6644} 6645 6646// Do executes the "authorizedbuyersmarketplace.buyers.finalizedDeals.resume" call. 6647// Exactly one of *FinalizedDeal or error will be non-nil. Any non-2xx 6648// status code is an error. Response headers are in either 6649// *FinalizedDeal.ServerResponse.Header or (if a response was returned 6650// at all) in error.(*googleapi.Error).Header. Use 6651// googleapi.IsNotModified to check whether the returned error was 6652// because http.StatusNotModified was returned. 6653func (c *BuyersFinalizedDealsResumeCall) Do(opts ...googleapi.CallOption) (*FinalizedDeal, error) { 6654 gensupport.SetOptions(c.urlParams_, opts...) 6655 res, err := c.doRequest("json") 6656 if res != nil && res.StatusCode == http.StatusNotModified { 6657 if res.Body != nil { 6658 res.Body.Close() 6659 } 6660 return nil, &googleapi.Error{ 6661 Code: res.StatusCode, 6662 Header: res.Header, 6663 } 6664 } 6665 if err != nil { 6666 return nil, err 6667 } 6668 defer googleapi.CloseBody(res) 6669 if err := googleapi.CheckResponse(res); err != nil { 6670 return nil, err 6671 } 6672 ret := &FinalizedDeal{ 6673 ServerResponse: googleapi.ServerResponse{ 6674 Header: res.Header, 6675 HTTPStatusCode: res.StatusCode, 6676 }, 6677 } 6678 target := &ret 6679 if err := gensupport.DecodeResponse(target, res); err != nil { 6680 return nil, err 6681 } 6682 return ret, nil 6683 // { 6684 // "description": "Resumes serving of the given finalized deal. Calling this method for an running deal has no effect. If a deal is initially paused by the seller, calling this method will not resume serving of the deal until the seller also resumes the deal. This method only applies to programmatic guaranteed deals.", 6685 // "flatPath": "v1/buyers/{buyersId}/finalizedDeals/{finalizedDealsId}:resume", 6686 // "httpMethod": "POST", 6687 // "id": "authorizedbuyersmarketplace.buyers.finalizedDeals.resume", 6688 // "parameterOrder": [ 6689 // "name" 6690 // ], 6691 // "parameters": { 6692 // "name": { 6693 // "description": "Required. Format: `buyers/{accountId}/finalizedDeals/{dealId}`", 6694 // "location": "path", 6695 // "pattern": "^buyers/[^/]+/finalizedDeals/[^/]+$", 6696 // "required": true, 6697 // "type": "string" 6698 // } 6699 // }, 6700 // "path": "v1/{+name}:resume", 6701 // "request": { 6702 // "$ref": "ResumeFinalizedDealRequest" 6703 // }, 6704 // "response": { 6705 // "$ref": "FinalizedDeal" 6706 // }, 6707 // "scopes": [ 6708 // "https://www.googleapis.com/auth/authorized-buyers-marketplace" 6709 // ] 6710 // } 6711 6712} 6713 6714// method id "authorizedbuyersmarketplace.buyers.finalizedDeals.setReadyToServe": 6715 6716type BuyersFinalizedDealsSetReadyToServeCall struct { 6717 s *Service 6718 deal string 6719 setreadytoserverequest *SetReadyToServeRequest 6720 urlParams_ gensupport.URLParams 6721 ctx_ context.Context 6722 header_ http.Header 6723} 6724 6725// SetReadyToServe: Sets the given finalized deal as ready to serve. By 6726// default, deals are ready to serve as soon as they're finalized. A 6727// bidder can opt out of this feature by asking to be included in an 6728// allowlist. Once opted out, finalized deals belonging to the bidder 6729// and its child seats will not start serving until this method is 6730// called. This method is useful to the bidders who prefer to not 6731// receive bid requests before the creative is ready. This method only 6732// applies to programmatic guaranteed deals. 6733// 6734// - deal: Format: `buyers/{accountId}/finalizedDeals/{dealId}`. 6735func (r *BuyersFinalizedDealsService) SetReadyToServe(deal string, setreadytoserverequest *SetReadyToServeRequest) *BuyersFinalizedDealsSetReadyToServeCall { 6736 c := &BuyersFinalizedDealsSetReadyToServeCall{s: r.s, urlParams_: make(gensupport.URLParams)} 6737 c.deal = deal 6738 c.setreadytoserverequest = setreadytoserverequest 6739 return c 6740} 6741 6742// Fields allows partial responses to be retrieved. See 6743// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse 6744// for more information. 6745func (c *BuyersFinalizedDealsSetReadyToServeCall) Fields(s ...googleapi.Field) *BuyersFinalizedDealsSetReadyToServeCall { 6746 c.urlParams_.Set("fields", googleapi.CombineFields(s)) 6747 return c 6748} 6749 6750// Context sets the context to be used in this call's Do method. Any 6751// pending HTTP request will be aborted if the provided context is 6752// canceled. 6753func (c *BuyersFinalizedDealsSetReadyToServeCall) Context(ctx context.Context) *BuyersFinalizedDealsSetReadyToServeCall { 6754 c.ctx_ = ctx 6755 return c 6756} 6757 6758// Header returns an http.Header that can be modified by the caller to 6759// add HTTP headers to the request. 6760func (c *BuyersFinalizedDealsSetReadyToServeCall) Header() http.Header { 6761 if c.header_ == nil { 6762 c.header_ = make(http.Header) 6763 } 6764 return c.header_ 6765} 6766 6767func (c *BuyersFinalizedDealsSetReadyToServeCall) doRequest(alt string) (*http.Response, error) { 6768 reqHeaders := make(http.Header) 6769 reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/20211027") 6770 for k, v := range c.header_ { 6771 reqHeaders[k] = v 6772 } 6773 reqHeaders.Set("User-Agent", c.s.userAgent()) 6774 var body io.Reader = nil 6775 body, err := googleapi.WithoutDataWrapper.JSONReader(c.setreadytoserverequest) 6776 if err != nil { 6777 return nil, err 6778 } 6779 reqHeaders.Set("Content-Type", "application/json") 6780 c.urlParams_.Set("alt", alt) 6781 c.urlParams_.Set("prettyPrint", "false") 6782 urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+deal}:setReadyToServe") 6783 urls += "?" + c.urlParams_.Encode() 6784 req, err := http.NewRequest("POST", urls, body) 6785 if err != nil { 6786 return nil, err 6787 } 6788 req.Header = reqHeaders 6789 googleapi.Expand(req.URL, map[string]string{ 6790 "deal": c.deal, 6791 }) 6792 return gensupport.SendRequest(c.ctx_, c.s.client, req) 6793} 6794 6795// Do executes the "authorizedbuyersmarketplace.buyers.finalizedDeals.setReadyToServe" call. 6796// Exactly one of *FinalizedDeal or error will be non-nil. Any non-2xx 6797// status code is an error. Response headers are in either 6798// *FinalizedDeal.ServerResponse.Header or (if a response was returned 6799// at all) in error.(*googleapi.Error).Header. Use 6800// googleapi.IsNotModified to check whether the returned error was 6801// because http.StatusNotModified was returned. 6802func (c *BuyersFinalizedDealsSetReadyToServeCall) Do(opts ...googleapi.CallOption) (*FinalizedDeal, error) { 6803 gensupport.SetOptions(c.urlParams_, opts...) 6804 res, err := c.doRequest("json") 6805 if res != nil && res.StatusCode == http.StatusNotModified { 6806 if res.Body != nil { 6807 res.Body.Close() 6808 } 6809 return nil, &googleapi.Error{ 6810 Code: res.StatusCode, 6811 Header: res.Header, 6812 } 6813 } 6814 if err != nil { 6815 return nil, err 6816 } 6817 defer googleapi.CloseBody(res) 6818 if err := googleapi.CheckResponse(res); err != nil { 6819 return nil, err 6820 } 6821 ret := &FinalizedDeal{ 6822 ServerResponse: googleapi.ServerResponse{ 6823 Header: res.Header, 6824 HTTPStatusCode: res.StatusCode, 6825 }, 6826 } 6827 target := &ret 6828 if err := gensupport.DecodeResponse(target, res); err != nil { 6829 return nil, err 6830 } 6831 return ret, nil 6832 // { 6833 // "description": "Sets the given finalized deal as ready to serve. By default, deals are ready to serve as soon as they're finalized. A bidder can opt out of this feature by asking to be included in an allowlist. Once opted out, finalized deals belonging to the bidder and its child seats will not start serving until this method is called. This method is useful to the bidders who prefer to not receive bid requests before the creative is ready. This method only applies to programmatic guaranteed deals.", 6834 // "flatPath": "v1/buyers/{buyersId}/finalizedDeals/{finalizedDealsId}:setReadyToServe", 6835 // "httpMethod": "POST", 6836 // "id": "authorizedbuyersmarketplace.buyers.finalizedDeals.setReadyToServe", 6837 // "parameterOrder": [ 6838 // "deal" 6839 // ], 6840 // "parameters": { 6841 // "deal": { 6842 // "description": "Required. Format: `buyers/{accountId}/finalizedDeals/{dealId}`", 6843 // "location": "path", 6844 // "pattern": "^buyers/[^/]+/finalizedDeals/[^/]+$", 6845 // "required": true, 6846 // "type": "string" 6847 // } 6848 // }, 6849 // "path": "v1/{+deal}:setReadyToServe", 6850 // "request": { 6851 // "$ref": "SetReadyToServeRequest" 6852 // }, 6853 // "response": { 6854 // "$ref": "FinalizedDeal" 6855 // }, 6856 // "scopes": [ 6857 // "https://www.googleapis.com/auth/authorized-buyers-marketplace" 6858 // ] 6859 // } 6860 6861} 6862 6863// method id "authorizedbuyersmarketplace.buyers.proposals.accept": 6864 6865type BuyersProposalsAcceptCall struct { 6866 s *Service 6867 name string 6868 acceptproposalrequest *AcceptProposalRequest 6869 urlParams_ gensupport.URLParams 6870 ctx_ context.Context 6871 header_ http.Header 6872} 6873 6874// Accept: Accepts the proposal at the given revision number. If the 6875// revision number in the request is behind the latest from the server, 6876// an error message will be returned. This call updates the 6877// Proposal.state from `BUYER_ACCEPTANCE_REQUESTED` to `FINALIZED`; it 6878// has no side effect if the Proposal.state is already `FINALIZED` and 6879// throws exception if the Proposal.state is not either 6880// `BUYER_ACCEPTANCE_REQUESTED` or `FINALIZED`. Accepting a proposal 6881// means the buyer understands and accepts the 6882// Proposal.terms_and_conditions proposed by the seller. 6883// 6884// - name: Name of the proposal. Format: 6885// `buyers/{accountId}/proposals/{proposalId}`. 6886func (r *BuyersProposalsService) Accept(name string, acceptproposalrequest *AcceptProposalRequest) *BuyersProposalsAcceptCall { 6887 c := &BuyersProposalsAcceptCall{s: r.s, urlParams_: make(gensupport.URLParams)} 6888 c.name = name 6889 c.acceptproposalrequest = acceptproposalrequest 6890 return c 6891} 6892 6893// Fields allows partial responses to be retrieved. See 6894// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse 6895// for more information. 6896func (c *BuyersProposalsAcceptCall) Fields(s ...googleapi.Field) *BuyersProposalsAcceptCall { 6897 c.urlParams_.Set("fields", googleapi.CombineFields(s)) 6898 return c 6899} 6900 6901// Context sets the context to be used in this call's Do method. Any 6902// pending HTTP request will be aborted if the provided context is 6903// canceled. 6904func (c *BuyersProposalsAcceptCall) Context(ctx context.Context) *BuyersProposalsAcceptCall { 6905 c.ctx_ = ctx 6906 return c 6907} 6908 6909// Header returns an http.Header that can be modified by the caller to 6910// add HTTP headers to the request. 6911func (c *BuyersProposalsAcceptCall) Header() http.Header { 6912 if c.header_ == nil { 6913 c.header_ = make(http.Header) 6914 } 6915 return c.header_ 6916} 6917 6918func (c *BuyersProposalsAcceptCall) doRequest(alt string) (*http.Response, error) { 6919 reqHeaders := make(http.Header) 6920 reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/20211027") 6921 for k, v := range c.header_ { 6922 reqHeaders[k] = v 6923 } 6924 reqHeaders.Set("User-Agent", c.s.userAgent()) 6925 var body io.Reader = nil 6926 body, err := googleapi.WithoutDataWrapper.JSONReader(c.acceptproposalrequest) 6927 if err != nil { 6928 return nil, err 6929 } 6930 reqHeaders.Set("Content-Type", "application/json") 6931 c.urlParams_.Set("alt", alt) 6932 c.urlParams_.Set("prettyPrint", "false") 6933 urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+name}:accept") 6934 urls += "?" + c.urlParams_.Encode() 6935 req, err := http.NewRequest("POST", urls, body) 6936 if err != nil { 6937 return nil, err 6938 } 6939 req.Header = reqHeaders 6940 googleapi.Expand(req.URL, map[string]string{ 6941 "name": c.name, 6942 }) 6943 return gensupport.SendRequest(c.ctx_, c.s.client, req) 6944} 6945 6946// Do executes the "authorizedbuyersmarketplace.buyers.proposals.accept" call. 6947// Exactly one of *Proposal or error will be non-nil. Any non-2xx status 6948// code is an error. Response headers are in either 6949// *Proposal.ServerResponse.Header or (if a response was returned at 6950// all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified 6951// to check whether the returned error was because 6952// http.StatusNotModified was returned. 6953func (c *BuyersProposalsAcceptCall) Do(opts ...googleapi.CallOption) (*Proposal, error) { 6954 gensupport.SetOptions(c.urlParams_, opts...) 6955 res, err := c.doRequest("json") 6956 if res != nil && res.StatusCode == http.StatusNotModified { 6957 if res.Body != nil { 6958 res.Body.Close() 6959 } 6960 return nil, &googleapi.Error{ 6961 Code: res.StatusCode, 6962 Header: res.Header, 6963 } 6964 } 6965 if err != nil { 6966 return nil, err 6967 } 6968 defer googleapi.CloseBody(res) 6969 if err := googleapi.CheckResponse(res); err != nil { 6970 return nil, err 6971 } 6972 ret := &Proposal{ 6973 ServerResponse: googleapi.ServerResponse{ 6974 Header: res.Header, 6975 HTTPStatusCode: res.StatusCode, 6976 }, 6977 } 6978 target := &ret 6979 if err := gensupport.DecodeResponse(target, res); err != nil { 6980 return nil, err 6981 } 6982 return ret, nil 6983 // { 6984 // "description": "Accepts the proposal at the given revision number. If the revision number in the request is behind the latest from the server, an error message will be returned. This call updates the Proposal.state from `BUYER_ACCEPTANCE_REQUESTED` to `FINALIZED`; it has no side effect if the Proposal.state is already `FINALIZED` and throws exception if the Proposal.state is not either `BUYER_ACCEPTANCE_REQUESTED` or `FINALIZED`. Accepting a proposal means the buyer understands and accepts the Proposal.terms_and_conditions proposed by the seller.", 6985 // "flatPath": "v1/buyers/{buyersId}/proposals/{proposalsId}:accept", 6986 // "httpMethod": "POST", 6987 // "id": "authorizedbuyersmarketplace.buyers.proposals.accept", 6988 // "parameterOrder": [ 6989 // "name" 6990 // ], 6991 // "parameters": { 6992 // "name": { 6993 // "description": "Name of the proposal. Format: `buyers/{accountId}/proposals/{proposalId}`", 6994 // "location": "path", 6995 // "pattern": "^buyers/[^/]+/proposals/[^/]+$", 6996 // "required": true, 6997 // "type": "string" 6998 // } 6999 // }, 7000 // "path": "v1/{+name}:accept", 7001 // "request": { 7002 // "$ref": "AcceptProposalRequest" 7003 // }, 7004 // "response": { 7005 // "$ref": "Proposal" 7006 // }, 7007 // "scopes": [ 7008 // "https://www.googleapis.com/auth/authorized-buyers-marketplace" 7009 // ] 7010 // } 7011 7012} 7013 7014// method id "authorizedbuyersmarketplace.buyers.proposals.addNote": 7015 7016type BuyersProposalsAddNoteCall struct { 7017 s *Service 7018 proposal string 7019 addnoterequest *AddNoteRequest 7020 urlParams_ gensupport.URLParams 7021 ctx_ context.Context 7022 header_ http.Header 7023} 7024 7025// AddNote: Creates a note for this proposal and sends to the seller. 7026// 7027// - proposal: Name of the proposal. Format: 7028// `buyers/{accountId}/proposals/{proposalId}`. 7029func (r *BuyersProposalsService) AddNote(proposal string, addnoterequest *AddNoteRequest) *BuyersProposalsAddNoteCall { 7030 c := &BuyersProposalsAddNoteCall{s: r.s, urlParams_: make(gensupport.URLParams)} 7031 c.proposal = proposal 7032 c.addnoterequest = addnoterequest 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 7038// for more information. 7039func (c *BuyersProposalsAddNoteCall) Fields(s ...googleapi.Field) *BuyersProposalsAddNoteCall { 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. Any 7045// pending HTTP request will be aborted if the provided context is 7046// canceled. 7047func (c *BuyersProposalsAddNoteCall) Context(ctx context.Context) *BuyersProposalsAddNoteCall { 7048 c.ctx_ = ctx 7049 return c 7050} 7051 7052// Header returns an http.Header that can be modified by the caller to 7053// add HTTP headers to the request. 7054func (c *BuyersProposalsAddNoteCall) Header() http.Header { 7055 if c.header_ == nil { 7056 c.header_ = make(http.Header) 7057 } 7058 return c.header_ 7059} 7060 7061func (c *BuyersProposalsAddNoteCall) doRequest(alt string) (*http.Response, error) { 7062 reqHeaders := make(http.Header) 7063 reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/20211027") 7064 for k, v := range c.header_ { 7065 reqHeaders[k] = v 7066 } 7067 reqHeaders.Set("User-Agent", c.s.userAgent()) 7068 var body io.Reader = nil 7069 body, err := googleapi.WithoutDataWrapper.JSONReader(c.addnoterequest) 7070 if err != nil { 7071 return nil, err 7072 } 7073 reqHeaders.Set("Content-Type", "application/json") 7074 c.urlParams_.Set("alt", alt) 7075 c.urlParams_.Set("prettyPrint", "false") 7076 urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+proposal}:addNote") 7077 urls += "?" + c.urlParams_.Encode() 7078 req, err := http.NewRequest("POST", urls, body) 7079 if err != nil { 7080 return nil, err 7081 } 7082 req.Header = reqHeaders 7083 googleapi.Expand(req.URL, map[string]string{ 7084 "proposal": c.proposal, 7085 }) 7086 return gensupport.SendRequest(c.ctx_, c.s.client, req) 7087} 7088 7089// Do executes the "authorizedbuyersmarketplace.buyers.proposals.addNote" call. 7090// Exactly one of *Proposal or error will be non-nil. Any non-2xx status 7091// code is an error. Response headers are in either 7092// *Proposal.ServerResponse.Header or (if a response was returned at 7093// all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified 7094// to check whether the returned error was because 7095// http.StatusNotModified was returned. 7096func (c *BuyersProposalsAddNoteCall) Do(opts ...googleapi.CallOption) (*Proposal, error) { 7097 gensupport.SetOptions(c.urlParams_, opts...) 7098 res, err := c.doRequest("json") 7099 if res != nil && res.StatusCode == http.StatusNotModified { 7100 if res.Body != nil { 7101 res.Body.Close() 7102 } 7103 return nil, &googleapi.Error{ 7104 Code: res.StatusCode, 7105 Header: res.Header, 7106 } 7107 } 7108 if err != nil { 7109 return nil, err 7110 } 7111 defer googleapi.CloseBody(res) 7112 if err := googleapi.CheckResponse(res); err != nil { 7113 return nil, err 7114 } 7115 ret := &Proposal{ 7116 ServerResponse: googleapi.ServerResponse{ 7117 Header: res.Header, 7118 HTTPStatusCode: res.StatusCode, 7119 }, 7120 } 7121 target := &ret 7122 if err := gensupport.DecodeResponse(target, res); err != nil { 7123 return nil, err 7124 } 7125 return ret, nil 7126 // { 7127 // "description": "Creates a note for this proposal and sends to the seller.", 7128 // "flatPath": "v1/buyers/{buyersId}/proposals/{proposalsId}:addNote", 7129 // "httpMethod": "POST", 7130 // "id": "authorizedbuyersmarketplace.buyers.proposals.addNote", 7131 // "parameterOrder": [ 7132 // "proposal" 7133 // ], 7134 // "parameters": { 7135 // "proposal": { 7136 // "description": "Name of the proposal. Format: `buyers/{accountId}/proposals/{proposalId}`", 7137 // "location": "path", 7138 // "pattern": "^buyers/[^/]+/proposals/[^/]+$", 7139 // "required": true, 7140 // "type": "string" 7141 // } 7142 // }, 7143 // "path": "v1/{+proposal}:addNote", 7144 // "request": { 7145 // "$ref": "AddNoteRequest" 7146 // }, 7147 // "response": { 7148 // "$ref": "Proposal" 7149 // }, 7150 // "scopes": [ 7151 // "https://www.googleapis.com/auth/authorized-buyers-marketplace" 7152 // ] 7153 // } 7154 7155} 7156 7157// method id "authorizedbuyersmarketplace.buyers.proposals.cancelNegotiation": 7158 7159type BuyersProposalsCancelNegotiationCall struct { 7160 s *Service 7161 proposal string 7162 cancelnegotiationrequest *CancelNegotiationRequest 7163 urlParams_ gensupport.URLParams 7164 ctx_ context.Context 7165 header_ http.Header 7166} 7167 7168// CancelNegotiation: Cancels an ongoing negotiation on a proposal. This 7169// does not cancel or end serving for the deals if the proposal has been 7170// finalized. If the proposal has not been finalized before, calling 7171// this method will set the Proposal.state to `TERMINATED` and increment 7172// the Proposal.proposal_revision. If the proposal has been finalized 7173// before and is under renegotiation now, calling this method will reset 7174// the Proposal.state to `FINALIZED` and increment the 7175// Proposal.proposal_revision. This method does not support private 7176// auction proposals whose Proposal.deal_type is 'PRIVATE_AUCTION'. 7177// 7178// - proposal: Name of the proposal. Format: 7179// `buyers/{accountId}/proposals/{proposalId}`. 7180func (r *BuyersProposalsService) CancelNegotiation(proposal string, cancelnegotiationrequest *CancelNegotiationRequest) *BuyersProposalsCancelNegotiationCall { 7181 c := &BuyersProposalsCancelNegotiationCall{s: r.s, urlParams_: make(gensupport.URLParams)} 7182 c.proposal = proposal 7183 c.cancelnegotiationrequest = cancelnegotiationrequest 7184 return c 7185} 7186 7187// Fields allows partial responses to be retrieved. See 7188// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse 7189// for more information. 7190func (c *BuyersProposalsCancelNegotiationCall) Fields(s ...googleapi.Field) *BuyersProposalsCancelNegotiationCall { 7191 c.urlParams_.Set("fields", googleapi.CombineFields(s)) 7192 return c 7193} 7194 7195// Context sets the context to be used in this call's Do method. Any 7196// pending HTTP request will be aborted if the provided context is 7197// canceled. 7198func (c *BuyersProposalsCancelNegotiationCall) Context(ctx context.Context) *BuyersProposalsCancelNegotiationCall { 7199 c.ctx_ = ctx 7200 return c 7201} 7202 7203// Header returns an http.Header that can be modified by the caller to 7204// add HTTP headers to the request. 7205func (c *BuyersProposalsCancelNegotiationCall) Header() http.Header { 7206 if c.header_ == nil { 7207 c.header_ = make(http.Header) 7208 } 7209 return c.header_ 7210} 7211 7212func (c *BuyersProposalsCancelNegotiationCall) doRequest(alt string) (*http.Response, error) { 7213 reqHeaders := make(http.Header) 7214 reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/20211027") 7215 for k, v := range c.header_ { 7216 reqHeaders[k] = v 7217 } 7218 reqHeaders.Set("User-Agent", c.s.userAgent()) 7219 var body io.Reader = nil 7220 body, err := googleapi.WithoutDataWrapper.JSONReader(c.cancelnegotiationrequest) 7221 if err != nil { 7222 return nil, err 7223 } 7224 reqHeaders.Set("Content-Type", "application/json") 7225 c.urlParams_.Set("alt", alt) 7226 c.urlParams_.Set("prettyPrint", "false") 7227 urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+proposal}:cancelNegotiation") 7228 urls += "?" + c.urlParams_.Encode() 7229 req, err := http.NewRequest("POST", urls, body) 7230 if err != nil { 7231 return nil, err 7232 } 7233 req.Header = reqHeaders 7234 googleapi.Expand(req.URL, map[string]string{ 7235 "proposal": c.proposal, 7236 }) 7237 return gensupport.SendRequest(c.ctx_, c.s.client, req) 7238} 7239 7240// Do executes the "authorizedbuyersmarketplace.buyers.proposals.cancelNegotiation" call. 7241// Exactly one of *Proposal or error will be non-nil. Any non-2xx status 7242// code is an error. Response headers are in either 7243// *Proposal.ServerResponse.Header or (if a response was returned at 7244// all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified 7245// to check whether the returned error was because 7246// http.StatusNotModified was returned. 7247func (c *BuyersProposalsCancelNegotiationCall) Do(opts ...googleapi.CallOption) (*Proposal, error) { 7248 gensupport.SetOptions(c.urlParams_, opts...) 7249 res, err := c.doRequest("json") 7250 if res != nil && res.StatusCode == http.StatusNotModified { 7251 if res.Body != nil { 7252 res.Body.Close() 7253 } 7254 return nil, &googleapi.Error{ 7255 Code: res.StatusCode, 7256 Header: res.Header, 7257 } 7258 } 7259 if err != nil { 7260 return nil, err 7261 } 7262 defer googleapi.CloseBody(res) 7263 if err := googleapi.CheckResponse(res); err != nil { 7264 return nil, err 7265 } 7266 ret := &Proposal{ 7267 ServerResponse: googleapi.ServerResponse{ 7268 Header: res.Header, 7269 HTTPStatusCode: res.StatusCode, 7270 }, 7271 } 7272 target := &ret 7273 if err := gensupport.DecodeResponse(target, res); err != nil { 7274 return nil, err 7275 } 7276 return ret, nil 7277 // { 7278 // "description": "Cancels an ongoing negotiation on a proposal. This does not cancel or end serving for the deals if the proposal has been finalized. If the proposal has not been finalized before, calling this method will set the Proposal.state to `TERMINATED` and increment the Proposal.proposal_revision. If the proposal has been finalized before and is under renegotiation now, calling this method will reset the Proposal.state to `FINALIZED` and increment the Proposal.proposal_revision. This method does not support private auction proposals whose Proposal.deal_type is 'PRIVATE_AUCTION'.", 7279 // "flatPath": "v1/buyers/{buyersId}/proposals/{proposalsId}:cancelNegotiation", 7280 // "httpMethod": "POST", 7281 // "id": "authorizedbuyersmarketplace.buyers.proposals.cancelNegotiation", 7282 // "parameterOrder": [ 7283 // "proposal" 7284 // ], 7285 // "parameters": { 7286 // "proposal": { 7287 // "description": "Name of the proposal. Format: `buyers/{accountId}/proposals/{proposalId}`", 7288 // "location": "path", 7289 // "pattern": "^buyers/[^/]+/proposals/[^/]+$", 7290 // "required": true, 7291 // "type": "string" 7292 // } 7293 // }, 7294 // "path": "v1/{+proposal}:cancelNegotiation", 7295 // "request": { 7296 // "$ref": "CancelNegotiationRequest" 7297 // }, 7298 // "response": { 7299 // "$ref": "Proposal" 7300 // }, 7301 // "scopes": [ 7302 // "https://www.googleapis.com/auth/authorized-buyers-marketplace" 7303 // ] 7304 // } 7305 7306} 7307 7308// method id "authorizedbuyersmarketplace.buyers.proposals.get": 7309 7310type BuyersProposalsGetCall struct { 7311 s *Service 7312 name string 7313 urlParams_ gensupport.URLParams 7314 ifNoneMatch_ string 7315 ctx_ context.Context 7316 header_ http.Header 7317} 7318 7319// Get: Gets a proposal using its name. The proposal is returned at most 7320// recent revision. revision. 7321// 7322// - name: Name of the proposal. Format: 7323// `buyers/{accountId}/proposals/{proposalId}`. 7324func (r *BuyersProposalsService) Get(name string) *BuyersProposalsGetCall { 7325 c := &BuyersProposalsGetCall{s: r.s, urlParams_: make(gensupport.URLParams)} 7326 c.name = name 7327 return c 7328} 7329 7330// Fields allows partial responses to be retrieved. See 7331// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse 7332// for more information. 7333func (c *BuyersProposalsGetCall) Fields(s ...googleapi.Field) *BuyersProposalsGetCall { 7334 c.urlParams_.Set("fields", googleapi.CombineFields(s)) 7335 return c 7336} 7337 7338// IfNoneMatch sets the optional parameter which makes the operation 7339// fail if the object's ETag matches the given value. This is useful for 7340// getting updates only after the object has changed since the last 7341// request. Use googleapi.IsNotModified to check whether the response 7342// error from Do is the result of In-None-Match. 7343func (c *BuyersProposalsGetCall) IfNoneMatch(entityTag string) *BuyersProposalsGetCall { 7344 c.ifNoneMatch_ = entityTag 7345 return c 7346} 7347 7348// Context sets the context to be used in this call's Do method. Any 7349// pending HTTP request will be aborted if the provided context is 7350// canceled. 7351func (c *BuyersProposalsGetCall) Context(ctx context.Context) *BuyersProposalsGetCall { 7352 c.ctx_ = ctx 7353 return c 7354} 7355 7356// Header returns an http.Header that can be modified by the caller to 7357// add HTTP headers to the request. 7358func (c *BuyersProposalsGetCall) Header() http.Header { 7359 if c.header_ == nil { 7360 c.header_ = make(http.Header) 7361 } 7362 return c.header_ 7363} 7364 7365func (c *BuyersProposalsGetCall) doRequest(alt string) (*http.Response, error) { 7366 reqHeaders := make(http.Header) 7367 reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/20211027") 7368 for k, v := range c.header_ { 7369 reqHeaders[k] = v 7370 } 7371 reqHeaders.Set("User-Agent", c.s.userAgent()) 7372 if c.ifNoneMatch_ != "" { 7373 reqHeaders.Set("If-None-Match", c.ifNoneMatch_) 7374 } 7375 var body io.Reader = nil 7376 c.urlParams_.Set("alt", alt) 7377 c.urlParams_.Set("prettyPrint", "false") 7378 urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+name}") 7379 urls += "?" + c.urlParams_.Encode() 7380 req, err := http.NewRequest("GET", urls, body) 7381 if err != nil { 7382 return nil, err 7383 } 7384 req.Header = reqHeaders 7385 googleapi.Expand(req.URL, map[string]string{ 7386 "name": c.name, 7387 }) 7388 return gensupport.SendRequest(c.ctx_, c.s.client, req) 7389} 7390 7391// Do executes the "authorizedbuyersmarketplace.buyers.proposals.get" call. 7392// Exactly one of *Proposal or error will be non-nil. Any non-2xx status 7393// code is an error. Response headers are in either 7394// *Proposal.ServerResponse.Header or (if a response was returned at 7395// all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified 7396// to check whether the returned error was because 7397// http.StatusNotModified was returned. 7398func (c *BuyersProposalsGetCall) Do(opts ...googleapi.CallOption) (*Proposal, error) { 7399 gensupport.SetOptions(c.urlParams_, opts...) 7400 res, err := c.doRequest("json") 7401 if res != nil && res.StatusCode == http.StatusNotModified { 7402 if res.Body != nil { 7403 res.Body.Close() 7404 } 7405 return nil, &googleapi.Error{ 7406 Code: res.StatusCode, 7407 Header: res.Header, 7408 } 7409 } 7410 if err != nil { 7411 return nil, err 7412 } 7413 defer googleapi.CloseBody(res) 7414 if err := googleapi.CheckResponse(res); err != nil { 7415 return nil, err 7416 } 7417 ret := &Proposal{ 7418 ServerResponse: googleapi.ServerResponse{ 7419 Header: res.Header, 7420 HTTPStatusCode: res.StatusCode, 7421 }, 7422 } 7423 target := &ret 7424 if err := gensupport.DecodeResponse(target, res); err != nil { 7425 return nil, err 7426 } 7427 return ret, nil 7428 // { 7429 // "description": "Gets a proposal using its name. The proposal is returned at most recent revision. revision.", 7430 // "flatPath": "v1/buyers/{buyersId}/proposals/{proposalsId}", 7431 // "httpMethod": "GET", 7432 // "id": "authorizedbuyersmarketplace.buyers.proposals.get", 7433 // "parameterOrder": [ 7434 // "name" 7435 // ], 7436 // "parameters": { 7437 // "name": { 7438 // "description": "Required. Name of the proposal. Format: `buyers/{accountId}/proposals/{proposalId}`", 7439 // "location": "path", 7440 // "pattern": "^buyers/[^/]+/proposals/[^/]+$", 7441 // "required": true, 7442 // "type": "string" 7443 // } 7444 // }, 7445 // "path": "v1/{+name}", 7446 // "response": { 7447 // "$ref": "Proposal" 7448 // }, 7449 // "scopes": [ 7450 // "https://www.googleapis.com/auth/authorized-buyers-marketplace" 7451 // ] 7452 // } 7453 7454} 7455 7456// method id "authorizedbuyersmarketplace.buyers.proposals.list": 7457 7458type BuyersProposalsListCall struct { 7459 s *Service 7460 parent string 7461 urlParams_ gensupport.URLParams 7462 ifNoneMatch_ string 7463 ctx_ context.Context 7464 header_ http.Header 7465} 7466 7467// List: Lists proposals. A filter expression (list filter syntax) may 7468// be specified to filter the results. This will not list finalized 7469// versions of proposals that are being renegotiated; to retrieve these 7470// use the finalizedProposals resource. 7471// 7472// - parent: Parent that owns the collection of proposals Format: 7473// `buyers/{accountId}`. 7474func (r *BuyersProposalsService) List(parent string) *BuyersProposalsListCall { 7475 c := &BuyersProposalsListCall{s: r.s, urlParams_: make(gensupport.URLParams)} 7476 c.parent = parent 7477 return c 7478} 7479 7480// Filter sets the optional parameter "filter": Optional query string 7481// using the Cloud API list filtering syntax 7482// (https://developers.google.com/authorized-buyers/apis/guides/v2/list-filters) 7483// Supported columns for filtering are: * displayName * dealType * 7484// updateTime * state 7485func (c *BuyersProposalsListCall) Filter(filter string) *BuyersProposalsListCall { 7486 c.urlParams_.Set("filter", filter) 7487 return c 7488} 7489 7490// PageSize sets the optional parameter "pageSize": Requested page size. 7491// The server may return fewer results than requested. If unspecified, 7492// the server will put a size of 500. 7493func (c *BuyersProposalsListCall) PageSize(pageSize int64) *BuyersProposalsListCall { 7494 c.urlParams_.Set("pageSize", fmt.Sprint(pageSize)) 7495 return c 7496} 7497 7498// PageToken sets the optional parameter "pageToken": The page token as 7499// returned from ListProposalsResponse. 7500func (c *BuyersProposalsListCall) PageToken(pageToken string) *BuyersProposalsListCall { 7501 c.urlParams_.Set("pageToken", pageToken) 7502 return c 7503} 7504 7505// Fields allows partial responses to be retrieved. See 7506// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse 7507// for more information. 7508func (c *BuyersProposalsListCall) Fields(s ...googleapi.Field) *BuyersProposalsListCall { 7509 c.urlParams_.Set("fields", googleapi.CombineFields(s)) 7510 return c 7511} 7512 7513// IfNoneMatch sets the optional parameter which makes the operation 7514// fail if the object's ETag matches the given value. This is useful for 7515// getting updates only after the object has changed since the last 7516// request. Use googleapi.IsNotModified to check whether the response 7517// error from Do is the result of In-None-Match. 7518func (c *BuyersProposalsListCall) IfNoneMatch(entityTag string) *BuyersProposalsListCall { 7519 c.ifNoneMatch_ = entityTag 7520 return c 7521} 7522 7523// Context sets the context to be used in this call's Do method. Any 7524// pending HTTP request will be aborted if the provided context is 7525// canceled. 7526func (c *BuyersProposalsListCall) Context(ctx context.Context) *BuyersProposalsListCall { 7527 c.ctx_ = ctx 7528 return c 7529} 7530 7531// Header returns an http.Header that can be modified by the caller to 7532// add HTTP headers to the request. 7533func (c *BuyersProposalsListCall) Header() http.Header { 7534 if c.header_ == nil { 7535 c.header_ = make(http.Header) 7536 } 7537 return c.header_ 7538} 7539 7540func (c *BuyersProposalsListCall) doRequest(alt string) (*http.Response, error) { 7541 reqHeaders := make(http.Header) 7542 reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/20211027") 7543 for k, v := range c.header_ { 7544 reqHeaders[k] = v 7545 } 7546 reqHeaders.Set("User-Agent", c.s.userAgent()) 7547 if c.ifNoneMatch_ != "" { 7548 reqHeaders.Set("If-None-Match", c.ifNoneMatch_) 7549 } 7550 var body io.Reader = nil 7551 c.urlParams_.Set("alt", alt) 7552 c.urlParams_.Set("prettyPrint", "false") 7553 urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+parent}/proposals") 7554 urls += "?" + c.urlParams_.Encode() 7555 req, err := http.NewRequest("GET", urls, body) 7556 if err != nil { 7557 return nil, err 7558 } 7559 req.Header = reqHeaders 7560 googleapi.Expand(req.URL, map[string]string{ 7561 "parent": c.parent, 7562 }) 7563 return gensupport.SendRequest(c.ctx_, c.s.client, req) 7564} 7565 7566// Do executes the "authorizedbuyersmarketplace.buyers.proposals.list" call. 7567// Exactly one of *ListProposalsResponse or error will be non-nil. Any 7568// non-2xx status code is an error. Response headers are in either 7569// *ListProposalsResponse.ServerResponse.Header or (if a response was 7570// returned at all) in error.(*googleapi.Error).Header. Use 7571// googleapi.IsNotModified to check whether the returned error was 7572// because http.StatusNotModified was returned. 7573func (c *BuyersProposalsListCall) Do(opts ...googleapi.CallOption) (*ListProposalsResponse, error) { 7574 gensupport.SetOptions(c.urlParams_, opts...) 7575 res, err := c.doRequest("json") 7576 if res != nil && res.StatusCode == http.StatusNotModified { 7577 if res.Body != nil { 7578 res.Body.Close() 7579 } 7580 return nil, &googleapi.Error{ 7581 Code: res.StatusCode, 7582 Header: res.Header, 7583 } 7584 } 7585 if err != nil { 7586 return nil, err 7587 } 7588 defer googleapi.CloseBody(res) 7589 if err := googleapi.CheckResponse(res); err != nil { 7590 return nil, err 7591 } 7592 ret := &ListProposalsResponse{ 7593 ServerResponse: googleapi.ServerResponse{ 7594 Header: res.Header, 7595 HTTPStatusCode: res.StatusCode, 7596 }, 7597 } 7598 target := &ret 7599 if err := gensupport.DecodeResponse(target, res); err != nil { 7600 return nil, err 7601 } 7602 return ret, nil 7603 // { 7604 // "description": "Lists proposals. A filter expression (list filter syntax) may be specified to filter the results. This will not list finalized versions of proposals that are being renegotiated; to retrieve these use the finalizedProposals resource.", 7605 // "flatPath": "v1/buyers/{buyersId}/proposals", 7606 // "httpMethod": "GET", 7607 // "id": "authorizedbuyersmarketplace.buyers.proposals.list", 7608 // "parameterOrder": [ 7609 // "parent" 7610 // ], 7611 // "parameters": { 7612 // "filter": { 7613 // "description": "Optional query string using the [Cloud API list filtering syntax](https://developers.google.com/authorized-buyers/apis/guides/v2/list-filters) Supported columns for filtering are: * displayName * dealType * updateTime * state", 7614 // "location": "query", 7615 // "type": "string" 7616 // }, 7617 // "pageSize": { 7618 // "description": "Requested page size. The server may return fewer results than requested. If unspecified, the server will put a size of 500.", 7619 // "format": "int32", 7620 // "location": "query", 7621 // "type": "integer" 7622 // }, 7623 // "pageToken": { 7624 // "description": "The page token as returned from ListProposalsResponse.", 7625 // "location": "query", 7626 // "type": "string" 7627 // }, 7628 // "parent": { 7629 // "description": "Required. Parent that owns the collection of proposals Format: `buyers/{accountId}`", 7630 // "location": "path", 7631 // "pattern": "^buyers/[^/]+$", 7632 // "required": true, 7633 // "type": "string" 7634 // } 7635 // }, 7636 // "path": "v1/{+parent}/proposals", 7637 // "response": { 7638 // "$ref": "ListProposalsResponse" 7639 // }, 7640 // "scopes": [ 7641 // "https://www.googleapis.com/auth/authorized-buyers-marketplace" 7642 // ] 7643 // } 7644 7645} 7646 7647// Pages invokes f for each page of results. 7648// A non-nil error returned from f will halt the iteration. 7649// The provided context supersedes any context provided to the Context method. 7650func (c *BuyersProposalsListCall) Pages(ctx context.Context, f func(*ListProposalsResponse) error) error { 7651 c.ctx_ = ctx 7652 defer c.PageToken(c.urlParams_.Get("pageToken")) // reset paging to original point 7653 for { 7654 x, err := c.Do() 7655 if err != nil { 7656 return err 7657 } 7658 if err := f(x); err != nil { 7659 return err 7660 } 7661 if x.NextPageToken == "" { 7662 return nil 7663 } 7664 c.PageToken(x.NextPageToken) 7665 } 7666} 7667 7668// method id "authorizedbuyersmarketplace.buyers.proposals.patch": 7669 7670type BuyersProposalsPatchCall struct { 7671 s *Service 7672 nameid string 7673 proposal *Proposal 7674 urlParams_ gensupport.URLParams 7675 ctx_ context.Context 7676 header_ http.Header 7677} 7678 7679// Patch: Updates the proposal at the given revision number. If the 7680// revision number in the request is behind the latest from the server, 7681// an error message will be returned. See FieldMask for how to use 7682// FieldMask. Only fields specified in the 7683// UpdateProposalRequest.update_mask will be updated; Fields noted as 7684// 'Immutable' or 'Output only' yet specified in the 7685// UpdateProposalRequest.update_mask will be ignored and left unchanged. 7686// Updating a private auction proposal is not allowed and will result in 7687// an error. 7688// 7689// - name: Immutable. The name of the proposal serving as a unique 7690// identifier. Format: buyers/{accountId}/proposals/{proposalId}. 7691func (r *BuyersProposalsService) Patch(nameid string, proposal *Proposal) *BuyersProposalsPatchCall { 7692 c := &BuyersProposalsPatchCall{s: r.s, urlParams_: make(gensupport.URLParams)} 7693 c.nameid = nameid 7694 c.proposal = proposal 7695 return c 7696} 7697 7698// UpdateMask sets the optional parameter "updateMask": List of fields 7699// to be updated. If empty or unspecified, the service will update all 7700// fields populated in the update request excluding the output only 7701// fields and primitive fields with default value. Note that explicit 7702// field mask is required in order to reset a primitive field back to 7703// its default value, e.g. false for boolean fields, 0 for integer 7704// fields. A special field mask consisting of a single path "*" can be 7705// used to indicate full replacement(the equivalent of PUT method), 7706// updatable fields unset or unspecified in the input will be cleared or 7707// set to default value. Output only fields will be ignored regardless 7708// of the value of updateMask. 7709func (c *BuyersProposalsPatchCall) UpdateMask(updateMask string) *BuyersProposalsPatchCall { 7710 c.urlParams_.Set("updateMask", updateMask) 7711 return c 7712} 7713 7714// Fields allows partial responses to be retrieved. See 7715// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse 7716// for more information. 7717func (c *BuyersProposalsPatchCall) Fields(s ...googleapi.Field) *BuyersProposalsPatchCall { 7718 c.urlParams_.Set("fields", googleapi.CombineFields(s)) 7719 return c 7720} 7721 7722// Context sets the context to be used in this call's Do method. Any 7723// pending HTTP request will be aborted if the provided context is 7724// canceled. 7725func (c *BuyersProposalsPatchCall) Context(ctx context.Context) *BuyersProposalsPatchCall { 7726 c.ctx_ = ctx 7727 return c 7728} 7729 7730// Header returns an http.Header that can be modified by the caller to 7731// add HTTP headers to the request. 7732func (c *BuyersProposalsPatchCall) Header() http.Header { 7733 if c.header_ == nil { 7734 c.header_ = make(http.Header) 7735 } 7736 return c.header_ 7737} 7738 7739func (c *BuyersProposalsPatchCall) doRequest(alt string) (*http.Response, error) { 7740 reqHeaders := make(http.Header) 7741 reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/20211027") 7742 for k, v := range c.header_ { 7743 reqHeaders[k] = v 7744 } 7745 reqHeaders.Set("User-Agent", c.s.userAgent()) 7746 var body io.Reader = nil 7747 body, err := googleapi.WithoutDataWrapper.JSONReader(c.proposal) 7748 if err != nil { 7749 return nil, err 7750 } 7751 reqHeaders.Set("Content-Type", "application/json") 7752 c.urlParams_.Set("alt", alt) 7753 c.urlParams_.Set("prettyPrint", "false") 7754 urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+name}") 7755 urls += "?" + c.urlParams_.Encode() 7756 req, err := http.NewRequest("PATCH", urls, body) 7757 if err != nil { 7758 return nil, err 7759 } 7760 req.Header = reqHeaders 7761 googleapi.Expand(req.URL, map[string]string{ 7762 "name": c.nameid, 7763 }) 7764 return gensupport.SendRequest(c.ctx_, c.s.client, req) 7765} 7766 7767// Do executes the "authorizedbuyersmarketplace.buyers.proposals.patch" call. 7768// Exactly one of *Proposal or error will be non-nil. Any non-2xx status 7769// code is an error. Response headers are in either 7770// *Proposal.ServerResponse.Header or (if a response was returned at 7771// all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified 7772// to check whether the returned error was because 7773// http.StatusNotModified was returned. 7774func (c *BuyersProposalsPatchCall) Do(opts ...googleapi.CallOption) (*Proposal, error) { 7775 gensupport.SetOptions(c.urlParams_, opts...) 7776 res, err := c.doRequest("json") 7777 if res != nil && res.StatusCode == http.StatusNotModified { 7778 if res.Body != nil { 7779 res.Body.Close() 7780 } 7781 return nil, &googleapi.Error{ 7782 Code: res.StatusCode, 7783 Header: res.Header, 7784 } 7785 } 7786 if err != nil { 7787 return nil, err 7788 } 7789 defer googleapi.CloseBody(res) 7790 if err := googleapi.CheckResponse(res); err != nil { 7791 return nil, err 7792 } 7793 ret := &Proposal{ 7794 ServerResponse: googleapi.ServerResponse{ 7795 Header: res.Header, 7796 HTTPStatusCode: res.StatusCode, 7797 }, 7798 } 7799 target := &ret 7800 if err := gensupport.DecodeResponse(target, res); err != nil { 7801 return nil, err 7802 } 7803 return ret, nil 7804 // { 7805 // "description": "Updates the proposal at the given revision number. If the revision number in the request is behind the latest from the server, an error message will be returned. See FieldMask for how to use FieldMask. Only fields specified in the UpdateProposalRequest.update_mask will be updated; Fields noted as 'Immutable' or 'Output only' yet specified in the UpdateProposalRequest.update_mask will be ignored and left unchanged. Updating a private auction proposal is not allowed and will result in an error.", 7806 // "flatPath": "v1/buyers/{buyersId}/proposals/{proposalsId}", 7807 // "httpMethod": "PATCH", 7808 // "id": "authorizedbuyersmarketplace.buyers.proposals.patch", 7809 // "parameterOrder": [ 7810 // "name" 7811 // ], 7812 // "parameters": { 7813 // "name": { 7814 // "description": "Immutable. The name of the proposal serving as a unique identifier. Format: buyers/{accountId}/proposals/{proposalId}", 7815 // "location": "path", 7816 // "pattern": "^buyers/[^/]+/proposals/[^/]+$", 7817 // "required": true, 7818 // "type": "string" 7819 // }, 7820 // "updateMask": { 7821 // "description": "List of fields to be updated. If empty or unspecified, the service will update all fields populated in the update request excluding the output only fields and primitive fields with default value. Note that explicit field mask is required in order to reset a primitive field back to its default value, e.g. false for boolean fields, 0 for integer fields. A special field mask consisting of a single path \"*\" can be used to indicate full replacement(the equivalent of PUT method), updatable fields unset or unspecified in the input will be cleared or set to default value. Output only fields will be ignored regardless of the value of updateMask.", 7822 // "format": "google-fieldmask", 7823 // "location": "query", 7824 // "type": "string" 7825 // } 7826 // }, 7827 // "path": "v1/{+name}", 7828 // "request": { 7829 // "$ref": "Proposal" 7830 // }, 7831 // "response": { 7832 // "$ref": "Proposal" 7833 // }, 7834 // "scopes": [ 7835 // "https://www.googleapis.com/auth/authorized-buyers-marketplace" 7836 // ] 7837 // } 7838 7839} 7840 7841// method id "authorizedbuyersmarketplace.buyers.proposals.sendRfp": 7842 7843type BuyersProposalsSendRfpCall struct { 7844 s *Service 7845 buyer string 7846 sendrfprequest *SendRfpRequest 7847 urlParams_ gensupport.URLParams 7848 ctx_ context.Context 7849 header_ http.Header 7850} 7851 7852// SendRfp: Sends a request for proposal (RFP) to a publisher to 7853// initiate the negotiation regarding certain inventory. In the RFP, 7854// buyers can specify the deal type, deal terms, start and end dates, 7855// targeting, and a message to the publisher. Once the RFP is sent, a 7856// proposal in `SELLER_REVIEW_REQUESTED` state will be created and 7857// returned in the response. The publisher may review your request and 7858// respond with detailed deals in the proposal. 7859// 7860// - buyer: The current buyer who is sending the RFP in the format: 7861// `buyers/{accountId}`. 7862func (r *BuyersProposalsService) SendRfp(buyer string, sendrfprequest *SendRfpRequest) *BuyersProposalsSendRfpCall { 7863 c := &BuyersProposalsSendRfpCall{s: r.s, urlParams_: make(gensupport.URLParams)} 7864 c.buyer = buyer 7865 c.sendrfprequest = sendrfprequest 7866 return c 7867} 7868 7869// Fields allows partial responses to be retrieved. See 7870// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse 7871// for more information. 7872func (c *BuyersProposalsSendRfpCall) Fields(s ...googleapi.Field) *BuyersProposalsSendRfpCall { 7873 c.urlParams_.Set("fields", googleapi.CombineFields(s)) 7874 return c 7875} 7876 7877// Context sets the context to be used in this call's Do method. Any 7878// pending HTTP request will be aborted if the provided context is 7879// canceled. 7880func (c *BuyersProposalsSendRfpCall) Context(ctx context.Context) *BuyersProposalsSendRfpCall { 7881 c.ctx_ = ctx 7882 return c 7883} 7884 7885// Header returns an http.Header that can be modified by the caller to 7886// add HTTP headers to the request. 7887func (c *BuyersProposalsSendRfpCall) Header() http.Header { 7888 if c.header_ == nil { 7889 c.header_ = make(http.Header) 7890 } 7891 return c.header_ 7892} 7893 7894func (c *BuyersProposalsSendRfpCall) doRequest(alt string) (*http.Response, error) { 7895 reqHeaders := make(http.Header) 7896 reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/20211027") 7897 for k, v := range c.header_ { 7898 reqHeaders[k] = v 7899 } 7900 reqHeaders.Set("User-Agent", c.s.userAgent()) 7901 var body io.Reader = nil 7902 body, err := googleapi.WithoutDataWrapper.JSONReader(c.sendrfprequest) 7903 if err != nil { 7904 return nil, err 7905 } 7906 reqHeaders.Set("Content-Type", "application/json") 7907 c.urlParams_.Set("alt", alt) 7908 c.urlParams_.Set("prettyPrint", "false") 7909 urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+buyer}/proposals:sendRfp") 7910 urls += "?" + c.urlParams_.Encode() 7911 req, err := http.NewRequest("POST", urls, body) 7912 if err != nil { 7913 return nil, err 7914 } 7915 req.Header = reqHeaders 7916 googleapi.Expand(req.URL, map[string]string{ 7917 "buyer": c.buyer, 7918 }) 7919 return gensupport.SendRequest(c.ctx_, c.s.client, req) 7920} 7921 7922// Do executes the "authorizedbuyersmarketplace.buyers.proposals.sendRfp" call. 7923// Exactly one of *Proposal or error will be non-nil. Any non-2xx status 7924// code is an error. Response headers are in either 7925// *Proposal.ServerResponse.Header or (if a response was returned at 7926// all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified 7927// to check whether the returned error was because 7928// http.StatusNotModified was returned. 7929func (c *BuyersProposalsSendRfpCall) Do(opts ...googleapi.CallOption) (*Proposal, error) { 7930 gensupport.SetOptions(c.urlParams_, opts...) 7931 res, err := c.doRequest("json") 7932 if res != nil && res.StatusCode == http.StatusNotModified { 7933 if res.Body != nil { 7934 res.Body.Close() 7935 } 7936 return nil, &googleapi.Error{ 7937 Code: res.StatusCode, 7938 Header: res.Header, 7939 } 7940 } 7941 if err != nil { 7942 return nil, err 7943 } 7944 defer googleapi.CloseBody(res) 7945 if err := googleapi.CheckResponse(res); err != nil { 7946 return nil, err 7947 } 7948 ret := &Proposal{ 7949 ServerResponse: googleapi.ServerResponse{ 7950 Header: res.Header, 7951 HTTPStatusCode: res.StatusCode, 7952 }, 7953 } 7954 target := &ret 7955 if err := gensupport.DecodeResponse(target, res); err != nil { 7956 return nil, err 7957 } 7958 return ret, nil 7959 // { 7960 // "description": "Sends a request for proposal (RFP) to a publisher to initiate the negotiation regarding certain inventory. In the RFP, buyers can specify the deal type, deal terms, start and end dates, targeting, and a message to the publisher. Once the RFP is sent, a proposal in `SELLER_REVIEW_REQUESTED` state will be created and returned in the response. The publisher may review your request and respond with detailed deals in the proposal.", 7961 // "flatPath": "v1/buyers/{buyersId}/proposals:sendRfp", 7962 // "httpMethod": "POST", 7963 // "id": "authorizedbuyersmarketplace.buyers.proposals.sendRfp", 7964 // "parameterOrder": [ 7965 // "buyer" 7966 // ], 7967 // "parameters": { 7968 // "buyer": { 7969 // "description": "Required. The current buyer who is sending the RFP in the format: `buyers/{accountId}`.", 7970 // "location": "path", 7971 // "pattern": "^buyers/[^/]+$", 7972 // "required": true, 7973 // "type": "string" 7974 // } 7975 // }, 7976 // "path": "v1/{+buyer}/proposals:sendRfp", 7977 // "request": { 7978 // "$ref": "SendRfpRequest" 7979 // }, 7980 // "response": { 7981 // "$ref": "Proposal" 7982 // }, 7983 // "scopes": [ 7984 // "https://www.googleapis.com/auth/authorized-buyers-marketplace" 7985 // ] 7986 // } 7987 7988} 7989 7990// method id "authorizedbuyersmarketplace.buyers.proposals.deals.batchUpdate": 7991 7992type BuyersProposalsDealsBatchUpdateCall struct { 7993 s *Service 7994 parent string 7995 batchupdatedealsrequest *BatchUpdateDealsRequest 7996 urlParams_ gensupport.URLParams 7997 ctx_ context.Context 7998 header_ http.Header 7999} 8000 8001// BatchUpdate: Batch updates multiple deals in the same proposal. 8002// 8003// - parent: The name of the proposal containing the deals to batch 8004// update. Format: buyers/{accountId}/proposals/{proposalId}. 8005func (r *BuyersProposalsDealsService) BatchUpdate(parent string, batchupdatedealsrequest *BatchUpdateDealsRequest) *BuyersProposalsDealsBatchUpdateCall { 8006 c := &BuyersProposalsDealsBatchUpdateCall{s: r.s, urlParams_: make(gensupport.URLParams)} 8007 c.parent = parent 8008 c.batchupdatedealsrequest = batchupdatedealsrequest 8009 return c 8010} 8011 8012// Fields allows partial responses to be retrieved. See 8013// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse 8014// for more information. 8015func (c *BuyersProposalsDealsBatchUpdateCall) Fields(s ...googleapi.Field) *BuyersProposalsDealsBatchUpdateCall { 8016 c.urlParams_.Set("fields", googleapi.CombineFields(s)) 8017 return c 8018} 8019 8020// Context sets the context to be used in this call's Do method. Any 8021// pending HTTP request will be aborted if the provided context is 8022// canceled. 8023func (c *BuyersProposalsDealsBatchUpdateCall) Context(ctx context.Context) *BuyersProposalsDealsBatchUpdateCall { 8024 c.ctx_ = ctx 8025 return c 8026} 8027 8028// Header returns an http.Header that can be modified by the caller to 8029// add HTTP headers to the request. 8030func (c *BuyersProposalsDealsBatchUpdateCall) Header() http.Header { 8031 if c.header_ == nil { 8032 c.header_ = make(http.Header) 8033 } 8034 return c.header_ 8035} 8036 8037func (c *BuyersProposalsDealsBatchUpdateCall) doRequest(alt string) (*http.Response, error) { 8038 reqHeaders := make(http.Header) 8039 reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/20211027") 8040 for k, v := range c.header_ { 8041 reqHeaders[k] = v 8042 } 8043 reqHeaders.Set("User-Agent", c.s.userAgent()) 8044 var body io.Reader = nil 8045 body, err := googleapi.WithoutDataWrapper.JSONReader(c.batchupdatedealsrequest) 8046 if err != nil { 8047 return nil, err 8048 } 8049 reqHeaders.Set("Content-Type", "application/json") 8050 c.urlParams_.Set("alt", alt) 8051 c.urlParams_.Set("prettyPrint", "false") 8052 urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+parent}/deals:batchUpdate") 8053 urls += "?" + c.urlParams_.Encode() 8054 req, err := http.NewRequest("POST", urls, body) 8055 if err != nil { 8056 return nil, err 8057 } 8058 req.Header = reqHeaders 8059 googleapi.Expand(req.URL, map[string]string{ 8060 "parent": c.parent, 8061 }) 8062 return gensupport.SendRequest(c.ctx_, c.s.client, req) 8063} 8064 8065// Do executes the "authorizedbuyersmarketplace.buyers.proposals.deals.batchUpdate" call. 8066// Exactly one of *BatchUpdateDealsResponse or error will be non-nil. 8067// Any non-2xx status code is an error. Response headers are in either 8068// *BatchUpdateDealsResponse.ServerResponse.Header or (if a response was 8069// returned at all) in error.(*googleapi.Error).Header. Use 8070// googleapi.IsNotModified to check whether the returned error was 8071// because http.StatusNotModified was returned. 8072func (c *BuyersProposalsDealsBatchUpdateCall) Do(opts ...googleapi.CallOption) (*BatchUpdateDealsResponse, error) { 8073 gensupport.SetOptions(c.urlParams_, opts...) 8074 res, err := c.doRequest("json") 8075 if res != nil && res.StatusCode == http.StatusNotModified { 8076 if res.Body != nil { 8077 res.Body.Close() 8078 } 8079 return nil, &googleapi.Error{ 8080 Code: res.StatusCode, 8081 Header: res.Header, 8082 } 8083 } 8084 if err != nil { 8085 return nil, err 8086 } 8087 defer googleapi.CloseBody(res) 8088 if err := googleapi.CheckResponse(res); err != nil { 8089 return nil, err 8090 } 8091 ret := &BatchUpdateDealsResponse{ 8092 ServerResponse: googleapi.ServerResponse{ 8093 Header: res.Header, 8094 HTTPStatusCode: res.StatusCode, 8095 }, 8096 } 8097 target := &ret 8098 if err := gensupport.DecodeResponse(target, res); err != nil { 8099 return nil, err 8100 } 8101 return ret, nil 8102 // { 8103 // "description": "Batch updates multiple deals in the same proposal.", 8104 // "flatPath": "v1/buyers/{buyersId}/proposals/{proposalsId}/deals:batchUpdate", 8105 // "httpMethod": "POST", 8106 // "id": "authorizedbuyersmarketplace.buyers.proposals.deals.batchUpdate", 8107 // "parameterOrder": [ 8108 // "parent" 8109 // ], 8110 // "parameters": { 8111 // "parent": { 8112 // "description": "Required. The name of the proposal containing the deals to batch update. Format: buyers/{accountId}/proposals/{proposalId}", 8113 // "location": "path", 8114 // "pattern": "^buyers/[^/]+/proposals/[^/]+$", 8115 // "required": true, 8116 // "type": "string" 8117 // } 8118 // }, 8119 // "path": "v1/{+parent}/deals:batchUpdate", 8120 // "request": { 8121 // "$ref": "BatchUpdateDealsRequest" 8122 // }, 8123 // "response": { 8124 // "$ref": "BatchUpdateDealsResponse" 8125 // }, 8126 // "scopes": [ 8127 // "https://www.googleapis.com/auth/authorized-buyers-marketplace" 8128 // ] 8129 // } 8130 8131} 8132 8133// method id "authorizedbuyersmarketplace.buyers.proposals.deals.get": 8134 8135type BuyersProposalsDealsGetCall struct { 8136 s *Service 8137 name string 8138 urlParams_ gensupport.URLParams 8139 ifNoneMatch_ string 8140 ctx_ context.Context 8141 header_ http.Header 8142} 8143 8144// Get: Gets a deal given its name. The deal is returned at its head 8145// revision. 8146// 8147// - name: Format: 8148// buyers/{accountId}/proposals/{proposalId}/deals/{dealId}. 8149func (r *BuyersProposalsDealsService) Get(name string) *BuyersProposalsDealsGetCall { 8150 c := &BuyersProposalsDealsGetCall{s: r.s, urlParams_: make(gensupport.URLParams)} 8151 c.name = name 8152 return c 8153} 8154 8155// Fields allows partial responses to be retrieved. See 8156// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse 8157// for more information. 8158func (c *BuyersProposalsDealsGetCall) Fields(s ...googleapi.Field) *BuyersProposalsDealsGetCall { 8159 c.urlParams_.Set("fields", googleapi.CombineFields(s)) 8160 return c 8161} 8162 8163// IfNoneMatch sets the optional parameter which makes the operation 8164// fail if the object's ETag matches the given value. This is useful for 8165// getting updates only after the object has changed since the last 8166// request. Use googleapi.IsNotModified to check whether the response 8167// error from Do is the result of In-None-Match. 8168func (c *BuyersProposalsDealsGetCall) IfNoneMatch(entityTag string) *BuyersProposalsDealsGetCall { 8169 c.ifNoneMatch_ = entityTag 8170 return c 8171} 8172 8173// Context sets the context to be used in this call's Do method. Any 8174// pending HTTP request will be aborted if the provided context is 8175// canceled. 8176func (c *BuyersProposalsDealsGetCall) Context(ctx context.Context) *BuyersProposalsDealsGetCall { 8177 c.ctx_ = ctx 8178 return c 8179} 8180 8181// Header returns an http.Header that can be modified by the caller to 8182// add HTTP headers to the request. 8183func (c *BuyersProposalsDealsGetCall) Header() http.Header { 8184 if c.header_ == nil { 8185 c.header_ = make(http.Header) 8186 } 8187 return c.header_ 8188} 8189 8190func (c *BuyersProposalsDealsGetCall) doRequest(alt string) (*http.Response, error) { 8191 reqHeaders := make(http.Header) 8192 reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/20211027") 8193 for k, v := range c.header_ { 8194 reqHeaders[k] = v 8195 } 8196 reqHeaders.Set("User-Agent", c.s.userAgent()) 8197 if c.ifNoneMatch_ != "" { 8198 reqHeaders.Set("If-None-Match", c.ifNoneMatch_) 8199 } 8200 var body io.Reader = nil 8201 c.urlParams_.Set("alt", alt) 8202 c.urlParams_.Set("prettyPrint", "false") 8203 urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+name}") 8204 urls += "?" + c.urlParams_.Encode() 8205 req, err := http.NewRequest("GET", urls, body) 8206 if err != nil { 8207 return nil, err 8208 } 8209 req.Header = reqHeaders 8210 googleapi.Expand(req.URL, map[string]string{ 8211 "name": c.name, 8212 }) 8213 return gensupport.SendRequest(c.ctx_, c.s.client, req) 8214} 8215 8216// Do executes the "authorizedbuyersmarketplace.buyers.proposals.deals.get" call. 8217// Exactly one of *Deal or error will be non-nil. Any non-2xx status 8218// code is an error. Response headers are in either 8219// *Deal.ServerResponse.Header or (if a response was returned at all) in 8220// error.(*googleapi.Error).Header. Use googleapi.IsNotModified to check 8221// whether the returned error was because http.StatusNotModified was 8222// returned. 8223func (c *BuyersProposalsDealsGetCall) Do(opts ...googleapi.CallOption) (*Deal, error) { 8224 gensupport.SetOptions(c.urlParams_, opts...) 8225 res, err := c.doRequest("json") 8226 if res != nil && res.StatusCode == http.StatusNotModified { 8227 if res.Body != nil { 8228 res.Body.Close() 8229 } 8230 return nil, &googleapi.Error{ 8231 Code: res.StatusCode, 8232 Header: res.Header, 8233 } 8234 } 8235 if err != nil { 8236 return nil, err 8237 } 8238 defer googleapi.CloseBody(res) 8239 if err := googleapi.CheckResponse(res); err != nil { 8240 return nil, err 8241 } 8242 ret := &Deal{ 8243 ServerResponse: googleapi.ServerResponse{ 8244 Header: res.Header, 8245 HTTPStatusCode: res.StatusCode, 8246 }, 8247 } 8248 target := &ret 8249 if err := gensupport.DecodeResponse(target, res); err != nil { 8250 return nil, err 8251 } 8252 return ret, nil 8253 // { 8254 // "description": "Gets a deal given its name. The deal is returned at its head revision.", 8255 // "flatPath": "v1/buyers/{buyersId}/proposals/{proposalsId}/deals/{dealsId}", 8256 // "httpMethod": "GET", 8257 // "id": "authorizedbuyersmarketplace.buyers.proposals.deals.get", 8258 // "parameterOrder": [ 8259 // "name" 8260 // ], 8261 // "parameters": { 8262 // "name": { 8263 // "description": "Required. Format: buyers/{accountId}/proposals/{proposalId}/deals/{dealId}", 8264 // "location": "path", 8265 // "pattern": "^buyers/[^/]+/proposals/[^/]+/deals/[^/]+$", 8266 // "required": true, 8267 // "type": "string" 8268 // } 8269 // }, 8270 // "path": "v1/{+name}", 8271 // "response": { 8272 // "$ref": "Deal" 8273 // }, 8274 // "scopes": [ 8275 // "https://www.googleapis.com/auth/authorized-buyers-marketplace" 8276 // ] 8277 // } 8278 8279} 8280 8281// method id "authorizedbuyersmarketplace.buyers.proposals.deals.list": 8282 8283type BuyersProposalsDealsListCall struct { 8284 s *Service 8285 parent string 8286 urlParams_ gensupport.URLParams 8287 ifNoneMatch_ string 8288 ctx_ context.Context 8289 header_ http.Header 8290} 8291 8292// List: Lists all deals in a proposal. To retrieve only the finalized 8293// revision deals regardless if a deal is being renegotiated, see the 8294// FinalizedDeals resource. 8295// 8296// - parent: The name of the proposal containing the deals to retrieve. 8297// Format: buyers/{accountId}/proposals/{proposalId}. 8298func (r *BuyersProposalsDealsService) List(parent string) *BuyersProposalsDealsListCall { 8299 c := &BuyersProposalsDealsListCall{s: r.s, urlParams_: make(gensupport.URLParams)} 8300 c.parent = parent 8301 return c 8302} 8303 8304// PageSize sets the optional parameter "pageSize": Requested page size. 8305// The server may return fewer results than requested. If requested more 8306// than 500, the server will return 500 results per page. If 8307// unspecified, the server will pick a default page size of 100. 8308func (c *BuyersProposalsDealsListCall) PageSize(pageSize int64) *BuyersProposalsDealsListCall { 8309 c.urlParams_.Set("pageSize", fmt.Sprint(pageSize)) 8310 return c 8311} 8312 8313// PageToken sets the optional parameter "pageToken": The page token as 8314// returned from ListDealsResponse. 8315func (c *BuyersProposalsDealsListCall) PageToken(pageToken string) *BuyersProposalsDealsListCall { 8316 c.urlParams_.Set("pageToken", pageToken) 8317 return c 8318} 8319 8320// Fields allows partial responses to be retrieved. See 8321// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse 8322// for more information. 8323func (c *BuyersProposalsDealsListCall) Fields(s ...googleapi.Field) *BuyersProposalsDealsListCall { 8324 c.urlParams_.Set("fields", googleapi.CombineFields(s)) 8325 return c 8326} 8327 8328// IfNoneMatch sets the optional parameter which makes the operation 8329// fail if the object's ETag matches the given value. This is useful for 8330// getting updates only after the object has changed since the last 8331// request. Use googleapi.IsNotModified to check whether the response 8332// error from Do is the result of In-None-Match. 8333func (c *BuyersProposalsDealsListCall) IfNoneMatch(entityTag string) *BuyersProposalsDealsListCall { 8334 c.ifNoneMatch_ = entityTag 8335 return c 8336} 8337 8338// Context sets the context to be used in this call's Do method. Any 8339// pending HTTP request will be aborted if the provided context is 8340// canceled. 8341func (c *BuyersProposalsDealsListCall) Context(ctx context.Context) *BuyersProposalsDealsListCall { 8342 c.ctx_ = ctx 8343 return c 8344} 8345 8346// Header returns an http.Header that can be modified by the caller to 8347// add HTTP headers to the request. 8348func (c *BuyersProposalsDealsListCall) Header() http.Header { 8349 if c.header_ == nil { 8350 c.header_ = make(http.Header) 8351 } 8352 return c.header_ 8353} 8354 8355func (c *BuyersProposalsDealsListCall) doRequest(alt string) (*http.Response, error) { 8356 reqHeaders := make(http.Header) 8357 reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/20211027") 8358 for k, v := range c.header_ { 8359 reqHeaders[k] = v 8360 } 8361 reqHeaders.Set("User-Agent", c.s.userAgent()) 8362 if c.ifNoneMatch_ != "" { 8363 reqHeaders.Set("If-None-Match", c.ifNoneMatch_) 8364 } 8365 var body io.Reader = nil 8366 c.urlParams_.Set("alt", alt) 8367 c.urlParams_.Set("prettyPrint", "false") 8368 urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+parent}/deals") 8369 urls += "?" + c.urlParams_.Encode() 8370 req, err := http.NewRequest("GET", urls, body) 8371 if err != nil { 8372 return nil, err 8373 } 8374 req.Header = reqHeaders 8375 googleapi.Expand(req.URL, map[string]string{ 8376 "parent": c.parent, 8377 }) 8378 return gensupport.SendRequest(c.ctx_, c.s.client, req) 8379} 8380 8381// Do executes the "authorizedbuyersmarketplace.buyers.proposals.deals.list" call. 8382// Exactly one of *ListDealsResponse or error will be non-nil. Any 8383// non-2xx status code is an error. Response headers are in either 8384// *ListDealsResponse.ServerResponse.Header or (if a response was 8385// returned at all) in error.(*googleapi.Error).Header. Use 8386// googleapi.IsNotModified to check whether the returned error was 8387// because http.StatusNotModified was returned. 8388func (c *BuyersProposalsDealsListCall) Do(opts ...googleapi.CallOption) (*ListDealsResponse, error) { 8389 gensupport.SetOptions(c.urlParams_, opts...) 8390 res, err := c.doRequest("json") 8391 if res != nil && res.StatusCode == http.StatusNotModified { 8392 if res.Body != nil { 8393 res.Body.Close() 8394 } 8395 return nil, &googleapi.Error{ 8396 Code: res.StatusCode, 8397 Header: res.Header, 8398 } 8399 } 8400 if err != nil { 8401 return nil, err 8402 } 8403 defer googleapi.CloseBody(res) 8404 if err := googleapi.CheckResponse(res); err != nil { 8405 return nil, err 8406 } 8407 ret := &ListDealsResponse{ 8408 ServerResponse: googleapi.ServerResponse{ 8409 Header: res.Header, 8410 HTTPStatusCode: res.StatusCode, 8411 }, 8412 } 8413 target := &ret 8414 if err := gensupport.DecodeResponse(target, res); err != nil { 8415 return nil, err 8416 } 8417 return ret, nil 8418 // { 8419 // "description": "Lists all deals in a proposal. To retrieve only the finalized revision deals regardless if a deal is being renegotiated, see the FinalizedDeals resource.", 8420 // "flatPath": "v1/buyers/{buyersId}/proposals/{proposalsId}/deals", 8421 // "httpMethod": "GET", 8422 // "id": "authorizedbuyersmarketplace.buyers.proposals.deals.list", 8423 // "parameterOrder": [ 8424 // "parent" 8425 // ], 8426 // "parameters": { 8427 // "pageSize": { 8428 // "description": "Requested page size. The server may return fewer results than requested. If requested more than 500, the server will return 500 results per page. If unspecified, the server will pick a default page size of 100.", 8429 // "format": "int32", 8430 // "location": "query", 8431 // "type": "integer" 8432 // }, 8433 // "pageToken": { 8434 // "description": "The page token as returned from ListDealsResponse.", 8435 // "location": "query", 8436 // "type": "string" 8437 // }, 8438 // "parent": { 8439 // "description": "Required. The name of the proposal containing the deals to retrieve. Format: buyers/{accountId}/proposals/{proposalId}", 8440 // "location": "path", 8441 // "pattern": "^buyers/[^/]+/proposals/[^/]+$", 8442 // "required": true, 8443 // "type": "string" 8444 // } 8445 // }, 8446 // "path": "v1/{+parent}/deals", 8447 // "response": { 8448 // "$ref": "ListDealsResponse" 8449 // }, 8450 // "scopes": [ 8451 // "https://www.googleapis.com/auth/authorized-buyers-marketplace" 8452 // ] 8453 // } 8454 8455} 8456 8457// Pages invokes f for each page of results. 8458// A non-nil error returned from f will halt the iteration. 8459// The provided context supersedes any context provided to the Context method. 8460func (c *BuyersProposalsDealsListCall) Pages(ctx context.Context, f func(*ListDealsResponse) error) error { 8461 c.ctx_ = ctx 8462 defer c.PageToken(c.urlParams_.Get("pageToken")) // reset paging to original point 8463 for { 8464 x, err := c.Do() 8465 if err != nil { 8466 return err 8467 } 8468 if err := f(x); err != nil { 8469 return err 8470 } 8471 if x.NextPageToken == "" { 8472 return nil 8473 } 8474 c.PageToken(x.NextPageToken) 8475 } 8476} 8477 8478// method id "authorizedbuyersmarketplace.buyers.proposals.deals.patch": 8479 8480type BuyersProposalsDealsPatchCall struct { 8481 s *Service 8482 nameid string 8483 deal *Deal 8484 urlParams_ gensupport.URLParams 8485 ctx_ context.Context 8486 header_ http.Header 8487} 8488 8489// Patch: Updates the given deal at the buyer known revision number. If 8490// the server revision has advanced since the passed-in 8491// proposal.proposal_revision an ABORTED error message will be returned. 8492// The revision number is incremented by the server whenever the 8493// proposal or its constituent deals are updated. Note: The revision 8494// number is kept at a proposal level. The buyer of the API is expected 8495// to keep track of the revision number after the last update operation 8496// and send it in as part of the next update request. This way, if there 8497// are further changes on the server (e.g., seller making new updates), 8498// then the server can detect conflicts and reject the proposed changes. 8499// 8500// - name: Immutable. The unique identifier of the deal. Auto-generated 8501// by the server when a deal is created. Format: 8502// buyers/{accountId}/proposals/{proposalId}/deals/{dealId}. 8503func (r *BuyersProposalsDealsService) Patch(nameid string, deal *Deal) *BuyersProposalsDealsPatchCall { 8504 c := &BuyersProposalsDealsPatchCall{s: r.s, urlParams_: make(gensupport.URLParams)} 8505 c.nameid = nameid 8506 c.deal = deal 8507 return c 8508} 8509 8510// UpdateMask sets the optional parameter "updateMask": List of fields 8511// to be updated. If empty or unspecified, the service will update all 8512// fields populated in the update request excluding the output only 8513// fields and primitive fields with default value. Note that explicit 8514// field mask is required in order to reset a primitive field back to 8515// its default value, e.g. false for boolean fields, 0 for integer 8516// fields. A special field mask consisting of a single path "*" can be 8517// used to indicate full replacement(the equivalent of PUT method), 8518// updatable fields unset or unspecified in the input will be cleared or 8519// set to default value. Output only fields will be ignored regardless 8520// of the value of updateMask. 8521func (c *BuyersProposalsDealsPatchCall) UpdateMask(updateMask string) *BuyersProposalsDealsPatchCall { 8522 c.urlParams_.Set("updateMask", updateMask) 8523 return c 8524} 8525 8526// Fields allows partial responses to be retrieved. See 8527// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse 8528// for more information. 8529func (c *BuyersProposalsDealsPatchCall) Fields(s ...googleapi.Field) *BuyersProposalsDealsPatchCall { 8530 c.urlParams_.Set("fields", googleapi.CombineFields(s)) 8531 return c 8532} 8533 8534// Context sets the context to be used in this call's Do method. Any 8535// pending HTTP request will be aborted if the provided context is 8536// canceled. 8537func (c *BuyersProposalsDealsPatchCall) Context(ctx context.Context) *BuyersProposalsDealsPatchCall { 8538 c.ctx_ = ctx 8539 return c 8540} 8541 8542// Header returns an http.Header that can be modified by the caller to 8543// add HTTP headers to the request. 8544func (c *BuyersProposalsDealsPatchCall) Header() http.Header { 8545 if c.header_ == nil { 8546 c.header_ = make(http.Header) 8547 } 8548 return c.header_ 8549} 8550 8551func (c *BuyersProposalsDealsPatchCall) doRequest(alt string) (*http.Response, error) { 8552 reqHeaders := make(http.Header) 8553 reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/20211027") 8554 for k, v := range c.header_ { 8555 reqHeaders[k] = v 8556 } 8557 reqHeaders.Set("User-Agent", c.s.userAgent()) 8558 var body io.Reader = nil 8559 body, err := googleapi.WithoutDataWrapper.JSONReader(c.deal) 8560 if err != nil { 8561 return nil, err 8562 } 8563 reqHeaders.Set("Content-Type", "application/json") 8564 c.urlParams_.Set("alt", alt) 8565 c.urlParams_.Set("prettyPrint", "false") 8566 urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+name}") 8567 urls += "?" + c.urlParams_.Encode() 8568 req, err := http.NewRequest("PATCH", urls, body) 8569 if err != nil { 8570 return nil, err 8571 } 8572 req.Header = reqHeaders 8573 googleapi.Expand(req.URL, map[string]string{ 8574 "name": c.nameid, 8575 }) 8576 return gensupport.SendRequest(c.ctx_, c.s.client, req) 8577} 8578 8579// Do executes the "authorizedbuyersmarketplace.buyers.proposals.deals.patch" call. 8580// Exactly one of *Deal or error will be non-nil. Any non-2xx status 8581// code is an error. Response headers are in either 8582// *Deal.ServerResponse.Header or (if a response was returned at all) in 8583// error.(*googleapi.Error).Header. Use googleapi.IsNotModified to check 8584// whether the returned error was because http.StatusNotModified was 8585// returned. 8586func (c *BuyersProposalsDealsPatchCall) Do(opts ...googleapi.CallOption) (*Deal, error) { 8587 gensupport.SetOptions(c.urlParams_, opts...) 8588 res, err := c.doRequest("json") 8589 if res != nil && res.StatusCode == http.StatusNotModified { 8590 if res.Body != nil { 8591 res.Body.Close() 8592 } 8593 return nil, &googleapi.Error{ 8594 Code: res.StatusCode, 8595 Header: res.Header, 8596 } 8597 } 8598 if err != nil { 8599 return nil, err 8600 } 8601 defer googleapi.CloseBody(res) 8602 if err := googleapi.CheckResponse(res); err != nil { 8603 return nil, err 8604 } 8605 ret := &Deal{ 8606 ServerResponse: googleapi.ServerResponse{ 8607 Header: res.Header, 8608 HTTPStatusCode: res.StatusCode, 8609 }, 8610 } 8611 target := &ret 8612 if err := gensupport.DecodeResponse(target, res); err != nil { 8613 return nil, err 8614 } 8615 return ret, nil 8616 // { 8617 // "description": "Updates the given deal at the buyer known revision number. If the server revision has advanced since the passed-in proposal.proposal_revision an ABORTED error message will be returned. The revision number is incremented by the server whenever the proposal or its constituent deals are updated. Note: The revision number is kept at a proposal level. The buyer of the API is expected to keep track of the revision number after the last update operation and send it in as part of the next update request. This way, if there are further changes on the server (e.g., seller making new updates), then the server can detect conflicts and reject the proposed changes.", 8618 // "flatPath": "v1/buyers/{buyersId}/proposals/{proposalsId}/deals/{dealsId}", 8619 // "httpMethod": "PATCH", 8620 // "id": "authorizedbuyersmarketplace.buyers.proposals.deals.patch", 8621 // "parameterOrder": [ 8622 // "name" 8623 // ], 8624 // "parameters": { 8625 // "name": { 8626 // "description": "Immutable. The unique identifier of the deal. Auto-generated by the server when a deal is created. Format: buyers/{accountId}/proposals/{proposalId}/deals/{dealId}", 8627 // "location": "path", 8628 // "pattern": "^buyers/[^/]+/proposals/[^/]+/deals/[^/]+$", 8629 // "required": true, 8630 // "type": "string" 8631 // }, 8632 // "updateMask": { 8633 // "description": "List of fields to be updated. If empty or unspecified, the service will update all fields populated in the update request excluding the output only fields and primitive fields with default value. Note that explicit field mask is required in order to reset a primitive field back to its default value, e.g. false for boolean fields, 0 for integer fields. A special field mask consisting of a single path \"*\" can be used to indicate full replacement(the equivalent of PUT method), updatable fields unset or unspecified in the input will be cleared or set to default value. Output only fields will be ignored regardless of the value of updateMask.", 8634 // "format": "google-fieldmask", 8635 // "location": "query", 8636 // "type": "string" 8637 // } 8638 // }, 8639 // "path": "v1/{+name}", 8640 // "request": { 8641 // "$ref": "Deal" 8642 // }, 8643 // "response": { 8644 // "$ref": "Deal" 8645 // }, 8646 // "scopes": [ 8647 // "https://www.googleapis.com/auth/authorized-buyers-marketplace" 8648 // ] 8649 // } 8650 8651} 8652 8653// method id "authorizedbuyersmarketplace.buyers.publisherProfiles.get": 8654 8655type BuyersPublisherProfilesGetCall struct { 8656 s *Service 8657 name string 8658 urlParams_ gensupport.URLParams 8659 ifNoneMatch_ string 8660 ctx_ context.Context 8661 header_ http.Header 8662} 8663 8664// Get: Gets the requested publisher profile by name. 8665// 8666// - name: Name of the publisher profile. Format: 8667// `buyers/{buyerId}/publisherProfiles/{publisherProfileId}`. 8668func (r *BuyersPublisherProfilesService) Get(name string) *BuyersPublisherProfilesGetCall { 8669 c := &BuyersPublisherProfilesGetCall{s: r.s, urlParams_: make(gensupport.URLParams)} 8670 c.name = name 8671 return c 8672} 8673 8674// Fields allows partial responses to be retrieved. See 8675// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse 8676// for more information. 8677func (c *BuyersPublisherProfilesGetCall) Fields(s ...googleapi.Field) *BuyersPublisherProfilesGetCall { 8678 c.urlParams_.Set("fields", googleapi.CombineFields(s)) 8679 return c 8680} 8681 8682// IfNoneMatch sets the optional parameter which makes the operation 8683// fail if the object's ETag matches the given value. This is useful for 8684// getting updates only after the object has changed since the last 8685// request. Use googleapi.IsNotModified to check whether the response 8686// error from Do is the result of In-None-Match. 8687func (c *BuyersPublisherProfilesGetCall) IfNoneMatch(entityTag string) *BuyersPublisherProfilesGetCall { 8688 c.ifNoneMatch_ = entityTag 8689 return c 8690} 8691 8692// Context sets the context to be used in this call's Do method. Any 8693// pending HTTP request will be aborted if the provided context is 8694// canceled. 8695func (c *BuyersPublisherProfilesGetCall) Context(ctx context.Context) *BuyersPublisherProfilesGetCall { 8696 c.ctx_ = ctx 8697 return c 8698} 8699 8700// Header returns an http.Header that can be modified by the caller to 8701// add HTTP headers to the request. 8702func (c *BuyersPublisherProfilesGetCall) Header() http.Header { 8703 if c.header_ == nil { 8704 c.header_ = make(http.Header) 8705 } 8706 return c.header_ 8707} 8708 8709func (c *BuyersPublisherProfilesGetCall) doRequest(alt string) (*http.Response, error) { 8710 reqHeaders := make(http.Header) 8711 reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/20211027") 8712 for k, v := range c.header_ { 8713 reqHeaders[k] = v 8714 } 8715 reqHeaders.Set("User-Agent", c.s.userAgent()) 8716 if c.ifNoneMatch_ != "" { 8717 reqHeaders.Set("If-None-Match", c.ifNoneMatch_) 8718 } 8719 var body io.Reader = nil 8720 c.urlParams_.Set("alt", alt) 8721 c.urlParams_.Set("prettyPrint", "false") 8722 urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+name}") 8723 urls += "?" + c.urlParams_.Encode() 8724 req, err := http.NewRequest("GET", urls, body) 8725 if err != nil { 8726 return nil, err 8727 } 8728 req.Header = reqHeaders 8729 googleapi.Expand(req.URL, map[string]string{ 8730 "name": c.name, 8731 }) 8732 return gensupport.SendRequest(c.ctx_, c.s.client, req) 8733} 8734 8735// Do executes the "authorizedbuyersmarketplace.buyers.publisherProfiles.get" call. 8736// Exactly one of *PublisherProfile or error will be non-nil. Any 8737// non-2xx status code is an error. Response headers are in either 8738// *PublisherProfile.ServerResponse.Header or (if a response was 8739// returned at all) in error.(*googleapi.Error).Header. Use 8740// googleapi.IsNotModified to check whether the returned error was 8741// because http.StatusNotModified was returned. 8742func (c *BuyersPublisherProfilesGetCall) Do(opts ...googleapi.CallOption) (*PublisherProfile, error) { 8743 gensupport.SetOptions(c.urlParams_, opts...) 8744 res, err := c.doRequest("json") 8745 if res != nil && res.StatusCode == http.StatusNotModified { 8746 if res.Body != nil { 8747 res.Body.Close() 8748 } 8749 return nil, &googleapi.Error{ 8750 Code: res.StatusCode, 8751 Header: res.Header, 8752 } 8753 } 8754 if err != nil { 8755 return nil, err 8756 } 8757 defer googleapi.CloseBody(res) 8758 if err := googleapi.CheckResponse(res); err != nil { 8759 return nil, err 8760 } 8761 ret := &PublisherProfile{ 8762 ServerResponse: googleapi.ServerResponse{ 8763 Header: res.Header, 8764 HTTPStatusCode: res.StatusCode, 8765 }, 8766 } 8767 target := &ret 8768 if err := gensupport.DecodeResponse(target, res); err != nil { 8769 return nil, err 8770 } 8771 return ret, nil 8772 // { 8773 // "description": "Gets the requested publisher profile by name.", 8774 // "flatPath": "v1/buyers/{buyersId}/publisherProfiles/{publisherProfilesId}", 8775 // "httpMethod": "GET", 8776 // "id": "authorizedbuyersmarketplace.buyers.publisherProfiles.get", 8777 // "parameterOrder": [ 8778 // "name" 8779 // ], 8780 // "parameters": { 8781 // "name": { 8782 // "description": "Required. Name of the publisher profile. Format: `buyers/{buyerId}/publisherProfiles/{publisherProfileId}`", 8783 // "location": "path", 8784 // "pattern": "^buyers/[^/]+/publisherProfiles/[^/]+$", 8785 // "required": true, 8786 // "type": "string" 8787 // } 8788 // }, 8789 // "path": "v1/{+name}", 8790 // "response": { 8791 // "$ref": "PublisherProfile" 8792 // }, 8793 // "scopes": [ 8794 // "https://www.googleapis.com/auth/authorized-buyers-marketplace" 8795 // ] 8796 // } 8797 8798} 8799 8800// method id "authorizedbuyersmarketplace.buyers.publisherProfiles.list": 8801 8802type BuyersPublisherProfilesListCall struct { 8803 s *Service 8804 parent string 8805 urlParams_ gensupport.URLParams 8806 ifNoneMatch_ string 8807 ctx_ context.Context 8808 header_ http.Header 8809} 8810 8811// List: Lists publisher profiles 8812// 8813// - parent: Parent that owns the collection of publisher profiles 8814// Format: `buyers/{buyerId}`. 8815func (r *BuyersPublisherProfilesService) List(parent string) *BuyersPublisherProfilesListCall { 8816 c := &BuyersPublisherProfilesListCall{s: r.s, urlParams_: make(gensupport.URLParams)} 8817 c.parent = parent 8818 return c 8819} 8820 8821// Filter sets the optional parameter "filter": Optional query string 8822// using the [Cloud API list filtering] 8823// (https://developers.google.com/authorized-buyers/apis/guides/v2/list-filters) 8824// syntax. 8825func (c *BuyersPublisherProfilesListCall) Filter(filter string) *BuyersPublisherProfilesListCall { 8826 c.urlParams_.Set("filter", filter) 8827 return c 8828} 8829 8830// PageSize sets the optional parameter "pageSize": Requested page size. 8831// The server may return fewer results than requested. If requested more 8832// than 500, the server will return 500 results per page. If 8833// unspecified, the server will pick a default page size of 100. 8834func (c *BuyersPublisherProfilesListCall) PageSize(pageSize int64) *BuyersPublisherProfilesListCall { 8835 c.urlParams_.Set("pageSize", fmt.Sprint(pageSize)) 8836 return c 8837} 8838 8839// PageToken sets the optional parameter "pageToken": The page token as 8840// returned from a previous ListPublisherProfilesResponse. 8841func (c *BuyersPublisherProfilesListCall) PageToken(pageToken string) *BuyersPublisherProfilesListCall { 8842 c.urlParams_.Set("pageToken", pageToken) 8843 return c 8844} 8845 8846// Fields allows partial responses to be retrieved. See 8847// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse 8848// for more information. 8849func (c *BuyersPublisherProfilesListCall) Fields(s ...googleapi.Field) *BuyersPublisherProfilesListCall { 8850 c.urlParams_.Set("fields", googleapi.CombineFields(s)) 8851 return c 8852} 8853 8854// IfNoneMatch sets the optional parameter which makes the operation 8855// fail if the object's ETag matches the given value. This is useful for 8856// getting updates only after the object has changed since the last 8857// request. Use googleapi.IsNotModified to check whether the response 8858// error from Do is the result of In-None-Match. 8859func (c *BuyersPublisherProfilesListCall) IfNoneMatch(entityTag string) *BuyersPublisherProfilesListCall { 8860 c.ifNoneMatch_ = entityTag 8861 return c 8862} 8863 8864// Context sets the context to be used in this call's Do method. Any 8865// pending HTTP request will be aborted if the provided context is 8866// canceled. 8867func (c *BuyersPublisherProfilesListCall) Context(ctx context.Context) *BuyersPublisherProfilesListCall { 8868 c.ctx_ = ctx 8869 return c 8870} 8871 8872// Header returns an http.Header that can be modified by the caller to 8873// add HTTP headers to the request. 8874func (c *BuyersPublisherProfilesListCall) Header() http.Header { 8875 if c.header_ == nil { 8876 c.header_ = make(http.Header) 8877 } 8878 return c.header_ 8879} 8880 8881func (c *BuyersPublisherProfilesListCall) doRequest(alt string) (*http.Response, error) { 8882 reqHeaders := make(http.Header) 8883 reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/20211027") 8884 for k, v := range c.header_ { 8885 reqHeaders[k] = v 8886 } 8887 reqHeaders.Set("User-Agent", c.s.userAgent()) 8888 if c.ifNoneMatch_ != "" { 8889 reqHeaders.Set("If-None-Match", c.ifNoneMatch_) 8890 } 8891 var body io.Reader = nil 8892 c.urlParams_.Set("alt", alt) 8893 c.urlParams_.Set("prettyPrint", "false") 8894 urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+parent}/publisherProfiles") 8895 urls += "?" + c.urlParams_.Encode() 8896 req, err := http.NewRequest("GET", urls, body) 8897 if err != nil { 8898 return nil, err 8899 } 8900 req.Header = reqHeaders 8901 googleapi.Expand(req.URL, map[string]string{ 8902 "parent": c.parent, 8903 }) 8904 return gensupport.SendRequest(c.ctx_, c.s.client, req) 8905} 8906 8907// Do executes the "authorizedbuyersmarketplace.buyers.publisherProfiles.list" call. 8908// Exactly one of *ListPublisherProfilesResponse or error will be 8909// non-nil. Any non-2xx status code is an error. Response headers are in 8910// either *ListPublisherProfilesResponse.ServerResponse.Header or (if a 8911// response was returned at all) in error.(*googleapi.Error).Header. Use 8912// googleapi.IsNotModified to check whether the returned error was 8913// because http.StatusNotModified was returned. 8914func (c *BuyersPublisherProfilesListCall) Do(opts ...googleapi.CallOption) (*ListPublisherProfilesResponse, error) { 8915 gensupport.SetOptions(c.urlParams_, opts...) 8916 res, err := c.doRequest("json") 8917 if res != nil && res.StatusCode == http.StatusNotModified { 8918 if res.Body != nil { 8919 res.Body.Close() 8920 } 8921 return nil, &googleapi.Error{ 8922 Code: res.StatusCode, 8923 Header: res.Header, 8924 } 8925 } 8926 if err != nil { 8927 return nil, err 8928 } 8929 defer googleapi.CloseBody(res) 8930 if err := googleapi.CheckResponse(res); err != nil { 8931 return nil, err 8932 } 8933 ret := &ListPublisherProfilesResponse{ 8934 ServerResponse: googleapi.ServerResponse{ 8935 Header: res.Header, 8936 HTTPStatusCode: res.StatusCode, 8937 }, 8938 } 8939 target := &ret 8940 if err := gensupport.DecodeResponse(target, res); err != nil { 8941 return nil, err 8942 } 8943 return ret, nil 8944 // { 8945 // "description": "Lists publisher profiles", 8946 // "flatPath": "v1/buyers/{buyersId}/publisherProfiles", 8947 // "httpMethod": "GET", 8948 // "id": "authorizedbuyersmarketplace.buyers.publisherProfiles.list", 8949 // "parameterOrder": [ 8950 // "parent" 8951 // ], 8952 // "parameters": { 8953 // "filter": { 8954 // "description": "Optional query string using the [Cloud API list filtering] (https://developers.google.com/authorized-buyers/apis/guides/v2/list-filters) syntax.", 8955 // "location": "query", 8956 // "type": "string" 8957 // }, 8958 // "pageSize": { 8959 // "description": "Requested page size. The server may return fewer results than requested. If requested more than 500, the server will return 500 results per page. If unspecified, the server will pick a default page size of 100.", 8960 // "format": "int32", 8961 // "location": "query", 8962 // "type": "integer" 8963 // }, 8964 // "pageToken": { 8965 // "description": "The page token as returned from a previous ListPublisherProfilesResponse.", 8966 // "location": "query", 8967 // "type": "string" 8968 // }, 8969 // "parent": { 8970 // "description": "Required. Parent that owns the collection of publisher profiles Format: `buyers/{buyerId}`", 8971 // "location": "path", 8972 // "pattern": "^buyers/[^/]+$", 8973 // "required": true, 8974 // "type": "string" 8975 // } 8976 // }, 8977 // "path": "v1/{+parent}/publisherProfiles", 8978 // "response": { 8979 // "$ref": "ListPublisherProfilesResponse" 8980 // }, 8981 // "scopes": [ 8982 // "https://www.googleapis.com/auth/authorized-buyers-marketplace" 8983 // ] 8984 // } 8985 8986} 8987 8988// Pages invokes f for each page of results. 8989// A non-nil error returned from f will halt the iteration. 8990// The provided context supersedes any context provided to the Context method. 8991func (c *BuyersPublisherProfilesListCall) Pages(ctx context.Context, f func(*ListPublisherProfilesResponse) error) error { 8992 c.ctx_ = ctx 8993 defer c.PageToken(c.urlParams_.Get("pageToken")) // reset paging to original point 8994 for { 8995 x, err := c.Do() 8996 if err != nil { 8997 return err 8998 } 8999 if err := f(x); err != nil { 9000 return err 9001 } 9002 if x.NextPageToken == "" { 9003 return nil 9004 } 9005 c.PageToken(x.NextPageToken) 9006 } 9007} 9008