forked from distribution/distribution
/
gan-gen.go
3722 lines (3321 loc) · 125 KB
/
gan-gen.go
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
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
// Package gan provides access to the Google Affiliate Network API.
//
// See https://developers.google.com/affiliate-network/
//
// Usage example:
//
// import "google.golang.org/api/gan/v1beta1"
// ...
// ganService, err := gan.New(oauthHttpClient)
package gan // import "google.golang.org/api/gan/v1beta1"
import (
"bytes"
"encoding/json"
"errors"
"fmt"
"golang.org/x/net/context"
"golang.org/x/net/context/ctxhttp"
"google.golang.org/api/googleapi"
"google.golang.org/api/internal"
"io"
"net/http"
"net/url"
"strconv"
"strings"
)
// Always reference these packages, just in case the auto-generated code
// below doesn't.
var _ = bytes.NewBuffer
var _ = strconv.Itoa
var _ = fmt.Sprintf
var _ = json.NewDecoder
var _ = io.Copy
var _ = url.Parse
var _ = googleapi.Version
var _ = errors.New
var _ = strings.Replace
var _ = internal.MarshalJSON
var _ = context.Canceled
var _ = ctxhttp.Do
const apiId = "gan:v1beta1"
const apiName = "gan"
const apiVersion = "v1beta1"
const basePath = "https://www.googleapis.com/gan/v1beta1/"
func New(client *http.Client) (*Service, error) {
if client == nil {
return nil, errors.New("client is nil")
}
s := &Service{client: client, BasePath: basePath}
s.Advertisers = NewAdvertisersService(s)
s.CcOffers = NewCcOffersService(s)
s.Events = NewEventsService(s)
s.Links = NewLinksService(s)
s.Publishers = NewPublishersService(s)
s.Reports = NewReportsService(s)
return s, nil
}
type Service struct {
client *http.Client
BasePath string // API endpoint base URL
UserAgent string // optional additional User-Agent fragment
Advertisers *AdvertisersService
CcOffers *CcOffersService
Events *EventsService
Links *LinksService
Publishers *PublishersService
Reports *ReportsService
}
func (s *Service) userAgent() string {
if s.UserAgent == "" {
return googleapi.UserAgent
}
return googleapi.UserAgent + " " + s.UserAgent
}
func NewAdvertisersService(s *Service) *AdvertisersService {
rs := &AdvertisersService{s: s}
return rs
}
type AdvertisersService struct {
s *Service
}
func NewCcOffersService(s *Service) *CcOffersService {
rs := &CcOffersService{s: s}
return rs
}
type CcOffersService struct {
s *Service
}
func NewEventsService(s *Service) *EventsService {
rs := &EventsService{s: s}
return rs
}
type EventsService struct {
s *Service
}
func NewLinksService(s *Service) *LinksService {
rs := &LinksService{s: s}
return rs
}
type LinksService struct {
s *Service
}
func NewPublishersService(s *Service) *PublishersService {
rs := &PublishersService{s: s}
return rs
}
type PublishersService struct {
s *Service
}
func NewReportsService(s *Service) *ReportsService {
rs := &ReportsService{s: s}
return rs
}
type ReportsService struct {
s *Service
}
// Advertiser: An AdvertiserResource.
type Advertiser struct {
// AllowPublisherCreatedLinks: True if the advertiser allows publisher
// created links, otherwise false.
AllowPublisherCreatedLinks bool `json:"allowPublisherCreatedLinks,omitempty"`
// Category: Category that this advertiser belongs to. A valid list of
// categories can be found here:
// http://www.google.com/support/affiliatenetwork/advertiser/bin/answer.py?hl=en&answer=107581
Category string `json:"category,omitempty"`
// CommissionDuration: The longest possible length of a commission (how
// long the cookies on the customer's browser last before they expire).
CommissionDuration int64 `json:"commissionDuration,omitempty"`
// ContactEmail: Email that this advertiser would like publishers to
// contact them with.
ContactEmail string `json:"contactEmail,omitempty"`
// ContactPhone: Phone that this advertiser would like publishers to
// contact them with.
ContactPhone string `json:"contactPhone,omitempty"`
// DefaultLinkId: The default link id for this advertiser.
DefaultLinkId int64 `json:"defaultLinkId,omitempty,string"`
// Description: Description of the website the advertiser advertises
// from.
Description string `json:"description,omitempty"`
// EpcNinetyDayAverage: The sum of fees paid to publishers divided by
// the total number of clicks over the past three months. This value
// should be multiplied by 100 at the time of display.
EpcNinetyDayAverage *Money `json:"epcNinetyDayAverage,omitempty"`
// EpcSevenDayAverage: The sum of fees paid to publishers divided by the
// total number of clicks over the past seven days. This value should be
// multiplied by 100 at the time of display.
EpcSevenDayAverage *Money `json:"epcSevenDayAverage,omitempty"`
// Id: The ID of this advertiser.
Id int64 `json:"id,omitempty,string"`
// Item: The requested advertiser.
Item *Advertiser `json:"item,omitempty"`
// JoinDate: Date that this advertiser was approved as a Google
// Affiliate Network advertiser.
JoinDate string `json:"joinDate,omitempty"`
// Kind: The kind for an advertiser.
Kind string `json:"kind,omitempty"`
// LogoUrl: URL to the logo this advertiser uses on the Google Affiliate
// Network.
LogoUrl string `json:"logoUrl,omitempty"`
// MerchantCenterIds: List of merchant center ids for this advertiser
MerchantCenterIds googleapi.Int64s `json:"merchantCenterIds,omitempty"`
// Name: The name of this advertiser.
Name string `json:"name,omitempty"`
// PayoutRank: A rank based on commissions paid to publishers over the
// past 90 days. A number between 1 and 4 where 4 means the top quartile
// (most money paid) and 1 means the bottom quartile (least money paid).
PayoutRank string `json:"payoutRank,omitempty"`
// ProductFeedsEnabled: Allows advertisers to submit product listings to
// Google Product Search.
ProductFeedsEnabled bool `json:"productFeedsEnabled,omitempty"`
// RedirectDomains: List of redirect URLs for this advertiser
RedirectDomains []string `json:"redirectDomains,omitempty"`
// SiteUrl: URL of the website this advertiser advertises from.
SiteUrl string `json:"siteUrl,omitempty"`
// Status: The status of the requesting publisher's relationship this
// advertiser.
Status string `json:"status,omitempty"`
// ServerResponse contains the HTTP response code and headers from the
// server.
googleapi.ServerResponse `json:"-"`
// ForceSendFields is a list of field names (e.g.
// "AllowPublisherCreatedLinks") to unconditionally include in API
// requests. By default, fields with empty values are omitted from API
// requests. However, any non-pointer, non-interface field appearing in
// ForceSendFields will be sent to the server regardless of whether the
// field is empty or not. This may be used to include empty fields in
// Patch requests.
ForceSendFields []string `json:"-"`
}
func (s *Advertiser) MarshalJSON() ([]byte, error) {
type noMethod Advertiser
raw := noMethod(*s)
return internal.MarshalJSON(raw, s.ForceSendFields)
}
type Advertisers struct {
// Items: The advertiser list.
Items []*Advertiser `json:"items,omitempty"`
// Kind: The kind for a page of advertisers.
Kind string `json:"kind,omitempty"`
// NextPageToken: The 'pageToken' to pass to the next request to get the
// next page, if there are more to retrieve.
NextPageToken string `json:"nextPageToken,omitempty"`
// ServerResponse contains the HTTP response code and headers from the
// server.
googleapi.ServerResponse `json:"-"`
// ForceSendFields is a list of field names (e.g. "Items") to
// unconditionally include in API requests. By default, fields with
// empty values are omitted from API requests. However, any non-pointer,
// non-interface field appearing in ForceSendFields will be sent to the
// server regardless of whether the field is empty or not. This may be
// used to include empty fields in Patch requests.
ForceSendFields []string `json:"-"`
}
func (s *Advertisers) MarshalJSON() ([]byte, error) {
type noMethod Advertisers
raw := noMethod(*s)
return internal.MarshalJSON(raw, s.ForceSendFields)
}
// CcOffer: A credit card offer. There are many possible result fields.
// We provide two different views of the data, or "projections." The
// "full" projection includes every result field. And the "summary"
// projection, which is the default, includes a smaller subset of the
// fields. The fields included in the summary projection are marked as
// such in their descriptions.
type CcOffer struct {
// AdditionalCardBenefits: More marketing copy about the card's
// benefits. A summary field.
AdditionalCardBenefits []string `json:"additionalCardBenefits,omitempty"`
// AdditionalCardHolderFee: Any extra fees levied on card holders.
AdditionalCardHolderFee string `json:"additionalCardHolderFee,omitempty"`
// AgeMinimum: The youngest a recipient of this card may be.
AgeMinimum float64 `json:"ageMinimum,omitempty"`
// AgeMinimumDetails: Text describing the details of the age minimum
// restriction.
AgeMinimumDetails string `json:"ageMinimumDetails,omitempty"`
// AnnualFee: The ongoing annual fee, in dollars.
AnnualFee float64 `json:"annualFee,omitempty"`
// AnnualFeeDisplay: Text describing the annual fee, including any
// difference for the first year. A summary field.
AnnualFeeDisplay string `json:"annualFeeDisplay,omitempty"`
// AnnualRewardMaximum: The largest number of units you may accumulate
// in a year.
AnnualRewardMaximum float64 `json:"annualRewardMaximum,omitempty"`
// ApprovedCategories: Possible categories for this card, eg "Low
// Interest" or "Good." A summary field.
ApprovedCategories []string `json:"approvedCategories,omitempty"`
// AprDisplay: Text describing the purchase APR. A summary field.
AprDisplay string `json:"aprDisplay,omitempty"`
// BalanceComputationMethod: Text describing how the balance is
// computed. A summary field.
BalanceComputationMethod string `json:"balanceComputationMethod,omitempty"`
// BalanceTransferTerms: Text describing the terms for balance
// transfers. A summary field.
BalanceTransferTerms string `json:"balanceTransferTerms,omitempty"`
// BonusRewards: For cards with rewards programs, extra circumstances
// whereby additional rewards may be granted.
BonusRewards []*CcOfferBonusRewards `json:"bonusRewards,omitempty"`
// CarRentalInsurance: If you get coverage when you use the card for the
// given activity, this field describes it.
CarRentalInsurance string `json:"carRentalInsurance,omitempty"`
// CardBenefits: A list of what the issuer thinks are the most important
// benefits of the card. Usually summarizes the rewards program, if
// there is one. A summary field.
CardBenefits []string `json:"cardBenefits,omitempty"`
// CardName: The issuer's name for the card, including any trademark or
// service mark designators. A summary field.
CardName string `json:"cardName,omitempty"`
// CardType: What kind of credit card this is, for example secured or
// unsecured.
CardType string `json:"cardType,omitempty"`
// CashAdvanceTerms: Text describing the terms for cash advances. A
// summary field.
CashAdvanceTerms string `json:"cashAdvanceTerms,omitempty"`
// CreditLimitMax: The high end for credit limits the issuer imposes on
// recipients of this card.
CreditLimitMax float64 `json:"creditLimitMax,omitempty"`
// CreditLimitMin: The low end for credit limits the issuer imposes on
// recipients of this card.
CreditLimitMin float64 `json:"creditLimitMin,omitempty"`
// CreditRatingDisplay: Text describing the credit ratings required for
// recipients of this card, for example "Excellent/Good." A summary
// field.
CreditRatingDisplay string `json:"creditRatingDisplay,omitempty"`
// DefaultFees: Fees for defaulting on your payments.
DefaultFees []*CcOfferDefaultFees `json:"defaultFees,omitempty"`
// Disclaimer: A notice that, if present, is referenced via an asterisk
// by many of the other summary fields. If this field is present, it
// will always start with an asterisk ("*"), and must be prominently
// displayed with the offer. A summary field.
Disclaimer string `json:"disclaimer,omitempty"`
// EmergencyInsurance: If you get coverage when you use the card for the
// given activity, this field describes it.
EmergencyInsurance string `json:"emergencyInsurance,omitempty"`
// ExistingCustomerOnly: Whether this card is only available to existing
// customers of the issuer.
ExistingCustomerOnly bool `json:"existingCustomerOnly,omitempty"`
// ExtendedWarranty: If you get coverage when you use the card for the
// given activity, this field describes it.
ExtendedWarranty string `json:"extendedWarranty,omitempty"`
// FirstYearAnnualFee: The annual fee for the first year, if different
// from the ongoing fee. Optional.
FirstYearAnnualFee float64 `json:"firstYearAnnualFee,omitempty"`
// FlightAccidentInsurance: If you get coverage when you use the card
// for the given activity, this field describes it.
FlightAccidentInsurance string `json:"flightAccidentInsurance,omitempty"`
// ForeignCurrencyTransactionFee: Fee for each transaction involving a
// foreign currency.
ForeignCurrencyTransactionFee string `json:"foreignCurrencyTransactionFee,omitempty"`
// FraudLiability: If you get coverage when you use the card for the
// given activity, this field describes it.
FraudLiability string `json:"fraudLiability,omitempty"`
// GracePeriodDisplay: Text describing the grace period before finance
// charges apply. A summary field.
GracePeriodDisplay string `json:"gracePeriodDisplay,omitempty"`
// ImageUrl: The link to the image of the card that is shown on Connect
// Commerce. A summary field.
ImageUrl string `json:"imageUrl,omitempty"`
// InitialSetupAndProcessingFee: Fee for setting up the card.
InitialSetupAndProcessingFee string `json:"initialSetupAndProcessingFee,omitempty"`
// IntroBalanceTransferTerms: Text describing the terms for introductory
// period balance transfers. A summary field.
IntroBalanceTransferTerms string `json:"introBalanceTransferTerms,omitempty"`
// IntroCashAdvanceTerms: Text describing the terms for introductory
// period cash advances. A summary field.
IntroCashAdvanceTerms string `json:"introCashAdvanceTerms,omitempty"`
// IntroPurchaseTerms: Text describing the terms for introductory period
// purchases. A summary field.
IntroPurchaseTerms string `json:"introPurchaseTerms,omitempty"`
// Issuer: Name of card issuer. A summary field.
Issuer string `json:"issuer,omitempty"`
// IssuerId: The Google Affiliate Network ID of the advertiser making
// this offer.
IssuerId string `json:"issuerId,omitempty"`
// IssuerWebsite: The generic link to the issuer's site.
IssuerWebsite string `json:"issuerWebsite,omitempty"`
// Kind: The kind for one credit card offer. A summary field.
Kind string `json:"kind,omitempty"`
// LandingPageUrl: The link to the issuer's page for this card. A
// summary field.
LandingPageUrl string `json:"landingPageUrl,omitempty"`
// LatePaymentFee: Text describing how much a late payment will cost, eg
// "up to $35." A summary field.
LatePaymentFee string `json:"latePaymentFee,omitempty"`
// LuggageInsurance: If you get coverage when you use the card for the
// given activity, this field describes it.
LuggageInsurance string `json:"luggageInsurance,omitempty"`
// MaxPurchaseRate: The highest interest rate the issuer charges on this
// card. Expressed as an absolute number, not as a percentage.
MaxPurchaseRate float64 `json:"maxPurchaseRate,omitempty"`
// MinPurchaseRate: The lowest interest rate the issuer charges on this
// card. Expressed as an absolute number, not as a percentage.
MinPurchaseRate float64 `json:"minPurchaseRate,omitempty"`
// MinimumFinanceCharge: Text describing how much missing the grace
// period will cost.
MinimumFinanceCharge string `json:"minimumFinanceCharge,omitempty"`
// Network: Which network (eg Visa) the card belongs to. A summary
// field.
Network string `json:"network,omitempty"`
// OfferId: This offer's ID. A summary field.
OfferId string `json:"offerId,omitempty"`
// OffersImmediateCashReward: Whether a cash reward program lets you get
// cash back sooner than end of year or other longish period.
OffersImmediateCashReward bool `json:"offersImmediateCashReward,omitempty"`
// OverLimitFee: Fee for exceeding the card's charge limit.
OverLimitFee string `json:"overLimitFee,omitempty"`
// ProhibitedCategories: Categories in which the issuer does not wish
// the card to be displayed. A summary field.
ProhibitedCategories []string `json:"prohibitedCategories,omitempty"`
// PurchaseRateAdditionalDetails: Text describing any additional details
// for the purchase rate. A summary field.
PurchaseRateAdditionalDetails string `json:"purchaseRateAdditionalDetails,omitempty"`
// PurchaseRateType: Fixed or variable.
PurchaseRateType string `json:"purchaseRateType,omitempty"`
// ReturnedPaymentFee: Text describing the fee for a payment that
// doesn't clear. A summary field.
ReturnedPaymentFee string `json:"returnedPaymentFee,omitempty"`
// RewardPartner: The company that redeems the rewards, if different
// from the issuer.
RewardPartner string `json:"rewardPartner,omitempty"`
// RewardUnit: For cards with rewards programs, the unit of reward. For
// example, miles, cash back, points.
RewardUnit string `json:"rewardUnit,omitempty"`
// Rewards: For cards with rewards programs, detailed rules about how
// the program works.
Rewards []*CcOfferRewards `json:"rewards,omitempty"`
// RewardsExpire: Whether accumulated rewards ever expire.
RewardsExpire bool `json:"rewardsExpire,omitempty"`
// RewardsHaveBlackoutDates: For airline miles rewards, tells whether
// blackout dates apply to the miles.
RewardsHaveBlackoutDates bool `json:"rewardsHaveBlackoutDates,omitempty"`
// StatementCopyFee: Fee for requesting a copy of your statement.
StatementCopyFee string `json:"statementCopyFee,omitempty"`
// TrackingUrl: The link to ping to register a click on this offer. A
// summary field.
TrackingUrl string `json:"trackingUrl,omitempty"`
// TravelInsurance: If you get coverage when you use the card for the
// given activity, this field describes it.
TravelInsurance string `json:"travelInsurance,omitempty"`
// VariableRatesLastUpdated: When variable rates were last updated.
VariableRatesLastUpdated string `json:"variableRatesLastUpdated,omitempty"`
// VariableRatesUpdateFrequency: How often variable rates are updated.
VariableRatesUpdateFrequency string `json:"variableRatesUpdateFrequency,omitempty"`
// ForceSendFields is a list of field names (e.g.
// "AdditionalCardBenefits") to unconditionally include in API requests.
// By default, fields with empty values are omitted from API requests.
// However, any non-pointer, non-interface field appearing in
// ForceSendFields will be sent to the server regardless of whether the
// field is empty or not. This may be used to include empty fields in
// Patch requests.
ForceSendFields []string `json:"-"`
}
func (s *CcOffer) MarshalJSON() ([]byte, error) {
type noMethod CcOffer
raw := noMethod(*s)
return internal.MarshalJSON(raw, s.ForceSendFields)
}
type CcOfferBonusRewards struct {
// Amount: How many units of reward will be granted.
Amount float64 `json:"amount,omitempty"`
// Details: The circumstances under which this rule applies, for
// example, booking a flight via Orbitz.
Details string `json:"details,omitempty"`
// ForceSendFields is a list of field names (e.g. "Amount") to
// unconditionally include in API requests. By default, fields with
// empty values are omitted from API requests. However, any non-pointer,
// non-interface field appearing in ForceSendFields will be sent to the
// server regardless of whether the field is empty or not. This may be
// used to include empty fields in Patch requests.
ForceSendFields []string `json:"-"`
}
func (s *CcOfferBonusRewards) MarshalJSON() ([]byte, error) {
type noMethod CcOfferBonusRewards
raw := noMethod(*s)
return internal.MarshalJSON(raw, s.ForceSendFields)
}
type CcOfferDefaultFees struct {
// Category: The type of charge, for example Purchases.
Category string `json:"category,omitempty"`
// MaxRate: The highest rate the issuer may charge for defaulting on
// debt in this category. Expressed as an absolute number, not as a
// percentage.
MaxRate float64 `json:"maxRate,omitempty"`
// MinRate: The lowest rate the issuer may charge for defaulting on debt
// in this category. Expressed as an absolute number, not as a
// percentage.
MinRate float64 `json:"minRate,omitempty"`
// RateType: Fixed or variable.
RateType string `json:"rateType,omitempty"`
// ForceSendFields is a list of field names (e.g. "Category") to
// unconditionally include in API requests. By default, fields with
// empty values are omitted from API requests. However, any non-pointer,
// non-interface field appearing in ForceSendFields will be sent to the
// server regardless of whether the field is empty or not. This may be
// used to include empty fields in Patch requests.
ForceSendFields []string `json:"-"`
}
func (s *CcOfferDefaultFees) MarshalJSON() ([]byte, error) {
type noMethod CcOfferDefaultFees
raw := noMethod(*s)
return internal.MarshalJSON(raw, s.ForceSendFields)
}
type CcOfferRewards struct {
// AdditionalDetails: Other limits, for example, if this rule only
// applies during an introductory period.
AdditionalDetails string `json:"additionalDetails,omitempty"`
// Amount: The number of units rewarded per purchase dollar.
Amount float64 `json:"amount,omitempty"`
// Category: The kind of purchases covered by this rule.
Category string `json:"category,omitempty"`
// ExpirationMonths: How long rewards granted by this rule last.
ExpirationMonths float64 `json:"expirationMonths,omitempty"`
// MaxRewardTier: The maximum purchase amount in the given category for
// this rule to apply.
MaxRewardTier float64 `json:"maxRewardTier,omitempty"`
// MinRewardTier: The minimum purchase amount in the given category
// before this rule applies.
MinRewardTier float64 `json:"minRewardTier,omitempty"`
// ForceSendFields is a list of field names (e.g. "AdditionalDetails")
// to unconditionally include in API requests. By default, fields with
// empty values are omitted from API requests. However, any non-pointer,
// non-interface field appearing in ForceSendFields will be sent to the
// server regardless of whether the field is empty or not. This may be
// used to include empty fields in Patch requests.
ForceSendFields []string `json:"-"`
}
func (s *CcOfferRewards) MarshalJSON() ([]byte, error) {
type noMethod CcOfferRewards
raw := noMethod(*s)
return internal.MarshalJSON(raw, s.ForceSendFields)
}
type CcOffers struct {
// Items: The credit card offers.
Items []*CcOffer `json:"items,omitempty"`
// Kind: The kind for a page of credit card offers.
Kind string `json:"kind,omitempty"`
// ServerResponse contains the HTTP response code and headers from the
// server.
googleapi.ServerResponse `json:"-"`
// ForceSendFields is a list of field names (e.g. "Items") to
// unconditionally include in API requests. By default, fields with
// empty values are omitted from API requests. However, any non-pointer,
// non-interface field appearing in ForceSendFields will be sent to the
// server regardless of whether the field is empty or not. This may be
// used to include empty fields in Patch requests.
ForceSendFields []string `json:"-"`
}
func (s *CcOffers) MarshalJSON() ([]byte, error) {
type noMethod CcOffers
raw := noMethod(*s)
return internal.MarshalJSON(raw, s.ForceSendFields)
}
// Event: An EventResource.
type Event struct {
// AdvertiserId: The ID of advertiser for this event.
AdvertiserId int64 `json:"advertiserId,omitempty,string"`
// AdvertiserName: The name of the advertiser for this event.
AdvertiserName string `json:"advertiserName,omitempty"`
// ChargeId: The charge ID for this event. Only returned for charge
// events.
ChargeId string `json:"chargeId,omitempty"`
// ChargeType: Charge type of the event
// (other|slotting_fee|monthly_minimum|tier_bonus|debit|credit). Only
// returned for charge events.
ChargeType string `json:"chargeType,omitempty"`
// CommissionableSales: Amount of money exchanged during the
// transaction. Only returned for charge and conversion events.
CommissionableSales *Money `json:"commissionableSales,omitempty"`
// Earnings: Earnings by the publisher.
Earnings *Money `json:"earnings,omitempty"`
// EventDate: The date-time this event was initiated as a RFC 3339
// date-time value.
EventDate string `json:"eventDate,omitempty"`
// Kind: The kind for one event.
Kind string `json:"kind,omitempty"`
// MemberId: The ID of the member attached to this event. Only returned
// for conversion events.
MemberId string `json:"memberId,omitempty"`
// ModifyDate: The date-time this event was last modified as a RFC 3339
// date-time value.
ModifyDate string `json:"modifyDate,omitempty"`
// NetworkFee: Fee that the advertiser paid to the Google Affiliate
// Network.
NetworkFee *Money `json:"networkFee,omitempty"`
// OrderId: The order ID for this event. Only returned for conversion
// events.
OrderId string `json:"orderId,omitempty"`
// Products: Products associated with the event.
Products []*EventProducts `json:"products,omitempty"`
// PublisherFee: Fee that the advertiser paid to the publisher.
PublisherFee *Money `json:"publisherFee,omitempty"`
// PublisherId: The ID of the publisher for this event.
PublisherId int64 `json:"publisherId,omitempty,string"`
// PublisherName: The name of the publisher for this event.
PublisherName string `json:"publisherName,omitempty"`
// Status: Status of the event (active|canceled). Only returned for
// charge and conversion events.
Status string `json:"status,omitempty"`
// Type: Type of the event (action|transaction|charge).
Type string `json:"type,omitempty"`
// ForceSendFields is a list of field names (e.g. "AdvertiserId") to
// unconditionally include in API requests. By default, fields with
// empty values are omitted from API requests. However, any non-pointer,
// non-interface field appearing in ForceSendFields will be sent to the
// server regardless of whether the field is empty or not. This may be
// used to include empty fields in Patch requests.
ForceSendFields []string `json:"-"`
}
func (s *Event) MarshalJSON() ([]byte, error) {
type noMethod Event
raw := noMethod(*s)
return internal.MarshalJSON(raw, s.ForceSendFields)
}
type EventProducts struct {
// CategoryId: Id of the category this product belongs to.
CategoryId string `json:"categoryId,omitempty"`
// CategoryName: Name of the category this product belongs to.
CategoryName string `json:"categoryName,omitempty"`
// Earnings: Amount earned by the publisher on this product.
Earnings *Money `json:"earnings,omitempty"`
// NetworkFee: Fee that the advertiser paid to the Google Affiliate
// Network for this product.
NetworkFee *Money `json:"networkFee,omitempty"`
// PublisherFee: Fee that the advertiser paid to the publisehr for this
// product.
PublisherFee *Money `json:"publisherFee,omitempty"`
// Quantity: Quantity of this product bought/exchanged.
Quantity int64 `json:"quantity,omitempty,string"`
// Sku: Sku of this product.
Sku string `json:"sku,omitempty"`
// SkuName: Sku name of this product.
SkuName string `json:"skuName,omitempty"`
// UnitPrice: Price per unit of this product.
UnitPrice *Money `json:"unitPrice,omitempty"`
// ForceSendFields is a list of field names (e.g. "CategoryId") to
// unconditionally include in API requests. By default, fields with
// empty values are omitted from API requests. However, any non-pointer,
// non-interface field appearing in ForceSendFields will be sent to the
// server regardless of whether the field is empty or not. This may be
// used to include empty fields in Patch requests.
ForceSendFields []string `json:"-"`
}
func (s *EventProducts) MarshalJSON() ([]byte, error) {
type noMethod EventProducts
raw := noMethod(*s)
return internal.MarshalJSON(raw, s.ForceSendFields)
}
type Events struct {
// Items: The event list.
Items []*Event `json:"items,omitempty"`
// Kind: The kind for a page of events.
Kind string `json:"kind,omitempty"`
// NextPageToken: The 'pageToken' to pass to the next request to get the
// next page, if there are more to retrieve.
NextPageToken string `json:"nextPageToken,omitempty"`
// ServerResponse contains the HTTP response code and headers from the
// server.
googleapi.ServerResponse `json:"-"`
// ForceSendFields is a list of field names (e.g. "Items") to
// unconditionally include in API requests. By default, fields with
// empty values are omitted from API requests. However, any non-pointer,
// non-interface field appearing in ForceSendFields will be sent to the
// server regardless of whether the field is empty or not. This may be
// used to include empty fields in Patch requests.
ForceSendFields []string `json:"-"`
}
func (s *Events) MarshalJSON() ([]byte, error) {
type noMethod Events
raw := noMethod(*s)
return internal.MarshalJSON(raw, s.ForceSendFields)
}
// Link: A LinkResource.
type Link struct {
// AdvertiserId: The advertiser id for the advertiser who owns this
// link.
AdvertiserId int64 `json:"advertiserId,omitempty,string"`
// Authorship: Authorship
Authorship string `json:"authorship,omitempty"`
// Availability: Availability.
Availability string `json:"availability,omitempty"`
// ClickTrackingUrl: Tracking url for clicks.
ClickTrackingUrl string `json:"clickTrackingUrl,omitempty"`
// CreateDate: Date that this link was created.
CreateDate string `json:"createDate,omitempty"`
// Description: Description.
Description string `json:"description,omitempty"`
// DestinationUrl: The destination URL for the link.
DestinationUrl string `json:"destinationUrl,omitempty"`
// Duration: Duration
Duration string `json:"duration,omitempty"`
// EndDate: Date that this link becomes inactive.
EndDate string `json:"endDate,omitempty"`
// EpcNinetyDayAverage: The sum of fees paid to publishers divided by
// the total number of clicks over the past three months on this link.
// This value should be multiplied by 100 at the time of display.
EpcNinetyDayAverage *Money `json:"epcNinetyDayAverage,omitempty"`
// EpcSevenDayAverage: The sum of fees paid to publishers divided by the
// total number of clicks over the past seven days on this link. This
// value should be multiplied by 100 at the time of display.
EpcSevenDayAverage *Money `json:"epcSevenDayAverage,omitempty"`
// Id: The ID of this link.
Id int64 `json:"id,omitempty,string"`
// ImageAltText: image alt text.
ImageAltText string `json:"imageAltText,omitempty"`
// ImpressionTrackingUrl: Tracking url for impressions.
ImpressionTrackingUrl string `json:"impressionTrackingUrl,omitempty"`
// IsActive: Flag for if this link is active.
IsActive bool `json:"isActive,omitempty"`
// Kind: The kind for one entity.
Kind string `json:"kind,omitempty"`
// LinkType: The link type.
LinkType string `json:"linkType,omitempty"`
// Name: The logical name for this link.
Name string `json:"name,omitempty"`
// PromotionType: Promotion Type
PromotionType string `json:"promotionType,omitempty"`
// SpecialOffers: Special offers on the link.
SpecialOffers *LinkSpecialOffers `json:"specialOffers,omitempty"`
// StartDate: Date that this link becomes active.
StartDate string `json:"startDate,omitempty"`
// ServerResponse contains the HTTP response code and headers from the
// server.
googleapi.ServerResponse `json:"-"`
// ForceSendFields is a list of field names (e.g. "AdvertiserId") to
// unconditionally include in API requests. By default, fields with
// empty values are omitted from API requests. However, any non-pointer,
// non-interface field appearing in ForceSendFields will be sent to the
// server regardless of whether the field is empty or not. This may be
// used to include empty fields in Patch requests.
ForceSendFields []string `json:"-"`
}
func (s *Link) MarshalJSON() ([]byte, error) {
type noMethod Link
raw := noMethod(*s)
return internal.MarshalJSON(raw, s.ForceSendFields)
}
// LinkSpecialOffers: Special offers on the link.
type LinkSpecialOffers struct {
// FreeGift: Whether there is a free gift
FreeGift bool `json:"freeGift,omitempty"`
// FreeShipping: Whether there is free shipping
FreeShipping bool `json:"freeShipping,omitempty"`
// FreeShippingMin: Minimum purchase amount for free shipping promotion
FreeShippingMin *Money `json:"freeShippingMin,omitempty"`
// PercentOff: Percent off on the purchase
PercentOff float64 `json:"percentOff,omitempty"`
// PercentOffMin: Minimum purchase amount for percent off promotion
PercentOffMin *Money `json:"percentOffMin,omitempty"`
// PriceCut: Price cut on the purchase
PriceCut *Money `json:"priceCut,omitempty"`
// PriceCutMin: Minimum purchase amount for price cut promotion
PriceCutMin *Money `json:"priceCutMin,omitempty"`
// PromotionCodes: List of promotion code associated with the link
PromotionCodes []string `json:"promotionCodes,omitempty"`
// ForceSendFields is a list of field names (e.g. "FreeGift") to
// unconditionally include in API requests. By default, fields with
// empty values are omitted from API requests. However, any non-pointer,
// non-interface field appearing in ForceSendFields will be sent to the
// server regardless of whether the field is empty or not. This may be
// used to include empty fields in Patch requests.
ForceSendFields []string `json:"-"`
}
func (s *LinkSpecialOffers) MarshalJSON() ([]byte, error) {
type noMethod LinkSpecialOffers
raw := noMethod(*s)
return internal.MarshalJSON(raw, s.ForceSendFields)
}
type Links struct {
// Items: The links.
Items []*Link `json:"items,omitempty"`
// Kind: The kind for a page of links.
Kind string `json:"kind,omitempty"`
// NextPageToken: The next page token.
NextPageToken string `json:"nextPageToken,omitempty"`
// ServerResponse contains the HTTP response code and headers from the
// server.
googleapi.ServerResponse `json:"-"`
// ForceSendFields is a list of field names (e.g. "Items") to
// unconditionally include in API requests. By default, fields with
// empty values are omitted from API requests. However, any non-pointer,
// non-interface field appearing in ForceSendFields will be sent to the
// server regardless of whether the field is empty or not. This may be
// used to include empty fields in Patch requests.
ForceSendFields []string `json:"-"`
}
func (s *Links) MarshalJSON() ([]byte, error) {
type noMethod Links
raw := noMethod(*s)
return internal.MarshalJSON(raw, s.ForceSendFields)
}
// Money: An ApiMoneyProto.
type Money struct {
// Amount: The amount of money.
Amount float64 `json:"amount,omitempty"`
// CurrencyCode: The 3-letter code of the currency in question.
CurrencyCode string `json:"currencyCode,omitempty"`
// ForceSendFields is a list of field names (e.g. "Amount") to
// unconditionally include in API requests. By default, fields with
// empty values are omitted from API requests. However, any non-pointer,
// non-interface field appearing in ForceSendFields will be sent to the
// server regardless of whether the field is empty or not. This may be
// used to include empty fields in Patch requests.
ForceSendFields []string `json:"-"`
}
func (s *Money) MarshalJSON() ([]byte, error) {
type noMethod Money
raw := noMethod(*s)
return internal.MarshalJSON(raw, s.ForceSendFields)
}
// Publisher: A PublisherResource.
type Publisher struct {
// Classification: Classification that this publisher belongs to. See
// this link for all publisher classifications:
// http://www.google.com/support/affiliatenetwork/advertiser/bin/answer.py?hl=en&answer=107625&ctx=cb&src=cb&cbid=-k5fihzthfaik&cbrank=4
Classification string `json:"classification,omitempty"`
// EpcNinetyDayAverage: The sum of fees paid to this publisher divided
// by the total number of clicks over the past three months. Values are