~nskaggs/+junk/xenial-test

« back to all changes in this revision

Viewing changes to src/google.golang.org/api/adexchangebuyer/v1.3/adexchangebuyer-gen.go

  • Committer: Nicholas Skaggs
  • Date: 2016-10-24 20:56:05 UTC
  • Revision ID: nicholas.skaggs@canonical.com-20161024205605-z8lta0uvuhtxwzwl
Initi with beta15

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
// Package adexchangebuyer provides access to the Ad Exchange Buyer API.
 
2
//
 
3
// See https://developers.google.com/ad-exchange/buyer-rest
 
4
//
 
5
// Usage example:
 
6
//
 
7
//   import "google.golang.org/api/adexchangebuyer/v1.3"
 
8
//   ...
 
9
//   adexchangebuyerService, err := adexchangebuyer.New(oauthHttpClient)
 
10
package adexchangebuyer
 
11
 
 
12
import (
 
13
        "bytes"
 
14
        "encoding/json"
 
15
        "errors"
 
16
        "fmt"
 
17
        "google.golang.org/api/googleapi"
 
18
        "io"
 
19
        "net/http"
 
20
        "net/url"
 
21
        "strconv"
 
22
        "strings"
 
23
)
 
24
 
 
25
// Always reference these packages, just in case the auto-generated code
 
26
// below doesn't.
 
27
var _ = bytes.NewBuffer
 
28
var _ = strconv.Itoa
 
29
var _ = fmt.Sprintf
 
30
var _ = json.NewDecoder
 
31
var _ = io.Copy
 
32
var _ = url.Parse
 
33
var _ = googleapi.Version
 
34
var _ = errors.New
 
35
var _ = strings.Replace
 
36
 
 
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/"
 
41
 
 
42
// OAuth2 scopes used by this API.
 
43
const (
 
44
        // Manage your Ad Exchange buyer account configuration
 
45
        AdexchangeBuyerScope = "https://www.googleapis.com/auth/adexchange.buyer"
 
46
)
 
47
 
 
48
func New(client *http.Client) (*Service, error) {
 
49
        if client == nil {
 
50
                return nil, errors.New("client is nil")
 
51
        }
 
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)
 
59
        return s, nil
 
60
}
 
61
 
 
62
type Service struct {
 
63
        client   *http.Client
 
64
        BasePath string // API endpoint base URL
 
65
 
 
66
        Accounts *AccountsService
 
67
 
 
68
        BillingInfo *BillingInfoService
 
69
 
 
70
        Creatives *CreativesService
 
71
 
 
72
        DirectDeals *DirectDealsService
 
73
 
 
74
        PerformanceReport *PerformanceReportService
 
75
 
 
76
        PretargetingConfig *PretargetingConfigService
 
77
}
 
78
 
 
79
func NewAccountsService(s *Service) *AccountsService {
 
80
        rs := &AccountsService{s: s}
 
81
        return rs
 
82
}
 
83
 
 
84
type AccountsService struct {
 
85
        s *Service
 
86
}
 
87
 
 
88
func NewBillingInfoService(s *Service) *BillingInfoService {
 
89
        rs := &BillingInfoService{s: s}
 
90
        return rs
 
91
}
 
92
 
 
93
type BillingInfoService struct {
 
94
        s *Service
 
95
}
 
96
 
 
97
func NewCreativesService(s *Service) *CreativesService {
 
98
        rs := &CreativesService{s: s}
 
99
        return rs
 
100
}
 
101
 
 
102
type CreativesService struct {
 
103
        s *Service
 
104
}
 
105
 
 
106
func NewDirectDealsService(s *Service) *DirectDealsService {
 
107
        rs := &DirectDealsService{s: s}
 
108
        return rs
 
109
}
 
110
 
 
111
type DirectDealsService struct {
 
112
        s *Service
 
113
}
 
114
 
 
115
func NewPerformanceReportService(s *Service) *PerformanceReportService {
 
116
        rs := &PerformanceReportService{s: s}
 
117
        return rs
 
118
}
 
119
 
 
120
type PerformanceReportService struct {
 
121
        s *Service
 
122
}
 
123
 
 
124
func NewPretargetingConfigService(s *Service) *PretargetingConfigService {
 
125
        rs := &PretargetingConfigService{s: s}
 
126
        return rs
 
127
}
 
128
 
 
129
type PretargetingConfigService struct {
 
130
        s *Service
 
131
}
 
132
 
 
133
type Account struct {
 
134
        // BidderLocation: Your bidder locations that have distinct URLs.
 
135
        BidderLocation []*AccountBidderLocation `json:"bidderLocation,omitempty"`
 
136
 
 
137
        // CookieMatchingNid: The nid parameter value used in cookie match
 
138
        // requests. Please contact your technical account manager if you need
 
139
        // to change this.
 
140
        CookieMatchingNid string `json:"cookieMatchingNid,omitempty"`
 
141
 
 
142
        // CookieMatchingUrl: The base URL used in cookie match requests.
 
143
        CookieMatchingUrl string `json:"cookieMatchingUrl,omitempty"`
 
144
 
 
145
        // Id: Account id.
 
146
        Id int64 `json:"id,omitempty"`
 
147
 
 
148
        // Kind: Resource type.
 
149
        Kind string `json:"kind,omitempty"`
 
150
 
 
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"`
 
156
 
 
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"`
 
161
 
 
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"`
 
165
}
 
166
 
 
167
type AccountBidderLocation struct {
 
168
        // MaximumQps: The maximum queries per second the Ad Exchange will send.
 
169
        MaximumQps int64 `json:"maximumQps,omitempty"`
 
170
 
 
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:
 
174
        // - ASIA
 
175
        // - EUROPE
 
176
        // - US_EAST
 
177
        // -
 
178
        // US_WEST
 
179
        Region string `json:"region,omitempty"`
 
180
 
 
181
        // Url: The URL to which the Ad Exchange will send bid requests.
 
182
        Url string `json:"url,omitempty"`
 
183
}
 
184
 
 
185
type AccountsList struct {
 
186
        // Items: A list of accounts.
 
187
        Items []*Account `json:"items,omitempty"`
 
188
 
 
189
        // Kind: Resource type.
 
190
        Kind string `json:"kind,omitempty"`
 
191
}
 
192
 
 
193
type BillingInfo struct {
 
194
        // AccountId: Account id.
 
195
        AccountId int64 `json:"accountId,omitempty"`
 
196
 
 
197
        // AccountName: Account name.
 
198
        AccountName string `json:"accountName,omitempty"`
 
199
 
 
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"`
 
204
 
 
205
        // Kind: Resource type.
 
206
        Kind string `json:"kind,omitempty"`
 
207
}
 
208
 
 
209
type BillingInfoList struct {
 
210
        // Items: A list of billing info relevant for your account.
 
211
        Items []*BillingInfo `json:"items,omitempty"`
 
212
 
 
213
        // Kind: Resource type.
 
214
        Kind string `json:"kind,omitempty"`
 
215
}
 
216
 
 
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"`
 
221
 
 
222
        // AccountId: Account id.
 
223
        AccountId int64 `json:"accountId,omitempty"`
 
224
 
 
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"`
 
228
 
 
229
        // AdvertiserName: The name of the company being advertised in the
 
230
        // creative.
 
231
        AdvertiserName string `json:"advertiserName,omitempty"`
 
232
 
 
233
        // AgencyId: The agency id for this creative.
 
234
        AgencyId int64 `json:"agencyId,omitempty,string"`
 
235
 
 
236
        // Attribute: All attributes for the ads that may be shown from this
 
237
        // snippet.
 
238
        Attribute []int64 `json:"attribute,omitempty"`
 
239
 
 
240
        // BuyerCreativeId: A buyer-specific id identifying the creative in this
 
241
        // ad.
 
242
        BuyerCreativeId string `json:"buyerCreativeId,omitempty"`
 
243
 
 
244
        // ClickThroughUrl: The set of destination urls for the snippet.
 
245
        ClickThroughUrl []string `json:"clickThroughUrl,omitempty"`
 
246
 
 
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"`
 
250
 
 
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
 
256
        // requests.
 
