1
// Package adexchangebuyer provides access to the Ad Exchange Buyer API.
3
// See https://developers.google.com/ad-exchange/buyer-rest
7
// import "google.golang.org/api/adexchangebuyer/v1.3"
9
// adexchangebuyerService, err := adexchangebuyer.New(oauthHttpClient)
10
package adexchangebuyer
17
"google.golang.org/api/googleapi"
25
// Always reference these packages, just in case the auto-generated code
27
var _ = bytes.NewBuffer
30
var _ = json.NewDecoder
33
var _ = googleapi.Version
35
var _ = strings.Replace
37
const apiId = "adexchangebuyer:v1.3"
38
const apiName = "adexchangebuyer"
39
const apiVersion = "v1.3"
40
const basePath = "https://www.googleapis.com/adexchangebuyer/v1.3/"
42
// OAuth2 scopes used by this API.
44
// Manage your Ad Exchange buyer account configuration
45
AdexchangeBuyerScope = "https://www.googleapis.com/auth/adexchange.buyer"
48
func New(client *http.Client) (*Service, error) {
50
return nil, errors.New("client is nil")
52
s := &Service{client: client, BasePath: basePath}
53
s.Accounts = NewAccountsService(s)
54
s.BillingInfo = NewBillingInfoService(s)
55
s.Creatives = NewCreativesService(s)
56
s.DirectDeals = NewDirectDealsService(s)
57
s.PerformanceReport = NewPerformanceReportService(s)
58
s.PretargetingConfig = NewPretargetingConfigService(s)
64
BasePath string // API endpoint base URL
66
Accounts *AccountsService
68
BillingInfo *BillingInfoService
70
Creatives *CreativesService
72
DirectDeals *DirectDealsService
74
PerformanceReport *PerformanceReportService
76
PretargetingConfig *PretargetingConfigService
79
func NewAccountsService(s *Service) *AccountsService {
80
rs := &AccountsService{s: s}
84
type AccountsService struct {
88
func NewBillingInfoService(s *Service) *BillingInfoService {
89
rs := &BillingInfoService{s: s}
93
type BillingInfoService struct {
97
func NewCreativesService(s *Service) *CreativesService {
98
rs := &CreativesService{s: s}
102
type CreativesService struct {
106
func NewDirectDealsService(s *Service) *DirectDealsService {
107
rs := &DirectDealsService{s: s}
111
type DirectDealsService struct {
115
func NewPerformanceReportService(s *Service) *PerformanceReportService {
116
rs := &PerformanceReportService{s: s}
120
type PerformanceReportService struct {
124
func NewPretargetingConfigService(s *Service) *PretargetingConfigService {
125
rs := &PretargetingConfigService{s: s}
129
type PretargetingConfigService struct {
133
type Account struct {
134
// BidderLocation: Your bidder locations that have distinct URLs.
135
BidderLocation []*AccountBidderLocation `json:"bidderLocation,omitempty"`
137
// CookieMatchingNid: The nid parameter value used in cookie match
138
// requests. Please contact your technical account manager if you need
140
CookieMatchingNid string `json:"cookieMatchingNid,omitempty"`
142
// CookieMatchingUrl: The base URL used in cookie match requests.
143
CookieMatchingUrl string `json:"cookieMatchingUrl,omitempty"`
146
Id int64 `json:"id,omitempty"`
148
// Kind: Resource type.
149
Kind string `json:"kind,omitempty"`
151
// MaximumActiveCreatives: The maximum number of active creatives that
152
// an account can have, where a creative is active if it was inserted or
153
// bid with in the last 30 days. Please contact your technical account
154
// manager if you need to change this.
155
MaximumActiveCreatives int64 `json:"maximumActiveCreatives,omitempty"`
157
// MaximumTotalQps: The sum of all bidderLocation.maximumQps values
158
// cannot exceed this. Please contact your technical account manager if
159
// you need to change this.
160
MaximumTotalQps int64 `json:"maximumTotalQps,omitempty"`
162
// NumberActiveCreatives: The number of creatives that this account
163
// inserted or bid with in the last 30 days.
164
NumberActiveCreatives int64 `json:"numberActiveCreatives,omitempty"`
167
type AccountBidderLocation struct {
168
// MaximumQps: The maximum queries per second the Ad Exchange will send.
169
MaximumQps int64 `json:"maximumQps,omitempty"`
171
// Region: The geographical region the Ad Exchange should send requests
172
// from. Only used by some quota systems, but always setting the value
173
// is recommended. Allowed values:
179
Region string `json:"region,omitempty"`
181
// Url: The URL to which the Ad Exchange will send bid requests.
182
Url string `json:"url,omitempty"`
185
type AccountsList struct {
186
// Items: A list of accounts.
187
Items []*Account `json:"items,omitempty"`
189
// Kind: Resource type.
190
Kind string `json:"kind,omitempty"`
193
type BillingInfo struct {
194
// AccountId: Account id.
195
AccountId int64 `json:"accountId,omitempty"`
197
// AccountName: Account name.
198
AccountName string `json:"accountName,omitempty"`
200
// BillingId: A list of adgroup IDs associated with this particular
201
// account. These IDs may show up as part of a realtime bidding
202
// BidRequest, which indicates a bid request for this account.
203
BillingId []string `json:"billingId,omitempty"`
205
// Kind: Resource type.
206
Kind string `json:"kind,omitempty"`
209
type BillingInfoList struct {
210
// Items: A list of billing info relevant for your account.
211
Items []*BillingInfo `json:"items,omitempty"`
213
// Kind: Resource type.
214
Kind string `json:"kind,omitempty"`
217
type Creative struct {
218
// HTMLSnippet: The HTML snippet that displays the ad when inserted in
219
// the web page. If set, videoURL should not be set.
220
HTMLSnippet string `json:"HTMLSnippet,omitempty"`
222
// AccountId: Account id.
223
AccountId int64 `json:"accountId,omitempty"`
225
// AdvertiserId: Detected advertiser id, if any. Read-only. This field
226
// should not be set in requests.
227
AdvertiserId googleapi.Int64s `json:"advertiserId,omitempty"`
229
// AdvertiserName: The name of the company being advertised in the
231
AdvertiserName string `json:"advertiserName,omitempty"`
233
// AgencyId: The agency id for this creative.
234
AgencyId int64 `json:"agencyId,omitempty,string"`
236
// Attribute: All attributes for the ads that may be shown from this
238
Attribute []int64 `json:"attribute,omitempty"`
240
// BuyerCreativeId: A buyer-specific id identifying the creative in this
242
BuyerCreativeId string `json:"buyerCreativeId,omitempty"`
244
// ClickThroughUrl: The set of destination urls for the snippet.
245
ClickThroughUrl []string `json:"clickThroughUrl,omitempty"`
247
// Corrections: Shows any corrections that were applied to this
248
// creative. Read-only. This field should not be set in requests.
249
Corrections []*CreativeCorrections `json:"corrections,omitempty"`
251
// DisapprovalReasons: The reasons for disapproval, if any. Note that
252
// not all disapproval reasons may be categorized, so it is possible for
253
// the creative to have a status of DISAPPROVED with an empty list for
254
// disapproval_reasons. In this case, please reach out to your TAM to
255
// help debug the issue. Read-only. This field should not be set in
257
DisapprovalReasons []*CreativeDisapprovalReasons `json:"disapprovalReasons,omitempty"`
259
// FilteringReasons: The filtering reasons for the creative. If this
260
// feature is not enabled, please ask your technical account manager.
261
// Read-only. This field should not be set in requests.
262
FilteringReasons *CreativeFilteringReasons `json:"filteringReasons,omitempty"`
264
// Height: Ad height.
265
Height int64 `json:"height,omitempty"`
267
// Kind: Resource type.
268
Kind string `json:"kind,omitempty"`
270
// ProductCategories: Detected product categories, if any. Read-only.
271
// This field should not be set in requests.
272
ProductCategories []int64 `json:"productCategories,omitempty"`
274
// RestrictedCategories: All restricted categories for the ads that may
275
// be shown from this snippet.
276
RestrictedCategories []int64 `json:"restrictedCategories,omitempty"`
278
// SensitiveCategories: Detected sensitive categories, if any.
279
// Read-only. This field should not be set in requests.
280
SensitiveCategories []int64 `json:"sensitiveCategories,omitempty"`
282
// Status: Creative serving status. Read-only. This field should not be
284
Status string `json:"status,omitempty"`
286
// VendorType: All vendor types for the ads that may be shown from this
288
VendorType []int64 `json:"vendorType,omitempty"`
290
// VideoURL: The url to fetch a video ad. If set, HTMLSnippet should not
292
VideoURL string `json:"videoURL,omitempty"`
295
Width int64 `json:"width,omitempty"`
298
type CreativeCorrections struct {
299
// Details: Additional details about the correction.
300
Details []string `json:"details,omitempty"`
302
// Reason: The type of correction that was applied to the creative.
303
Reason string `json:"reason,omitempty"`
306
type CreativeDisapprovalReasons struct {
307
// Details: Additional details about the reason for disapproval.
308
Details []string `json:"details,omitempty"`
310
// Reason: The categorized reason for disapproval.
311
Reason string `json:"reason,omitempty"`
314
type CreativeFilteringReasons struct {
315
// Date: The date in ISO 8601 format for the data. The data is collected
316
// from 00:00:00 to 23:59:59 in PST.
317
Date string `json:"date,omitempty"`
319
// Reasons: The filtering reasons.
320
Reasons []*CreativeFilteringReasonsReasons `json:"reasons,omitempty"`
323
type CreativeFilteringReasonsReasons struct {
324
// FilteringCount: The number of times the creative was filtered for the
325
// status. The count is aggregated across all publishers on the
327
FilteringCount int64 `json:"filteringCount,omitempty,string"`
329
// FilteringStatus: The filtering status code. Please refer to the
330
// creative-status-codes.txt file for different statuses.
331
FilteringStatus int64 `json:"filteringStatus,omitempty"`
334
type CreativesList struct {
335
// Items: A list of creatives.
336
Items []*Creative `json:"items,omitempty"`
338
// Kind: Resource type.
339
Kind string `json:"kind,omitempty"`
341
// NextPageToken: Continuation token used to page through creatives. To
342
// retrieve the next page of results, set the next request's "pageToken"
344
NextPageToken string `json:"nextPageToken,omitempty"`
347
type DirectDeal struct {
348
// AccountId: The account id of the buyer this deal is for.
349
AccountId int64 `json:"accountId,omitempty"`
351
// Advertiser: The name of the advertiser this deal is for.
352
Advertiser string `json:"advertiser,omitempty"`
354
// CurrencyCode: The currency code that applies to the fixed_cpm value.
355
// If not set then assumed to be USD.
356
CurrencyCode string `json:"currencyCode,omitempty"`
358
// EndTime: End time for when this deal stops being active. If not set
359
// then this deal is valid until manually disabled by the publisher. In
360
// seconds since the epoch.
361
EndTime int64 `json:"endTime,omitempty,string"`
363
// FixedCpm: The fixed price for this direct deal. In cpm micros of
364
// currency according to currency_code. If set, then this deal is
365
// eligible for the fixed price tier of buying (highest priority, pay
366
// exactly the configured fixed price).
367
FixedCpm int64 `json:"fixedCpm,omitempty,string"`
370
Id int64 `json:"id,omitempty,string"`
372
// Kind: Resource type.
373
Kind string `json:"kind,omitempty"`
376
Name string `json:"name,omitempty"`
378
// PrivateExchangeMinCpm: The minimum price for this direct deal. In cpm
379
// micros of currency according to currency_code. If set, then this deal
380
// is eligible for the private exchange tier of buying (below fixed
381
// price priority, run as a second price auction).
382
PrivateExchangeMinCpm int64 `json:"privateExchangeMinCpm,omitempty,string"`
384
// PublisherBlocksOverriden: If true, the publisher has opted to have
385
// their blocks ignored when a creative is bid with for this deal.
386
PublisherBlocksOverriden bool `json:"publisherBlocksOverriden,omitempty"`
388
// SellerNetwork: The name of the publisher offering this direct deal.
389
SellerNetwork string `json:"sellerNetwork,omitempty"`
391
// StartTime: Start time for when this deal becomes active. If not set
392
// then this deal is active immediately upon creation. In seconds since
394
StartTime int64 `json:"startTime,omitempty,string"`
397
type DirectDealsList struct {
398
// DirectDeals: A list of direct deals relevant for your account.
399
DirectDeals []*DirectDeal `json:"directDeals,omitempty"`
401
// Kind: Resource type.
402
Kind string `json:"kind,omitempty"`
405
type PerformanceReport struct {
406
// CalloutStatusRate: Rate of various prefiltering statuses per match.
407
// Please refer to the callout-status-codes.txt file for different
409
CalloutStatusRate []interface{} `json:"calloutStatusRate,omitempty"`
411
// CookieMatcherStatusRate: Average QPS for cookie matcher operations.
412
CookieMatcherStatusRate []interface{} `json:"cookieMatcherStatusRate,omitempty"`
414
// CreativeStatusRate: Rate of ads with a given status. Please refer to
415
// the creative-status-codes.txt file for different statuses.
416
CreativeStatusRate []interface{} `json:"creativeStatusRate,omitempty"`
418
// HostedMatchStatusRate: Average QPS for hosted match operations.
419
HostedMatchStatusRate []interface{} `json:"hostedMatchStatusRate,omitempty"`
421
// Kind: Resource type.
422
Kind string `json:"kind,omitempty"`
424
// Latency50thPercentile: The 50th percentile round trip latency(ms) as
425
// perceived from Google servers for the duration period covered by the
427
Latency50thPercentile float64 `json:"latency50thPercentile,omitempty"`
429
// Latency85thPercentile: The 85th percentile round trip latency(ms) as
430
// perceived from Google servers for the duration period covered by the
432
Latency85thPercentile float64 `json:"latency85thPercentile,omitempty"`
434
// Latency95thPercentile: The 95th percentile round trip latency(ms) as
435
// perceived from Google servers for the duration period covered by the
437
Latency95thPercentile float64 `json:"latency95thPercentile,omitempty"`
439
// NoQuotaInRegion: Rate of various quota account statuses per quota
441
NoQuotaInRegion float64 `json:"noQuotaInRegion,omitempty"`
443
// OutOfQuota: Rate of various quota account statuses per quota check.
444
OutOfQuota float64 `json:"outOfQuota,omitempty"`
446
// PixelMatchRequests: Average QPS for pixel match requests from
448
PixelMatchRequests float64 `json:"pixelMatchRequests,omitempty"`
450
// PixelMatchResponses: Average QPS for pixel match responses from
452
PixelMatchResponses float64 `json:"pixelMatchResponses,omitempty"`
454
// QuotaConfiguredLimit: The configured quota limits for this account.
455
QuotaConfiguredLimit float64 `json:"quotaConfiguredLimit,omitempty"`
457
// QuotaThrottledLimit: The throttled quota limits for this account.
458
QuotaThrottledLimit float64 `json:"quotaThrottledLimit,omitempty"`
460
// Region: The trading location of this data.
461
Region string `json:"region,omitempty"`
463
// Timestamp: The unix timestamp of the starting time of this
465
Timestamp int64 `json:"timestamp,omitempty,string"`
468
type PerformanceReportList struct {
469
// Kind: Resource type.
470
Kind string `json:"kind,omitempty"`
472
// PerformanceReport: A list of performance reports relevant for the
474
PerformanceReport []*PerformanceReport `json:"performanceReport,omitempty"`
477
type PretargetingConfig struct {
478
// BillingId: The id for billing purposes, provided for reference. Leave
479
// this field blank for insert requests; the id will be generated
481
BillingId int64 `json:"billingId,omitempty,string"`
483
// ConfigId: The config id; generated automatically. Leave this field
484
// blank for insert requests.
485
ConfigId int64 `json:"configId,omitempty,string"`
487
// ConfigName: The name of the config. Must be unique. Required for all
489
ConfigName string `json:"configName,omitempty"`
491
// CreativeType: List must contain exactly one of
492
// PRETARGETING_CREATIVE_TYPE_HTML or PRETARGETING_CREATIVE_TYPE_VIDEO.
493
CreativeType []string `json:"creativeType,omitempty"`
495
// Dimensions: Requests which allow one of these (width, height) pairs
496
// will match. All pairs must be supported ad dimensions.
497
Dimensions []*PretargetingConfigDimensions `json:"dimensions,omitempty"`
499
// ExcludedContentLabels: Requests with any of these content labels will
500
// not match. Values are from content-labels.txt in the downloadable
502
ExcludedContentLabels googleapi.Int64s `json:"excludedContentLabels,omitempty"`
504
// ExcludedGeoCriteriaIds: Requests containing any of these geo criteria
505
// ids will not match.
506
ExcludedGeoCriteriaIds googleapi.Int64s `json:"excludedGeoCriteriaIds,omitempty"`
508
// ExcludedPlacements: Requests containing any of these placements will
510
ExcludedPlacements []*PretargetingConfigExcludedPlacements `json:"excludedPlacements,omitempty"`
512
// ExcludedUserLists: Requests containing any of these users list ids
514
ExcludedUserLists googleapi.Int64s `json:"excludedUserLists,omitempty"`
516
// ExcludedVerticals: Requests containing any of these vertical ids will
517
// not match. Values are from the publisher-verticals.txt file in the
518
// downloadable files section.
519
ExcludedVerticals googleapi.Int64s `json:"excludedVerticals,omitempty"`
521
// GeoCriteriaIds: Requests containing any of these geo criteria ids
523
GeoCriteriaIds googleapi.Int64s `json:"geoCriteriaIds,omitempty"`
525
// IsActive: Whether this config is active. Required for all requests.
526
IsActive bool `json:"isActive,omitempty"`
528
// Kind: The kind of the resource, i.e.
529
// "adexchangebuyer#pretargetingConfig".
530
Kind string `json:"kind,omitempty"`
532
// Languages: Request containing any of these language codes will match.
533
Languages []string `json:"languages,omitempty"`
535
// MobileCarriers: Requests containing any of these mobile carrier ids
536
// will match. Values are from mobile-carriers.csv in the downloadable
538
MobileCarriers googleapi.Int64s `json:"mobileCarriers,omitempty"`
540
// MobileDevices: Requests containing any of these mobile device ids
541
// will match. Values are from mobile-devices.csv in the downloadable
543
MobileDevices googleapi.Int64s `json:"mobileDevices,omitempty"`
545
// MobileOperatingSystemVersions: Requests containing any of these
546
// mobile operating system version ids will match. Values are from
547
// mobile-os.csv in the downloadable files section.
548
MobileOperatingSystemVersions googleapi.Int64s `json:"mobileOperatingSystemVersions,omitempty"`
550
// Placements: Requests containing any of these placements will match.
551
Placements []*PretargetingConfigPlacements `json:"placements,omitempty"`
553
// Platforms: Requests matching any of these platforms will match.
554
// Possible values are PRETARGETING_PLATFORM_MOBILE,
555
// PRETARGETING_PLATFORM_DESKTOP, and PRETARGETING_PLATFORM_TABLET.
556
Platforms []string `json:"platforms,omitempty"`
558
// SupportedCreativeAttributes: Creative attributes should be declared
559
// here if all creatives corresponding to this pretargeting
560
// configuration have that creative attribute. Values are from
561
// pretargetable-creative-attributes.txt in the downloadable files
563
SupportedCreativeAttributes googleapi.Int64s `json:"supportedCreativeAttributes,omitempty"`
565
// UserLists: Requests containing any of these user list ids will match.
566
UserLists googleapi.Int64s `json:"userLists,omitempty"`
568
// VendorTypes: Requests that allow any of these vendor ids will match.
569
// Values are from vendors.txt in the downloadable files section.
570
VendorTypes googleapi.Int64s `json:"vendorTypes,omitempty"`
572
// Verticals: Requests containing any of these vertical ids will match.
573
Verticals googleapi.Int64s `json:"verticals,omitempty"`
576
type PretargetingConfigDimensions struct {
577
// Height: Height in pixels.
578
Height int64 `json:"height,omitempty,string"`
580
// Width: Width in pixels.
581
Width int64 `json:"width,omitempty,string"`
584
type PretargetingConfigExcludedPlacements struct {
585
// Token: The value of the placement. Interpretation depends on the
586
// placement type, e.g. URL for a site placement, channel name for a
587
// channel placement, app id for a mobile app placement.
588
Token string `json:"token,omitempty"`
590
// Type: The type of the placement.
591
Type string `json:"type,omitempty"`
594
type PretargetingConfigPlacements struct {
595
// Token: The value of the placement. Interpretation depends on the
596
// placement type, e.g. URL for a site placement, channel name for a
597
// channel placement, app id for a mobile app placement.
598
Token string `json:"token,omitempty"`
600
// Type: The type of the placement.
601
Type string `json:"type,omitempty"`
604
type PretargetingConfigList struct {
605
// Items: A list of pretargeting configs
606
Items []*PretargetingConfig `json:"items,omitempty"`
608
// Kind: Resource type.
609
Kind string `json:"kind,omitempty"`
612
// method id "adexchangebuyer.accounts.get":
614
type AccountsGetCall struct {
617
opt_ map[string]interface{}
620
// Get: Gets one account by ID.
621
func (r *AccountsService) Get(id int64) *AccountsGetCall {
622
c := &AccountsGetCall{s: r.s, opt_: make(map[string]interface{})}
627
// Fields allows partial responses to be retrieved.
628
// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
629
// for more information.
630
func (c *AccountsGetCall) Fields(s ...googleapi.Field) *AccountsGetCall {
631
c.opt_["fields"] = googleapi.CombineFields(s)
635
func (c *AccountsGetCall) Do() (*Account, error) {
636
var body io.Reader = nil
637
params := make(url.Values)
638
params.Set("alt", "json")
639
if v, ok := c.opt_["fields"]; ok {
640
params.Set("fields", fmt.Sprintf("%v", v))
642
urls := googleapi.ResolveRelative(c.s.BasePath, "accounts/{id}")
643
urls += "?" + params.Encode()
644
req, _ := http.NewRequest("GET", urls, body)
645
googleapi.Expand(req.URL, map[string]string{
646
"id": strconv.FormatInt(c.id, 10),
648
req.Header.Set("User-Agent", "google-api-go-client/0.5")
649
res, err := c.s.client.Do(req)
653
defer googleapi.CloseBody(res)
654
if err := googleapi.CheckResponse(res); err != nil {
658
if err := json.NewDecoder(res.Body).Decode(&ret); err != nil {
663
// "description": "Gets one account by ID.",
664
// "httpMethod": "GET",
665
// "id": "adexchangebuyer.accounts.get",
666
// "parameterOrder": [
671
// "description": "The account id",
672
// "format": "int32",
673
// "location": "path",
678
// "path": "accounts/{id}",
683
// "https://www.googleapis.com/auth/adexchange.buyer"
689
// method id "adexchangebuyer.accounts.list":
691
type AccountsListCall struct {
693
opt_ map[string]interface{}
696
// List: Retrieves the authenticated user's list of accounts.
697
func (r *AccountsService) List() *AccountsListCall {
698
c := &AccountsListCall{s: r.s, opt_: make(map[string]interface{})}
702
// Fields allows partial responses to be retrieved.
703
// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
704
// for more information.
705
func (c *AccountsListCall) Fields(s ...googleapi.Field) *AccountsListCall {
706
c.opt_["fields"] = googleapi.CombineFields(s)
710
func (c *AccountsListCall) Do() (*AccountsList, error) {
711
var body io.Reader = nil
712
params := make(url.Values)
713
params.Set("alt", "json")
714
if v, ok := c.opt_["fields"]; ok {
715
params.Set("fields", fmt.Sprintf("%v", v))
717
urls := googleapi.ResolveRelative(c.s.BasePath, "accounts")
718
urls += "?" + params.Encode()
719
req, _ := http.NewRequest("GET", urls, body)
720
googleapi.SetOpaque(req.URL)
721
req.Header.Set("User-Agent", "google-api-go-client/0.5")
722
res, err := c.s.client.Do(req)
726
defer googleapi.CloseBody(res)
727
if err := googleapi.CheckResponse(res); err != nil {
730
var ret *AccountsList
731
if err := json.NewDecoder(res.Body).Decode(&ret); err != nil {
736
// "description": "Retrieves the authenticated user's list of accounts.",
737
// "httpMethod": "GET",
738
// "id": "adexchangebuyer.accounts.list",
739
// "path": "accounts",
741
// "$ref": "AccountsList"
744
// "https://www.googleapis.com/auth/adexchange.buyer"
750
// method id "adexchangebuyer.accounts.patch":
752
type AccountsPatchCall struct {
756
opt_ map[string]interface{}
759
// Patch: Updates an existing account. This method supports patch
761
func (r *AccountsService) Patch(id int64, account *Account) *AccountsPatchCall {
762
c := &AccountsPatchCall{s: r.s, opt_: make(map[string]interface{})}
768
// Fields allows partial responses to be retrieved.
769
// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
770
// for more information.
771
func (c *AccountsPatchCall) Fields(s ...googleapi.Field) *AccountsPatchCall {
772
c.opt_["fields"] = googleapi.CombineFields(s)
776
func (c *AccountsPatchCall) Do() (*Account, error) {
777
var body io.Reader = nil
778
body, err := googleapi.WithoutDataWrapper.JSONReader(c.account)
782
ctype := "application/json"
783
params := make(url.Values)
784
params.Set("alt", "json")
785
if v, ok := c.opt_["fields"]; ok {
786
params.Set("fields", fmt.Sprintf("%v", v))
788
urls := googleapi.ResolveRelative(c.s.BasePath, "accounts/{id}")
789
urls += "?" + params.Encode()
790
req, _ := http.NewRequest("PATCH", urls, body)
791
googleapi.Expand(req.URL, map[string]string{
792
"id": strconv.FormatInt(c.id, 10),
794
req.Header.Set("Content-Type", ctype)
795
req.Header.Set("User-Agent", "google-api-go-client/0.5")
796
res, err := c.s.client.Do(req)
800
defer googleapi.CloseBody(res)
801
if err := googleapi.CheckResponse(res); err != nil {
805
if err := json.NewDecoder(res.Body).Decode(&ret); err != nil {
810
// "description": "Updates an existing account. This method supports patch semantics.",
811
// "httpMethod": "PATCH",
812
// "id": "adexchangebuyer.accounts.patch",
813
// "parameterOrder": [
818
// "description": "The account id",
819
// "format": "int32",
820
// "location": "path",
825
// "path": "accounts/{id}",
833
// "https://www.googleapis.com/auth/adexchange.buyer"
839
// method id "adexchangebuyer.accounts.update":
841
type AccountsUpdateCall struct {
845
opt_ map[string]interface{}
848
// Update: Updates an existing account.
849
func (r *AccountsService) Update(id int64, account *Account) *AccountsUpdateCall {
850
c := &AccountsUpdateCall{s: r.s, opt_: make(map[string]interface{})}
856
// Fields allows partial responses to be retrieved.
857
// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
858
// for more information.
859
func (c *AccountsUpdateCall) Fields(s ...googleapi.Field) *AccountsUpdateCall {
860
c.opt_["fields"] = googleapi.CombineFields(s)
864
func (c *AccountsUpdateCall) Do() (*Account, error) {
865
var body io.Reader = nil
866
body, err := googleapi.WithoutDataWrapper.JSONReader(c.account)
870
ctype := "application/json"
871
params := make(url.Values)
872
params.Set("alt", "json")
873
if v, ok := c.opt_["fields"]; ok {
874
params.Set("fields", fmt.Sprintf("%v", v))
876
urls := googleapi.ResolveRelative(c.s.BasePath, "accounts/{id}")
877
urls += "?" + params.Encode()
878
req, _ := http.NewRequest("PUT", urls, body)
879
googleapi.Expand(req.URL, map[string]string{
880
"id": strconv.FormatInt(c.id, 10),
882
req.Header.Set("Content-Type", ctype)
883
req.Header.Set("User-Agent", "google-api-go-client/0.5")
884
res, err := c.s.client.Do(req)
888
defer googleapi.CloseBody(res)
889
if err := googleapi.CheckResponse(res); err != nil {
893
if err := json.NewDecoder(res.Body).Decode(&ret); err != nil {
898
// "description": "Updates an existing account.",
899
// "httpMethod": "PUT",
900
// "id": "adexchangebuyer.accounts.update",
901
// "parameterOrder": [
906
// "description": "The account id",
907
// "format": "int32",
908
// "location": "path",
913
// "path": "accounts/{id}",
921
// "https://www.googleapis.com/auth/adexchange.buyer"
927
// method id "adexchangebuyer.billingInfo.get":
929
type BillingInfoGetCall struct {
932
opt_ map[string]interface{}
935
// Get: Returns the billing information for one account specified by
937
func (r *BillingInfoService) Get(accountId int64) *BillingInfoGetCall {
938
c := &BillingInfoGetCall{s: r.s, opt_: make(map[string]interface{})}
939
c.accountId = accountId
943
// Fields allows partial responses to be retrieved.
944
// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
945
// for more information.
946
func (c *BillingInfoGetCall) Fields(s ...googleapi.Field) *BillingInfoGetCall {
947
c.opt_["fields"] = googleapi.CombineFields(s)
951
func (c *BillingInfoGetCall) Do() (*BillingInfo, error) {
952
var body io.Reader = nil
953
params := make(url.Values)
954
params.Set("alt", "json")
955
if v, ok := c.opt_["fields"]; ok {
956
params.Set("fields", fmt.Sprintf("%v", v))
958
urls := googleapi.ResolveRelative(c.s.BasePath, "billinginfo/{accountId}")
959
urls += "?" + params.Encode()
960
req, _ := http.NewRequest("GET", urls, body)
961
googleapi.Expand(req.URL, map[string]string{
962
"accountId": strconv.FormatInt(c.accountId, 10),
964
req.Header.Set("User-Agent", "google-api-go-client/0.5")
965
res, err := c.s.client.Do(req)
969
defer googleapi.CloseBody(res)
970
if err := googleapi.CheckResponse(res); err != nil {
974
if err := json.NewDecoder(res.Body).Decode(&ret); err != nil {
979
// "description": "Returns the billing information for one account specified by account ID.",
980
// "httpMethod": "GET",
981
// "id": "adexchangebuyer.billingInfo.get",
982
// "parameterOrder": [
987
// "description": "The account id.",
988
// "format": "int32",
989
// "location": "path",
994
// "path": "billinginfo/{accountId}",
996
// "$ref": "BillingInfo"
999
// "https://www.googleapis.com/auth/adexchange.buyer"
1005
// method id "adexchangebuyer.billingInfo.list":
1007
type BillingInfoListCall struct {
1009
opt_ map[string]interface{}
1012
// List: Retrieves a list of billing information for all accounts of the
1013
// authenticated user.
1014
func (r *BillingInfoService) List() *BillingInfoListCall {
1015
c := &BillingInfoListCall{s: r.s, opt_: make(map[string]interface{})}
1019
// Fields allows partial responses to be retrieved.
1020
// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
1021
// for more information.
1022
func (c *BillingInfoListCall) Fields(s ...googleapi.Field) *BillingInfoListCall {
1023
c.opt_["fields"] = googleapi.CombineFields(s)
1027
func (c *BillingInfoListCall) Do() (*BillingInfoList, error) {
1028
var body io.Reader = nil
1029
params := make(url.Values)
1030
params.Set("alt", "json")
1031
if v, ok := c.opt_["fields"]; ok {
1032
params.Set("fields", fmt.Sprintf("%v", v))
1034
urls := googleapi.ResolveRelative(c.s.BasePath, "billinginfo")
1035
urls += "?" + params.Encode()
1036
req, _ := http.NewRequest("GET", urls, body)
1037
googleapi.SetOpaque(req.URL)
1038
req.Header.Set("User-Agent", "google-api-go-client/0.5")
1039
res, err := c.s.client.Do(req)
1043
defer googleapi.CloseBody(res)
1044
if err := googleapi.CheckResponse(res); err != nil {
1047
var ret *BillingInfoList
1048
if err := json.NewDecoder(res.Body).Decode(&ret); err != nil {
1053
// "description": "Retrieves a list of billing information for all accounts of the authenticated user.",
1054
// "httpMethod": "GET",
1055
// "id": "adexchangebuyer.billingInfo.list",
1056
// "path": "billinginfo",
1058
// "$ref": "BillingInfoList"
1061
// "https://www.googleapis.com/auth/adexchange.buyer"
1067
// method id "adexchangebuyer.creatives.get":
1069
type CreativesGetCall struct {
1072
buyerCreativeId string
1073
opt_ map[string]interface{}
1076
// Get: Gets the status for a single creative. A creative will be
1077
// available 30-40 minutes after submission.
1078
func (r *CreativesService) Get(accountId int64, buyerCreativeId string) *CreativesGetCall {
1079
c := &CreativesGetCall{s: r.s, opt_: make(map[string]interface{})}
1080
c.accountId = accountId
1081
c.buyerCreativeId = buyerCreativeId
1085
// Fields allows partial responses to be retrieved.
1086
// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
1087
// for more information.
1088
func (c *CreativesGetCall) Fields(s ...googleapi.Field) *CreativesGetCall {
1089
c.opt_["fields"] = googleapi.CombineFields(s)
1093
func (c *CreativesGetCall) Do() (*Creative, error) {
1094
var body io.Reader = nil
1095
params := make(url.Values)
1096
params.Set("alt", "json")
1097
if v, ok := c.opt_["fields"]; ok {
1098
params.Set("fields", fmt.Sprintf("%v", v))
1100
urls := googleapi.ResolveRelative(c.s.BasePath, "creatives/{accountId}/{buyerCreativeId}")
1101
urls += "?" + params.Encode()
1102
req, _ := http.NewRequest("GET", urls, body)
1103
googleapi.Expand(req.URL, map[string]string{
1104
"accountId": strconv.FormatInt(c.accountId, 10),
1105
"buyerCreativeId": c.buyerCreativeId,
1107
req.Header.Set("User-Agent", "google-api-go-client/0.5")
1108
res, err := c.s.client.Do(req)
1112
defer googleapi.CloseBody(res)
1113
if err := googleapi.CheckResponse(res); err != nil {
1117
if err := json.NewDecoder(res.Body).Decode(&ret); err != nil {
1122
// "description": "Gets the status for a single creative. A creative will be available 30-40 minutes after submission.",
1123
// "httpMethod": "GET",
1124
// "id": "adexchangebuyer.creatives.get",
1125
// "parameterOrder": [
1127
// "buyerCreativeId"
1131
// "description": "The id for the account that will serve this creative.",
1132
// "format": "int32",
1133
// "location": "path",
1134
// "required": true,
1135
// "type": "integer"
1137
// "buyerCreativeId": {
1138
// "description": "The buyer-specific id for this creative.",
1139
// "location": "path",
1140
// "required": true,
1144
// "path": "creatives/{accountId}/{buyerCreativeId}",
1146
// "$ref": "Creative"
1149
// "https://www.googleapis.com/auth/adexchange.buyer"
1155
// method id "adexchangebuyer.creatives.insert":
1157
type CreativesInsertCall struct {
1160
opt_ map[string]interface{}
1163
// Insert: Submit a new creative.
1164
func (r *CreativesService) Insert(creative *Creative) *CreativesInsertCall {
1165
c := &CreativesInsertCall{s: r.s, opt_: make(map[string]interface{})}
1166
c.creative = creative
1170
// Fields allows partial responses to be retrieved.
1171
// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
1172
// for more information.
1173
func (c *CreativesInsertCall) Fields(s ...googleapi.Field) *CreativesInsertCall {
1174
c.opt_["fields"] = googleapi.CombineFields(s)
1178
func (c *CreativesInsertCall) Do() (*Creative, error) {
1179
var body io.Reader = nil
1180
body, err := googleapi.WithoutDataWrapper.JSONReader(c.creative)
1184
ctype := "application/json"
1185
params := make(url.Values)
1186
params.Set("alt", "json")
1187
if v, ok := c.opt_["fields"]; ok {
1188
params.Set("fields", fmt.Sprintf("%v", v))
1190
urls := googleapi.ResolveRelative(c.s.BasePath, "creatives")
1191
urls += "?" + params.Encode()
1192
req, _ := http.NewRequest("POST", urls, body)
1193
googleapi.SetOpaque(req.URL)
1194
req.Header.Set("Content-Type", ctype)
1195
req.Header.Set("User-Agent", "google-api-go-client/0.5")
1196
res, err := c.s.client.Do(req)
1200
defer googleapi.CloseBody(res)
1201
if err := googleapi.CheckResponse(res); err != nil {
1205
if err := json.NewDecoder(res.Body).Decode(&ret); err != nil {
1210
// "description": "Submit a new creative.",
1211
// "httpMethod": "POST",
1212
// "id": "adexchangebuyer.creatives.insert",
1213
// "path": "creatives",
1215
// "$ref": "Creative"
1218
// "$ref": "Creative"
1221
// "https://www.googleapis.com/auth/adexchange.buyer"
1227
// method id "adexchangebuyer.creatives.list":
1229
type CreativesListCall struct {
1231
opt_ map[string]interface{}
1234
// List: Retrieves a list of the authenticated user's active creatives.
1235
// A creative will be available 30-40 minutes after submission.
1236
func (r *CreativesService) List() *CreativesListCall {
1237
c := &CreativesListCall{s: r.s, opt_: make(map[string]interface{})}
1241
// AccountId sets the optional parameter "accountId": When specified,
1242
// only creatives for the given account ids are returned.
1243
func (c *CreativesListCall) AccountId(accountId int64) *CreativesListCall {
1244
c.opt_["accountId"] = accountId
1248
// BuyerCreativeId sets the optional parameter "buyerCreativeId": When
1249
// specified, only creatives for the given buyer creative ids are
1251
func (c *CreativesListCall) BuyerCreativeId(buyerCreativeId string) *CreativesListCall {
1252
c.opt_["buyerCreativeId"] = buyerCreativeId
1256
// MaxResults sets the optional parameter "maxResults": Maximum number
1257
// of entries returned on one result page. If not set, the default is
1259
func (c *CreativesListCall) MaxResults(maxResults int64) *CreativesListCall {
1260
c.opt_["maxResults"] = maxResults
1264
// PageToken sets the optional parameter "pageToken": A continuation
1265
// token, used to page through ad clients. To retrieve the next page,
1266
// set this parameter to the value of "nextPageToken" from the previous
1268
func (c *CreativesListCall) PageToken(pageToken string) *CreativesListCall {
1269
c.opt_["pageToken"] = pageToken
1273
// StatusFilter sets the optional parameter "statusFilter": When
1274
// specified, only creatives having the given status are returned.
1275
func (c *CreativesListCall) StatusFilter(statusFilter string) *CreativesListCall {
1276
c.opt_["statusFilter"] = statusFilter
1280
// Fields allows partial responses to be retrieved.
1281
// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
1282
// for more information.
1283
func (c *CreativesListCall) Fields(s ...googleapi.Field) *CreativesListCall {
1284
c.opt_["fields"] = googleapi.CombineFields(s)
1288
func (c *CreativesListCall) Do() (*CreativesList, error) {
1289
var body io.Reader = nil
1290
params := make(url.Values)
1291
params.Set("alt", "json")
1292
if v, ok := c.opt_["accountId"]; ok {
1293
params.Set("accountId", fmt.Sprintf("%v", v))
1295
if v, ok := c.opt_["buyerCreativeId"]; ok {
1296
params.Set("buyerCreativeId", fmt.Sprintf("%v", v))
1298
if v, ok := c.opt_["maxResults"]; ok {
1299
params.Set("maxResults", fmt.Sprintf("%v", v))
1301
if v, ok := c.opt_["pageToken"]; ok {
1302
params.Set("pageToken", fmt.Sprintf("%v", v))
1304
if v, ok := c.opt_["statusFilter"]; ok {
1305
params.Set("statusFilter", fmt.Sprintf("%v", v))
1307
if v, ok := c.opt_["fields"]; ok {
1308
params.Set("fields", fmt.Sprintf("%v", v))
1310
urls := googleapi.ResolveRelative(c.s.BasePath, "creatives")
1311
urls += "?" + params.Encode()
1312
req, _ := http.NewRequest("GET", urls, body)
1313
googleapi.SetOpaque(req.URL)
1314
req.Header.Set("User-Agent", "google-api-go-client/0.5")
1315
res, err := c.s.client.Do(req)
1319
defer googleapi.CloseBody(res)
1320
if err := googleapi.CheckResponse(res); err != nil {
1323
var ret *CreativesList
1324
if err := json.NewDecoder(res.Body).Decode(&ret); err != nil {
1329
// "description": "Retrieves a list of the authenticated user's active creatives. A creative will be available 30-40 minutes after submission.",
1330
// "httpMethod": "GET",
1331
// "id": "adexchangebuyer.creatives.list",
1334
// "description": "When specified, only creatives for the given account ids are returned.",
1335
// "format": "int32",
1336
// "location": "query",
1337
// "repeated": true,
1338
// "type": "integer"
1340
// "buyerCreativeId": {
1341
// "description": "When specified, only creatives for the given buyer creative ids are returned.",
1342
// "location": "query",
1343
// "repeated": true,
1347
// "description": "Maximum number of entries returned on one result page. If not set, the default is 100. Optional.",
1348
// "format": "uint32",
1349
// "location": "query",
1350
// "maximum": "1000",
1352
// "type": "integer"
1355
// "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.",
1356
// "location": "query",
1359
// "statusFilter": {
1360
// "description": "When specified, only creatives having the given status are returned.",
1366
// "enumDescriptions": [
1367
// "Creatives which have been approved.",
1368
// "Creatives which have been disapproved.",
1369
// "Creatives whose status is not yet checked."
1371
// "location": "query",
1375
// "path": "creatives",
1377
// "$ref": "CreativesList"
1380
// "https://www.googleapis.com/auth/adexchange.buyer"
1386
// method id "adexchangebuyer.directDeals.get":
1388
type DirectDealsGetCall struct {
1391
opt_ map[string]interface{}
1394
// Get: Gets one direct deal by ID.
1395
func (r *DirectDealsService) Get(id int64) *DirectDealsGetCall {
1396
c := &DirectDealsGetCall{s: r.s, opt_: make(map[string]interface{})}
1401
// Fields allows partial responses to be retrieved.
1402
// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
1403
// for more information.
1404
func (c *DirectDealsGetCall) Fields(s ...googleapi.Field) *DirectDealsGetCall {
1405
c.opt_["fields"] = googleapi.CombineFields(s)
1409
func (c *DirectDealsGetCall) Do() (*DirectDeal, error) {
1410
var body io.Reader = nil
1411
params := make(url.Values)
1412
params.Set("alt", "json")
1413
if v, ok := c.opt_["fields"]; ok {
1414
params.Set("fields", fmt.Sprintf("%v", v))
1416
urls := googleapi.ResolveRelative(c.s.BasePath, "directdeals/{id}")
1417
urls += "?" + params.Encode()
1418
req, _ := http.NewRequest("GET", urls, body)
1419
googleapi.Expand(req.URL, map[string]string{
1420
"id": strconv.FormatInt(c.id, 10),
1422
req.Header.Set("User-Agent", "google-api-go-client/0.5")
1423
res, err := c.s.client.Do(req)
1427
defer googleapi.CloseBody(res)
1428
if err := googleapi.CheckResponse(res); err != nil {
1432
if err := json.NewDecoder(res.Body).Decode(&ret); err != nil {
1437
// "description": "Gets one direct deal by ID.",
1438
// "httpMethod": "GET",
1439
// "id": "adexchangebuyer.directDeals.get",
1440
// "parameterOrder": [
1445
// "description": "The direct deal id",
1446
// "format": "int64",
1447
// "location": "path",
1448
// "required": true,
1452
// "path": "directdeals/{id}",
1454
// "$ref": "DirectDeal"
1457
// "https://www.googleapis.com/auth/adexchange.buyer"
1463
// method id "adexchangebuyer.directDeals.list":
1465
type DirectDealsListCall struct {
1467
opt_ map[string]interface{}
1470
// List: Retrieves the authenticated user's list of direct deals.
1471
func (r *DirectDealsService) List() *DirectDealsListCall {
1472
c := &DirectDealsListCall{s: r.s, opt_: make(map[string]interface{})}
1476
// Fields allows partial responses to be retrieved.
1477
// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
1478
// for more information.
1479
func (c *DirectDealsListCall) Fields(s ...googleapi.Field) *DirectDealsListCall {
1480
c.opt_["fields"] = googleapi.CombineFields(s)
1484
func (c *DirectDealsListCall) Do() (*DirectDealsList, error) {
1485
var body io.Reader = nil
1486
params := make(url.Values)
1487
params.Set("alt", "json")
1488
if v, ok := c.opt_["fields"]; ok {
1489
params.Set("fields", fmt.Sprintf("%v", v))
1491
urls := googleapi.ResolveRelative(c.s.BasePath, "directdeals")
1492
urls += "?" + params.Encode()
1493
req, _ := http.NewRequest("GET", urls, body)
1494
googleapi.SetOpaque(req.URL)
1495
req.Header.Set("User-Agent", "google-api-go-client/0.5")
1496
res, err := c.s.client.Do(req)
1500
defer googleapi.CloseBody(res)
1501
if err := googleapi.CheckResponse(res); err != nil {
1504
var ret *DirectDealsList
1505
if err := json.NewDecoder(res.Body).Decode(&ret); err != nil {
1510
// "description": "Retrieves the authenticated user's list of direct deals.",
1511
// "httpMethod": "GET",
1512
// "id": "adexchangebuyer.directDeals.list",
1513
// "path": "directdeals",
1515
// "$ref": "DirectDealsList"
1518
// "https://www.googleapis.com/auth/adexchange.buyer"
1524
// method id "adexchangebuyer.performanceReport.list":
1526
type PerformanceReportListCall struct {
1530
startDateTime string
1531
opt_ map[string]interface{}
1534
// List: Retrieves the authenticated user's list of performance metrics.
1535
func (r *PerformanceReportService) List(accountId int64, endDateTime string, startDateTime string) *PerformanceReportListCall {
1536
c := &PerformanceReportListCall{s: r.s, opt_: make(map[string]interface{})}
1537
c.accountId = accountId
1538
c.endDateTime = endDateTime
1539
c.startDateTime = startDateTime
1543
// MaxResults sets the optional parameter "maxResults": Maximum number
1544
// of entries returned on one result page. If not set, the default is
1546
func (c *PerformanceReportListCall) MaxResults(maxResults int64) *PerformanceReportListCall {
1547
c.opt_["maxResults"] = maxResults
1551
// PageToken sets the optional parameter "pageToken": A continuation
1552
// token, used to page through performance reports. To retrieve the next
1553
// page, set this parameter to the value of "nextPageToken" from the
1554
// previous response.
1555
func (c *PerformanceReportListCall) PageToken(pageToken string) *PerformanceReportListCall {
1556
c.opt_["pageToken"] = pageToken
1560
// Fields allows partial responses to be retrieved.
1561
// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
1562
// for more information.
1563
func (c *PerformanceReportListCall) Fields(s ...googleapi.Field) *PerformanceReportListCall {
1564
c.opt_["fields"] = googleapi.CombineFields(s)
1568
func (c *PerformanceReportListCall) Do() (*PerformanceReportList, error) {
1569
var body io.Reader = nil
1570
params := make(url.Values)
1571
params.Set("alt", "json")
1572
params.Set("accountId", fmt.Sprintf("%v", c.accountId))
1573
params.Set("endDateTime", fmt.Sprintf("%v", c.endDateTime))
1574
params.Set("startDateTime", fmt.Sprintf("%v", c.startDateTime))
1575
if v, ok := c.opt_["maxResults"]; ok {
1576
params.Set("maxResults", fmt.Sprintf("%v", v))
1578
if v, ok := c.opt_["pageToken"]; ok {
1579
params.Set("pageToken", fmt.Sprintf("%v", v))
1581
if v, ok := c.opt_["fields"]; ok {
1582
params.Set("fields", fmt.Sprintf("%v", v))
1584
urls := googleapi.ResolveRelative(c.s.BasePath, "performancereport")
1585
urls += "?" + params.Encode()
1586
req, _ := http.NewRequest("GET", urls, body)
1587
googleapi.SetOpaque(req.URL)
1588
req.Header.Set("User-Agent", "google-api-go-client/0.5")
1589
res, err := c.s.client.Do(req)
1593
defer googleapi.CloseBody(res)
1594
if err := googleapi.CheckResponse(res); err != nil {
1597
var ret *PerformanceReportList
1598
if err := json.NewDecoder(res.Body).Decode(&ret); err != nil {
1603
// "description": "Retrieves the authenticated user's list of performance metrics.",
1604
// "httpMethod": "GET",
1605
// "id": "adexchangebuyer.performanceReport.list",
1606
// "parameterOrder": [
1613
// "description": "The account id to get the reports.",
1614
// "format": "int64",
1615
// "location": "query",
1616
// "required": true,
1620
// "description": "The end time of the report in ISO 8601 timestamp format using UTC.",
1621
// "location": "query",
1622
// "required": true,
1626
// "description": "Maximum number of entries returned on one result page. If not set, the default is 100. Optional.",
1627
// "format": "uint32",
1628
// "location": "query",
1629
// "maximum": "1000",
1631
// "type": "integer"
1634
// "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.",
1635
// "location": "query",
1638
// "startDateTime": {
1639
// "description": "The start time of the report in ISO 8601 timestamp format using UTC.",
1640
// "location": "query",
1641
// "required": true,
1645
// "path": "performancereport",
1647
// "$ref": "PerformanceReportList"
1650
// "https://www.googleapis.com/auth/adexchange.buyer"
1656
// method id "adexchangebuyer.pretargetingConfig.delete":
1658
type PretargetingConfigDeleteCall struct {
1662
opt_ map[string]interface{}
1665
// Delete: Deletes an existing pretargeting config.
1666
func (r *PretargetingConfigService) Delete(accountId int64, configId int64) *PretargetingConfigDeleteCall {
1667
c := &PretargetingConfigDeleteCall{s: r.s, opt_: make(map[string]interface{})}
1668
c.accountId = accountId
1669
c.configId = configId
1673
// Fields allows partial responses to be retrieved.
1674
// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
1675
// for more information.
1676
func (c *PretargetingConfigDeleteCall) Fields(s ...googleapi.Field) *PretargetingConfigDeleteCall {
1677
c.opt_["fields"] = googleapi.CombineFields(s)
1681
func (c *PretargetingConfigDeleteCall) Do() error {
1682
var body io.Reader = nil
1683
params := make(url.Values)
1684
params.Set("alt", "json")
1685
if v, ok := c.opt_["fields"]; ok {
1686
params.Set("fields", fmt.Sprintf("%v", v))
1688
urls := googleapi.ResolveRelative(c.s.BasePath, "pretargetingconfigs/{accountId}/{configId}")
1689
urls += "?" + params.Encode()
1690
req, _ := http.NewRequest("DELETE", urls, body)
1691
googleapi.Expand(req.URL, map[string]string{
1692
"accountId": strconv.FormatInt(c.accountId, 10),
1693
"configId": strconv.FormatInt(c.configId, 10),
1695
req.Header.Set("User-Agent", "google-api-go-client/0.5")
1696
res, err := c.s.client.Do(req)
1700
defer googleapi.CloseBody(res)
1701
if err := googleapi.CheckResponse(res); err != nil {
1706
// "description": "Deletes an existing pretargeting config.",
1707
// "httpMethod": "DELETE",
1708
// "id": "adexchangebuyer.pretargetingConfig.delete",
1709
// "parameterOrder": [
1715
// "description": "The account id to delete the pretargeting config for.",
1716
// "format": "int64",
1717
// "location": "path",
1718
// "required": true,
1722
// "description": "The specific id of the configuration to delete.",
1723
// "format": "int64",
1724
// "location": "path",
1725
// "required": true,
1729
// "path": "pretargetingconfigs/{accountId}/{configId}",
1731
// "https://www.googleapis.com/auth/adexchange.buyer"
1737
// method id "adexchangebuyer.pretargetingConfig.get":
1739
type PretargetingConfigGetCall struct {
1743
opt_ map[string]interface{}
1746
// Get: Gets a specific pretargeting configuration
1747
func (r *PretargetingConfigService) Get(accountId int64, configId int64) *PretargetingConfigGetCall {
1748
c := &PretargetingConfigGetCall{s: r.s, opt_: make(map[string]interface{})}
1749
c.accountId = accountId
1750
c.configId = configId
1754
// Fields allows partial responses to be retrieved.
1755
// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
1756
// for more information.
1757
func (c *PretargetingConfigGetCall) Fields(s ...googleapi.Field) *PretargetingConfigGetCall {
1758
c.opt_["fields"] = googleapi.CombineFields(s)
1762
func (c *PretargetingConfigGetCall) Do() (*PretargetingConfig, error) {
1763
var body io.Reader = nil
1764
params := make(url.Values)
1765
params.Set("alt", "json")
1766
if v, ok := c.opt_["fields"]; ok {
1767
params.Set("fields", fmt.Sprintf("%v", v))
1769
urls := googleapi.ResolveRelative(c.s.BasePath, "pretargetingconfigs/{accountId}/{configId}")
1770
urls += "?" + params.Encode()
1771
req, _ := http.NewRequest("GET", urls, body)
1772
googleapi.Expand(req.URL, map[string]string{
1773
"accountId": strconv.FormatInt(c.accountId, 10),
1774
"configId": strconv.FormatInt(c.configId, 10),
1776
req.Header.Set("User-Agent", "google-api-go-client/0.5")
1777
res, err := c.s.client.Do(req)
1781
defer googleapi.CloseBody(res)
1782
if err := googleapi.CheckResponse(res); err != nil {
1785
var ret *PretargetingConfig
1786
if err := json.NewDecoder(res.Body).Decode(&ret); err != nil {
1791
// "description": "Gets a specific pretargeting configuration",
1792
// "httpMethod": "GET",
1793
// "id": "adexchangebuyer.pretargetingConfig.get",
1794
// "parameterOrder": [
1800
// "description": "The account id to get the pretargeting config for.",
1801
// "format": "int64",
1802
// "location": "path",
1803
// "required": true,
1807
// "description": "The specific id of the configuration to retrieve.",
1808
// "format": "int64",
1809
// "location": "path",
1810
// "required": true,
1814
// "path": "pretargetingconfigs/{accountId}/{configId}",
1816
// "$ref": "PretargetingConfig"
1819
// "https://www.googleapis.com/auth/adexchange.buyer"
1825
// method id "adexchangebuyer.pretargetingConfig.insert":
1827
type PretargetingConfigInsertCall struct {
1830
pretargetingconfig *PretargetingConfig
1831
opt_ map[string]interface{}
1834
// Insert: Inserts a new pretargeting configuration.
1835
func (r *PretargetingConfigService) Insert(accountId int64, pretargetingconfig *PretargetingConfig) *PretargetingConfigInsertCall {
1836
c := &PretargetingConfigInsertCall{s: r.s, opt_: make(map[string]interface{})}
1837
c.accountId = accountId
1838
c.pretargetingconfig = pretargetingconfig
1842
// Fields allows partial responses to be retrieved.
1843
// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
1844
// for more information.
1845
func (c *PretargetingConfigInsertCall) Fields(s ...googleapi.Field) *PretargetingConfigInsertCall {
1846
c.opt_["fields"] = googleapi.CombineFields(s)
1850
func (c *PretargetingConfigInsertCall) Do() (*PretargetingConfig, error) {
1851
var body io.Reader = nil
1852
body, err := googleapi.WithoutDataWrapper.JSONReader(c.pretargetingconfig)
1856
ctype := "application/json"
1857
params := make(url.Values)
1858
params.Set("alt", "json")
1859
if v, ok := c.opt_["fields"]; ok {
1860
params.Set("fields", fmt.Sprintf("%v", v))
1862
urls := googleapi.ResolveRelative(c.s.BasePath, "pretargetingconfigs/{accountId}")
1863
urls += "?" + params.Encode()
1864
req, _ := http.NewRequest("POST", urls, body)
1865
googleapi.Expand(req.URL, map[string]string{
1866
"accountId": strconv.FormatInt(c.accountId, 10),
1868
req.Header.Set("Content-Type", ctype)
1869
req.Header.Set("User-Agent", "google-api-go-client/0.5")
1870
res, err := c.s.client.Do(req)
1874
defer googleapi.CloseBody(res)
1875
if err := googleapi.CheckResponse(res); err != nil {
1878
var ret *PretargetingConfig
1879
if err := json.NewDecoder(res.Body).Decode(&ret); err != nil {
1884
// "description": "Inserts a new pretargeting configuration.",
1885
// "httpMethod": "POST",
1886
// "id": "adexchangebuyer.pretargetingConfig.insert",
1887
// "parameterOrder": [
1892
// "description": "The account id to insert the pretargeting config for.",
1893
// "format": "int64",
1894
// "location": "path",
1895
// "required": true,
1899
// "path": "pretargetingconfigs/{accountId}",
1901
// "$ref": "PretargetingConfig"
1904
// "$ref": "PretargetingConfig"
1907
// "https://www.googleapis.com/auth/adexchange.buyer"
1913
// method id "adexchangebuyer.pretargetingConfig.list":
1915
type PretargetingConfigListCall struct {
1918
opt_ map[string]interface{}
1921
// List: Retrieves a list of the authenticated user's pretargeting
1923
func (r *PretargetingConfigService) List(accountId int64) *PretargetingConfigListCall {
1924
c := &PretargetingConfigListCall{s: r.s, opt_: make(map[string]interface{})}
1925
c.accountId = accountId
1929
// Fields allows partial responses to be retrieved.
1930
// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
1931
// for more information.
1932
func (c *PretargetingConfigListCall) Fields(s ...googleapi.Field) *PretargetingConfigListCall {
1933
c.opt_["fields"] = googleapi.CombineFields(s)
1937
func (c *PretargetingConfigListCall) Do() (*PretargetingConfigList, error) {
1938
var body io.Reader = nil
1939
params := make(url.Values)
1940
params.Set("alt", "json")
1941
if v, ok := c.opt_["fields"]; ok {
1942
params.Set("fields", fmt.Sprintf("%v", v))
1944
urls := googleapi.ResolveRelative(c.s.BasePath, "pretargetingconfigs/{accountId}")
1945
urls += "?" + params.Encode()
1946
req, _ := http.NewRequest("GET", urls, body)
1947
googleapi.Expand(req.URL, map[string]string{
1948
"accountId": strconv.FormatInt(c.accountId, 10),
1950
req.Header.Set("User-Agent", "google-api-go-client/0.5")
1951
res, err := c.s.client.Do(req)
1955
defer googleapi.CloseBody(res)
1956
if err := googleapi.CheckResponse(res); err != nil {
1959
var ret *PretargetingConfigList
1960
if err := json.NewDecoder(res.Body).Decode(&ret); err != nil {
1965
// "description": "Retrieves a list of the authenticated user's pretargeting configurations.",
1966
// "httpMethod": "GET",
1967
// "id": "adexchangebuyer.pretargetingConfig.list",
1968
// "parameterOrder": [
1973
// "description": "The account id to get the pretargeting configs for.",
1974
// "format": "int64",
1975
// "location": "path",
1976
// "required": true,
1980
// "path": "pretargetingconfigs/{accountId}",
1982
// "$ref": "PretargetingConfigList"
1985
// "https://www.googleapis.com/auth/adexchange.buyer"
1991
// method id "adexchangebuyer.pretargetingConfig.patch":
1993
type PretargetingConfigPatchCall struct {
1997
pretargetingconfig *PretargetingConfig
1998
opt_ map[string]interface{}
2001
// Patch: Updates an existing pretargeting config. This method supports
2003
func (r *PretargetingConfigService) Patch(accountId int64, configId int64, pretargetingconfig *PretargetingConfig) *PretargetingConfigPatchCall {
2004
c := &PretargetingConfigPatchCall{s: r.s, opt_: make(map[string]interface{})}
2005
c.accountId = accountId
2006
c.configId = configId
2007
c.pretargetingconfig = pretargetingconfig
2011
// Fields allows partial responses to be retrieved.
2012
// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
2013
// for more information.
2014
func (c *PretargetingConfigPatchCall) Fields(s ...googleapi.Field) *PretargetingConfigPatchCall {
2015
c.opt_["fields"] = googleapi.CombineFields(s)
2019
func (c *PretargetingConfigPatchCall) Do() (*PretargetingConfig, error) {
2020
var body io.Reader = nil
2021
body, err := googleapi.WithoutDataWrapper.JSONReader(c.pretargetingconfig)
2025
ctype := "application/json"
2026
params := make(url.Values)
2027
params.Set("alt", "json")
2028
if v, ok := c.opt_["fields"]; ok {
2029
params.Set("fields", fmt.Sprintf("%v", v))
2031
urls := googleapi.ResolveRelative(c.s.BasePath, "pretargetingconfigs/{accountId}/{configId}")
2032
urls += "?" + params.Encode()
2033
req, _ := http.NewRequest("PATCH", urls, body)
2034
googleapi.Expand(req.URL, map[string]string{
2035
"accountId": strconv.FormatInt(c.accountId, 10),
2036
"configId": strconv.FormatInt(c.configId, 10),
2038
req.Header.Set("Content-Type", ctype)
2039
req.Header.Set("User-Agent", "google-api-go-client/0.5")
2040
res, err := c.s.client.Do(req)
2044
defer googleapi.CloseBody(res)
2045
if err := googleapi.CheckResponse(res); err != nil {
2048
var ret *PretargetingConfig
2049
if err := json.NewDecoder(res.Body).Decode(&ret); err != nil {
2054
// "description": "Updates an existing pretargeting config. This method supports patch semantics.",
2055
// "httpMethod": "PATCH",
2056
// "id": "adexchangebuyer.pretargetingConfig.patch",
2057
// "parameterOrder": [
2063
// "description": "The account id to update the pretargeting config for.",
2064
// "format": "int64",
2065
// "location": "path",
2066
// "required": true,
2070
// "description": "The specific id of the configuration to update.",
2071
// "format": "int64",
2072
// "location": "path",
2073
// "required": true,
2077
// "path": "pretargetingconfigs/{accountId}/{configId}",
2079
// "$ref": "PretargetingConfig"
2082
// "$ref": "PretargetingConfig"
2085
// "https://www.googleapis.com/auth/adexchange.buyer"
2091
// method id "adexchangebuyer.pretargetingConfig.update":
2093
type PretargetingConfigUpdateCall struct {
2097
pretargetingconfig *PretargetingConfig
2098
opt_ map[string]interface{}
2101
// Update: Updates an existing pretargeting config.
2102
func (r *PretargetingConfigService) Update(accountId int64, configId int64, pretargetingconfig *PretargetingConfig) *PretargetingConfigUpdateCall {
2103
c := &PretargetingConfigUpdateCall{s: r.s, opt_: make(map[string]interface{})}
2104
c.accountId = accountId
2105
c.configId = configId
2106
c.pretargetingconfig = pretargetingconfig
2110
// Fields allows partial responses to be retrieved.
2111
// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
2112
// for more information.
2113
func (c *PretargetingConfigUpdateCall) Fields(s ...googleapi.Field) *PretargetingConfigUpdateCall {
2114
c.opt_["fields"] = googleapi.CombineFields(s)
2118
func (c *PretargetingConfigUpdateCall) Do() (*PretargetingConfig, error) {
2119
var body io.Reader = nil
2120
body, err := googleapi.WithoutDataWrapper.JSONReader(c.pretargetingconfig)
2124
ctype := "application/json"
2125
params := make(url.Values)
2126
params.Set("alt", "json")
2127
if v, ok := c.opt_["fields"]; ok {
2128
params.Set("fields", fmt.Sprintf("%v", v))
2130
urls := googleapi.ResolveRelative(c.s.BasePath, "pretargetingconfigs/{accountId}/{configId}")
2131
urls += "?" + params.Encode()
2132
req, _ := http.NewRequest("PUT", urls, body)
2133
googleapi.Expand(req.URL, map[string]string{
2134
"accountId": strconv.FormatInt(c.accountId, 10),
2135
"configId": strconv.FormatInt(c.configId, 10),
2137
req.Header.Set("Content-Type", ctype)
2138
req.Header.Set("User-Agent", "google-api-go-client/0.5")
2139
res, err := c.s.client.Do(req)
2143
defer googleapi.CloseBody(res)
2144
if err := googleapi.CheckResponse(res); err != nil {
2147
var ret *PretargetingConfig
2148
if err := json.NewDecoder(res.Body).Decode(&ret); err != nil {
2153
// "description": "Updates an existing pretargeting config.",
2154
// "httpMethod": "PUT",
2155
// "id": "adexchangebuyer.pretargetingConfig.update",
2156
// "parameterOrder": [
2162
// "description": "The account id to update the pretargeting config for.",
2163
// "format": "int64",
2164
// "location": "path",
2165
// "required": true,
2169
// "description": "The specific id of the configuration to update.",
2170
// "format": "int64",
2171
// "location": "path",
2172
// "required": true,
2176
// "path": "pretargetingconfigs/{accountId}/{configId}",
2178
// "$ref": "PretargetingConfig"
2181
// "$ref": "PretargetingConfig"
2184
// "https://www.googleapis.com/auth/adexchange.buyer"