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