257
        DisapprovalReasons []*CreativeDisapprovalReasons `json:"disapprovalReasons,omitempty"`
 
258
 
 
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"`
 
263
 
 
264
        // Height: Ad height.
 
265
        Height int64 `json:"height,omitempty"`
 
266
 
 
267
        // Kind: Resource type.
 
268
        Kind string `json:"kind,omitempty"`
 
269
 
 
270
        // ProductCategories: Detected product categories, if any. Read-only.
 
271
        // This field should not be set in requests.
 
272
        ProductCategories []int64 `json:"productCategories,omitempty"`
 
273
 
 
274
        // RestrictedCategories: All restricted categories for the ads that may
 
275
        // be shown from this snippet.
 
276
        RestrictedCategories []int64 `json:"restrictedCategories,omitempty"`
 
277
 
 
278
        // SensitiveCategories: Detected sensitive categories, if any.
 
279
        // Read-only. This field should not be set in requests.
 
280
        SensitiveCategories []int64 `json:"sensitiveCategories,omitempty"`
 
281
 
 
282
        // Status: Creative serving status. Read-only. This field should not be
 
283
        // set in requests.
 
284
        Status string `json:"status,omitempty"`
 
285
 
 
286
        // VendorType: All vendor types for the ads that may be shown from this
 
287
        // snippet.
 
288
        VendorType []int64 `json:"vendorType,omitempty"`
 
289
 
 
290
        // VideoURL: The url to fetch a video ad. If set, HTMLSnippet should not
 
291
        // be set.
 
292
        VideoURL string `json:"videoURL,omitempty"`
 
293
 
 
294
        // Width: Ad width.
 
295
        Width int64 `json:"width,omitempty"`
 
296
}
 
297
 
 
298
type CreativeCorrections struct {
 
299
        // Details: Additional details about the correction.
 
300
        Details []string `json:"details,omitempty"`
 
301
 
 
302
        // Reason: The type of correction that was applied to the creative.
 
303
        Reason string `json:"reason,omitempty"`
 
304
}
 
305
 
 
306
type CreativeDisapprovalReasons struct {
 
307
        // Details: Additional details about the reason for disapproval.
 
308
        Details []string `json:"details,omitempty"`
 
309
 
 
310
        // Reason: The categorized reason for disapproval.
 
311
        Reason string `json:"reason,omitempty"`
 
312
}
 
313
 
 
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"`
 
318
 
 
319
        // Reasons: The filtering reasons.
 
320
        Reasons []*CreativeFilteringReasonsReasons `json:"reasons,omitempty"`
 
321
}
 
322
 
 
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
 
326
        // exchange.
 
327
        FilteringCount int64 `json:"filteringCount,omitempty,string"`
 
328
 
 
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"`
 
332
}
 
333
 
 
334
type CreativesList struct {
 
335
        // Items: A list of creatives.
 
336
        Items []*Creative `json:"items,omitempty"`
 
337
 
 
338
        // Kind: Resource type.
 
339
        Kind string `json:"kind,omitempty"`
 
340
 
 
341
        // NextPageToken: Continuation token used to page through creatives. To
 
342
        // retrieve the next page of results, set the next request's "pageToken"
 
343
        // value to this.
 
344
        NextPageToken string `json:"nextPageToken,omitempty"`
 
345
}
 
346
 
 
347
type DirectDeal struct {
 
348
        // AccountId: The account id of the buyer this deal is for.
 
349
        AccountId int64 `json:"accountId,omitempty"`
 
350
 
 
351
        // Advertiser: The name of the advertiser this deal is for.
 
352
        Advertiser string `json:"advertiser,omitempty"`
 
353
 
 
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"`
 
357
 
 
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"`
 
362
 
 
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"`
 
368
 
 
369
        // Id: Deal id.
 
370
        Id int64 `json:"id,omitempty,string"`
 
371
 
 
372
        // Kind: Resource type.
 
373
        Kind string `json:"kind,omitempty"`
 
374
 
 
375
        // Name: Deal name.
 
376
        Name string `json:"name,omitempty"`
 
377
 
 
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"`
 
383
 
 
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"`
 
387
 
 
388
        // SellerNetwork: The name of the publisher offering this direct deal.
 
389
        SellerNetwork string `json:"sellerNetwork,omitempty"`
 
390
 
 
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
 
393
        // the epoch.
 
394
        StartTime int64 `json:"startTime,omitempty,string"`
 
395
}
 
396
 
 
397
type DirectDealsList struct {
 
398
        // DirectDeals: A list of direct deals relevant for your account.
 
399
        DirectDeals []*DirectDeal `json:"directDeals,omitempty"`
 
400
 
 
401
        // Kind: Resource type.
 
402
        Kind string `json:"kind,omitempty"`
 
403
}
 
404
 
 
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
 
408
        // statuses.
 
409
        CalloutStatusRate []interface{} `json:"calloutStatusRate,omitempty"`
 
410
 
 
411
        // CookieMatcherStatusRate: Average QPS for cookie matcher operations.
 
412
        CookieMatcherStatusRate []interface{} `json:"cookieMatcherStatusRate,omitempty"`
 
413
 
 
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"`
 
417
 
 
418
        // HostedMatchStatusRate: Average QPS for hosted match operations.
 
419
        HostedMatchStatusRate []interface{} `json:"hostedMatchStatusRate,omitempty"`
 
420
 
 
421
        // Kind: Resource type.
 
422
        Kind string `json:"kind,omitempty"`
 
423
 
 
424
        // Latency50thPercentile: The 50th percentile round trip latency(ms) as
 
425
        // perceived from Google servers for the duration period covered by the
 
426
        // report.
 
427
        Latency50thPercentile float64 `json:"latency50thPercentile,omitempty"`
 
428
 
 
429
        // Latency85thPercentile: The 85th percentile round trip latency(ms) as
 
430
        // perceived from Google servers for the duration period covered by the
 
431
        // report.
 
432
        Latency85thPercentile float64 `json:"latency85thPercentile,omitempty"`
 
433
 
 
434
        // Latency95thPercentile: The 95th percentile round trip latency(ms) as
 
435
        // perceived from Google servers for the duration period covered by the
 
436
        // report.
 
437
        Latency95thPercentile float64 `json:"latency95thPercentile,omitempty"`
 
438
 
 
439
        // NoQuotaInRegion: Rate of various quota account statuses per quota
 
440
        // check.
 
441
        NoQuotaInRegion float64 `json:"noQuotaInRegion,omitempty"`
 
442
 
 
443
        // OutOfQuota: Rate of various quota account statuses per quota check.
 
444
        OutOfQuota float64 `json:"outOfQuota,omitempty"`
 
445
 
 
446
        // PixelMatchRequests: Average QPS for pixel match requests from
 
447
        // clients.
 
448
        PixelMatchRequests float64 `json:"pixelMatchRequests,omitempty"`
 
449
 
 
450
        // PixelMatchResponses: Average QPS for pixel match responses from
 
451
        // clients.
 
452
        PixelMatchResponses float64 `json:"pixelMatchResponses,omitempty"`
 
453
 
 
454
        // QuotaConfiguredLimit: The configured quota limits for this account.
 
455
        QuotaConfiguredLimit float64 `json:"quotaConfiguredLimit,omitempty"`
 
456
 
 
457
        // QuotaThrottledLimit: The throttled quota limits for this account.
 
458
        QuotaThrottledLimit float64 `json:"quotaThrottledLimit,omitempty"`
 
459
 
 
460
        // Region: The trading location of this data.
 
461
        Region string `json:"region,omitempty"`
 
462
 
 
463
        // Timestamp: The unix timestamp of the starting time of this
 
464
        // performance data.
 
465
        Timestamp int64 `json:"timestamp,omitempty,string"`
 
466
}
 
467
 
 
468
type PerformanceReportList struct {
 
469
        // Kind: Resource type.
 
470
        Kind string `json:"kind,omitempty"`
 
471
 
 
472
        // PerformanceReport: A list of performance reports relevant for the
 
473
        // account.
 
474
        PerformanceReport []*PerformanceReport `json:"performanceReport,omitempty"`
 
475
}
 
