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