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