476
 
 
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
 
480
        // automatically.
 
481
        BillingId int64 `json:"billingId,omitempty,string"`
 
482
 
 
483
        // ConfigId: The config id; generated automatically. Leave this field
 
484
        // blank for insert requests.
 
485
        ConfigId int64 `json:"configId,omitempty,string"`
 
486
 
 
487
        // ConfigName: The name of the config. Must be unique. Required for all
 
488
        // requests.
 
489
        ConfigName string `json:"configName,omitempty"`
 
490
 
 
491
        // CreativeType: List must contain exactly one of
 
492
        // PRETARGETING_CREATIVE_TYPE_HTML or PRETARGETING_CREATIVE_TYPE_VIDEO.
 
493
        CreativeType []string `json:"creativeType,omitempty"`
 
494
 
 
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"`
 
498
 
 
499
        // ExcludedContentLabels: Requests with any of these content labels will
 
500
        // not match. Values are from content-labels.txt in the downloadable
 
501
        // files section.
 
502
        ExcludedContentLabels googleapi.Int64s `json:"excludedContentLabels,omitempty"`
 
503
 
 
504
        // ExcludedGeoCriteriaIds: Requests containing any of these geo criteria
 
505
        // ids will not match.
 
506
        ExcludedGeoCriteriaIds googleapi.Int64s `json:"excludedGeoCriteriaIds,omitempty"`
 
507
 
 
508
        // ExcludedPlacements: Requests containing any of these placements will
 
509
        // not match.
 
510
        ExcludedPlacements []*PretargetingConfigExcludedPlacements `json:"excludedPlacements,omitempty"`
 
511
 
 
512
        // ExcludedUserLists: Requests containing any of these users list ids
 
513
        // will not match.
 
514
        ExcludedUserLists googleapi.Int64s `json:"excludedUserLists,omitempty"`
 
515
 
 
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"`
 
520
 
 
521
        // GeoCriteriaIds: Requests containing any of these geo criteria ids
 
522
        // will match.
 
523
        GeoCriteriaIds googleapi.Int64s `json:"geoCriteriaIds,omitempty"`
 
524
 
 
525
        // IsActive: Whether this config is active. Required for all requests.
 
526
        IsActive bool `json:"isActive,omitempty"`
 
527
 
 
528
        // Kind: The kind of the resource, i.e.
 
529
        // "adexchangebuyer#pretargetingConfig".
 
530
        Kind string `json:"kind,omitempty"`
 
531
 
 
532
        // Languages: Request containing any of these language codes will match.
 
533
        Languages []string `json:"languages,omitempty"`
 
534
 
 
535
        // MobileCarriers: Requests containing any of these mobile carrier ids
 
536
        // will match. Values are from mobile-carriers.csv in the downloadable
 
537
        // files section.
 
538
        MobileCarriers googleapi.Int64s `json:"mobileCarriers,omitempty"`
 
539
 
 
540
        // MobileDevices: Requests containing any of these mobile device ids
 
541
        // will match. Values are from mobile-devices.csv in the downloadable
 
542
        // files section.
 
543
        MobileDevices googleapi.Int64s `json:"mobileDevices,omitempty"`
 
544
 
 
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"`
 
549
 
 
550
        // Placements: Requests containing any of these placements will match.
 
551
        Placements []*PretargetingConfigPlacements `json:"placements,omitempty"`
 
552
 
 
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"`
 
557
 
 
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
 
562
        // section.
 
563
        SupportedCreativeAttributes googleapi.Int64s `json:"supportedCreativeAttributes,omitempty"`
 
564
 
 
565
        // UserLists: Requests containing any of these user list ids will match.
 
566
        UserLists googleapi.Int64s `json:"userLists,omitempty"`
 
567
 
 
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"`
 
571
 
 
572
        // Verticals: Requests containing any of these vertical ids will match.
 
573
        Verticals googleapi.Int64s `json:"verticals,omitempty"`
 
574
}
 
575
 
 
576
type PretargetingConfigDimensions struct {
 
577
        // Height: Height in pixels.
 
578
        Height int64 `json:"height,omitempty,string"`
 
579
 
 
580
        // Width: Width in pixels.
 
581
        Width int64 `json:"width,omitempty,string"`
 
582
}
 
583
 
 
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"`
 
589
 
 
590
        // Type: The type of the placement.
 
591
        Type string `json:"type,omitempty"`
 
592
}
 
593
 
 
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"`
 
599
 
 
600
        // Type: The type of the placement.
 
601
        Type string `json:"type,omitempty"`
 
602
}
 
603
 
 
604
type PretargetingConfigList struct {
 
605
        // Items: A list of pretargeting configs
 
606
        Items []*PretargetingConfig `json:"items,omitempty"`
 
607
 
 
608
        // Kind: Resource type.
 
609
        Kind string `json:"kind,omitempty"`
 
610
}
 
611
 
 
612
// method id "adexchangebuyer.accounts.get":
 
613
 
 
614
type AccountsGetCall struct {
 
615
        s    *Service
 
616
        id   int64
 
617
        opt_ map[string]interface{}
 
618
}
 
619
 
 
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{})}
 
623
        c.id = id
 
624
        return c
 
625
}
 
626
 
 
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)
 
632
        return c
 
633
}
 
634
 
 
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))
 
641
        }
 
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),
 
647
        })
 
648
        req.Header.Set("User-Agent", "google-api-go-client/0.5")
 
649
        res, err := c.s.client.Do(req)
 
650
        if err != nil {
 
651
                return nil, err
 
652
        }
 
653
        defer googleapi.CloseBody(res)
 
654
        if err := googleapi.CheckResponse(res); err != nil {
 
655
                return nil, err
 
656
        }
 
657
        var ret *Account
 
658
        if err := json.NewDecoder(res.Body).Decode(&ret); err != nil {
 
659
                return nil, err
 
660
        }
 
661
        return ret, nil
 
662
        // {
 
663
        //   "description": "Gets one account by ID.",
 
664
        //   "httpMethod": "GET",
 
665
        //   "id": "adexchangebuyer.accounts.get",
 
666
        //   "parameterOrder": [
 
667
        //     "id"
 
668
        //   ],
 
669
        //   "parameters": {
 
670
        //     "id": {
 
671
        //       "description": "The account id",
 
672
        //       "format": "int32",
 
673
        //       "location": "path",
 
674
        //       "required": true,
 
675
        //       "type": "integer"
 
676
        //     }
 
677
        //   },
 
678
        //   "path": "accounts/{id}",
 
679
        //   "response": {
 
680
        //     "$ref": "Account"
 
681
        //   },
 
682
        //   "scopes": [
 
683
        //     "https://www.googleapis.com/auth/adexchange.buyer"
 
684
        //   ]
 
685
        // }
 
686
 
 
687
}
 
688
 
 
689
// method id "adexchangebuyer.accounts.list":
 
690
 
 
691
type AccountsListCall struct {
 
692
        s    *Service
 
693
        opt_ map[string]interface{}
 
694
}
 
695
 
 
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{})}
 
699
        return c
 
700
}
 
701
 
 
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)
 
707
        return c
 
708
}
 
709
 
 
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))
 
716
        }
 
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)
 
723
        if err != nil {
 
724
                return nil, err
 
725
        }
 
726
        defer googleapi.CloseBody(res)
 
727
        if err := googleapi.CheckResponse(res); err != nil {
 
728
                return nil, err
 
729
        }
 
730
        var ret *AccountsList
 
731
        if err := json.NewDecoder(res.Body).Decode(&ret); err != nil {
 
732
                return nil, err
 
733
        }
 
734
        return ret, nil
 
735
        // {
 
736
        //   "description": "Retrieves the authenticated user's list of accounts.",
 
737
        //   "httpMethod": "GET",
 
738
        //   "id": "adexchangebuyer.accounts.list",
 
739
        //   "path": "accounts",
 
740
        //   "response": {
 
741
        //     "$ref": "AccountsList"
 
742
        //   },
 
743
        //   "scopes": [
 
744
        //     "https://www.googleapis.com/auth/adexchange.buyer"
 
745
        //   ]
 
746
        // }
 
747
 
 
748
}
 
749
 
 
750
// method id "adexchangebuyer.accounts.patch":
 
751
 
 
752
type AccountsPatchCall struct {
 
753
        s       *Service
 
754
        id      int64
 
755
        account *Account
 
756
        opt_    map[string]interface{}
 
757
}
 
758
 
 
759
// Patch: Updates an existing account. This method supports patch
 
760
// semantics.
 
761
func (r *AccountsService) Patch(id int64, account *Account) *AccountsPatchCall {
 
762
        c := &AccountsPatchCall{s: r.s, opt_: make(map[string]interface{})}
 
763
        c.id = id
 
764
        c.account = account
 
765
        return c
 
766
}
 
767
 
 
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)
 
773
        return c
 
774
}
 
775
 
 
776
func (c *AccountsPatchCall) Do() (*Account, error) {
 
777
        var body io.Reader = nil
 
778
        body, err := googleapi.WithoutDataWrapper.JSONReader(c.account)
 
779
        if err != nil {
 
780
                return nil, err
 
781
        }
 
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))
 
787
        }
 
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),
 
793
        })
 
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)
 
797
        if err != nil {
 
798
                return nil, err
 
799
        }
 
800
        defer googleapi.CloseBody(res)
 
801
        if err := googleapi.CheckResponse(res); err != nil {
 
802
                return nil, err
 
803
        }
 
804
        var ret *Account
 
805
        if err := json.NewDecoder(res.Body).Decode(&ret); err != nil {
 
806
                return nil, err
 
807
        }
 
808
        return ret, nil
 
809
        // {
 
810
        //   "description": "Updates an existing account. This method supports patch semantics.",
 
811
        //   "httpMethod": "PATCH",
 
812
        //   "id": "adexchangebuyer.accounts.patch",
 
813
        //   "parameterOrder": [
 
814
        //     "id"
 
815
        //   ],
 
816
        //   "parameters": {
 
817
        //     "id": {
 
818
        //       "description": "The account id",
 
819
        //       "format": "int32",
 
820
        //       "location": "path",
 
821
        //       "required": true,
 
822
        //       "type": "integer"
 
823
        //     }
 
824
        //   },
 
825
        //   "path": "accounts/{id}",
 
826
        //   "request": {
 
827
        //     "$ref": "Account"
 
828
        //   },
 
829
        //   "response": {
 
830
        //     "$ref": "Account"
 
831
        //   },
 
832
        //   "scopes": [
 
833
        //     "https://www.googleapis.com/auth/adexchange.buyer"
 
834
        //   ]
 
835
        // }
 
836
 
 
837
}
 
838
 
 
839
// method id "adexchangebuyer.accounts.update":
 
840
 
 
841
type AccountsUpdateCall struct {
 
842
        s       *Service
 
843
        id      int64
 
844
        account *Account
 
845
        opt_    map[string]interface{}
 
846
}
 
847
 
 
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{})}
 
851
        c.id = id
 
852
        c.account = account
 
853
        return c
 
854
}
 
855
 
 
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)
 
861
        return c
 
862
}
 
863
 
 
864
func (c *AccountsUpdateCall) Do() (*Account, error) {
 
865
        var body io.Reader = nil
 
866
        body, err := googleapi.WithoutDataWrapper.JSONReader(c.account)
 
867
        if err != nil {
 
868
                return nil, err
 
869
        }
 
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))
 
875
        }
 
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),
 
881
        })
 
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)
 
885
        if err != nil {
 
886
                return nil, err
 
887
        }
 
888
        defer googleapi.CloseBody(res)
 
889
        if err := googleapi.CheckResponse(res); err != nil {
 
890
                return nil, err
 
891
        }
 
892
        var ret *Account
 
893
        if err := json.NewDecoder(res.Body).Decode(&ret); err != nil {
 
894
                return nil, err
 
895
        }
 
896
        return ret, nil
 
897
        // {
 
898
        //   "description": "Updates an existing account.",
 
899
        //   "httpMethod": "PUT",
 
900
        //   "id": "adexchangebuyer.accounts.update",
 
901
        //   "parameterOrder": [
 
902
        //     "id"
 
903
        //   ],
 
904
        //   "parameters": {
 
905
        //     "id": {
 
906
        //       "description": "The account id",
 
907
        //       "format": "int32",
 
908
        //       "location": "path",
 
909
        //       "required": true,
 
910
        //       "type": "integer"
 
911
        //     }
 
912
        //   },
 
913
        //   "path": "accounts/{id}",
 
914
        //   "request": {
 
915
        //     "$ref": "Account"
 
916
        //   },
 
917
        //   "response": {
 
918
        //     "$ref": "Account"
 
919
        //   },
 
920
        //   "scopes": [
 
921
        //     "https://www.googleapis.com/auth/adexchange.buyer"
 
922
        //   ]
 
923
        // }
 
924
 
 
925
}
 
926
 
 
927
// method id "adexchangebuyer.billingInfo.get":
 
928
 
 
929
type BillingInfoGetCall struct {
 
930
        s         *Service
 
931
        accountId int64
 
932
        opt_      map[string]interface{}
 
933
}
 
934
 
 
935
// Get: Returns the billing information for one account specified by
 
936
// account ID.
 
937
func (r *BillingInfoService) Get(accountId int64) *BillingInfoGetCall {
 
938
        c := &BillingInfoGetCall{s: r.s, opt_: make(map[string]interface{})}
 
939
        c.accountId = accountId
 
940
        return c
 
941
}
 
942
 
 
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)
 
948
        return c
 
949
}
 
950
 
 
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))
 
957
        }
 
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),
 
963
        })
 
964
        req.Header.Set("User-Agent", "google-api-go-client/0.5")
 
965
        res, err := c.s.client.Do(req)
 
966
        if err != nil {
 
967
                return nil, err
 
968
        }
 
969
        defer googleapi.CloseBody(res)
 
970
        if err := googleapi.CheckResponse(res); err != nil {
 
971
                return nil, err
 
972
        }
 
973
        var ret *BillingInfo
 
974
        if err := json.NewDecoder(res.Body).Decode(&ret); err != nil {
 
975
                return nil, err
 
976
        }
 
977
        return ret, nil
 
978
        // {
 
979
        //   "description": "Returns the billing information for one account specified by account ID.",
 
980
        //   "httpMethod": "GET",
 
981
        //   "id": "adexchangebuyer.billingInfo.get",
 
982
        //   "parameterOrder": [
 
983
        //     "accountId"
 
984
        //   ],
 
985
        //   "parameters": {
 
986
        //     "accountId": {
 
987
        //       "description": "The account id.",
 
988
        //       "format": "int32",
 
989
        //       "location": "path",
 
990
        //       "required": true,
 
991
        //       "type": "integer"
 
992
        //     }
 
993
        //   },
 
994
        //   "path": "billinginfo/{accountId}",
 
995
        //   "response": {
 
996
        //     "$ref": "BillingInfo"
 
997
        //   },
 
998
        //   "scopes": [
 
999
        //     "https://www.googleapis.com/auth/adexchange.buyer"
 
1000
        //   ]
 
1001
        // }
 
1002
 
 
1003
}
 
1004
 
 
1005
// method id "adexchangebuyer.billingInfo.list":
 
1006
 
 
1007
type BillingInfoListCall struct {
 
1008
        s    *Service
 
1009
        opt_ map[string]interface{}
 
1010
}
 
1011
 
 
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{})}
 
1016
        return c
 
1017
}
 
1018
 
 
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)
 
1024
        return c
 
1025
}
 
1026
 
 
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))
 
1033
        }
 
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)
 
1040
        if err != nil {
 
1041
                return nil, err
 
1042
        }
 
1043
        defer googleapi.CloseBody(res)
 
1044
        if err := googleapi.CheckResponse(res); err != nil {
 
1045
                return nil, err
 
1046
        }
 
1047
        var ret *BillingInfoList
 
1048
        if err := json.NewDecoder(res.Body).Decode(&ret); err != nil {
 
1049
                return nil, err
 
1050
        }
 
1051
        return ret, nil
 
1052
        // {
 
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",
 
1057
        //   "response": {
 
1058
        //     "$ref": "BillingInfoList"
 
1059
        //   },
 
1060
        //   "scopes": [
 
1061
        //     "https://www.googleapis.com/auth/adexchange.buyer"
 
1062
        //   ]
 
1063
        // }
 
1064
 
 
1065
}
 
1066
 
 
1067
// method id "adexchangebuyer.creatives.get":
 
1068
 
 
1069
type CreativesGetCall struct {
 
1070
        s               *Service
 
1071
        accountId       int64
 
1072
        buyerCreativeId string
 
1073
        opt_            map[string]interface{}
 
1074
}
 
1075
 
 
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
 
1082
        return c
 
1083
}
 
1084
 
 
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)
 
1090
        return c
 
1091
}
 
1092
 
 
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))
 
1099
        }
 
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,
 
1106
        })
 
1107
        req.Header.Set("User-Agent", "google-api-go-client/0.5")
 
1108
        res, err := c.s.client.Do(req)
 
1109
        if err != nil {
 
1110
                return nil, err
 
1111
        }
 
1112
        defer googleapi.CloseBody(res)
 
1113
        if err := googleapi.CheckResponse(res); err != nil {
 
1114
                return nil, err
 
1115
        }
 
1116
        var ret *Creative
 
1117
        if err := json.NewDecoder(res.Body).Decode(&ret); err != nil {
 
1118
                return nil, err
 
1119
        }
 
1120
        return ret, nil
 
1121
        // {
 
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": [
 
1126
        //     "accountId",
 
1127
        //     "buyerCreativeId"
 
1128
        //   ],
 
1129
        //   "parameters": {
 
1130
        //     "accountId": {
 
1131
        //       "description": "The id for the account that will serve this creative.",
 
1132
        //       "format": "int32",
 
1133
        //       "location": "path",
 
1134
        //       "required": true,
 
1135
        //       "type": "integer"
 
1136
        //     },
 
1137
        //     "buyerCreativeId": {
 
1138
        //       "description": "The buyer-specific id for this creative.",
 
1139
        //       "location": "path",
 
1140
        //       "required": true,
 
1141
        //       "type": "string"
 
1142
        //     }
 
1143
        //   },
 
1144
        //   "path": "creatives/{accountId}/{buyerCreativeId}",
 
1145
        //   "response": {
 
1146
        //     "$ref": "Creative"
 
1147
        //   },
 
1148
        //   "scopes": [
 
1149
        //     "https://www.googleapis.com/auth/adexchange.buyer"
 
1150
        //   ]
 
1151
        // }
 
1152
 
 
1153
}
 
1154
 
 
1155
// method id "adexchangebuyer.creatives.insert":
 
1156
 
 
1157
type CreativesInsertCall struct {
 
1158
        s        *Service
 
1159
        creative *Creative
 
1160
        opt_     map[string]interface{}
 
1161
}
 
1162
 
 
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
 
1167
        return c
 
1168
}
 
1169
 
 
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)
 
1175
        return c
 
1176
}
 
1177
 
 
1178
func (c *CreativesInsertCall) Do() (*Creative, error) {
 
1179
        var body io.Reader = nil
 
1180
        body, err := googleapi.WithoutDataWrapper.JSONReader(c.creative)
 
1181
        if err != nil {
 
1182
                return nil, err
 
1183
        }
 
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))
 
1189
        }
 
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)
 
1197
        if err != nil {
 
1198
                return nil, err
 
1199
        }
 
1200
        defer googleapi.CloseBody(res)
 
1201
        if err := googleapi.CheckResponse(res); err != nil {
 
1202
                return nil, err
 
1203
        }
 
1204
        var ret *Creative
 
1205
        if err := json.NewDecoder(res.Body).Decode(&ret); err != nil {
 
1206
                return nil, err
 
1207
        }
 
1208
        return ret, nil
 
1209
        // {
 
1210
        //   "description": "Submit a new creative.",
 
1211
        //   "httpMethod": "POST",
 
1212
        //   "id": "adexchangebuyer.creatives.insert",
 
1213
        //   "path": "creatives",
 
1214
        //   "request": {
 
1215
        //     "$ref": "Creative"
 
1216
        //   },
 
1217
        //   "response": {
 
1218
        //     "$ref": "Creative"
 
1219
        //   },
 
1220
        //   "scopes": [
 
1221
        //     "https://www.googleapis.com/auth/adexchange.buyer"
 
1222
        //   ]
 
1223
        // }
 
1224
 
 
1225
}
 
1226
 
 
1227
// method id "adexchangebuyer.creatives.list":
 
1228
 
 
1229
type CreativesListCall struct {
 
1230
        s    *Service
 
1231
        opt_ map[string]interface{}
 
1232
}
 
1233
 
 
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{})}
 
1238
        return c
 
1239
}
 
1240
 
 
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
 
1245
        return c
 
1246
}
 
1247
 
 
1248
// BuyerCreativeId sets the optional parameter "buyerCreativeId": When
 
1249
// specified, only creatives for the given buyer creative ids are
 
1250
// returned.
 
1251
func (c *CreativesListCall) BuyerCreativeId(buyerCreativeId string) *CreativesListCall {
 
1252
        c.opt_["buyerCreativeId"] = buyerCreativeId
 
1253
        return c
 
1254
}
 
1255
 
 
1256
// MaxResults sets the optional parameter "maxResults": Maximum number
 
1257
// of entries returned on one result page. If not set, the default is
 
1258
// 100.
 
1259
func (c *CreativesListCall) MaxResults(maxResults int64) *CreativesListCall {
 
1260
        c.opt_["maxResults"] = maxResults
 
1261
        return c
 
1262
}
 
1263
 
 
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
 
1267
// response.
 
1268
func (c *CreativesListCall) PageToken(pageToken string) *CreativesListCall {
 
1269
        c.opt_["pageToken"] = pageToken
 
1270
        return c
 
1271
}
 
1272
 
 
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
 
1277
        return c
 
1278
}
 
1279
 
 
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)
 
1285
        return c
 
1286
}
 
1287
 
 
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))
 
1294
        }
 
1295
        if v, ok := c.opt_["buyerCreativeId"]; ok {
 
1296
                params.Set("buyerCreativeId", fmt.Sprintf("%v", v))
 
1297
        }
 
1298
        if v, ok := c.opt_["maxResults"]; ok {
 
1299
                params.Set("maxResults", fmt.Sprintf("%v", v))
 
1300
        }
 
1301
        if v, ok := c.opt_["pageToken"]; ok {
 
1302
                params.Set("pageToken", fmt.Sprintf("%v", v))
 
1303
        }
 
1304
        if v, ok := c.opt_["statusFilter"]; ok {
 
1305
                params.Set("statusFilter", fmt.Sprintf("%v", v))
 
1306
        }
 
1307
        if v, ok := c.opt_["fields"]; ok {
 
1308
                params.Set("fields", fmt.Sprintf("%v", v))
 
1309
        }
 
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)
 
1316
        if err != nil {
 
1317
                return nil, err
 
1318
        }
 
1319
        defer googleapi.CloseBody(res)
 
1320
        if err := googleapi.CheckResponse(res); err != nil {
 
1321
                return nil, err
 
1322
        }
 
1323
        var ret *CreativesList
 
1324
        if err := json.NewDecoder(res.Body).Decode(&ret); err != nil {
 
1325
                return nil, err
 
1326
        }
 
1327
        return ret, nil
 
1328
        // {
 
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",
 
1332
        //   "parameters": {
 
1333
        //     "accountId": {
 
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"
 
1339
        //     },
 
1340
        //     "buyerCreativeId": {
 
1341
        //       "description": "When specified, only creatives for the given buyer creative ids are returned.",
 
1342
        //       "location": "query",
 
1343
        //       "repeated": true,
 
1344
        //       "type": "string"
 
1345
        //     },
 
1346
        //     "maxResults": {
 
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",
 
1351
        //       "minimum": "1",
 
1352
        //       "type": "integer"
 
1353
        //     },
 
1354
        //     "pageToken": {
 
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",
 
1357
        //       "type": "string"
 
1358
        //     },
 
1359
        //     "statusFilter": {
 
1360
        //       "description": "When specified, only creatives having the given status are returned.",
 
1361
        //       "enum": [
 
1362
        //         "approved",
 
1363
        //         "disapproved",
 
1364
        //         "not_checked"
 
1365
        //       ],
 
1366
        //       "enumDescriptions": [
 
1367
        //         "Creatives which have been approved.",
 
1368
        //         "Creatives which have been disapproved.",
 
1369
        //         "Creatives whose status is not yet checked."
 
1370
        //       ],
 
1371
        //       "location": "query",
 
1372
        //       "type": "string"
 
1373
        //     }
 
1374
        //   },
 
1375
        //   "path": "creatives",
 
1376
        //   "response": {
 
1377
        //     "$ref": "CreativesList"
 
1378
        //   },
 
1379
        //   "scopes": [
 
1380
        //     "https://www.googleapis.com/auth/adexchange.buyer"
 
1381
        //   ]
 
1382
        // }
 
1383
 
 
1384
}
 
1385
 
 
1386
// method id "adexchangebuyer.directDeals.get":
 
1387
 
 
1388
type DirectDealsGetCall struct {
 
1389
        s    *Service
 
1390
        id   int64
 
1391
        opt_ map[string]interface{}
 
1392
}
 
1393
 
 
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{})}
 
1397
        c.id = id
 
1398
        return c
 
1399
}
 
1400
 
 
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)
 
1406
        return c
 
1407
}
 
1408
 
 
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))
 
1415
        }
 
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),
 
1421
        })
 
1422
        req.Header.Set("User-Agent", "google-api-go-client/0.5")
 
1423
        res, err := c.s.client.Do(req)
 
1424
        if err != nil {
 
1425
                return nil, err
 
1426
        }
 
1427
        defer googleapi.CloseBody(res)
 
1428
        if err := googleapi.CheckResponse(res); err != nil {
 
1429
                return nil, err
 
1430
        }
 
1431
        var ret *DirectDeal
 
1432
        if err := json.NewDecoder(res.Body).Decode(&ret); err != nil {
 
1433
                return nil, err
 
1434
        }
 
1435
        return ret, nil
 
1436
        // {
 
1437
        //   "description": "Gets one direct deal by ID.",
 
1438
        //   "httpMethod": "GET",
 
1439
        //   "id": "adexchangebuyer.directDeals.get",
 
1440
        //   "parameterOrder": [
 
1441
        //     "id"
 
1442
        //   ],
 
1443
        //   "parameters": {
 
1444
        //     "id": {
 
1445
        //       "description": "The direct deal id",
 
1446
        //       "format": "int64",
 
1447
        //       "location": "path",
 
1448
        //       "required": true,
 
1449
        //       "type": "string"
 
1450
        //     }
 
1451
        //   },
 
1452
        //   "path": "directdeals/{id}",
 
1453
        //   "response": {
 
1454
        //     "$ref": "DirectDeal"
 
1455
        //   },
 
1456
        //   "scopes": [
 
1457
        //     "https://www.googleapis.com/auth/adexchange.buyer"
 
1458
        //   ]
 
1459
        // }
 
1460
 
 
1461
}
 
1462
 
 
1463
// method id "adexchangebuyer.directDeals.list":
 
1464
 
 
1465
type DirectDealsListCall struct {
 
1466
        s    *Service
 
1467
        opt_ map[string]interface{}
 
1468
}
 
1469
 
 
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{})}
 
1473
        return c
 
1474
}
 
1475
 
 
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)
 
1481
        return c
 
1482
}
 
1483
 
 
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))
 
1490
        }
 
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)
 
1497
        if err != nil {
 
1498
                return nil, err
 
1499
        }
 
1500
        defer googleapi.CloseBody(res)
 
1501
        if err := googleapi.CheckResponse(res); err != nil {
 
1502
                return nil, err
 
1503
        }
 
1504
        var ret *DirectDealsList
 
1505
        if err := json.NewDecoder(res.Body).Decode(&ret); err != nil {
 
1506
                return nil, err
 
1507
        }
 
1508
        return ret, nil
 
1509
        // {
 
1510
        //   "description": "Retrieves the authenticated user's list of direct deals.",
 
1511
        //   "httpMethod": "GET",
 
1512
        //   "id": "adexchangebuyer.directDeals.list",
 
1513
        //   "path": "directdeals",
 
1514
        //   "response": {
 
1515
        //     "$ref": "DirectDealsList"
 
1516
        //   },
 
1517
        //   "scopes": [
 
1518
        //     "https://www.googleapis.com/auth/adexchange.buyer"
 
1519
        //   ]
 
1520
        // }
 
1521
 
 
1522
}
 
1523
 
 
1524
// method id "adexchangebuyer.performanceReport.list":
 
1525
 
 
1526
type PerformanceReportListCall struct {
 
1527
        s             *Service
 
1528
        accountId     int64
 
1529
        endDateTime   string
 
1530
        startDateTime string
 
1531
        opt_          map[string]interface{}
 
1532
}
 
1533
 
 
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
 
1540
        return c
 
1541
}
 
1542
 
 
1543
// MaxResults sets the optional parameter "maxResults": Maximum number
 
1544
// of entries returned on one result page. If not set, the default is
 
1545
// 100.
 
1546
func (c *PerformanceReportListCall) MaxResults(maxResults int64) *PerformanceReportListCall {
 
1547
        c.opt_["maxResults"] = maxResults
 
1548
        return c
 
1549
}
 
1550
 
 
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
 
1557
        return c
 
1558
}
 
1559
 
 
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)
 
1565
        return c
 
1566
}
 
1567
 
 
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))
 
1577
        }
 
1578
        if v, ok := c.opt_["pageToken"]; ok {
 
1579
                params.Set("pageToken", fmt.Sprintf("%v", v))
 
1580
        }
 
1581
        if v, ok := c.opt_["fields"]; ok {
 
1582
                params.Set("fields", fmt.Sprintf("%v", v))
 
1583
        }
 
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)
 
1590
        if err != nil {
 
1591
                return nil, err
 
1592
        }
 
1593
        defer googleapi.CloseBody(res)
 
1594
        if err := googleapi.CheckResponse(res); err != nil {
 
1595
                return nil, err
 
1596
        }
 
1597
        var ret *PerformanceReportList
 
1598
        if err := json.NewDecoder(res.Body).Decode(&ret); err != nil {
 
1599
                return nil, err
 
1600
        }
 
1601
        return ret, nil
 
1602
        // {
 
1603
        //   "description": "Retrieves the authenticated user's list of performance metrics.",
 
1604
        //   "httpMethod": "GET",
 
1605
        //   "id": "adexchangebuyer.performanceReport.list",
 
1606
        //   "parameterOrder": [
 
1607
        //     "accountId",
 
1608
        //     "endDateTime",
 
1609
        //     "startDateTime"
 
1610
        //   ],
 
1611
        //   "parameters": {
 
1612
        //     "accountId": {
 
1613
        //       "description": "The account id to get the reports.",
 
1614
        //       "format": "int64",
 
1615
        //       "location": "query",
 
1616
        //       "required": true,
 
1617
        //       "type": "string"
 
1618
        //     },
 
1619
        //     "endDateTime": {
 
1620
        //       "description": "The end time of the report in ISO 8601 timestamp format using UTC.",
 
1621
        //       "location": "query",
 
1622
        //       "required": true,
 
1623
        //       "type": "string"
 
1624
        //     },
 
1625
        //     "maxResults": {
 
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",
 
1630
        //       "minimum": "1",
 
1631
        //       "type": "integer"
 
1632
        //     },
 
1633
        //     "pageToken": {
 
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",
 
1636
        //       "type": "string"
 
1637
        //     },
 
1638
        //     "startDateTime": {
 
1639
        //       "description": "The start time of the report in ISO 8601 timestamp format using UTC.",
 
1640
        //       "location": "query",
 
1641
        //       "required": true,
 
1642
        //       "type": "string"
 
1643
        //     }
 
1644
        //   },
 
1645
        //   "path": "performancereport",
 
1646
        //   "response": {
 
1647
        //     "$ref": "PerformanceReportList"
 
1648
        //   },
 
1649
        //   "scopes": [
 
1650
        //     "https://www.googleapis.com/auth/adexchange.buyer"
 
1651
        //   ]
 
1652
        // }
 
1653
 
 
1654
}
 
1655
 
 
1656
// method id "adexchangebuyer.pretargetingConfig.delete":
 
1657
 
 
1658
type PretargetingConfigDeleteCall struct {
 
1659
        s         *Service
 
1660
        accountId int64
 
1661
        configId  int64
 
1662
        opt_      map[string]interface{}
 
1663
}
 
1664
 
 
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
 
1670
        return c
 
1671
}
 
1672
 
 
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)
 
1678
        return c
 
1679
}
 
1680
 
 
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))
 
1687
        }
 
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),
 
1694
        })
 
1695
        req.Header.Set("User-Agent", "google-api-go-client/0.5")
 
1696
        res, err := c.s.client.Do(req)
 
1697
        if err != nil {
 
1698
                return err
 
1699
        }
 
1700
        defer googleapi.CloseBody(res)
 
1701
        if err := googleapi.CheckResponse(res); err != nil {
 
1702
                return err
 
1703
        }
 
1704
        return nil
 
1705
        // {
 
1706
        //   "description": "Deletes an existing pretargeting config.",
 
1707
        //   "httpMethod": "DELETE",
 
1708
        //   "id": "adexchangebuyer.pretargetingConfig.delete",
 
1709
        //   "parameterOrder": [
 
1710
        //     "accountId",
 
1711
        //     "configId"
 
1712
        //   ],
 
1713
        //   "parameters": {
 
1714
        //     "accountId": {
 
1715
        //       "description": "The account id to delete the pretargeting config for.",
 
1716
        //       "format": "int64",
 
1717
        //       "location": "path",
 
1718
        //       "required": true,
 
1719
        //       "type": "string"
 
1720
        //     },
 
1721
        //     "configId": {
 
1722
        //       "description": "The specific id of the configuration to delete.",
 
1723
        //       "format": "int64",
 
1724
        //       "location": "path",
 
1725
        //       "required": true,
 
1726
        //       "type": "string"
 
1727
        //     }
 
1728
        //   },
 
1729
        //   "path": "pretargetingconfigs/{accountId}/{configId}",
 
1730
        //   "scopes": [
 
1731
        //     "https://www.googleapis.com/auth/adexchange.buyer"
 
1732
        //   ]
 
1733
        // }
 
1734
 
 
1735
}
 
1736
 
 
1737
// method id "adexchangebuyer.pretargetingConfig.get":
 
1738
 
 
1739
type PretargetingConfigGetCall struct {
 
1740
        s         *Service
 
1741
        accountId int64
 
1742
        configId  int64
 
1743
        opt_      map[string]interface{}
 
1744
}
 
1745
 
 
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
 
1751
        return c
 
1752
}
 
1753
 
 
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)
 
1759
        return c
 
1760
}
 
1761
 
 
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))
 
1768
        }
 
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),
 
1775
        })
 
1776
        req.Header.Set("User-Agent", "google-api-go-client/0.5")
 
1777
        res, err := c.s.client.Do(req)
 
1778
        if err != nil {
 
1779
                return nil, err
 
1780
        }
 
1781
        defer googleapi.CloseBody(res)
 
1782
        if err := googleapi.CheckResponse(res); err != nil {
 
1783
                return nil, err
 
1784
        }
 
1785
        var ret *PretargetingConfig
 
1786
        if err := json.NewDecoder(res.Body).Decode(&ret); err != nil {
 
1787
                return nil, err
 
1788
        }
 
1789
        return ret, nil
 
1790
        // {
 
1791
        //   "description": "Gets a specific pretargeting configuration",
 
1792
        //   "httpMethod": "GET",
 
1793
        //   "id": "adexchangebuyer.pretargetingConfig.get",
 
1794
        //   "parameterOrder": [
 
1795
        //     "accountId",
 
1796
        //     "configId"
 
1797
        //   ],
 
1798
        //   "parameters": {
 
1799
        //     "accountId": {
 
1800
        //       "description": "The account id to get the pretargeting config for.",
 
1801
        //       "format": "int64",
 
1802
        //       "location": "path",
 
1803
        //       "required": true,
 
1804
        //       "type": "string"
 
1805
        //     },
 
1806
        //     "configId": {
 
1807
        //       "description": "The specific id of the configuration to retrieve.",
 
1808
        //       "format": "int64",
 
1809
        //       "location": "path",
 
1810
        //       "required": true,
 
1811
        //       "type": "string"
 
1812
        //     }
 
1813
        //   },
 
1814
        //   "path": "pretargetingconfigs/{accountId}/{configId}",
 
1815
        //   "response": {
 
1816
        //     "$ref": "PretargetingConfig"
 
1817
        //   },
 
1818
        //   "scopes": [
 
1819
        //     "https://www.googleapis.com/auth/adexchange.buyer"
 
1820
        //   ]
 
1821
        // }
 
1822
 
 
1823
}
 
1824
 
 
1825
// method id "adexchangebuyer.pretargetingConfig.insert":
 
1826
 
 
1827
type PretargetingConfigInsertCall struct {
 
1828
        s                  *Service
 
1829
        accountId          int64
 
1830
        pretargetingconfig *PretargetingConfig
 
1831
        opt_               map[string]interface{}
 
1832
}
 
1833
 
 
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
 
1839
        return c
 
1840
}
 
1841
 
 
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)
 
1847
        return c
 
1848
}
 
1849
 
 
1850
func (c *PretargetingConfigInsertCall) Do() (*PretargetingConfig, error) {
 
1851
        var body io.Reader = nil
 
1852
        body, err := googleapi.WithoutDataWrapper.JSONReader(c.pretargetingconfig)
 
1853
        if err != nil {
 
1854
                return nil, err
 
1855
        }
 
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))
 
1861
        }
 
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),
 
1867
        })
 
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)
 
1871
        if err != nil {
 
1872
                return nil, err
 
1873
        }
 
1874
        defer googleapi.CloseBody(res)
 
1875
        if err := googleapi.CheckResponse(res); err != nil {
 
1876
                return nil, err
 
1877
        }
 
1878
        var ret *PretargetingConfig
 
1879
        if err := json.NewDecoder(res.Body).Decode(&ret); err != nil {
 
1880
                return nil, err
 
1881
        }
 
1882
        return ret, nil
 
1883
        // {
 
1884
        //   "description": "Inserts a new pretargeting configuration.",
 
1885
        //   "httpMethod": "POST",
 
1886
        //   "id": "adexchangebuyer.pretargetingConfig.insert",
 
1887
        //   "parameterOrder": [
 
1888
        //     "accountId"
 
1889
        //   ],
 
1890
        //   "parameters": {
 
1891
        //     "accountId": {
 
1892
        //       "description": "The account id to insert the pretargeting config for.",
 
1893
        //       "format": "int64",
 
1894
        //       "location": "path",
 
1895
        //       "required": true,
 
1896
        //       "type": "string"
 
1897
        //     }
 
1898
        //   },
 
1899
        //   "path": "pretargetingconfigs/{accountId}",
 
1900
        //   "request": {
 
1901
        //     "$ref": "PretargetingConfig"
 
1902
        //   },
 
1903
        //   "response": {
 
1904
        //     "$ref": "PretargetingConfig"
 
1905
        //   },
 
1906
        //   "scopes": [
 
1907
        //     "https://www.googleapis.com/auth/adexchange.buyer"
 
1908
        //   ]
 
1909
        // }
 
1910
 
 
1911
}
 
1912
 
 
1913
// method id "adexchangebuyer.pretargetingConfig.list":
 
1914
 
 
1915
type PretargetingConfigListCall struct {
 
1916
        s         *Service
 
1917
        accountId int64
 
1918
        opt_      map[string]interface{}
 
1919
}
 
1920
 
 
1921
// List: Retrieves a list of the authenticated user's pretargeting
 
1922
// configurations.
 
1923
func (r *PretargetingConfigService) List(accountId int64) *PretargetingConfigListCall {
 
1924
        c := &PretargetingConfigListCall{s: r.s, opt_: make(map[string]interface{})}
 
1925
        c.accountId = accountId
 
1926
        return c
 
1927
}
 
1928
 
 
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)
 
1934
        return c
 
1935
}
 
1936
 
 
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))
 
1943
        }
 
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),
 
1949
        })
 
1950
        req.Header.Set("User-Agent", "google-api-go-client/0.5")
 
1951
        res, err := c.s.client.Do(req)
 
1952
        if err != nil {
 
1953
                return nil, err
 
1954
        }
 
1955
        defer googleapi.CloseBody(res)
 
1956
        if err := googleapi.CheckResponse(res); err != nil {
 
1957
                return nil, err
 
1958
        }
 
1959
        var ret *PretargetingConfigList
 
1960
        if err := json.NewDecoder(res.Body).Decode(&ret); err != nil {
 
1961
                return nil, err
 
1962
        }
 
1963
        return ret, nil
 
1964
        // {
 
1965
        //   "description": "Retrieves a list of the authenticated user's pretargeting configurations.",
 
1966
        //   "httpMethod": "GET",
 
1967
        //   "id": "adexchangebuyer.pretargetingConfig.list",
 
1968
        //   "parameterOrder": [
 
1969
        //     "accountId"
 
1970
        //   ],
 
1971
        //   "parameters": {
 
1972
        //     "accountId": {
 
1973
        //       "description": "The account id to get the pretargeting configs for.",
 
1974
        //       "format": "int64",
 
1975
        //       "location": "path",
 
1976
        //       "required": true,
 
1977
        //       "type": "string"
 
1978
        //     }
 
1979
        //   },
 
1980
        //   "path": "pretargetingconfigs/{accountId}",
 
1981
        //   "response": {
 
1982
        //     "$ref": "PretargetingConfigList"
 
1983
        //   },
 
1984
        //   "scopes": [
 
1985
        //     "https://www.googleapis.com/auth/adexchange.buyer"
 
1986
        //   ]
 
1987
        // }
 
1988
 
 
1989
}
 
1990
 
 
1991
// method id "adexchangebuyer.pretargetingConfig.patch":
 
1992
 
 
1993
type PretargetingConfigPatchCall struct {
 
1994
        s                  *Service
 
1995
        accountId          int64
 
1996
        configId           int64
 
1997
        pretargetingconfig *PretargetingConfig
 
1998
        opt_               map[string]interface{}
 
1999
}
 
2000
 
 
2001
// Patch: Updates an existing pretargeting config. This method supports
 
2002
// patch semantics.
 
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
 
2008
        return c
 
2009
}
 
2010
 
 
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)
 
2016
        return c
 
2017
}
 
2018
 
 
2019
func (c *PretargetingConfigPatchCall) Do() (*PretargetingConfig, error) {
 
2020
        var body io.Reader = nil
 
2021
        body, err := googleapi.WithoutDataWrapper.JSONReader(c.pretargetingconfig)
 
2022
        if err != nil {
 
2023
                return nil, err
 
2024
        }
 
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))
 
2030
        }
 
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),
 
2037
        })
 
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)
 
2041
        if err != nil {
 
2042
                return nil, err
 
2043
        }
 
2044
        defer googleapi.CloseBody(res)
 
2045
        if err := googleapi.CheckResponse(res); err != nil {
 
2046
                return nil, err
 
2047
        }
 
2048
        var ret *PretargetingConfig
 
2049
        if err := json.NewDecoder(res.Body).Decode(&ret); err != nil {
 
2050
                return nil, err
 
2051
        }
 
2052
        return ret, nil
 
2053
        // {
 
2054
        //   "description": "Updates an existing pretargeting config. This method supports patch semantics.",
 
2055
        //   "httpMethod": "PATCH",
 
2056
        //   "id": "adexchangebuyer.pretargetingConfig.patch",
 
2057
        //   "parameterOrder": [
 
2058
        //     "accountId",
 
2059
        //     "configId"
 
2060
        //   ],
 
2061
        //   "parameters": {
 
2062
        //     "accountId": {
 
2063
        //       "description": "The account id to update the pretargeting config for.",
 
2064
        //       "format": "int64",
 
2065
        //       "location": "path",
 
2066
        //       "required": true,
 
2067
        //       "type": "string"
 
2068
        //     },
 
2069
        //     "configId": {
 
2070
        //       "description": "The specific id of the configuration to update.",
 
2071
        //       "format": "int64",
 
2072
        //       "location": "path",
 
2073
        //       "required": true,
 
2074
        //       "type": "string"
 
2075
        //     }
 
2076
        //   },
 
2077
        //   "path": "pretargetingconfigs/{accountId}/{configId}",
 
2078
        //   "request": {
 
2079
        //     "$ref": "PretargetingConfig"
 
2080
        //   },
 
2081
        //   "response": {
 
2082
        //     "$ref": "PretargetingConfig"
 
2083
        //   },
 
2084
        //   "scopes": [
 
2085
        //     "https://www.googleapis.com/auth/adexchange.buyer"
 
2086
        //   ]
 
2087
        // }
 
2088
 
 
2089
}
 
2090
 
 
2091
// method id "adexchangebuyer.pretargetingConfig.update":
 
2092
 
 
2093
type PretargetingConfigUpdateCall struct {
 
2094
        s                  *Service
 
2095
        accountId          int64
 
2096
        configId           int64
 
2097
        pretargetingconfig *PretargetingConfig
 
2098
        opt_               map[string]interface{}
 
2099
}
 
2100
 
 
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
 
2107
        return c
 
2108
}
 
2109
 
 
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)
 
2115
        return c
 
2116
}
 
2117
 
 
2118
func (c *PretargetingConfigUpdateCall) Do() (*PretargetingConfig, error) {
 
2119
        var body io.Reader = nil
 
2120
        body, err := googleapi.WithoutDataWrapper.JSONReader(c.pretargetingconfig)
 
2121
        if err != nil {
 
2122
                return nil, err
 
2123
        }
 
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))
 
2129
        }
 
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),
 
2136
        })
 
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)
 
2140
        if err != nil {
 
2141
                return nil, err
 
2142
        }
 
2143
        defer googleapi.CloseBody(res)
 
2144
        if err := googleapi.CheckResponse(res); err != nil {
 
2145
                return nil, err
 
2146
        }
 
2147
        var ret *PretargetingConfig
 
2148
        if err := json.NewDecoder(res.Body).Decode(&ret); err != nil {
 
2149
                return nil, err
 
2150
        }
 
2151
        return ret, nil
 
2152
        // {
 
2153
        //   "description": "Updates an existing pretargeting config.",
 
2154
        //   "httpMethod": "PUT",
 
2155
        //   "id": "adexchangebuyer.pretargetingConfig.update",
 
2156
        //   "parameterOrder": [
 
2157
        //     "accountId",
 
2158
        //     "configId"
 
2159
        //   ],
 
2160
        //   "parameters": {
 
2161
        //     "accountId": {
 
2162
        //       "description": "The account id to update the pretargeting config for.",
 
2163
        //       "format": "int64",
 
2164
        //       "location": "path",
 
2165
        //       "required": true,
 
2166
        //       "type": "string"
 
2167
        //     },
 
2168
        //     "configId": {
 
2169
        //       "description": "The specific id of the configuration to update.",
 
2170
        //       "format": "int64",
 
2171
        //       "location": "path",
 
2172
        //       "required": true,
 
2173
        //       "type": "string"
 
2174
        //     }
 
2175
        //   },
 
2176
        //   "path": "pretargetingconfigs/{accountId}/{configId}",
 
2177
        //   "request": {
 
2178
        //     "$ref": "PretargetingConfig"
 
2179
        //   },
 
2180
        //   "response": {
 
2181
        //     "$ref": "PretargetingConfig"
 
2182
        //   },
 
2183
        //   "scopes": [
 
2184
        //     "https://www.googleapis.com/auth/adexchange.buyer"
 
2185
        //   ]
 
2186
        // }
 
2187
 
 
2188
}