1// Package gan provides access to the Google Affiliate Network API.
2//
3// See https://developers.google.com/affiliate-network/
4//
5// Usage example:
6//
7//   import "google.golang.org/api/gan/v1beta1"
8//   ...
9//   ganService, err := gan.New(oauthHttpClient)
10package gan // import "google.golang.org/api/gan/v1beta1"
11
12import (
13	"bytes"
14	"encoding/json"
15	"errors"
16	"fmt"
17	context "golang.org/x/net/context"
18	ctxhttp "golang.org/x/net/context/ctxhttp"
19	gensupport "google.golang.org/api/gensupport"
20	googleapi "google.golang.org/api/googleapi"
21	"io"
22	"net/http"
23	"net/url"
24	"strconv"
25	"strings"
26)
27
28// Always reference these packages, just in case the auto-generated code
29// below doesn't.
30var _ = bytes.NewBuffer
31var _ = strconv.Itoa
32var _ = fmt.Sprintf
33var _ = json.NewDecoder
34var _ = io.Copy
35var _ = url.Parse
36var _ = gensupport.MarshalJSON
37var _ = googleapi.Version
38var _ = errors.New
39var _ = strings.Replace
40var _ = context.Canceled
41var _ = ctxhttp.Do
42
43const apiId = "gan:v1beta1"
44const apiName = "gan"
45const apiVersion = "v1beta1"
46const basePath = "https://www.googleapis.com/gan/v1beta1/"
47
48func New(client *http.Client) (*Service, error) {
49	if client == nil {
50		return nil, errors.New("client is nil")
51	}
52	s := &Service{client: client, BasePath: basePath}
53	s.Advertisers = NewAdvertisersService(s)
54	s.CcOffers = NewCcOffersService(s)
55	s.Events = NewEventsService(s)
56	s.Links = NewLinksService(s)
57	s.Publishers = NewPublishersService(s)
58	s.Reports = NewReportsService(s)
59	return s, nil
60}
61
62type Service struct {
63	client    *http.Client
64	BasePath  string // API endpoint base URL
65	UserAgent string // optional additional User-Agent fragment
66
67	Advertisers *AdvertisersService
68
69	CcOffers *CcOffersService
70
71	Events *EventsService
72
73	Links *LinksService
74
75	Publishers *PublishersService
76
77	Reports *ReportsService
78}
79
80func (s *Service) userAgent() string {
81	if s.UserAgent == "" {
82		return googleapi.UserAgent
83	}
84	return googleapi.UserAgent + " " + s.UserAgent
85}
86
87func NewAdvertisersService(s *Service) *AdvertisersService {
88	rs := &AdvertisersService{s: s}
89	return rs
90}
91
92type AdvertisersService struct {
93	s *Service
94}
95
96func NewCcOffersService(s *Service) *CcOffersService {
97	rs := &CcOffersService{s: s}
98	return rs
99}
100
101type CcOffersService struct {
102	s *Service
103}
104
105func NewEventsService(s *Service) *EventsService {
106	rs := &EventsService{s: s}
107	return rs
108}
109
110type EventsService struct {
111	s *Service
112}
113
114func NewLinksService(s *Service) *LinksService {
115	rs := &LinksService{s: s}
116	return rs
117}
118
119type LinksService struct {
120	s *Service
121}
122
123func NewPublishersService(s *Service) *PublishersService {
124	rs := &PublishersService{s: s}
125	return rs
126}
127
128type PublishersService struct {
129	s *Service
130}
131
132func NewReportsService(s *Service) *ReportsService {
133	rs := &ReportsService{s: s}
134	return rs
135}
136
137type ReportsService struct {
138	s *Service
139}
140
141// Advertiser: An AdvertiserResource.
142type Advertiser struct {
143	// AllowPublisherCreatedLinks: True if the advertiser allows publisher
144	// created links, otherwise false.
145	AllowPublisherCreatedLinks bool `json:"allowPublisherCreatedLinks,omitempty"`
146
147	// Category: Category that this advertiser belongs to. A valid list of
148	// categories can be found here:
149	// http://www.google.com/support/affiliatenetwork/advertiser/bin/answer.py?hl=en&answer=107581
150	Category string `json:"category,omitempty"`
151
152	// CommissionDuration: The longest possible length of a commission (how
153	// long the cookies on the customer's browser last before they expire).
154	CommissionDuration int64 `json:"commissionDuration,omitempty"`
155
156	// ContactEmail: Email that this advertiser would like publishers to
157	// contact them with.
158	ContactEmail string `json:"contactEmail,omitempty"`
159
160	// ContactPhone: Phone that this advertiser would like publishers to
161	// contact them with.
162	ContactPhone string `json:"contactPhone,omitempty"`
163
164	// DefaultLinkId: The default link id for this advertiser.
165	DefaultLinkId int64 `json:"defaultLinkId,omitempty,string"`
166
167	// Description: Description of the website the advertiser advertises
168	// from.
169	Description string `json:"description,omitempty"`
170
171	// EpcNinetyDayAverage: The sum of fees paid to publishers divided by
172	// the total number of clicks over the past three months. This value
173	// should be multiplied by 100 at the time of display.
174	EpcNinetyDayAverage *Money `json:"epcNinetyDayAverage,omitempty"`
175
176	// EpcSevenDayAverage: The sum of fees paid to publishers divided by the
177	// total number of clicks over the past seven days. This value should be
178	// multiplied by 100 at the time of display.
179	EpcSevenDayAverage *Money `json:"epcSevenDayAverage,omitempty"`
180
181	// Id: The ID of this advertiser.
182	Id int64 `json:"id,omitempty,string"`
183
184	// Item: The requested advertiser.
185	Item *Advertiser `json:"item,omitempty"`
186
187	// JoinDate: Date that this advertiser was approved as a Google
188	// Affiliate Network advertiser.
189	JoinDate string `json:"joinDate,omitempty"`
190
191	// Kind: The kind for an advertiser.
192	Kind string `json:"kind,omitempty"`
193
194	// LogoUrl: URL to the logo this advertiser uses on the Google Affiliate
195	// Network.
196	LogoUrl string `json:"logoUrl,omitempty"`
197
198	// MerchantCenterIds: List of merchant center ids for this advertiser
199	MerchantCenterIds googleapi.Int64s `json:"merchantCenterIds,omitempty"`
200
201	// Name: The name of this advertiser.
202	Name string `json:"name,omitempty"`
203
204	// PayoutRank: A rank based on commissions paid to publishers over the
205	// past 90 days. A number between 1 and 4 where 4 means the top quartile
206	// (most money paid) and 1 means the bottom quartile (least money paid).
207	PayoutRank string `json:"payoutRank,omitempty"`
208
209	// ProductFeedsEnabled: Allows advertisers to submit product listings to
210	// Google Product Search.
211	ProductFeedsEnabled bool `json:"productFeedsEnabled,omitempty"`
212
213	// RedirectDomains: List of redirect URLs for this advertiser
214	RedirectDomains []string `json:"redirectDomains,omitempty"`
215
216	// SiteUrl: URL of the website this advertiser advertises from.
217	SiteUrl string `json:"siteUrl,omitempty"`
218
219	// Status: The status of the requesting publisher's relationship this
220	// advertiser.
221	Status string `json:"status,omitempty"`
222
223	// ServerResponse contains the HTTP response code and headers from the
224	// server.
225	googleapi.ServerResponse `json:"-"`
226
227	// ForceSendFields is a list of field names (e.g.
228	// "AllowPublisherCreatedLinks") to unconditionally include in API
229	// requests. By default, fields with empty values are omitted from API
230	// requests. However, any non-pointer, non-interface field appearing in
231	// ForceSendFields will be sent to the server regardless of whether the
232	// field is empty or not. This may be used to include empty fields in
233	// Patch requests.
234	ForceSendFields []string `json:"-"`
235}
236
237func (s *Advertiser) MarshalJSON() ([]byte, error) {
238	type noMethod Advertiser
239	raw := noMethod(*s)
240	return gensupport.MarshalJSON(raw, s.ForceSendFields)
241}
242
243type Advertisers struct {
244	// Items: The advertiser list.
245	Items []*Advertiser `json:"items,omitempty"`
246
247	// Kind: The kind for a page of advertisers.
248	Kind string `json:"kind,omitempty"`
249
250	// NextPageToken: The 'pageToken' to pass to the next request to get the
251	// next page, if there are more to retrieve.
252	NextPageToken string `json:"nextPageToken,omitempty"`
253
254	// ServerResponse contains the HTTP response code and headers from the
255	// server.
256	googleapi.ServerResponse `json:"-"`
257
258	// ForceSendFields is a list of field names (e.g. "Items") to
259	// unconditionally include in API requests. By default, fields with
260	// empty values are omitted from API requests. However, any non-pointer,
261	// non-interface field appearing in ForceSendFields will be sent to the
262	// server regardless of whether the field is empty or not. This may be
263	// used to include empty fields in Patch requests.
264	ForceSendFields []string `json:"-"`
265}
266
267func (s *Advertisers) MarshalJSON() ([]byte, error) {
268	type noMethod Advertisers
269	raw := noMethod(*s)
270	return gensupport.MarshalJSON(raw, s.ForceSendFields)
271}
272
273// CcOffer: A credit card offer. There are many possible result fields.
274// We provide two different views of the data, or "projections." The
275// "full" projection includes every result field. And the "summary"
276// projection, which is the default, includes a smaller subset of the
277// fields. The fields included in the summary projection are marked as
278// such in their descriptions.
279type CcOffer struct {
280	// AdditionalCardBenefits: More marketing copy about the card's
281	// benefits. A summary field.
282	AdditionalCardBenefits []string `json:"additionalCardBenefits,omitempty"`
283
284	// AdditionalCardHolderFee: Any extra fees levied on card holders.
285	AdditionalCardHolderFee string `json:"additionalCardHolderFee,omitempty"`
286
287	// AgeMinimum: The youngest a recipient of this card may be.
288	AgeMinimum float64 `json:"ageMinimum,omitempty"`
289
290	// AgeMinimumDetails: Text describing the details of the age minimum
291	// restriction.
292	AgeMinimumDetails string `json:"ageMinimumDetails,omitempty"`
293
294	// AnnualFee: The ongoing annual fee, in dollars.
295	AnnualFee float64 `json:"annualFee,omitempty"`
296
297	// AnnualFeeDisplay: Text describing the annual fee, including any
298	// difference for the first year. A summary field.
299	AnnualFeeDisplay string `json:"annualFeeDisplay,omitempty"`
300
301	// AnnualRewardMaximum: The largest number of units you may accumulate
302	// in a year.
303	AnnualRewardMaximum float64 `json:"annualRewardMaximum,omitempty"`
304
305	// ApprovedCategories: Possible categories for this card, eg "Low
306	// Interest" or "Good." A summary field.
307	ApprovedCategories []string `json:"approvedCategories,omitempty"`
308
309	// AprDisplay: Text describing the purchase APR. A summary field.
310	AprDisplay string `json:"aprDisplay,omitempty"`
311
312	// BalanceComputationMethod: Text describing how the balance is
313	// computed. A summary field.
314	BalanceComputationMethod string `json:"balanceComputationMethod,omitempty"`
315
316	// BalanceTransferTerms: Text describing the terms for balance
317	// transfers. A summary field.
318	BalanceTransferTerms string `json:"balanceTransferTerms,omitempty"`
319
320	// BonusRewards: For cards with rewards programs, extra circumstances
321	// whereby additional rewards may be granted.
322	BonusRewards []*CcOfferBonusRewards `json:"bonusRewards,omitempty"`
323
324	// CarRentalInsurance: If you get coverage when you use the card for the
325	// given activity, this field describes it.
326	CarRentalInsurance string `json:"carRentalInsurance,omitempty"`
327
328	// CardBenefits: A list of what the issuer thinks are the most important
329	// benefits of the card. Usually summarizes the rewards program, if
330	// there is one. A summary field.
331	CardBenefits []string `json:"cardBenefits,omitempty"`
332
333	// CardName: The issuer's name for the card, including any trademark or
334	// service mark designators. A summary field.
335	CardName string `json:"cardName,omitempty"`
336
337	// CardType: What kind of credit card this is, for example secured or
338	// unsecured.
339	CardType string `json:"cardType,omitempty"`
340
341	// CashAdvanceTerms: Text describing the terms for cash advances. A
342	// summary field.
343	CashAdvanceTerms string `json:"cashAdvanceTerms,omitempty"`
344
345	// CreditLimitMax: The high end for credit limits the issuer imposes on
346	// recipients of this card.
347	CreditLimitMax float64 `json:"creditLimitMax,omitempty"`
348
349	// CreditLimitMin: The low end for credit limits the issuer imposes on
350	// recipients of this card.
351	CreditLimitMin float64 `json:"creditLimitMin,omitempty"`
352
353	// CreditRatingDisplay: Text describing the credit ratings required for
354	// recipients of this card, for example "Excellent/Good." A summary
355	// field.
356	CreditRatingDisplay string `json:"creditRatingDisplay,omitempty"`
357
358	// DefaultFees: Fees for defaulting on your payments.
359	DefaultFees []*CcOfferDefaultFees `json:"defaultFees,omitempty"`
360
361	// Disclaimer: A notice that, if present, is referenced via an asterisk
362	// by many of the other summary fields. If this field is present, it
363	// will always start with an asterisk ("*"), and must be prominently
364	// displayed with the offer. A summary field.
365	Disclaimer string `json:"disclaimer,omitempty"`
366
367	// EmergencyInsurance: If you get coverage when you use the card for the
368	// given activity, this field describes it.
369	EmergencyInsurance string `json:"emergencyInsurance,omitempty"`
370
371	// ExistingCustomerOnly: Whether this card is only available to existing
372	// customers of the issuer.
373	ExistingCustomerOnly bool `json:"existingCustomerOnly,omitempty"`
374
375	// ExtendedWarranty: If you get coverage when you use the card for the
376	// given activity, this field describes it.
377	ExtendedWarranty string `json:"extendedWarranty,omitempty"`
378
379	// FirstYearAnnualFee: The annual fee for the first year, if different
380	// from the ongoing fee. Optional.
381	FirstYearAnnualFee float64 `json:"firstYearAnnualFee,omitempty"`
382
383	// FlightAccidentInsurance: If you get coverage when you use the card
384	// for the given activity, this field describes it.
385	FlightAccidentInsurance string `json:"flightAccidentInsurance,omitempty"`
386
387	// ForeignCurrencyTransactionFee: Fee for each transaction involving a
388	// foreign currency.
389	ForeignCurrencyTransactionFee string `json:"foreignCurrencyTransactionFee,omitempty"`
390
391	// FraudLiability: If you get coverage when you use the card for the
392	// given activity, this field describes it.
393	FraudLiability string `json:"fraudLiability,omitempty"`
394
395	// GracePeriodDisplay: Text describing the grace period before finance
396	// charges apply. A summary field.
397	GracePeriodDisplay string `json:"gracePeriodDisplay,omitempty"`
398
399	// ImageUrl: The link to the image of the card that is shown on Connect
400	// Commerce. A summary field.
401	ImageUrl string `json:"imageUrl,omitempty"`
402
403	// InitialSetupAndProcessingFee: Fee for setting up the card.
404	InitialSetupAndProcessingFee string `json:"initialSetupAndProcessingFee,omitempty"`
405
406	// IntroBalanceTransferTerms: Text describing the terms for introductory
407	// period balance transfers. A summary field.
408	IntroBalanceTransferTerms string `json:"introBalanceTransferTerms,omitempty"`
409
410	// IntroCashAdvanceTerms: Text describing the terms for introductory
411	// period cash advances. A summary field.
412	IntroCashAdvanceTerms string `json:"introCashAdvanceTerms,omitempty"`
413
414	// IntroPurchaseTerms: Text describing the terms for introductory period
415	// purchases. A summary field.
416	IntroPurchaseTerms string `json:"introPurchaseTerms,omitempty"`
417
418	// Issuer: Name of card issuer. A summary field.
419	Issuer string `json:"issuer,omitempty"`
420
421	// IssuerId: The Google Affiliate Network ID of the advertiser making
422	// this offer.
423	IssuerId string `json:"issuerId,omitempty"`
424
425	// IssuerWebsite: The generic link to the issuer's site.
426	IssuerWebsite string `json:"issuerWebsite,omitempty"`
427
428	// Kind: The kind for one credit card offer. A summary field.
429	Kind string `json:"kind,omitempty"`
430
431	// LandingPageUrl: The link to the issuer's page for this card. A
432	// summary field.
433	LandingPageUrl string `json:"landingPageUrl,omitempty"`
434
435	// LatePaymentFee: Text describing how much a late payment will cost, eg
436	// "up to $35." A summary field.
437	LatePaymentFee string `json:"latePaymentFee,omitempty"`
438
439	// LuggageInsurance: If you get coverage when you use the card for the
440	// given activity, this field describes it.
441	LuggageInsurance string `json:"luggageInsurance,omitempty"`
442
443	// MaxPurchaseRate: The highest interest rate the issuer charges on this
444	// card. Expressed as an absolute number, not as a percentage.
445	MaxPurchaseRate float64 `json:"maxPurchaseRate,omitempty"`
446
447	// MinPurchaseRate: The lowest interest rate the issuer charges on this
448	// card. Expressed as an absolute number, not as a percentage.
449	MinPurchaseRate float64 `json:"minPurchaseRate,omitempty"`
450
451	// MinimumFinanceCharge: Text describing how much missing the grace
452	// period will cost.
453	MinimumFinanceCharge string `json:"minimumFinanceCharge,omitempty"`
454
455	// Network: Which network (eg Visa) the card belongs to. A summary
456	// field.
457	Network string `json:"network,omitempty"`
458
459	// OfferId: This offer's ID. A summary field.
460	OfferId string `json:"offerId,omitempty"`
461
462	// OffersImmediateCashReward: Whether a cash reward program lets you get
463	// cash back sooner than end of year or other longish period.
464	OffersImmediateCashReward bool `json:"offersImmediateCashReward,omitempty"`
465
466	// OverLimitFee: Fee for exceeding the card's charge limit.
467	OverLimitFee string `json:"overLimitFee,omitempty"`
468
469	// ProhibitedCategories: Categories in which the issuer does not wish
470	// the card to be displayed. A summary field.
471	ProhibitedCategories []string `json:"prohibitedCategories,omitempty"`
472
473	// PurchaseRateAdditionalDetails: Text describing any additional details
474	// for the purchase rate. A summary field.
475	PurchaseRateAdditionalDetails string `json:"purchaseRateAdditionalDetails,omitempty"`
476
477	// PurchaseRateType: Fixed or variable.
478	PurchaseRateType string `json:"purchaseRateType,omitempty"`
479
480	// ReturnedPaymentFee: Text describing the fee for a payment that
481	// doesn't clear. A summary field.
482	ReturnedPaymentFee string `json:"returnedPaymentFee,omitempty"`
483
484	// RewardPartner: The company that redeems the rewards, if different
485	// from the issuer.
486	RewardPartner string `json:"rewardPartner,omitempty"`
487
488	// RewardUnit: For cards with rewards programs, the unit of reward. For
489	// example, miles, cash back, points.
490	RewardUnit string `json:"rewardUnit,omitempty"`
491
492	// Rewards: For cards with rewards programs, detailed rules about how
493	// the program works.
494	Rewards []*CcOfferRewards `json:"rewards,omitempty"`
495
496	// RewardsExpire: Whether accumulated rewards ever expire.
497	RewardsExpire bool `json:"rewardsExpire,omitempty"`
498
499	// RewardsHaveBlackoutDates: For airline miles rewards, tells whether
500	// blackout dates apply to the miles.
501	RewardsHaveBlackoutDates bool `json:"rewardsHaveBlackoutDates,omitempty"`
502
503	// StatementCopyFee: Fee for requesting a copy of your statement.
504	StatementCopyFee string `json:"statementCopyFee,omitempty"`
505
506	// TrackingUrl: The link to ping to register a click on this offer. A
507	// summary field.
508	TrackingUrl string `json:"trackingUrl,omitempty"`
509
510	// TravelInsurance: If you get coverage when you use the card for the
511	// given activity, this field describes it.
512	TravelInsurance string `json:"travelInsurance,omitempty"`
513
514	// VariableRatesLastUpdated: When variable rates were last updated.
515	VariableRatesLastUpdated string `json:"variableRatesLastUpdated,omitempty"`
516
517	// VariableRatesUpdateFrequency: How often variable rates are updated.
518	VariableRatesUpdateFrequency string `json:"variableRatesUpdateFrequency,omitempty"`
519
520	// ForceSendFields is a list of field names (e.g.
521	// "AdditionalCardBenefits") to unconditionally include in API requests.
522	// By default, fields with empty values are omitted from API requests.
523	// However, any non-pointer, non-interface field appearing in
524	// ForceSendFields will be sent to the server regardless of whether the
525	// field is empty or not. This may be used to include empty fields in
526	// Patch requests.
527	ForceSendFields []string `json:"-"`
528}
529
530func (s *CcOffer) MarshalJSON() ([]byte, error) {
531	type noMethod CcOffer
532	raw := noMethod(*s)
533	return gensupport.MarshalJSON(raw, s.ForceSendFields)
534}
535
536type CcOfferBonusRewards struct {
537	// Amount: How many units of reward will be granted.
538	Amount float64 `json:"amount,omitempty"`
539
540	// Details: The circumstances under which this rule applies, for
541	// example, booking a flight via Orbitz.
542	Details string `json:"details,omitempty"`
543
544	// ForceSendFields is a list of field names (e.g. "Amount") to
545	// unconditionally include in API requests. By default, fields with
546	// empty values are omitted from API requests. However, any non-pointer,
547	// non-interface field appearing in ForceSendFields will be sent to the
548	// server regardless of whether the field is empty or not. This may be
549	// used to include empty fields in Patch requests.
550	ForceSendFields []string `json:"-"`
551}
552
553func (s *CcOfferBonusRewards) MarshalJSON() ([]byte, error) {
554	type noMethod CcOfferBonusRewards
555	raw := noMethod(*s)
556	return gensupport.MarshalJSON(raw, s.ForceSendFields)
557}
558
559type CcOfferDefaultFees struct {
560	// Category: The type of charge, for example Purchases.
561	Category string `json:"category,omitempty"`
562
563	// MaxRate: The highest rate the issuer may charge for defaulting on
564	// debt in this category. Expressed as an absolute number, not as a
565	// percentage.
566	MaxRate float64 `json:"maxRate,omitempty"`
567
568	// MinRate: The lowest rate the issuer may charge for defaulting on debt
569	// in this category. Expressed as an absolute number, not as a
570	// percentage.
571	MinRate float64 `json:"minRate,omitempty"`
572
573	// RateType: Fixed or variable.
574	RateType string `json:"rateType,omitempty"`
575
576	// ForceSendFields is a list of field names (e.g. "Category") to
577	// unconditionally include in API requests. By default, fields with
578	// empty values are omitted from API requests. However, any non-pointer,
579	// non-interface field appearing in ForceSendFields will be sent to the
580	// server regardless of whether the field is empty or not. This may be
581	// used to include empty fields in Patch requests.
582	ForceSendFields []string `json:"-"`
583}
584
585func (s *CcOfferDefaultFees) MarshalJSON() ([]byte, error) {
586	type noMethod CcOfferDefaultFees
587	raw := noMethod(*s)
588	return gensupport.MarshalJSON(raw, s.ForceSendFields)
589}
590
591type CcOfferRewards struct {
592	// AdditionalDetails: Other limits, for example, if this rule only
593	// applies during an introductory period.
594	AdditionalDetails string `json:"additionalDetails,omitempty"`
595
596	// Amount: The number of units rewarded per purchase dollar.
597	Amount float64 `json:"amount,omitempty"`
598
599	// Category: The kind of purchases covered by this rule.
600	Category string `json:"category,omitempty"`
601
602	// ExpirationMonths: How long rewards granted by this rule last.
603	ExpirationMonths float64 `json:"expirationMonths,omitempty"`
604
605	// MaxRewardTier: The maximum purchase amount in the given category for
606	// this rule to apply.
607	MaxRewardTier float64 `json:"maxRewardTier,omitempty"`
608
609	// MinRewardTier: The minimum purchase amount in the given category
610	// before this rule applies.
611	MinRewardTier float64 `json:"minRewardTier,omitempty"`
612
613	// ForceSendFields is a list of field names (e.g. "AdditionalDetails")
614	// to unconditionally include in API requests. By default, fields with
615	// empty values are omitted from API requests. However, any non-pointer,
616	// non-interface field appearing in ForceSendFields will be sent to the
617	// server regardless of whether the field is empty or not. This may be
618	// used to include empty fields in Patch requests.
619	ForceSendFields []string `json:"-"`
620}
621
622func (s *CcOfferRewards) MarshalJSON() ([]byte, error) {
623	type noMethod CcOfferRewards
624	raw := noMethod(*s)
625	return gensupport.MarshalJSON(raw, s.ForceSendFields)
626}
627
628type CcOffers struct {
629	// Items: The credit card offers.
630	Items []*CcOffer `json:"items,omitempty"`
631
632	// Kind: The kind for a page of credit card offers.
633	Kind string `json:"kind,omitempty"`
634
635	// ServerResponse contains the HTTP response code and headers from the
636	// server.
637	googleapi.ServerResponse `json:"-"`
638
639	// ForceSendFields is a list of field names (e.g. "Items") to
640	// unconditionally include in API requests. By default, fields with
641	// empty values are omitted from API requests. However, any non-pointer,
642	// non-interface field appearing in ForceSendFields will be sent to the
643	// server regardless of whether the field is empty or not. This may be
644	// used to include empty fields in Patch requests.
645	ForceSendFields []string `json:"-"`
646}
647
648func (s *CcOffers) MarshalJSON() ([]byte, error) {
649	type noMethod CcOffers
650	raw := noMethod(*s)
651	return gensupport.MarshalJSON(raw, s.ForceSendFields)
652}
653
654// Event: An EventResource.
655type Event struct {
656	// AdvertiserId: The ID of advertiser for this event.
657	AdvertiserId int64 `json:"advertiserId,omitempty,string"`
658
659	// AdvertiserName: The name of the advertiser for this event.
660	AdvertiserName string `json:"advertiserName,omitempty"`
661
662	// ChargeId: The charge ID for this event. Only returned for charge
663	// events.
664	ChargeId string `json:"chargeId,omitempty"`
665
666	// ChargeType: Charge type of the event
667	// (other|slotting_fee|monthly_minimum|tier_bonus|debit|credit). Only
668	// returned for charge events.
669	ChargeType string `json:"chargeType,omitempty"`
670
671	// CommissionableSales: Amount of money exchanged during the
672	// transaction. Only returned for charge and conversion events.
673	CommissionableSales *Money `json:"commissionableSales,omitempty"`
674
675	// Earnings: Earnings by the publisher.
676	Earnings *Money `json:"earnings,omitempty"`
677
678	// EventDate: The date-time this event was initiated as a RFC 3339
679	// date-time value.
680	EventDate string `json:"eventDate,omitempty"`
681
682	// Kind: The kind for one event.
683	Kind string `json:"kind,omitempty"`
684
685	// MemberId: The ID of the member attached to this event. Only returned
686	// for conversion events.
687	MemberId string `json:"memberId,omitempty"`
688
689	// ModifyDate: The date-time this event was last modified as a RFC 3339
690	// date-time value.
691	ModifyDate string `json:"modifyDate,omitempty"`
692
693	// NetworkFee: Fee that the advertiser paid to the Google Affiliate
694	// Network.
695	NetworkFee *Money `json:"networkFee,omitempty"`
696
697	// OrderId: The order ID for this event. Only returned for conversion
698	// events.
699	OrderId string `json:"orderId,omitempty"`
700
701	// Products: Products associated with the event.
702	Products []*EventProducts `json:"products,omitempty"`
703
704	// PublisherFee: Fee that the advertiser paid to the publisher.
705	PublisherFee *Money `json:"publisherFee,omitempty"`
706
707	// PublisherId: The ID of the publisher for this event.
708	PublisherId int64 `json:"publisherId,omitempty,string"`
709
710	// PublisherName: The name of the publisher for this event.
711	PublisherName string `json:"publisherName,omitempty"`
712
713	// Status: Status of the event (active|canceled). Only returned for
714	// charge and conversion events.
715	Status string `json:"status,omitempty"`
716
717	// Type: Type of the event (action|transaction|charge).
718	Type string `json:"type,omitempty"`
719
720	// ForceSendFields is a list of field names (e.g. "AdvertiserId") to
721	// unconditionally include in API requests. By default, fields with
722	// empty values are omitted from API requests. However, any non-pointer,
723	// non-interface field appearing in ForceSendFields will be sent to the
724	// server regardless of whether the field is empty or not. This may be
725	// used to include empty fields in Patch requests.
726	ForceSendFields []string `json:"-"`
727}
728
729func (s *Event) MarshalJSON() ([]byte, error) {
730	type noMethod Event
731	raw := noMethod(*s)
732	return gensupport.MarshalJSON(raw, s.ForceSendFields)
733}
734
735type EventProducts struct {
736	// CategoryId: Id of the category this product belongs to.
737	CategoryId string `json:"categoryId,omitempty"`
738
739	// CategoryName: Name of the category this product belongs to.
740	CategoryName string `json:"categoryName,omitempty"`
741
742	// Earnings: Amount earned by the publisher on this product.
743	Earnings *Money `json:"earnings,omitempty"`
744
745	// NetworkFee: Fee that the advertiser paid to the Google Affiliate
746	// Network for this product.
747	NetworkFee *Money `json:"networkFee,omitempty"`
748
749	// PublisherFee: Fee that the advertiser paid to the publisehr for this
750	// product.
751	PublisherFee *Money `json:"publisherFee,omitempty"`
752
753	// Quantity: Quantity of this product bought/exchanged.
754	Quantity int64 `json:"quantity,omitempty,string"`
755
756	// Sku: Sku of this product.
757	Sku string `json:"sku,omitempty"`
758
759	// SkuName: Sku name of this product.
760	SkuName string `json:"skuName,omitempty"`
761
762	// UnitPrice: Price per unit of this product.
763	UnitPrice *Money `json:"unitPrice,omitempty"`
764
765	// ForceSendFields is a list of field names (e.g. "CategoryId") to
766	// unconditionally include in API requests. By default, fields with
767	// empty values are omitted from API requests. However, any non-pointer,
768	// non-interface field appearing in ForceSendFields will be sent to the
769	// server regardless of whether the field is empty or not. This may be
770	// used to include empty fields in Patch requests.
771	ForceSendFields []string `json:"-"`
772}
773
774func (s *EventProducts) MarshalJSON() ([]byte, error) {
775	type noMethod EventProducts
776	raw := noMethod(*s)
777	return gensupport.MarshalJSON(raw, s.ForceSendFields)
778}
779
780type Events struct {
781	// Items: The event list.
782	Items []*Event `json:"items,omitempty"`
783
784	// Kind: The kind for a page of events.
785	Kind string `json:"kind,omitempty"`
786
787	// NextPageToken: The 'pageToken' to pass to the next request to get the
788	// next page, if there are more to retrieve.
789	NextPageToken string `json:"nextPageToken,omitempty"`
790
791	// ServerResponse contains the HTTP response code and headers from the
792	// server.
793	googleapi.ServerResponse `json:"-"`
794
795	// ForceSendFields is a list of field names (e.g. "Items") to
796	// unconditionally include in API requests. By default, fields with
797	// empty values are omitted from API requests. However, any non-pointer,
798	// non-interface field appearing in ForceSendFields will be sent to the
799	// server regardless of whether the field is empty or not. This may be
800	// used to include empty fields in Patch requests.
801	ForceSendFields []string `json:"-"`
802}
803
804func (s *Events) MarshalJSON() ([]byte, error) {
805	type noMethod Events
806	raw := noMethod(*s)
807	return gensupport.MarshalJSON(raw, s.ForceSendFields)
808}
809
810// Link: A LinkResource.
811type Link struct {
812	// AdvertiserId: The advertiser id for the advertiser who owns this
813	// link.
814	AdvertiserId int64 `json:"advertiserId,omitempty,string"`
815
816	// Authorship: Authorship
817	Authorship string `json:"authorship,omitempty"`
818
819	// Availability: Availability.
820	Availability string `json:"availability,omitempty"`
821
822	// ClickTrackingUrl: Tracking url for clicks.
823	ClickTrackingUrl string `json:"clickTrackingUrl,omitempty"`
824
825	// CreateDate: Date that this link was created.
826	CreateDate string `json:"createDate,omitempty"`
827
828	// Description: Description.
829	Description string `json:"description,omitempty"`
830
831	// DestinationUrl: The destination URL for the link.
832	DestinationUrl string `json:"destinationUrl,omitempty"`
833
834	// Duration: Duration
835	Duration string `json:"duration,omitempty"`
836
837	// EndDate: Date that this link becomes inactive.
838	EndDate string `json:"endDate,omitempty"`
839
840	// EpcNinetyDayAverage: The sum of fees paid to publishers divided by
841	// the total number of clicks over the past three months on this link.
842	// This value should be multiplied by 100 at the time of display.
843	EpcNinetyDayAverage *Money `json:"epcNinetyDayAverage,omitempty"`
844
845	// EpcSevenDayAverage: The sum of fees paid to publishers divided by the
846	// total number of clicks over the past seven days on this link. This
847	// value should be multiplied by 100 at the time of display.
848	EpcSevenDayAverage *Money `json:"epcSevenDayAverage,omitempty"`
849
850	// Id: The ID of this link.
851	Id int64 `json:"id,omitempty,string"`
852
853	// ImageAltText: image alt text.
854	ImageAltText string `json:"imageAltText,omitempty"`
855
856	// ImpressionTrackingUrl: Tracking url for impressions.
857	ImpressionTrackingUrl string `json:"impressionTrackingUrl,omitempty"`
858
859	// IsActive: Flag for if this link is active.
860	IsActive bool `json:"isActive,omitempty"`
861
862	// Kind: The kind for one entity.
863	Kind string `json:"kind,omitempty"`
864
865	// LinkType: The link type.
866	LinkType string `json:"linkType,omitempty"`
867
868	// Name: The logical name for this link.
869	Name string `json:"name,omitempty"`
870
871	// PromotionType: Promotion Type
872	PromotionType string `json:"promotionType,omitempty"`
873
874	// SpecialOffers: Special offers on the link.
875	SpecialOffers *LinkSpecialOffers `json:"specialOffers,omitempty"`
876
877	// StartDate: Date that this link becomes active.
878	StartDate string `json:"startDate,omitempty"`
879
880	// ServerResponse contains the HTTP response code and headers from the
881	// server.
882	googleapi.ServerResponse `json:"-"`
883
884	// ForceSendFields is a list of field names (e.g. "AdvertiserId") to
885	// unconditionally include in API requests. By default, fields with
886	// empty values are omitted from API requests. However, any non-pointer,
887	// non-interface field appearing in ForceSendFields will be sent to the
888	// server regardless of whether the field is empty or not. This may be
889	// used to include empty fields in Patch requests.
890	ForceSendFields []string `json:"-"`
891}
892
893func (s *Link) MarshalJSON() ([]byte, error) {
894	type noMethod Link
895	raw := noMethod(*s)
896	return gensupport.MarshalJSON(raw, s.ForceSendFields)
897}
898
899// LinkSpecialOffers: Special offers on the link.
900type LinkSpecialOffers struct {
901	// FreeGift: Whether there is a free gift
902	FreeGift bool `json:"freeGift,omitempty"`
903
904	// FreeShipping: Whether there is free shipping
905	FreeShipping bool `json:"freeShipping,omitempty"`
906
907	// FreeShippingMin: Minimum purchase amount for free shipping promotion
908	FreeShippingMin *Money `json:"freeShippingMin,omitempty"`
909
910	// PercentOff: Percent off on the purchase
911	PercentOff float64 `json:"percentOff,omitempty"`
912
913	// PercentOffMin: Minimum purchase amount for percent off promotion
914	PercentOffMin *Money `json:"percentOffMin,omitempty"`
915
916	// PriceCut: Price cut on the purchase
917	PriceCut *Money `json:"priceCut,omitempty"`
918
919	// PriceCutMin: Minimum purchase amount for price cut promotion
920	PriceCutMin *Money `json:"priceCutMin,omitempty"`
921
922	// PromotionCodes: List of promotion code associated with the link
923	PromotionCodes []string `json:"promotionCodes,omitempty"`
924
925	// ForceSendFields is a list of field names (e.g. "FreeGift") to
926	// unconditionally include in API requests. By default, fields with
927	// empty values are omitted from API requests. However, any non-pointer,
928	// non-interface field appearing in ForceSendFields will be sent to the
929	// server regardless of whether the field is empty or not. This may be
930	// used to include empty fields in Patch requests.
931	ForceSendFields []string `json:"-"`
932}
933
934func (s *LinkSpecialOffers) MarshalJSON() ([]byte, error) {
935	type noMethod LinkSpecialOffers
936	raw := noMethod(*s)
937	return gensupport.MarshalJSON(raw, s.ForceSendFields)
938}
939
940type Links struct {
941	// Items: The links.
942	Items []*Link `json:"items,omitempty"`
943
944	// Kind: The kind for a page of links.
945	Kind string `json:"kind,omitempty"`
946
947	// NextPageToken: The next page token.
948	NextPageToken string `json:"nextPageToken,omitempty"`
949
950	// ServerResponse contains the HTTP response code and headers from the
951	// server.
952	googleapi.ServerResponse `json:"-"`
953
954	// ForceSendFields is a list of field names (e.g. "Items") to
955	// unconditionally include in API requests. By default, fields with
956	// empty values are omitted from API requests. However, any non-pointer,
957	// non-interface field appearing in ForceSendFields will be sent to the
958	// server regardless of whether the field is empty or not. This may be
959	// used to include empty fields in Patch requests.
960	ForceSendFields []string `json:"-"`
961}
962
963func (s *Links) MarshalJSON() ([]byte, error) {
964	type noMethod Links
965	raw := noMethod(*s)
966	return gensupport.MarshalJSON(raw, s.ForceSendFields)
967}
968
969// Money: An ApiMoneyProto.
970type Money struct {
971	// Amount: The amount of money.
972	Amount float64 `json:"amount,omitempty"`
973
974	// CurrencyCode: The 3-letter code of the currency in question.
975	CurrencyCode string `json:"currencyCode,omitempty"`
976
977	// ForceSendFields is a list of field names (e.g. "Amount") to
978	// unconditionally include in API requests. By default, fields with
979	// empty values are omitted from API requests. However, any non-pointer,
980	// non-interface field appearing in ForceSendFields will be sent to the
981	// server regardless of whether the field is empty or not. This may be
982	// used to include empty fields in Patch requests.
983	ForceSendFields []string `json:"-"`
984}
985
986func (s *Money) MarshalJSON() ([]byte, error) {
987	type noMethod Money
988	raw := noMethod(*s)
989	return gensupport.MarshalJSON(raw, s.ForceSendFields)
990}
991
992// Publisher: A PublisherResource.
993type Publisher struct {
994	// Classification: Classification that this publisher belongs to. See
995	// this link for all publisher classifications:
996	// http://www.google.com/support/affiliatenetwork/advertiser/bin/answer.py?hl=en&answer=107625&ctx=cb&src=cb&cbid=-k5fihzthfaik&cbrank=4
997	Classification string `json:"classification,omitempty"`
998
999	// EpcNinetyDayAverage: The sum of fees paid to this publisher divided
1000	// by the total number of clicks over the past three months. Values are
1001	// multiplied by 100 for display purposes.
1002	EpcNinetyDayAverage *Money `json:"epcNinetyDayAverage,omitempty"`
1003
1004	// EpcSevenDayAverage: The sum of fees paid to this publisher divided by
1005	// the total number of clicks over the past seven days. Values are
1006	// multiplied by 100 for display purposes.
1007	EpcSevenDayAverage *Money `json:"epcSevenDayAverage,omitempty"`
1008
1009	// Id: The ID of this publisher.
1010	Id int64 `json:"id,omitempty,string"`
1011
1012	// Item: The requested publisher.
1013	Item *Publisher `json:"item,omitempty"`
1014
1015	// JoinDate: Date that this publisher was approved as a Google Affiliate
1016	// Network publisher.
1017	JoinDate string `json:"joinDate,omitempty"`
1018
1019	// Kind: The kind for a publisher.
1020	Kind string `json:"kind,omitempty"`
1021
1022	// Name: The name of this publisher.
1023	Name string `json:"name,omitempty"`
1024
1025	// PayoutRank: A rank based on commissions paid to this publisher over
1026	// the past 90 days. A number between 1 and 4 where 4 means the top
1027	// quartile (most money paid) and 1 means the bottom quartile (least
1028	// money paid).
1029	PayoutRank string `json:"payoutRank,omitempty"`
1030
1031	// Sites: Websites that this publisher uses to advertise.
1032	Sites []string `json:"sites,omitempty"`
1033
1034	// Status: The status of the requesting advertiser's relationship with
1035	// this publisher.
1036	Status string `json:"status,omitempty"`
1037
1038	// ServerResponse contains the HTTP response code and headers from the
1039	// server.
1040	googleapi.ServerResponse `json:"-"`
1041
1042	// ForceSendFields is a list of field names (e.g. "Classification") to
1043	// unconditionally include in API requests. By default, fields with
1044	// empty values are omitted from API requests. However, any non-pointer,
1045	// non-interface field appearing in ForceSendFields will be sent to the
1046	// server regardless of whether the field is empty or not. This may be
1047	// used to include empty fields in Patch requests.
1048	ForceSendFields []string `json:"-"`
1049}
1050
1051func (s *Publisher) MarshalJSON() ([]byte, error) {
1052	type noMethod Publisher
1053	raw := noMethod(*s)
1054	return gensupport.MarshalJSON(raw, s.ForceSendFields)
1055}
1056
1057type Publishers struct {
1058	// Items: The entity list.
1059	Items []*Publisher `json:"items,omitempty"`
1060
1061	// Kind: The kind for a page of entities.
1062	Kind string `json:"kind,omitempty"`
1063
1064	// NextPageToken: The 'pageToken' to pass to the next request to get the
1065	// next page, if there are more to retrieve.
1066	NextPageToken string `json:"nextPageToken,omitempty"`
1067
1068	// ServerResponse contains the HTTP response code and headers from the
1069	// server.
1070	googleapi.ServerResponse `json:"-"`
1071
1072	// ForceSendFields is a list of field names (e.g. "Items") to
1073	// unconditionally include in API requests. By default, fields with
1074	// empty values are omitted from API requests. However, any non-pointer,
1075	// non-interface field appearing in ForceSendFields will be sent to the
1076	// server regardless of whether the field is empty or not. This may be
1077	// used to include empty fields in Patch requests.
1078	ForceSendFields []string `json:"-"`
1079}
1080
1081func (s *Publishers) MarshalJSON() ([]byte, error) {
1082	type noMethod Publishers
1083	raw := noMethod(*s)
1084	return gensupport.MarshalJSON(raw, s.ForceSendFields)
1085}
1086
1087// Report: A ReportResource representing a report of a certain type
1088// either for an advertiser or publisher.
1089type Report struct {
1090	// ColumnNames: The column names for the report
1091	ColumnNames []string `json:"column_names,omitempty"`
1092
1093	// EndDate: The end of the date range for this report, exclusive.
1094	EndDate string `json:"end_date,omitempty"`
1095
1096	// Kind: The kind for a report.
1097	Kind string `json:"kind,omitempty"`
1098
1099	// MatchingRowCount: The number of matching rows before paging is
1100	// applied.
1101	MatchingRowCount int64 `json:"matching_row_count,omitempty,string"`
1102
1103	// Rows: The rows of data for the report
1104	Rows [][]interface{} `json:"rows,omitempty"`
1105
1106	// StartDate: The start of the date range for this report, inclusive.
1107	StartDate string `json:"start_date,omitempty"`
1108
1109	// TotalsRows: The totals rows for the report
1110	TotalsRows [][]interface{} `json:"totals_rows,omitempty"`
1111
1112	// Type: The report type.
1113	Type string `json:"type,omitempty"`
1114
1115	// ServerResponse contains the HTTP response code and headers from the
1116	// server.
1117	googleapi.ServerResponse `json:"-"`
1118
1119	// ForceSendFields is a list of field names (e.g. "ColumnNames") to
1120	// unconditionally include in API requests. By default, fields with
1121	// empty values are omitted from API requests. However, any non-pointer,
1122	// non-interface field appearing in ForceSendFields will be sent to the
1123	// server regardless of whether the field is empty or not. This may be
1124	// used to include empty fields in Patch requests.
1125	ForceSendFields []string `json:"-"`
1126}
1127
1128func (s *Report) MarshalJSON() ([]byte, error) {
1129	type noMethod Report
1130	raw := noMethod(*s)
1131	return gensupport.MarshalJSON(raw, s.ForceSendFields)
1132}
1133
1134// method id "gan.advertisers.get":
1135
1136type AdvertisersGetCall struct {
1137	s            *Service
1138	role         string
1139	roleId       string
1140	urlParams_   gensupport.URLParams
1141	ifNoneMatch_ string
1142	ctx_         context.Context
1143}
1144
1145// Get: Retrieves data about a single advertiser if that the requesting
1146// advertiser/publisher has access to it. Only publishers can lookup
1147// advertisers. Advertisers can request information about themselves by
1148// omitting the advertiserId query parameter.
1149func (r *AdvertisersService) Get(role string, roleId string) *AdvertisersGetCall {
1150	c := &AdvertisersGetCall{s: r.s, urlParams_: make(gensupport.URLParams)}
1151	c.role = role
1152	c.roleId = roleId
1153	return c
1154}
1155
1156// AdvertiserId sets the optional parameter "advertiserId": The ID of
1157// the advertiser to look up.
1158func (c *AdvertisersGetCall) AdvertiserId(advertiserId string) *AdvertisersGetCall {
1159	c.urlParams_.Set("advertiserId", advertiserId)
1160	return c
1161}
1162
1163// Fields allows partial responses to be retrieved. See
1164// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
1165// for more information.
1166func (c *AdvertisersGetCall) Fields(s ...googleapi.Field) *AdvertisersGetCall {
1167	c.urlParams_.Set("fields", googleapi.CombineFields(s))
1168	return c
1169}
1170
1171// IfNoneMatch sets the optional parameter which makes the operation
1172// fail if the object's ETag matches the given value. This is useful for
1173// getting updates only after the object has changed since the last
1174// request. Use googleapi.IsNotModified to check whether the response
1175// error from Do is the result of In-None-Match.
1176func (c *AdvertisersGetCall) IfNoneMatch(entityTag string) *AdvertisersGetCall {
1177	c.ifNoneMatch_ = entityTag
1178	return c
1179}
1180
1181// Context sets the context to be used in this call's Do method. Any
1182// pending HTTP request will be aborted if the provided context is
1183// canceled.
1184func (c *AdvertisersGetCall) Context(ctx context.Context) *AdvertisersGetCall {
1185	c.ctx_ = ctx
1186	return c
1187}
1188
1189func (c *AdvertisersGetCall) doRequest(alt string) (*http.Response, error) {
1190	var body io.Reader = nil
1191	c.urlParams_.Set("alt", alt)
1192	urls := googleapi.ResolveRelative(c.s.BasePath, "{role}/{roleId}/advertiser")
1193	urls += "?" + c.urlParams_.Encode()
1194	req, _ := http.NewRequest("GET", urls, body)
1195	googleapi.Expand(req.URL, map[string]string{
1196		"role":   c.role,
1197		"roleId": c.roleId,
1198	})
1199	req.Header.Set("User-Agent", c.s.userAgent())
1200	if c.ifNoneMatch_ != "" {
1201		req.Header.Set("If-None-Match", c.ifNoneMatch_)
1202	}
1203	if c.ctx_ != nil {
1204		return ctxhttp.Do(c.ctx_, c.s.client, req)
1205	}
1206	return c.s.client.Do(req)
1207}
1208
1209// Do executes the "gan.advertisers.get" call.
1210// Exactly one of *Advertiser or error will be non-nil. Any non-2xx
1211// status code is an error. Response headers are in either
1212// *Advertiser.ServerResponse.Header or (if a response was returned at
1213// all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
1214// to check whether the returned error was because
1215// http.StatusNotModified was returned.
1216func (c *AdvertisersGetCall) Do(opts ...googleapi.CallOption) (*Advertiser, error) {
1217	gensupport.SetOptions(c.urlParams_, opts...)
1218	res, err := c.doRequest("json")
1219	if res != nil && res.StatusCode == http.StatusNotModified {
1220		if res.Body != nil {
1221			res.Body.Close()
1222		}
1223		return nil, &googleapi.Error{
1224			Code:   res.StatusCode,
1225			Header: res.Header,
1226		}
1227	}
1228	if err != nil {
1229		return nil, err
1230	}
1231	defer googleapi.CloseBody(res)
1232	if err := googleapi.CheckResponse(res); err != nil {
1233		return nil, err
1234	}
1235	ret := &Advertiser{
1236		ServerResponse: googleapi.ServerResponse{
1237			Header:         res.Header,
1238			HTTPStatusCode: res.StatusCode,
1239		},
1240	}
1241	if err := json.NewDecoder(res.Body).Decode(&ret); err != nil {
1242		return nil, err
1243	}
1244	return ret, nil
1245	// {
1246	//   "description": "Retrieves data about a single advertiser if that the requesting advertiser/publisher has access to it. Only publishers can lookup advertisers. Advertisers can request information about themselves by omitting the advertiserId query parameter.",
1247	//   "httpMethod": "GET",
1248	//   "id": "gan.advertisers.get",
1249	//   "parameterOrder": [
1250	//     "role",
1251	//     "roleId"
1252	//   ],
1253	//   "parameters": {
1254	//     "advertiserId": {
1255	//       "description": "The ID of the advertiser to look up. Optional.",
1256	//       "location": "query",
1257	//       "type": "string"
1258	//     },
1259	//     "role": {
1260	//       "description": "The role of the requester. Valid values: 'advertisers' or 'publishers'.",
1261	//       "enum": [
1262	//         "advertisers",
1263	//         "publishers"
1264	//       ],
1265	//       "enumDescriptions": [
1266	//         "The requester is requesting as an advertiser.",
1267	//         "The requester is requesting as a publisher."
1268	//       ],
1269	//       "location": "path",
1270	//       "required": true,
1271	//       "type": "string"
1272	//     },
1273	//     "roleId": {
1274	//       "description": "The ID of the requesting advertiser or publisher.",
1275	//       "location": "path",
1276	//       "required": true,
1277	//       "type": "string"
1278	//     }
1279	//   },
1280	//   "path": "{role}/{roleId}/advertiser",
1281	//   "response": {
1282	//     "$ref": "Advertiser"
1283	//   }
1284	// }
1285
1286}
1287
1288// method id "gan.advertisers.list":
1289
1290type AdvertisersListCall struct {
1291	s            *Service
1292	role         string
1293	roleId       string
1294	urlParams_   gensupport.URLParams
1295	ifNoneMatch_ string
1296	ctx_         context.Context
1297}
1298
1299// List: Retrieves data about all advertisers that the requesting
1300// advertiser/publisher has access to.
1301func (r *AdvertisersService) List(role string, roleId string) *AdvertisersListCall {
1302	c := &AdvertisersListCall{s: r.s, urlParams_: make(gensupport.URLParams)}
1303	c.role = role
1304	c.roleId = roleId
1305	return c
1306}
1307
1308// AdvertiserCategory sets the optional parameter "advertiserCategory":
1309// Caret(^) delimted list of advertiser categories. Valid categories are
1310// defined here:
1311// http://www.google.com/support/affiliatenetwork/advertiser/bin/answer.py?hl=en&answer=107581. Filters out all advertisers not in one of the given advertiser
1312// categories.
1313func (c *AdvertisersListCall) AdvertiserCategory(advertiserCategory string) *AdvertisersListCall {
1314	c.urlParams_.Set("advertiserCategory", advertiserCategory)
1315	return c
1316}
1317
1318// MaxResults sets the optional parameter "maxResults": Max number of
1319// items to return in this page.  Defaults to 20.
1320func (c *AdvertisersListCall) MaxResults(maxResults int64) *AdvertisersListCall {
1321	c.urlParams_.Set("maxResults", fmt.Sprint(maxResults))
1322	return c
1323}
1324
1325// MinNinetyDayEpc sets the optional parameter "minNinetyDayEpc":
1326// Filters out all advertisers that have a ninety day EPC average lower
1327// than the given value (inclusive). Min value: 0.0.
1328func (c *AdvertisersListCall) MinNinetyDayEpc(minNinetyDayEpc float64) *AdvertisersListCall {
1329	c.urlParams_.Set("minNinetyDayEpc", fmt.Sprint(minNinetyDayEpc))
1330	return c
1331}
1332
1333// MinPayoutRank sets the optional parameter "minPayoutRank": A value
1334// between 1 and 4, where 1 represents the quartile of advertisers with
1335// the lowest ranks and 4 represents the quartile of advertisers with
1336// the highest ranks. Filters out all advertisers with a lower rank than
1337// the given quartile. For example if a 2 was given only advertisers
1338// with a payout rank of 25 or higher would be included.
1339func (c *AdvertisersListCall) MinPayoutRank(minPayoutRank int64) *AdvertisersListCall {
1340	c.urlParams_.Set("minPayoutRank", fmt.Sprint(minPayoutRank))
1341	return c
1342}
1343
1344// MinSevenDayEpc sets the optional parameter "minSevenDayEpc": Filters
1345// out all advertisers that have a seven day EPC average lower than the
1346// given value (inclusive). Min value: 0.0.
1347func (c *AdvertisersListCall) MinSevenDayEpc(minSevenDayEpc float64) *AdvertisersListCall {
1348	c.urlParams_.Set("minSevenDayEpc", fmt.Sprint(minSevenDayEpc))
1349	return c
1350}
1351
1352// PageToken sets the optional parameter "pageToken": The value of
1353// 'nextPageToken' from the previous page.
1354func (c *AdvertisersListCall) PageToken(pageToken string) *AdvertisersListCall {
1355	c.urlParams_.Set("pageToken", pageToken)
1356	return c
1357}
1358
1359// RelationshipStatus sets the optional parameter "relationshipStatus":
1360// Filters out all advertisers for which do not have the given
1361// relationship status with the requesting publisher.
1362//
1363// Possible values:
1364//   "approved" - An advertiser that has approved your application.
1365//   "available" - An advertiser program that's accepting new
1366// publishers.
1367//   "deactivated" - Deactivated means either the advertiser has removed
1368// you from their program, or it could also mean that you chose to
1369// remove yourself from the advertiser's program.
1370//   "declined" - An advertiser that did not approve your application.
1371//   "pending" - An advertiser program that you've already applied to,
1372// but they haven't yet decided to approve or decline your application.
1373func (c *AdvertisersListCall) RelationshipStatus(relationshipStatus string) *AdvertisersListCall {
1374	c.urlParams_.Set("relationshipStatus", relationshipStatus)
1375	return c
1376}
1377
1378// Fields allows partial responses to be retrieved. See
1379// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
1380// for more information.
1381func (c *AdvertisersListCall) Fields(s ...googleapi.Field) *AdvertisersListCall {
1382	c.urlParams_.Set("fields", googleapi.CombineFields(s))
1383	return c
1384}
1385
1386// IfNoneMatch sets the optional parameter which makes the operation
1387// fail if the object's ETag matches the given value. This is useful for
1388// getting updates only after the object has changed since the last
1389// request. Use googleapi.IsNotModified to check whether the response
1390// error from Do is the result of In-None-Match.
1391func (c *AdvertisersListCall) IfNoneMatch(entityTag string) *AdvertisersListCall {
1392	c.ifNoneMatch_ = entityTag
1393	return c
1394}
1395
1396// Context sets the context to be used in this call's Do method. Any
1397// pending HTTP request will be aborted if the provided context is
1398// canceled.
1399func (c *AdvertisersListCall) Context(ctx context.Context) *AdvertisersListCall {
1400	c.ctx_ = ctx
1401	return c
1402}
1403
1404func (c *AdvertisersListCall) doRequest(alt string) (*http.Response, error) {
1405	var body io.Reader = nil
1406	c.urlParams_.Set("alt", alt)
1407	urls := googleapi.ResolveRelative(c.s.BasePath, "{role}/{roleId}/advertisers")
1408	urls += "?" + c.urlParams_.Encode()
1409	req, _ := http.NewRequest("GET", urls, body)
1410	googleapi.Expand(req.URL, map[string]string{
1411		"role":   c.role,
1412		"roleId": c.roleId,
1413	})
1414	req.Header.Set("User-Agent", c.s.userAgent())
1415	if c.ifNoneMatch_ != "" {
1416		req.Header.Set("If-None-Match", c.ifNoneMatch_)
1417	}
1418	if c.ctx_ != nil {
1419		return ctxhttp.Do(c.ctx_, c.s.client, req)
1420	}
1421	return c.s.client.Do(req)
1422}
1423
1424// Do executes the "gan.advertisers.list" call.
1425// Exactly one of *Advertisers or error will be non-nil. Any non-2xx
1426// status code is an error. Response headers are in either
1427// *Advertisers.ServerResponse.Header or (if a response was returned at
1428// all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
1429// to check whether the returned error was because
1430// http.StatusNotModified was returned.
1431func (c *AdvertisersListCall) Do(opts ...googleapi.CallOption) (*Advertisers, error) {
1432	gensupport.SetOptions(c.urlParams_, opts...)
1433	res, err := c.doRequest("json")
1434	if res != nil && res.StatusCode == http.StatusNotModified {
1435		if res.Body != nil {
1436			res.Body.Close()
1437		}
1438		return nil, &googleapi.Error{
1439			Code:   res.StatusCode,
1440			Header: res.Header,
1441		}
1442	}
1443	if err != nil {
1444		return nil, err
1445	}
1446	defer googleapi.CloseBody(res)
1447	if err := googleapi.CheckResponse(res); err != nil {
1448		return nil, err
1449	}
1450	ret := &Advertisers{
1451		ServerResponse: googleapi.ServerResponse{
1452			Header:         res.Header,
1453			HTTPStatusCode: res.StatusCode,
1454		},
1455	}
1456	if err := json.NewDecoder(res.Body).Decode(&ret); err != nil {
1457		return nil, err
1458	}
1459	return ret, nil
1460	// {
1461	//   "description": "Retrieves data about all advertisers that the requesting advertiser/publisher has access to.",
1462	//   "httpMethod": "GET",
1463	//   "id": "gan.advertisers.list",
1464	//   "parameterOrder": [
1465	//     "role",
1466	//     "roleId"
1467	//   ],
1468	//   "parameters": {
1469	//     "advertiserCategory": {
1470	//       "description": "Caret(^) delimted list of advertiser categories. Valid categories are defined here: http://www.google.com/support/affiliatenetwork/advertiser/bin/answer.py?hl=en\u0026answer=107581. Filters out all advertisers not in one of the given advertiser categories. Optional.",
1471	//       "location": "query",
1472	//       "type": "string"
1473	//     },
1474	//     "maxResults": {
1475	//       "description": "Max number of items to return in this page. Optional. Defaults to 20.",
1476	//       "format": "uint32",
1477	//       "location": "query",
1478	//       "maximum": "100",
1479	//       "minimum": "0",
1480	//       "type": "integer"
1481	//     },
1482	//     "minNinetyDayEpc": {
1483	//       "description": "Filters out all advertisers that have a ninety day EPC average lower than the given value (inclusive). Min value: 0.0. Optional.",
1484	//       "format": "double",
1485	//       "location": "query",
1486	//       "type": "number"
1487	//     },
1488	//     "minPayoutRank": {
1489	//       "description": "A value between 1 and 4, where 1 represents the quartile of advertisers with the lowest ranks and 4 represents the quartile of advertisers with the highest ranks. Filters out all advertisers with a lower rank than the given quartile. For example if a 2 was given only advertisers with a payout rank of 25 or higher would be included. Optional.",
1490	//       "format": "int32",
1491	//       "location": "query",
1492	//       "maximum": "4",
1493	//       "minimum": "1",
1494	//       "type": "integer"
1495	//     },
1496	//     "minSevenDayEpc": {
1497	//       "description": "Filters out all advertisers that have a seven day EPC average lower than the given value (inclusive). Min value: 0.0. Optional.",
1498	//       "format": "double",
1499	//       "location": "query",
1500	//       "type": "number"
1501	//     },
1502	//     "pageToken": {
1503	//       "description": "The value of 'nextPageToken' from the previous page. Optional.",
1504	//       "location": "query",
1505	//       "type": "string"
1506	//     },
1507	//     "relationshipStatus": {
1508	//       "description": "Filters out all advertisers for which do not have the given relationship status with the requesting publisher.",
1509	//       "enum": [
1510	//         "approved",
1511	//         "available",
1512	//         "deactivated",
1513	//         "declined",
1514	//         "pending"
1515	//       ],
1516	//       "enumDescriptions": [
1517	//         "An advertiser that has approved your application.",
1518	//         "An advertiser program that's accepting new publishers.",
1519	//         "Deactivated means either the advertiser has removed you from their program, or it could also mean that you chose to remove yourself from the advertiser's program.",
1520	//         "An advertiser that did not approve your application.",
1521	//         "An advertiser program that you've already applied to, but they haven't yet decided to approve or decline your application."
1522	//       ],
1523	//       "location": "query",
1524	//       "type": "string"
1525	//     },
1526	//     "role": {
1527	//       "description": "The role of the requester. Valid values: 'advertisers' or 'publishers'.",
1528	//       "enum": [
1529	//         "advertisers",
1530	//         "publishers"
1531	//       ],
1532	//       "enumDescriptions": [
1533	//         "The requester is requesting as an advertiser.",
1534	//         "The requester is requesting as a publisher."
1535	//       ],
1536	//       "location": "path",
1537	//       "required": true,
1538	//       "type": "string"
1539	//     },
1540	//     "roleId": {
1541	//       "description": "The ID of the requesting advertiser or publisher.",
1542	//       "location": "path",
1543	//       "required": true,
1544	//       "type": "string"
1545	//     }
1546	//   },
1547	//   "path": "{role}/{roleId}/advertisers",
1548	//   "response": {
1549	//     "$ref": "Advertisers"
1550	//   }
1551	// }
1552
1553}
1554
1555// Pages invokes f for each page of results.
1556// A non-nil error returned from f will halt the iteration.
1557// The provided context supersedes any context provided to the Context method.
1558func (c *AdvertisersListCall) Pages(ctx context.Context, f func(*Advertisers) error) error {
1559	c.ctx_ = ctx
1560	defer c.PageToken(c.urlParams_.Get("pageToken")) // reset paging to original point
1561	for {
1562		x, err := c.Do()
1563		if err != nil {
1564			return err
1565		}
1566		if err := f(x); err != nil {
1567			return err
1568		}
1569		if x.NextPageToken == "" {
1570			return nil
1571		}
1572		c.PageToken(x.NextPageToken)
1573	}
1574}
1575
1576// method id "gan.ccOffers.list":
1577
1578type CcOffersListCall struct {
1579	s            *Service
1580	publisher    string
1581	urlParams_   gensupport.URLParams
1582	ifNoneMatch_ string
1583	ctx_         context.Context
1584}
1585
1586// List: Retrieves credit card offers for the given publisher.
1587func (r *CcOffersService) List(publisher string) *CcOffersListCall {
1588	c := &CcOffersListCall{s: r.s, urlParams_: make(gensupport.URLParams)}
1589	c.publisher = publisher
1590	return c
1591}
1592
1593// Advertiser sets the optional parameter "advertiser": The advertiser
1594// ID of a card issuer whose offers to include. Optional, may be
1595// repeated.
1596func (c *CcOffersListCall) Advertiser(advertiser ...string) *CcOffersListCall {
1597	c.urlParams_.SetMulti("advertiser", append([]string{}, advertiser...))
1598	return c
1599}
1600
1601// Projection sets the optional parameter "projection": The set of
1602// fields to return.
1603//
1604// Possible values:
1605//   "full" - Include all offer fields. This is the default.
1606//   "summary" - Include only the basic fields needed to display an
1607// offer.
1608func (c *CcOffersListCall) Projection(projection string) *CcOffersListCall {
1609	c.urlParams_.Set("projection", projection)
1610	return c
1611}
1612
1613// Fields allows partial responses to be retrieved. See
1614// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
1615// for more information.
1616func (c *CcOffersListCall) Fields(s ...googleapi.Field) *CcOffersListCall {
1617	c.urlParams_.Set("fields", googleapi.CombineFields(s))
1618	return c
1619}
1620
1621// IfNoneMatch sets the optional parameter which makes the operation
1622// fail if the object's ETag matches the given value. This is useful for
1623// getting updates only after the object has changed since the last
1624// request. Use googleapi.IsNotModified to check whether the response
1625// error from Do is the result of In-None-Match.
1626func (c *CcOffersListCall) IfNoneMatch(entityTag string) *CcOffersListCall {
1627	c.ifNoneMatch_ = entityTag
1628	return c
1629}
1630
1631// Context sets the context to be used in this call's Do method. Any
1632// pending HTTP request will be aborted if the provided context is
1633// canceled.
1634func (c *CcOffersListCall) Context(ctx context.Context) *CcOffersListCall {
1635	c.ctx_ = ctx
1636	return c
1637}
1638
1639func (c *CcOffersListCall) doRequest(alt string) (*http.Response, error) {
1640	var body io.Reader = nil
1641	c.urlParams_.Set("alt", alt)
1642	urls := googleapi.ResolveRelative(c.s.BasePath, "publishers/{publisher}/ccOffers")
1643	urls += "?" + c.urlParams_.Encode()
1644	req, _ := http.NewRequest("GET", urls, body)
1645	googleapi.Expand(req.URL, map[string]string{
1646		"publisher": c.publisher,
1647	})
1648	req.Header.Set("User-Agent", c.s.userAgent())
1649	if c.ifNoneMatch_ != "" {
1650		req.Header.Set("If-None-Match", c.ifNoneMatch_)
1651	}
1652	if c.ctx_ != nil {
1653		return ctxhttp.Do(c.ctx_, c.s.client, req)
1654	}
1655	return c.s.client.Do(req)
1656}
1657
1658// Do executes the "gan.ccOffers.list" call.
1659// Exactly one of *CcOffers or error will be non-nil. Any non-2xx status
1660// code is an error. Response headers are in either
1661// *CcOffers.ServerResponse.Header or (if a response was returned at
1662// all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
1663// to check whether the returned error was because
1664// http.StatusNotModified was returned.
1665func (c *CcOffersListCall) Do(opts ...googleapi.CallOption) (*CcOffers, error) {
1666	gensupport.SetOptions(c.urlParams_, opts...)
1667	res, err := c.doRequest("json")
1668	if res != nil && res.StatusCode == http.StatusNotModified {
1669		if res.Body != nil {
1670			res.Body.Close()
1671		}
1672		return nil, &googleapi.Error{
1673			Code:   res.StatusCode,
1674			Header: res.Header,
1675		}
1676	}
1677	if err != nil {
1678		return nil, err
1679	}
1680	defer googleapi.CloseBody(res)
1681	if err := googleapi.CheckResponse(res); err != nil {
1682		return nil, err
1683	}
1684	ret := &CcOffers{
1685		ServerResponse: googleapi.ServerResponse{
1686			Header:         res.Header,
1687			HTTPStatusCode: res.StatusCode,
1688		},
1689	}
1690	if err := json.NewDecoder(res.Body).Decode(&ret); err != nil {
1691		return nil, err
1692	}
1693	return ret, nil
1694	// {
1695	//   "description": "Retrieves credit card offers for the given publisher.",
1696	//   "httpMethod": "GET",
1697	//   "id": "gan.ccOffers.list",
1698	//   "parameterOrder": [
1699	//     "publisher"
1700	//   ],
1701	//   "parameters": {
1702	//     "advertiser": {
1703	//       "description": "The advertiser ID of a card issuer whose offers to include. Optional, may be repeated.",
1704	//       "location": "query",
1705	//       "repeated": true,
1706	//       "type": "string"
1707	//     },
1708	//     "projection": {
1709	//       "description": "The set of fields to return.",
1710	//       "enum": [
1711	//         "full",
1712	//         "summary"
1713	//       ],
1714	//       "enumDescriptions": [
1715	//         "Include all offer fields. This is the default.",
1716	//         "Include only the basic fields needed to display an offer."
1717	//       ],
1718	//       "location": "query",
1719	//       "type": "string"
1720	//     },
1721	//     "publisher": {
1722	//       "description": "The ID of the publisher in question.",
1723	//       "location": "path",
1724	//       "required": true,
1725	//       "type": "string"
1726	//     }
1727	//   },
1728	//   "path": "publishers/{publisher}/ccOffers",
1729	//   "response": {
1730	//     "$ref": "CcOffers"
1731	//   }
1732	// }
1733
1734}
1735
1736// method id "gan.events.list":
1737
1738type EventsListCall struct {
1739	s            *Service
1740	role         string
1741	roleId       string
1742	urlParams_   gensupport.URLParams
1743	ifNoneMatch_ string
1744	ctx_         context.Context
1745}
1746
1747// List: Retrieves event data for a given advertiser/publisher.
1748func (r *EventsService) List(role string, roleId string) *EventsListCall {
1749	c := &EventsListCall{s: r.s, urlParams_: make(gensupport.URLParams)}
1750	c.role = role
1751	c.roleId = roleId
1752	return c
1753}
1754
1755// AdvertiserId sets the optional parameter "advertiserId": Caret(^)
1756// delimited list of advertiser IDs. Filters out all events that do not
1757// reference one of the given advertiser IDs. Only used when under
1758// publishers role.
1759func (c *EventsListCall) AdvertiserId(advertiserId string) *EventsListCall {
1760	c.urlParams_.Set("advertiserId", advertiserId)
1761	return c
1762}
1763
1764// ChargeType sets the optional parameter "chargeType": Filters out all
1765// charge events that are not of the given charge type. Valid values:
1766// 'other', 'slotting_fee', 'monthly_minimum', 'tier_bonus', 'credit',
1767// 'debit'.
1768//
1769// Possible values:
1770//   "credit" - A credit increases the publisher's payout amount and
1771// decreases the advertiser's invoice amount.
1772//   "debit" - A debit reduces the publisher's payout and increases the
1773// advertiser's invoice amount.
1774//   "monthly_minimum" - A payment made to Google by an advertiser as a
1775// minimum monthly network fee.
1776//   "other" - Catch all. Default if unset
1777//   "slotting_fee" - A one time payment made from an advertiser to a
1778// publisher.
1779//   "tier_bonus" - A payment from an advertiser to a publisher for the
1780// publisher maintaining a high tier level
1781func (c *EventsListCall) ChargeType(chargeType string) *EventsListCall {
1782	c.urlParams_.Set("chargeType", chargeType)
1783	return c
1784}
1785
1786// EventDateMax sets the optional parameter "eventDateMax": Filters out
1787// all events later than given date.  Defaults to 24 hours after
1788// eventMin.
1789func (c *EventsListCall) EventDateMax(eventDateMax string) *EventsListCall {
1790	c.urlParams_.Set("eventDateMax", eventDateMax)
1791	return c
1792}
1793
1794// EventDateMin sets the optional parameter "eventDateMin": Filters out
1795// all events earlier than given date.  Defaults to 24 hours from
1796// current date/time.
1797func (c *EventsListCall) EventDateMin(eventDateMin string) *EventsListCall {
1798	c.urlParams_.Set("eventDateMin", eventDateMin)
1799	return c
1800}
1801
1802// LinkId sets the optional parameter "linkId": Caret(^) delimited list
1803// of link IDs. Filters out all events that do not reference one of the
1804// given link IDs.
1805func (c *EventsListCall) LinkId(linkId string) *EventsListCall {
1806	c.urlParams_.Set("linkId", linkId)
1807	return c
1808}
1809
1810// MaxResults sets the optional parameter "maxResults": Max number of
1811// offers to return in this page.  Defaults to 20.
1812func (c *EventsListCall) MaxResults(maxResults int64) *EventsListCall {
1813	c.urlParams_.Set("maxResults", fmt.Sprint(maxResults))
1814	return c
1815}
1816
1817// MemberId sets the optional parameter "memberId": Caret(^) delimited
1818// list of member IDs. Filters out all events that do not reference one
1819// of the given member IDs.
1820func (c *EventsListCall) MemberId(memberId string) *EventsListCall {
1821	c.urlParams_.Set("memberId", memberId)
1822	return c
1823}
1824
1825// ModifyDateMax sets the optional parameter "modifyDateMax": Filters
1826// out all events modified later than given date.  Defaults to 24 hours
1827// after modifyDateMin, if modifyDateMin is explicitly set.
1828func (c *EventsListCall) ModifyDateMax(modifyDateMax string) *EventsListCall {
1829	c.urlParams_.Set("modifyDateMax", modifyDateMax)
1830	return c
1831}
1832
1833// ModifyDateMin sets the optional parameter "modifyDateMin": Filters
1834// out all events modified earlier than given date.  Defaults to 24
1835// hours before the current modifyDateMax, if modifyDateMax is
1836// explicitly set.
1837func (c *EventsListCall) ModifyDateMin(modifyDateMin string) *EventsListCall {
1838	c.urlParams_.Set("modifyDateMin", modifyDateMin)
1839	return c
1840}
1841
1842// OrderId sets the optional parameter "orderId": Caret(^) delimited
1843// list of order IDs. Filters out all events that do not reference one
1844// of the given order IDs.
1845func (c *EventsListCall) OrderId(orderId string) *EventsListCall {
1846	c.urlParams_.Set("orderId", orderId)
1847	return c
1848}
1849
1850// PageToken sets the optional parameter "pageToken": The value of
1851// 'nextPageToken' from the previous page.
1852func (c *EventsListCall) PageToken(pageToken string) *EventsListCall {
1853	c.urlParams_.Set("pageToken", pageToken)
1854	return c
1855}
1856
1857// ProductCategory sets the optional parameter "productCategory":
1858// Caret(^) delimited list of product categories. Filters out all events
1859// that do not reference a product in one of the given product
1860// categories.
1861func (c *EventsListCall) ProductCategory(productCategory string) *EventsListCall {
1862	c.urlParams_.Set("productCategory", productCategory)
1863	return c
1864}
1865
1866// PublisherId sets the optional parameter "publisherId": Caret(^)
1867// delimited list of publisher IDs. Filters out all events that do not
1868// reference one of the given publishers IDs. Only used when under
1869// advertiser role.
1870func (c *EventsListCall) PublisherId(publisherId string) *EventsListCall {
1871	c.urlParams_.Set("publisherId", publisherId)
1872	return c
1873}
1874
1875// Sku sets the optional parameter "sku": Caret(^) delimited list of
1876// SKUs. Filters out all events that do not reference one of the given
1877// SKU.
1878func (c *EventsListCall) Sku(sku string) *EventsListCall {
1879	c.urlParams_.Set("sku", sku)
1880	return c
1881}
1882
1883// Status sets the optional parameter "status": Filters out all events
1884// that do not have the given status. Valid values: 'active',
1885// 'canceled'.
1886//
1887// Possible values:
1888//   "active" - Event is currently active.
1889//   "canceled" - Event is currently canceled.
1890func (c *EventsListCall) Status(status string) *EventsListCall {
1891	c.urlParams_.Set("status", status)
1892	return c
1893}
1894
1895// Type sets the optional parameter "type": Filters out all events that
1896// are not of the given type. Valid values: 'action', 'transaction',
1897// 'charge'.
1898//
1899// Possible values:
1900//   "action" - The completion of an application, sign-up, or other
1901// process. For example, an action occurs if a user clicks an ad for a
1902// credit card and completes an application for that card.
1903//   "charge" - A charge event is typically a payment between an
1904// advertiser, publisher or Google.
1905//   "transaction" - A conversion event, typically an e-commerce
1906// transaction. Some advertisers use a transaction to record other types
1907// of events, such as magazine subscriptions.
1908func (c *EventsListCall) Type(type_ string) *EventsListCall {
1909	c.urlParams_.Set("type", type_)
1910	return c
1911}
1912
1913// Fields allows partial responses to be retrieved. See
1914// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
1915// for more information.
1916func (c *EventsListCall) Fields(s ...googleapi.Field) *EventsListCall {
1917	c.urlParams_.Set("fields", googleapi.CombineFields(s))
1918	return c
1919}
1920
1921// IfNoneMatch sets the optional parameter which makes the operation
1922// fail if the object's ETag matches the given value. This is useful for
1923// getting updates only after the object has changed since the last
1924// request. Use googleapi.IsNotModified to check whether the response
1925// error from Do is the result of In-None-Match.
1926func (c *EventsListCall) IfNoneMatch(entityTag string) *EventsListCall {
1927	c.ifNoneMatch_ = entityTag
1928	return c
1929}
1930
1931// Context sets the context to be used in this call's Do method. Any
1932// pending HTTP request will be aborted if the provided context is
1933// canceled.
1934func (c *EventsListCall) Context(ctx context.Context) *EventsListCall {
1935	c.ctx_ = ctx
1936	return c
1937}
1938
1939func (c *EventsListCall) doRequest(alt string) (*http.Response, error) {
1940	var body io.Reader = nil
1941	c.urlParams_.Set("alt", alt)
1942	urls := googleapi.ResolveRelative(c.s.BasePath, "{role}/{roleId}/events")
1943	urls += "?" + c.urlParams_.Encode()
1944	req, _ := http.NewRequest("GET", urls, body)
1945	googleapi.Expand(req.URL, map[string]string{
1946		"role":   c.role,
1947		"roleId": c.roleId,
1948	})
1949	req.Header.Set("User-Agent", c.s.userAgent())
1950	if c.ifNoneMatch_ != "" {
1951		req.Header.Set("If-None-Match", c.ifNoneMatch_)
1952	}
1953	if c.ctx_ != nil {
1954		return ctxhttp.Do(c.ctx_, c.s.client, req)
1955	}
1956	return c.s.client.Do(req)
1957}
1958
1959// Do executes the "gan.events.list" call.
1960// Exactly one of *Events or error will be non-nil. Any non-2xx status
1961// code is an error. Response headers are in either
1962// *Events.ServerResponse.Header or (if a response was returned at all)
1963// in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to
1964// check whether the returned error was because http.StatusNotModified
1965// was returned.
1966func (c *EventsListCall) Do(opts ...googleapi.CallOption) (*Events, error) {
1967	gensupport.SetOptions(c.urlParams_, opts...)
1968	res, err := c.doRequest("json")
1969	if res != nil && res.StatusCode == http.StatusNotModified {
1970		if res.Body != nil {
1971			res.Body.Close()
1972		}
1973		return nil, &googleapi.Error{
1974			Code:   res.StatusCode,
1975			Header: res.Header,
1976		}
1977	}
1978	if err != nil {
1979		return nil, err
1980	}
1981	defer googleapi.CloseBody(res)
1982	if err := googleapi.CheckResponse(res); err != nil {
1983		return nil, err
1984	}
1985	ret := &Events{
1986		ServerResponse: googleapi.ServerResponse{
1987			Header:         res.Header,
1988			HTTPStatusCode: res.StatusCode,
1989		},
1990	}
1991	if err := json.NewDecoder(res.Body).Decode(&ret); err != nil {
1992		return nil, err
1993	}
1994	return ret, nil
1995	// {
1996	//   "description": "Retrieves event data for a given advertiser/publisher.",
1997	//   "httpMethod": "GET",
1998	//   "id": "gan.events.list",
1999	//   "parameterOrder": [
2000	//     "role",
2001	//     "roleId"
2002	//   ],
2003	//   "parameters": {
2004	//     "advertiserId": {
2005	//       "description": "Caret(^) delimited list of advertiser IDs. Filters out all events that do not reference one of the given advertiser IDs. Only used when under publishers role. Optional.",
2006	//       "location": "query",
2007	//       "type": "string"
2008	//     },
2009	//     "chargeType": {
2010	//       "description": "Filters out all charge events that are not of the given charge type. Valid values: 'other', 'slotting_fee', 'monthly_minimum', 'tier_bonus', 'credit', 'debit'. Optional.",
2011	//       "enum": [
2012	//         "credit",
2013	//         "debit",
2014	//         "monthly_minimum",
2015	//         "other",
2016	//         "slotting_fee",
2017	//         "tier_bonus"
2018	//       ],
2019	//       "enumDescriptions": [
2020	//         "A credit increases the publisher's payout amount and decreases the advertiser's invoice amount.",
2021	//         "A debit reduces the publisher's payout and increases the advertiser's invoice amount.",
2022	//         "A payment made to Google by an advertiser as a minimum monthly network fee.",
2023	//         "Catch all. Default if unset",
2024	//         "A one time payment made from an advertiser to a publisher.",
2025	//         "A payment from an advertiser to a publisher for the publisher maintaining a high tier level"
2026	//       ],
2027	//       "location": "query",
2028	//       "type": "string"
2029	//     },
2030	//     "eventDateMax": {
2031	//       "description": "Filters out all events later than given date. Optional. Defaults to 24 hours after eventMin.",
2032	//       "location": "query",
2033	//       "type": "string"
2034	//     },
2035	//     "eventDateMin": {
2036	//       "description": "Filters out all events earlier than given date. Optional. Defaults to 24 hours from current date/time.",
2037	//       "location": "query",
2038	//       "type": "string"
2039	//     },
2040	//     "linkId": {
2041	//       "description": "Caret(^) delimited list of link IDs. Filters out all events that do not reference one of the given link IDs. Optional.",
2042	//       "location": "query",
2043	//       "type": "string"
2044	//     },
2045	//     "maxResults": {
2046	//       "description": "Max number of offers to return in this page. Optional. Defaults to 20.",
2047	//       "format": "uint32",
2048	//       "location": "query",
2049	//       "maximum": "100",
2050	//       "minimum": "0",
2051	//       "type": "integer"
2052	//     },
2053	//     "memberId": {
2054	//       "description": "Caret(^) delimited list of member IDs. Filters out all events that do not reference one of the given member IDs. Optional.",
2055	//       "location": "query",
2056	//       "type": "string"
2057	//     },
2058	//     "modifyDateMax": {
2059	//       "description": "Filters out all events modified later than given date. Optional. Defaults to 24 hours after modifyDateMin, if modifyDateMin is explicitly set.",
2060	//       "location": "query",
2061	//       "type": "string"
2062	//     },
2063	//     "modifyDateMin": {
2064	//       "description": "Filters out all events modified earlier than given date. Optional. Defaults to 24 hours before the current modifyDateMax, if modifyDateMax is explicitly set.",
2065	//       "location": "query",
2066	//       "type": "string"
2067	//     },
2068	//     "orderId": {
2069	//       "description": "Caret(^) delimited list of order IDs. Filters out all events that do not reference one of the given order IDs. Optional.",
2070	//       "location": "query",
2071	//       "type": "string"
2072	//     },
2073	//     "pageToken": {
2074	//       "description": "The value of 'nextPageToken' from the previous page. Optional.",
2075	//       "location": "query",
2076	//       "type": "string"
2077	//     },
2078	//     "productCategory": {
2079	//       "description": "Caret(^) delimited list of product categories. Filters out all events that do not reference a product in one of the given product categories. Optional.",
2080	//       "location": "query",
2081	//       "type": "string"
2082	//     },
2083	//     "publisherId": {
2084	//       "description": "Caret(^) delimited list of publisher IDs. Filters out all events that do not reference one of the given publishers IDs. Only used when under advertiser role. Optional.",
2085	//       "location": "query",
2086	//       "type": "string"
2087	//     },
2088	//     "role": {
2089	//       "description": "The role of the requester. Valid values: 'advertisers' or 'publishers'.",
2090	//       "enum": [
2091	//         "advertisers",
2092	//         "publishers"
2093	//       ],
2094	//       "enumDescriptions": [
2095	//         "The requester is requesting as an advertiser.",
2096	//         "The requester is requesting as a publisher."
2097	//       ],
2098	//       "location": "path",
2099	//       "required": true,
2100	//       "type": "string"
2101	//     },
2102	//     "roleId": {
2103	//       "description": "The ID of the requesting advertiser or publisher.",
2104	//       "location": "path",
2105	//       "required": true,
2106	//       "type": "string"
2107	//     },
2108	//     "sku": {
2109	//       "description": "Caret(^) delimited list of SKUs. Filters out all events that do not reference one of the given SKU. Optional.",
2110	//       "location": "query",
2111	//       "type": "string"
2112	//     },
2113	//     "status": {
2114	//       "description": "Filters out all events that do not have the given status. Valid values: 'active', 'canceled'. Optional.",
2115	//       "enum": [
2116	//         "active",
2117	//         "canceled"
2118	//       ],
2119	//       "enumDescriptions": [
2120	//         "Event is currently active.",
2121	//         "Event is currently canceled."
2122	//       ],
2123	//       "location": "query",
2124	//       "type": "string"
2125	//     },
2126	//     "type": {
2127	//       "description": "Filters out all events that are not of the given type. Valid values: 'action', 'transaction', 'charge'. Optional.",
2128	//       "enum": [
2129	//         "action",
2130	//         "charge",
2131	//         "transaction"
2132	//       ],
2133	//       "enumDescriptions": [
2134	//         "The completion of an application, sign-up, or other process. For example, an action occurs if a user clicks an ad for a credit card and completes an application for that card.",
2135	//         "A charge event is typically a payment between an advertiser, publisher or Google.",
2136	//         "A conversion event, typically an e-commerce transaction. Some advertisers use a transaction to record other types of events, such as magazine subscriptions."
2137	//       ],
2138	//       "location": "query",
2139	//       "type": "string"
2140	//     }
2141	//   },
2142	//   "path": "{role}/{roleId}/events",
2143	//   "response": {
2144	//     "$ref": "Events"
2145	//   }
2146	// }
2147
2148}
2149
2150// Pages invokes f for each page of results.
2151// A non-nil error returned from f will halt the iteration.
2152// The provided context supersedes any context provided to the Context method.
2153func (c *EventsListCall) Pages(ctx context.Context, f func(*Events) error) error {
2154	c.ctx_ = ctx
2155	defer c.PageToken(c.urlParams_.Get("pageToken")) // reset paging to original point
2156	for {
2157		x, err := c.Do()
2158		if err != nil {
2159			return err
2160		}
2161		if err := f(x); err != nil {
2162			return err
2163		}
2164		if x.NextPageToken == "" {
2165			return nil
2166		}
2167		c.PageToken(x.NextPageToken)
2168	}
2169}
2170
2171// method id "gan.links.get":
2172
2173type LinksGetCall struct {
2174	s            *Service
2175	role         string
2176	roleId       string
2177	linkId       int64
2178	urlParams_   gensupport.URLParams
2179	ifNoneMatch_ string
2180	ctx_         context.Context
2181}
2182
2183// Get: Retrieves data about a single link if the requesting
2184// advertiser/publisher has access to it. Advertisers can look up their
2185// own links. Publishers can look up visible links or links belonging to
2186// advertisers they are in a relationship with.
2187func (r *LinksService) Get(role string, roleId string, linkId int64) *LinksGetCall {
2188	c := &LinksGetCall{s: r.s, urlParams_: make(gensupport.URLParams)}
2189	c.role = role
2190	c.roleId = roleId
2191	c.linkId = linkId
2192	return c
2193}
2194
2195// Fields allows partial responses to be retrieved. See
2196// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
2197// for more information.
2198func (c *LinksGetCall) Fields(s ...googleapi.Field) *LinksGetCall {
2199	c.urlParams_.Set("fields", googleapi.CombineFields(s))
2200	return c
2201}
2202
2203// IfNoneMatch sets the optional parameter which makes the operation
2204// fail if the object's ETag matches the given value. This is useful for
2205// getting updates only after the object has changed since the last
2206// request. Use googleapi.IsNotModified to check whether the response
2207// error from Do is the result of In-None-Match.
2208func (c *LinksGetCall) IfNoneMatch(entityTag string) *LinksGetCall {
2209	c.ifNoneMatch_ = entityTag
2210	return c
2211}
2212
2213// Context sets the context to be used in this call's Do method. Any
2214// pending HTTP request will be aborted if the provided context is
2215// canceled.
2216func (c *LinksGetCall) Context(ctx context.Context) *LinksGetCall {
2217	c.ctx_ = ctx
2218	return c
2219}
2220
2221func (c *LinksGetCall) doRequest(alt string) (*http.Response, error) {
2222	var body io.Reader = nil
2223	c.urlParams_.Set("alt", alt)
2224	urls := googleapi.ResolveRelative(c.s.BasePath, "{role}/{roleId}/link/{linkId}")
2225	urls += "?" + c.urlParams_.Encode()
2226	req, _ := http.NewRequest("GET", urls, body)
2227	googleapi.Expand(req.URL, map[string]string{
2228		"role":   c.role,
2229		"roleId": c.roleId,
2230		"linkId": strconv.FormatInt(c.linkId, 10),
2231	})
2232	req.Header.Set("User-Agent", c.s.userAgent())
2233	if c.ifNoneMatch_ != "" {
2234		req.Header.Set("If-None-Match", c.ifNoneMatch_)
2235	}
2236	if c.ctx_ != nil {
2237		return ctxhttp.Do(c.ctx_, c.s.client, req)
2238	}
2239	return c.s.client.Do(req)
2240}
2241
2242// Do executes the "gan.links.get" call.
2243// Exactly one of *Link or error will be non-nil. Any non-2xx status
2244// code is an error. Response headers are in either
2245// *Link.ServerResponse.Header or (if a response was returned at all) in
2246// error.(*googleapi.Error).Header. Use googleapi.IsNotModified to check
2247// whether the returned error was because http.StatusNotModified was
2248// returned.
2249func (c *LinksGetCall) Do(opts ...googleapi.CallOption) (*Link, error) {
2250	gensupport.SetOptions(c.urlParams_, opts...)
2251	res, err := c.doRequest("json")
2252	if res != nil && res.StatusCode == http.StatusNotModified {
2253		if res.Body != nil {
2254			res.Body.Close()
2255		}
2256		return nil, &googleapi.Error{
2257			Code:   res.StatusCode,
2258			Header: res.Header,
2259		}
2260	}
2261	if err != nil {
2262		return nil, err
2263	}
2264	defer googleapi.CloseBody(res)
2265	if err := googleapi.CheckResponse(res); err != nil {
2266		return nil, err
2267	}
2268	ret := &Link{
2269		ServerResponse: googleapi.ServerResponse{
2270			Header:         res.Header,
2271			HTTPStatusCode: res.StatusCode,
2272		},
2273	}
2274	if err := json.NewDecoder(res.Body).Decode(&ret); err != nil {
2275		return nil, err
2276	}
2277	return ret, nil
2278	// {
2279	//   "description": "Retrieves data about a single link if the requesting advertiser/publisher has access to it. Advertisers can look up their own links. Publishers can look up visible links or links belonging to advertisers they are in a relationship with.",
2280	//   "httpMethod": "GET",
2281	//   "id": "gan.links.get",
2282	//   "parameterOrder": [
2283	//     "role",
2284	//     "roleId",
2285	//     "linkId"
2286	//   ],
2287	//   "parameters": {
2288	//     "linkId": {
2289	//       "description": "The ID of the link to look up.",
2290	//       "format": "int64",
2291	//       "location": "path",
2292	//       "required": true,
2293	//       "type": "string"
2294	//     },
2295	//     "role": {
2296	//       "description": "The role of the requester. Valid values: 'advertisers' or 'publishers'.",
2297	//       "enum": [
2298	//         "advertisers",
2299	//         "publishers"
2300	//       ],
2301	//       "enumDescriptions": [
2302	//         "The requester is requesting as an advertiser.",
2303	//         "The requester is requesting as a publisher."
2304	//       ],
2305	//       "location": "path",
2306	//       "required": true,
2307	//       "type": "string"
2308	//     },
2309	//     "roleId": {
2310	//       "description": "The ID of the requesting advertiser or publisher.",
2311	//       "location": "path",
2312	//       "required": true,
2313	//       "type": "string"
2314	//     }
2315	//   },
2316	//   "path": "{role}/{roleId}/link/{linkId}",
2317	//   "response": {
2318	//     "$ref": "Link"
2319	//   }
2320	// }
2321
2322}
2323
2324// method id "gan.links.insert":
2325
2326type LinksInsertCall struct {
2327	s          *Service
2328	role       string
2329	roleId     string
2330	link       *Link
2331	urlParams_ gensupport.URLParams
2332	ctx_       context.Context
2333}
2334
2335// Insert: Inserts a new link.
2336func (r *LinksService) Insert(role string, roleId string, link *Link) *LinksInsertCall {
2337	c := &LinksInsertCall{s: r.s, urlParams_: make(gensupport.URLParams)}
2338	c.role = role
2339	c.roleId = roleId
2340	c.link = link
2341	return c
2342}
2343
2344// Fields allows partial responses to be retrieved. See
2345// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
2346// for more information.
2347func (c *LinksInsertCall) Fields(s ...googleapi.Field) *LinksInsertCall {
2348	c.urlParams_.Set("fields", googleapi.CombineFields(s))
2349	return c
2350}
2351
2352// Context sets the context to be used in this call's Do method. Any
2353// pending HTTP request will be aborted if the provided context is
2354// canceled.
2355func (c *LinksInsertCall) Context(ctx context.Context) *LinksInsertCall {
2356	c.ctx_ = ctx
2357	return c
2358}
2359
2360func (c *LinksInsertCall) doRequest(alt string) (*http.Response, error) {
2361	var body io.Reader = nil
2362	body, err := googleapi.WithoutDataWrapper.JSONReader(c.link)
2363	if err != nil {
2364		return nil, err
2365	}
2366	ctype := "application/json"
2367	c.urlParams_.Set("alt", alt)
2368	urls := googleapi.ResolveRelative(c.s.BasePath, "{role}/{roleId}/link")
2369	urls += "?" + c.urlParams_.Encode()
2370	req, _ := http.NewRequest("POST", urls, body)
2371	googleapi.Expand(req.URL, map[string]string{
2372		"role":   c.role,
2373		"roleId": c.roleId,
2374	})
2375	req.Header.Set("Content-Type", ctype)
2376	req.Header.Set("User-Agent", c.s.userAgent())
2377	if c.ctx_ != nil {
2378		return ctxhttp.Do(c.ctx_, c.s.client, req)
2379	}
2380	return c.s.client.Do(req)
2381}
2382
2383// Do executes the "gan.links.insert" call.
2384// Exactly one of *Link or error will be non-nil. Any non-2xx status
2385// code is an error. Response headers are in either
2386// *Link.ServerResponse.Header or (if a response was returned at all) in
2387// error.(*googleapi.Error).Header. Use googleapi.IsNotModified to check
2388// whether the returned error was because http.StatusNotModified was
2389// returned.
2390func (c *LinksInsertCall) Do(opts ...googleapi.CallOption) (*Link, error) {
2391	gensupport.SetOptions(c.urlParams_, opts...)
2392	res, err := c.doRequest("json")
2393	if res != nil && res.StatusCode == http.StatusNotModified {
2394		if res.Body != nil {
2395			res.Body.Close()
2396		}
2397		return nil, &googleapi.Error{
2398			Code:   res.StatusCode,
2399			Header: res.Header,
2400		}
2401	}
2402	if err != nil {
2403		return nil, err
2404	}
2405	defer googleapi.CloseBody(res)
2406	if err := googleapi.CheckResponse(res); err != nil {
2407		return nil, err
2408	}
2409	ret := &Link{
2410		ServerResponse: googleapi.ServerResponse{
2411			Header:         res.Header,
2412			HTTPStatusCode: res.StatusCode,
2413		},
2414	}
2415	if err := json.NewDecoder(res.Body).Decode(&ret); err != nil {
2416		return nil, err
2417	}
2418	return ret, nil
2419	// {
2420	//   "description": "Inserts a new link.",
2421	//   "httpMethod": "POST",
2422	//   "id": "gan.links.insert",
2423	//   "parameterOrder": [
2424	//     "role",
2425	//     "roleId"
2426	//   ],
2427	//   "parameters": {
2428	//     "role": {
2429	//       "description": "The role of the requester. Valid values: 'advertisers' or 'publishers'.",
2430	//       "enum": [
2431	//         "advertisers",
2432	//         "publishers"
2433	//       ],
2434	//       "enumDescriptions": [
2435	//         "The requester is requesting as an advertiser.",
2436	//         "The requester is requesting as a publisher."
2437	//       ],
2438	//       "location": "path",
2439	//       "required": true,
2440	//       "type": "string"
2441	//     },
2442	//     "roleId": {
2443	//       "description": "The ID of the requesting advertiser or publisher.",
2444	//       "location": "path",
2445	//       "required": true,
2446	//       "type": "string"
2447	//     }
2448	//   },
2449	//   "path": "{role}/{roleId}/link",
2450	//   "request": {
2451	//     "$ref": "Link"
2452	//   },
2453	//   "response": {
2454	//     "$ref": "Link"
2455	//   }
2456	// }
2457
2458}
2459
2460// method id "gan.links.list":
2461
2462type LinksListCall struct {
2463	s            *Service
2464	role         string
2465	roleId       string
2466	urlParams_   gensupport.URLParams
2467	ifNoneMatch_ string
2468	ctx_         context.Context
2469}
2470
2471// List: Retrieves all links that match the query parameters.
2472func (r *LinksService) List(role string, roleId string) *LinksListCall {
2473	c := &LinksListCall{s: r.s, urlParams_: make(gensupport.URLParams)}
2474	c.role = role
2475	c.roleId = roleId
2476	return c
2477}
2478
2479// AdvertiserId sets the optional parameter "advertiserId": Limits the
2480// resulting links to the ones belonging to the listed advertisers.
2481func (c *LinksListCall) AdvertiserId(advertiserId ...int64) *LinksListCall {
2482	var advertiserId_ []string
2483	for _, v := range advertiserId {
2484		advertiserId_ = append(advertiserId_, fmt.Sprint(v))
2485	}
2486	c.urlParams_.SetMulti("advertiserId", advertiserId_)
2487	return c
2488}
2489
2490// AssetSize sets the optional parameter "assetSize": The size of the
2491// given asset.
2492func (c *LinksListCall) AssetSize(assetSize ...string) *LinksListCall {
2493	c.urlParams_.SetMulti("assetSize", append([]string{}, assetSize...))
2494	return c
2495}
2496
2497// Authorship sets the optional parameter "authorship": The role of the
2498// author of the link.
2499//
2500// Possible values:
2501//   "advertiser"
2502//   "publisher"
2503func (c *LinksListCall) Authorship(authorship string) *LinksListCall {
2504	c.urlParams_.Set("authorship", authorship)
2505	return c
2506}
2507
2508// CreateDateMax sets the optional parameter "createDateMax": The end of
2509// the create date range.
2510func (c *LinksListCall) CreateDateMax(createDateMax string) *LinksListCall {
2511	c.urlParams_.Set("createDateMax", createDateMax)
2512	return c
2513}
2514
2515// CreateDateMin sets the optional parameter "createDateMin": The
2516// beginning of the create date range.
2517func (c *LinksListCall) CreateDateMin(createDateMin string) *LinksListCall {
2518	c.urlParams_.Set("createDateMin", createDateMin)
2519	return c
2520}
2521
2522// LinkType sets the optional parameter "linkType": The type of the
2523// link.
2524//
2525// Possible values:
2526//   "banner"
2527//   "text"
2528func (c *LinksListCall) LinkType(linkType string) *LinksListCall {
2529	c.urlParams_.Set("linkType", linkType)
2530	return c
2531}
2532
2533// MaxResults sets the optional parameter "maxResults": Max number of
2534// items to return in this page.  Defaults to 20.
2535func (c *LinksListCall) MaxResults(maxResults int64) *LinksListCall {
2536	c.urlParams_.Set("maxResults", fmt.Sprint(maxResults))
2537	return c
2538}
2539
2540// PageToken sets the optional parameter "pageToken": The value of
2541// 'nextPageToken' from the previous page.
2542func (c *LinksListCall) PageToken(pageToken string) *LinksListCall {
2543	c.urlParams_.Set("pageToken", pageToken)
2544	return c
2545}
2546
2547// PromotionType sets the optional parameter "promotionType": The
2548// promotion type.
2549//
2550// Possible values:
2551//   "coupon"
2552//   "free_gift"
2553//   "free_shipping"
2554//   "percent_off"
2555//   "price_cut"
2556func (c *LinksListCall) PromotionType(promotionType ...string) *LinksListCall {
2557	c.urlParams_.SetMulti("promotionType", append([]string{}, promotionType...))
2558	return c
2559}
2560
2561// RelationshipStatus sets the optional parameter "relationshipStatus":
2562// The status of the relationship.
2563//
2564// Possible values:
2565//   "approved"
2566//   "available"
2567func (c *LinksListCall) RelationshipStatus(relationshipStatus string) *LinksListCall {
2568	c.urlParams_.Set("relationshipStatus", relationshipStatus)
2569	return c
2570}
2571
2572// SearchText sets the optional parameter "searchText": Field for full
2573// text search across title and merchandising text, supports link id
2574// search.
2575func (c *LinksListCall) SearchText(searchText string) *LinksListCall {
2576	c.urlParams_.Set("searchText", searchText)
2577	return c
2578}
2579
2580// StartDateMax sets the optional parameter "startDateMax": The end of
2581// the start date range.
2582func (c *LinksListCall) StartDateMax(startDateMax string) *LinksListCall {
2583	c.urlParams_.Set("startDateMax", startDateMax)
2584	return c
2585}
2586
2587// StartDateMin sets the optional parameter "startDateMin": The
2588// beginning of the start date range.
2589func (c *LinksListCall) StartDateMin(startDateMin string) *LinksListCall {
2590	c.urlParams_.Set("startDateMin", startDateMin)
2591	return c
2592}
2593
2594// Fields allows partial responses to be retrieved. See
2595// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
2596// for more information.
2597func (c *LinksListCall) Fields(s ...googleapi.Field) *LinksListCall {
2598	c.urlParams_.Set("fields", googleapi.CombineFields(s))
2599	return c
2600}
2601
2602// IfNoneMatch sets the optional parameter which makes the operation
2603// fail if the object's ETag matches the given value. This is useful for
2604// getting updates only after the object has changed since the last
2605// request. Use googleapi.IsNotModified to check whether the response
2606// error from Do is the result of In-None-Match.
2607func (c *LinksListCall) IfNoneMatch(entityTag string) *LinksListCall {
2608	c.ifNoneMatch_ = entityTag
2609	return c
2610}
2611
2612// Context sets the context to be used in this call's Do method. Any
2613// pending HTTP request will be aborted if the provided context is
2614// canceled.
2615func (c *LinksListCall) Context(ctx context.Context) *LinksListCall {
2616	c.ctx_ = ctx
2617	return c
2618}
2619
2620func (c *LinksListCall) doRequest(alt string) (*http.Response, error) {
2621	var body io.Reader = nil
2622	c.urlParams_.Set("alt", alt)
2623	urls := googleapi.ResolveRelative(c.s.BasePath, "{role}/{roleId}/links")
2624	urls += "?" + c.urlParams_.Encode()
2625	req, _ := http.NewRequest("GET", urls, body)
2626	googleapi.Expand(req.URL, map[string]string{
2627		"role":   c.role,
2628		"roleId": c.roleId,
2629	})
2630	req.Header.Set("User-Agent", c.s.userAgent())
2631	if c.ifNoneMatch_ != "" {
2632		req.Header.Set("If-None-Match", c.ifNoneMatch_)
2633	}
2634	if c.ctx_ != nil {
2635		return ctxhttp.Do(c.ctx_, c.s.client, req)
2636	}
2637	return c.s.client.Do(req)
2638}
2639
2640// Do executes the "gan.links.list" call.
2641// Exactly one of *Links or error will be non-nil. Any non-2xx status
2642// code is an error. Response headers are in either
2643// *Links.ServerResponse.Header or (if a response was returned at all)
2644// in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to
2645// check whether the returned error was because http.StatusNotModified
2646// was returned.
2647func (c *LinksListCall) Do(opts ...googleapi.CallOption) (*Links, error) {
2648	gensupport.SetOptions(c.urlParams_, opts...)
2649	res, err := c.doRequest("json")
2650	if res != nil && res.StatusCode == http.StatusNotModified {
2651		if res.Body != nil {
2652			res.Body.Close()
2653		}
2654		return nil, &googleapi.Error{
2655			Code:   res.StatusCode,
2656			Header: res.Header,
2657		}
2658	}
2659	if err != nil {
2660		return nil, err
2661	}
2662	defer googleapi.CloseBody(res)
2663	if err := googleapi.CheckResponse(res); err != nil {
2664		return nil, err
2665	}
2666	ret := &Links{
2667		ServerResponse: googleapi.ServerResponse{
2668			Header:         res.Header,
2669			HTTPStatusCode: res.StatusCode,
2670		},
2671	}
2672	if err := json.NewDecoder(res.Body).Decode(&ret); err != nil {
2673		return nil, err
2674	}
2675	return ret, nil
2676	// {
2677	//   "description": "Retrieves all links that match the query parameters.",
2678	//   "httpMethod": "GET",
2679	//   "id": "gan.links.list",
2680	//   "parameterOrder": [
2681	//     "role",
2682	//     "roleId"
2683	//   ],
2684	//   "parameters": {
2685	//     "advertiserId": {
2686	//       "description": "Limits the resulting links to the ones belonging to the listed advertisers.",
2687	//       "format": "int64",
2688	//       "location": "query",
2689	//       "repeated": true,
2690	//       "type": "string"
2691	//     },
2692	//     "assetSize": {
2693	//       "description": "The size of the given asset.",
2694	//       "location": "query",
2695	//       "repeated": true,
2696	//       "type": "string"
2697	//     },
2698	//     "authorship": {
2699	//       "description": "The role of the author of the link.",
2700	//       "enum": [
2701	//         "advertiser",
2702	//         "publisher"
2703	//       ],
2704	//       "enumDescriptions": [
2705	//         "",
2706	//         ""
2707	//       ],
2708	//       "location": "query",
2709	//       "type": "string"
2710	//     },
2711	//     "createDateMax": {
2712	//       "description": "The end of the create date range.",
2713	//       "location": "query",
2714	//       "type": "string"
2715	//     },
2716	//     "createDateMin": {
2717	//       "description": "The beginning of the create date range.",
2718	//       "location": "query",
2719	//       "type": "string"
2720	//     },
2721	//     "linkType": {
2722	//       "description": "The type of the link.",
2723	//       "enum": [
2724	//         "banner",
2725	//         "text"
2726	//       ],
2727	//       "enumDescriptions": [
2728	//         "",
2729	//         ""
2730	//       ],
2731	//       "location": "query",
2732	//       "type": "string"
2733	//     },
2734	//     "maxResults": {
2735	//       "description": "Max number of items to return in this page. Optional. Defaults to 20.",
2736	//       "format": "uint32",
2737	//       "location": "query",
2738	//       "maximum": "100",
2739	//       "minimum": "0",
2740	//       "type": "integer"
2741	//     },
2742	//     "pageToken": {
2743	//       "description": "The value of 'nextPageToken' from the previous page. Optional.",
2744	//       "location": "query",
2745	//       "type": "string"
2746	//     },
2747	//     "promotionType": {
2748	//       "description": "The promotion type.",
2749	//       "enum": [
2750	//         "coupon",
2751	//         "free_gift",
2752	//         "free_shipping",
2753	//         "percent_off",
2754	//         "price_cut"
2755	//       ],
2756	//       "enumDescriptions": [
2757	//         "",
2758	//         "",
2759	//         "",
2760	//         "",
2761	//         ""
2762	//       ],
2763	//       "location": "query",
2764	//       "repeated": true,
2765	//       "type": "string"
2766	//     },
2767	//     "relationshipStatus": {
2768	//       "description": "The status of the relationship.",
2769	//       "enum": [
2770	//         "approved",
2771	//         "available"
2772	//       ],
2773	//       "enumDescriptions": [
2774	//         "",
2775	//         ""
2776	//       ],
2777	//       "location": "query",
2778	//       "type": "string"
2779	//     },
2780	//     "role": {
2781	//       "description": "The role of the requester. Valid values: 'advertisers' or 'publishers'.",
2782	//       "enum": [
2783	//         "advertisers",
2784	//         "publishers"
2785	//       ],
2786	//       "enumDescriptions": [
2787	//         "The requester is requesting as an advertiser.",
2788	//         "The requester is requesting as a publisher."
2789	//       ],
2790	//       "location": "path",
2791	//       "required": true,
2792	//       "type": "string"
2793	//     },
2794	//     "roleId": {
2795	//       "description": "The ID of the requesting advertiser or publisher.",
2796	//       "location": "path",
2797	//       "required": true,
2798	//       "type": "string"
2799	//     },
2800	//     "searchText": {
2801	//       "description": "Field for full text search across title and merchandising text, supports link id search.",
2802	//       "location": "query",
2803	//       "type": "string"
2804	//     },
2805	//     "startDateMax": {
2806	//       "description": "The end of the start date range.",
2807	//       "location": "query",
2808	//       "type": "string"
2809	//     },
2810	//     "startDateMin": {
2811	//       "description": "The beginning of the start date range.",
2812	//       "location": "query",
2813	//       "type": "string"
2814	//     }
2815	//   },
2816	//   "path": "{role}/{roleId}/links",
2817	//   "response": {
2818	//     "$ref": "Links"
2819	//   }
2820	// }
2821
2822}
2823
2824// Pages invokes f for each page of results.
2825// A non-nil error returned from f will halt the iteration.
2826// The provided context supersedes any context provided to the Context method.
2827func (c *LinksListCall) Pages(ctx context.Context, f func(*Links) error) error {
2828	c.ctx_ = ctx
2829	defer c.PageToken(c.urlParams_.Get("pageToken")) // reset paging to original point
2830	for {
2831		x, err := c.Do()
2832		if err != nil {
2833			return err
2834		}
2835		if err := f(x); err != nil {
2836			return err
2837		}
2838		if x.NextPageToken == "" {
2839			return nil
2840		}
2841		c.PageToken(x.NextPageToken)
2842	}
2843}
2844
2845// method id "gan.publishers.get":
2846
2847type PublishersGetCall struct {
2848	s            *Service
2849	role         string
2850	roleId       string
2851	urlParams_   gensupport.URLParams
2852	ifNoneMatch_ string
2853	ctx_         context.Context
2854}
2855
2856// Get: Retrieves data about a single advertiser if that the requesting
2857// advertiser/publisher has access to it. Only advertisers can look up
2858// publishers. Publishers can request information about themselves by
2859// omitting the publisherId query parameter.
2860func (r *PublishersService) Get(role string, roleId string) *PublishersGetCall {
2861	c := &PublishersGetCall{s: r.s, urlParams_: make(gensupport.URLParams)}
2862	c.role = role
2863	c.roleId = roleId
2864	return c
2865}
2866
2867// PublisherId sets the optional parameter "publisherId": The ID of the
2868// publisher to look up.
2869func (c *PublishersGetCall) PublisherId(publisherId string) *PublishersGetCall {
2870	c.urlParams_.Set("publisherId", publisherId)
2871	return c
2872}
2873
2874// Fields allows partial responses to be retrieved. See
2875// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
2876// for more information.
2877func (c *PublishersGetCall) Fields(s ...googleapi.Field) *PublishersGetCall {
2878	c.urlParams_.Set("fields", googleapi.CombineFields(s))
2879	return c
2880}
2881
2882// IfNoneMatch sets the optional parameter which makes the operation
2883// fail if the object's ETag matches the given value. This is useful for
2884// getting updates only after the object has changed since the last
2885// request. Use googleapi.IsNotModified to check whether the response
2886// error from Do is the result of In-None-Match.
2887func (c *PublishersGetCall) IfNoneMatch(entityTag string) *PublishersGetCall {
2888	c.ifNoneMatch_ = entityTag
2889	return c
2890}
2891
2892// Context sets the context to be used in this call's Do method. Any
2893// pending HTTP request will be aborted if the provided context is
2894// canceled.
2895func (c *PublishersGetCall) Context(ctx context.Context) *PublishersGetCall {
2896	c.ctx_ = ctx
2897	return c
2898}
2899
2900func (c *PublishersGetCall) doRequest(alt string) (*http.Response, error) {
2901	var body io.Reader = nil
2902	c.urlParams_.Set("alt", alt)
2903	urls := googleapi.ResolveRelative(c.s.BasePath, "{role}/{roleId}/publisher")
2904	urls += "?" + c.urlParams_.Encode()
2905	req, _ := http.NewRequest("GET", urls, body)
2906	googleapi.Expand(req.URL, map[string]string{
2907		"role":   c.role,
2908		"roleId": c.roleId,
2909	})
2910	req.Header.Set("User-Agent", c.s.userAgent())
2911	if c.ifNoneMatch_ != "" {
2912		req.Header.Set("If-None-Match", c.ifNoneMatch_)
2913	}
2914	if c.ctx_ != nil {
2915		return ctxhttp.Do(c.ctx_, c.s.client, req)
2916	}
2917	return c.s.client.Do(req)
2918}
2919
2920// Do executes the "gan.publishers.get" call.
2921// Exactly one of *Publisher or error will be non-nil. Any non-2xx
2922// status code is an error. Response headers are in either
2923// *Publisher.ServerResponse.Header or (if a response was returned at
2924// all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
2925// to check whether the returned error was because
2926// http.StatusNotModified was returned.
2927func (c *PublishersGetCall) Do(opts ...googleapi.CallOption) (*Publisher, error) {
2928	gensupport.SetOptions(c.urlParams_, opts...)
2929	res, err := c.doRequest("json")
2930	if res != nil && res.StatusCode == http.StatusNotModified {
2931		if res.Body != nil {
2932			res.Body.Close()
2933		}
2934		return nil, &googleapi.Error{
2935			Code:   res.StatusCode,
2936			Header: res.Header,
2937		}
2938	}
2939	if err != nil {
2940		return nil, err
2941	}
2942	defer googleapi.CloseBody(res)
2943	if err := googleapi.CheckResponse(res); err != nil {
2944		return nil, err
2945	}
2946	ret := &Publisher{
2947		ServerResponse: googleapi.ServerResponse{
2948			Header:         res.Header,
2949			HTTPStatusCode: res.StatusCode,
2950		},
2951	}
2952	if err := json.NewDecoder(res.Body).Decode(&ret); err != nil {
2953		return nil, err
2954	}
2955	return ret, nil
2956	// {
2957	//   "description": "Retrieves data about a single advertiser if that the requesting advertiser/publisher has access to it. Only advertisers can look up publishers. Publishers can request information about themselves by omitting the publisherId query parameter.",
2958	//   "httpMethod": "GET",
2959	//   "id": "gan.publishers.get",
2960	//   "parameterOrder": [
2961	//     "role",
2962	//     "roleId"
2963	//   ],
2964	//   "parameters": {
2965	//     "publisherId": {
2966	//       "description": "The ID of the publisher to look up. Optional.",
2967	//       "location": "query",
2968	//       "type": "string"
2969	//     },
2970	//     "role": {
2971	//       "description": "The role of the requester. Valid values: 'advertisers' or 'publishers'.",
2972	//       "enum": [
2973	//         "advertisers",
2974	//         "publishers"
2975	//       ],
2976	//       "enumDescriptions": [
2977	//         "The requester is requesting as an advertiser.",
2978	//         "The requester is requesting as a publisher."
2979	//       ],
2980	//       "location": "path",
2981	//       "required": true,
2982	//       "type": "string"
2983	//     },
2984	//     "roleId": {
2985	//       "description": "The ID of the requesting advertiser or publisher.",
2986	//       "location": "path",
2987	//       "required": true,
2988	//       "type": "string"
2989	//     }
2990	//   },
2991	//   "path": "{role}/{roleId}/publisher",
2992	//   "response": {
2993	//     "$ref": "Publisher"
2994	//   }
2995	// }
2996
2997}
2998
2999// method id "gan.publishers.list":
3000
3001type PublishersListCall struct {
3002	s            *Service
3003	role         string
3004	roleId       string
3005	urlParams_   gensupport.URLParams
3006	ifNoneMatch_ string
3007	ctx_         context.Context
3008}
3009
3010// List: Retrieves data about all publishers that the requesting
3011// advertiser/publisher has access to.
3012func (r *PublishersService) List(role string, roleId string) *PublishersListCall {
3013	c := &PublishersListCall{s: r.s, urlParams_: make(gensupport.URLParams)}
3014	c.role = role
3015	c.roleId = roleId
3016	return c
3017}
3018
3019// MaxResults sets the optional parameter "maxResults": Max number of
3020// items to return in this page.  Defaults to 20.
3021func (c *PublishersListCall) MaxResults(maxResults int64) *PublishersListCall {
3022	c.urlParams_.Set("maxResults", fmt.Sprint(maxResults))
3023	return c
3024}
3025
3026// MinNinetyDayEpc sets the optional parameter "minNinetyDayEpc":
3027// Filters out all publishers that have a ninety day EPC average lower
3028// than the given value (inclusive). Min value: 0.0.
3029func (c *PublishersListCall) MinNinetyDayEpc(minNinetyDayEpc float64) *PublishersListCall {
3030	c.urlParams_.Set("minNinetyDayEpc", fmt.Sprint(minNinetyDayEpc))
3031	return c
3032}
3033
3034// MinPayoutRank sets the optional parameter "minPayoutRank": A value
3035// between 1 and 4, where 1 represents the quartile of publishers with
3036// the lowest ranks and 4 represents the quartile of publishers with the
3037// highest ranks. Filters out all publishers with a lower rank than the
3038// given quartile. For example if a 2 was given only publishers with a
3039// payout rank of 25 or higher would be included.
3040func (c *PublishersListCall) MinPayoutRank(minPayoutRank int64) *PublishersListCall {
3041	c.urlParams_.Set("minPayoutRank", fmt.Sprint(minPayoutRank))
3042	return c
3043}
3044
3045// MinSevenDayEpc sets the optional parameter "minSevenDayEpc": Filters
3046// out all publishers that have a seven day EPC average lower than the
3047// given value (inclusive). Min value 0.0.
3048func (c *PublishersListCall) MinSevenDayEpc(minSevenDayEpc float64) *PublishersListCall {
3049	c.urlParams_.Set("minSevenDayEpc", fmt.Sprint(minSevenDayEpc))
3050	return c
3051}
3052
3053// PageToken sets the optional parameter "pageToken": The value of
3054// 'nextPageToken' from the previous page.
3055func (c *PublishersListCall) PageToken(pageToken string) *PublishersListCall {
3056	c.urlParams_.Set("pageToken", pageToken)
3057	return c
3058}
3059
3060// PublisherCategory sets the optional parameter "publisherCategory":
3061// Caret(^) delimted list of publisher categories. Valid categories:
3062// (unclassified|community_and_content|shopping_and_promotion|loyalty_and
3063// _rewards|network|search_specialist|comparison_shopping|email).
3064// Filters out all publishers not in one of the given advertiser
3065// categories.
3066func (c *PublishersListCall) PublisherCategory(publisherCategory string) *PublishersListCall {
3067	c.urlParams_.Set("publisherCategory", publisherCategory)
3068	return c
3069}
3070
3071// RelationshipStatus sets the optional parameter "relationshipStatus":
3072// Filters out all publishers for which do not have the given
3073// relationship status with the requesting publisher.
3074//
3075// Possible values:
3076//   "approved" - Publishers you've approved to your program.
3077//   "available" - Publishers available for you to recruit.
3078//   "deactivated" - A publisher that you terminated from your program.
3079// Publishers also have the ability to remove themselves from your
3080// program.
3081//   "declined" - A publisher that you did not approve to your program.
3082//   "pending" - Publishers that have applied to your program. We
3083// recommend reviewing and deciding on pending publishers on a weekly
3084// basis.
3085func (c *PublishersListCall) RelationshipStatus(relationshipStatus string) *PublishersListCall {
3086	c.urlParams_.Set("relationshipStatus", relationshipStatus)
3087	return c
3088}
3089
3090// Fields allows partial responses to be retrieved. See
3091// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
3092// for more information.
3093func (c *PublishersListCall) Fields(s ...googleapi.Field) *PublishersListCall {
3094	c.urlParams_.Set("fields", googleapi.CombineFields(s))
3095	return c
3096}
3097
3098// IfNoneMatch sets the optional parameter which makes the operation
3099// fail if the object's ETag matches the given value. This is useful for
3100// getting updates only after the object has changed since the last
3101// request. Use googleapi.IsNotModified to check whether the response
3102// error from Do is the result of In-None-Match.
3103func (c *PublishersListCall) IfNoneMatch(entityTag string) *PublishersListCall {
3104	c.ifNoneMatch_ = entityTag
3105	return c
3106}
3107
3108// Context sets the context to be used in this call's Do method. Any
3109// pending HTTP request will be aborted if the provided context is
3110// canceled.
3111func (c *PublishersListCall) Context(ctx context.Context) *PublishersListCall {
3112	c.ctx_ = ctx
3113	return c
3114}
3115
3116func (c *PublishersListCall) doRequest(alt string) (*http.Response, error) {
3117	var body io.Reader = nil
3118	c.urlParams_.Set("alt", alt)
3119	urls := googleapi.ResolveRelative(c.s.BasePath, "{role}/{roleId}/publishers")
3120	urls += "?" + c.urlParams_.Encode()
3121	req, _ := http.NewRequest("GET", urls, body)
3122	googleapi.Expand(req.URL, map[string]string{
3123		"role":   c.role,
3124		"roleId": c.roleId,
3125	})
3126	req.Header.Set("User-Agent", c.s.userAgent())
3127	if c.ifNoneMatch_ != "" {
3128		req.Header.Set("If-None-Match", c.ifNoneMatch_)
3129	}
3130	if c.ctx_ != nil {
3131		return ctxhttp.Do(c.ctx_, c.s.client, req)
3132	}
3133	return c.s.client.Do(req)
3134}
3135
3136// Do executes the "gan.publishers.list" call.
3137// Exactly one of *Publishers or error will be non-nil. Any non-2xx
3138// status code is an error. Response headers are in either
3139// *Publishers.ServerResponse.Header or (if a response was returned at
3140// all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
3141// to check whether the returned error was because
3142// http.StatusNotModified was returned.
3143func (c *PublishersListCall) Do(opts ...googleapi.CallOption) (*Publishers, error) {
3144	gensupport.SetOptions(c.urlParams_, opts...)
3145	res, err := c.doRequest("json")
3146	if res != nil && res.StatusCode == http.StatusNotModified {
3147		if res.Body != nil {
3148			res.Body.Close()
3149		}
3150		return nil, &googleapi.Error{
3151			Code:   res.StatusCode,
3152			Header: res.Header,
3153		}
3154	}
3155	if err != nil {
3156		return nil, err
3157	}
3158	defer googleapi.CloseBody(res)
3159	if err := googleapi.CheckResponse(res); err != nil {
3160		return nil, err
3161	}
3162	ret := &Publishers{
3163		ServerResponse: googleapi.ServerResponse{
3164			Header:         res.Header,
3165			HTTPStatusCode: res.StatusCode,
3166		},
3167	}
3168	if err := json.NewDecoder(res.Body).Decode(&ret); err != nil {
3169		return nil, err
3170	}
3171	return ret, nil
3172	// {
3173	//   "description": "Retrieves data about all publishers that the requesting advertiser/publisher has access to.",
3174	//   "httpMethod": "GET",
3175	//   "id": "gan.publishers.list",
3176	//   "parameterOrder": [
3177	//     "role",
3178	//     "roleId"
3179	//   ],
3180	//   "parameters": {
3181	//     "maxResults": {
3182	//       "description": "Max number of items to return in this page. Optional. Defaults to 20.",
3183	//       "format": "uint32",
3184	//       "location": "query",
3185	//       "maximum": "100",
3186	//       "minimum": "0",
3187	//       "type": "integer"
3188	//     },
3189	//     "minNinetyDayEpc": {
3190	//       "description": "Filters out all publishers that have a ninety day EPC average lower than the given value (inclusive). Min value: 0.0. Optional.",
3191	//       "format": "double",
3192	//       "location": "query",
3193	//       "type": "number"
3194	//     },
3195	//     "minPayoutRank": {
3196	//       "description": "A value between 1 and 4, where 1 represents the quartile of publishers with the lowest ranks and 4 represents the quartile of publishers with the highest ranks. Filters out all publishers with a lower rank than the given quartile. For example if a 2 was given only publishers with a payout rank of 25 or higher would be included. Optional.",
3197	//       "format": "int32",
3198	//       "location": "query",
3199	//       "maximum": "4",
3200	//       "minimum": "1",
3201	//       "type": "integer"
3202	//     },
3203	//     "minSevenDayEpc": {
3204	//       "description": "Filters out all publishers that have a seven day EPC average lower than the given value (inclusive). Min value 0.0. Optional.",
3205	//       "format": "double",
3206	//       "location": "query",
3207	//       "type": "number"
3208	//     },
3209	//     "pageToken": {
3210	//       "description": "The value of 'nextPageToken' from the previous page. Optional.",
3211	//       "location": "query",
3212	//       "type": "string"
3213	//     },
3214	//     "publisherCategory": {
3215	//       "description": "Caret(^) delimted list of publisher categories. Valid categories: (unclassified|community_and_content|shopping_and_promotion|loyalty_and_rewards|network|search_specialist|comparison_shopping|email). Filters out all publishers not in one of the given advertiser categories. Optional.",
3216	//       "location": "query",
3217	//       "type": "string"
3218	//     },
3219	//     "relationshipStatus": {
3220	//       "description": "Filters out all publishers for which do not have the given relationship status with the requesting publisher.",
3221	//       "enum": [
3222	//         "approved",
3223	//         "available",
3224	//         "deactivated",
3225	//         "declined",
3226	//         "pending"
3227	//       ],
3228	//       "enumDescriptions": [
3229	//         "Publishers you've approved to your program.",
3230	//         "Publishers available for you to recruit.",
3231	//         "A publisher that you terminated from your program. Publishers also have the ability to remove themselves from your program.",
3232	//         "A publisher that you did not approve to your program.",
3233	//         "Publishers that have applied to your program. We recommend reviewing and deciding on pending publishers on a weekly basis."
3234	//       ],
3235	//       "location": "query",
3236	//       "type": "string"
3237	//     },
3238	//     "role": {
3239	//       "description": "The role of the requester. Valid values: 'advertisers' or 'publishers'.",
3240	//       "enum": [
3241	//         "advertisers",
3242	//         "publishers"
3243	//       ],
3244	//       "enumDescriptions": [
3245	//         "The requester is requesting as an advertiser.",
3246	//         "The requester is requesting as a publisher."
3247	//       ],
3248	//       "location": "path",
3249	//       "required": true,
3250	//       "type": "string"
3251	//     },
3252	//     "roleId": {
3253	//       "description": "The ID of the requesting advertiser or publisher.",
3254	//       "location": "path",
3255	//       "required": true,
3256	//       "type": "string"
3257	//     }
3258	//   },
3259	//   "path": "{role}/{roleId}/publishers",
3260	//   "response": {
3261	//     "$ref": "Publishers"
3262	//   }
3263	// }
3264
3265}
3266
3267// Pages invokes f for each page of results.
3268// A non-nil error returned from f will halt the iteration.
3269// The provided context supersedes any context provided to the Context method.
3270func (c *PublishersListCall) Pages(ctx context.Context, f func(*Publishers) error) error {
3271	c.ctx_ = ctx
3272	defer c.PageToken(c.urlParams_.Get("pageToken")) // reset paging to original point
3273	for {
3274		x, err := c.Do()
3275		if err != nil {
3276			return err
3277		}
3278		if err := f(x); err != nil {
3279			return err
3280		}
3281		if x.NextPageToken == "" {
3282			return nil
3283		}
3284		c.PageToken(x.NextPageToken)
3285	}
3286}
3287
3288// method id "gan.reports.get":
3289
3290type ReportsGetCall struct {
3291	s            *Service
3292	role         string
3293	roleId       string
3294	reportType   string
3295	urlParams_   gensupport.URLParams
3296	ifNoneMatch_ string
3297	ctx_         context.Context
3298}
3299
3300// Get: Retrieves a report of the specified type.
3301func (r *ReportsService) Get(role string, roleId string, reportType string) *ReportsGetCall {
3302	c := &ReportsGetCall{s: r.s, urlParams_: make(gensupport.URLParams)}
3303	c.role = role
3304	c.roleId = roleId
3305	c.reportType = reportType
3306	return c
3307}
3308
3309// AdvertiserId sets the optional parameter "advertiserId": The IDs of
3310// the advertisers to look up, if applicable.
3311func (c *ReportsGetCall) AdvertiserId(advertiserId ...string) *ReportsGetCall {
3312	c.urlParams_.SetMulti("advertiserId", append([]string{}, advertiserId...))
3313	return c
3314}
3315
3316// CalculateTotals sets the optional parameter "calculateTotals":
3317// Whether or not to calculate totals rows.
3318func (c *ReportsGetCall) CalculateTotals(calculateTotals bool) *ReportsGetCall {
3319	c.urlParams_.Set("calculateTotals", fmt.Sprint(calculateTotals))
3320	return c
3321}
3322
3323// EndDate sets the optional parameter "endDate": The end date
3324// (exclusive), in RFC 3339 format, for the report data to be returned.
3325// Defaults to one day after startDate, if that is given, or today.
3326func (c *ReportsGetCall) EndDate(endDate string) *ReportsGetCall {
3327	c.urlParams_.Set("endDate", endDate)
3328	return c
3329}
3330
3331// EventType sets the optional parameter "eventType": Filters out all
3332// events that are not of the given type. Valid values: 'action',
3333// 'transaction', or 'charge'.
3334//
3335// Possible values:
3336//   "action" - Event type is action.
3337//   "charge" - Event type is charge.
3338//   "transaction" - Event type is transaction.
3339func (c *ReportsGetCall) EventType(eventType string) *ReportsGetCall {
3340	c.urlParams_.Set("eventType", eventType)
3341	return c
3342}
3343
3344// LinkId sets the optional parameter "linkId": Filters to capture one
3345// of given link IDs.
3346func (c *ReportsGetCall) LinkId(linkId ...string) *ReportsGetCall {
3347	c.urlParams_.SetMulti("linkId", append([]string{}, linkId...))
3348	return c
3349}
3350
3351// MaxResults sets the optional parameter "maxResults": Max number of
3352// items to return in this page.  Defaults to return all results.
3353func (c *ReportsGetCall) MaxResults(maxResults int64) *ReportsGetCall {
3354	c.urlParams_.Set("maxResults", fmt.Sprint(maxResults))
3355	return c
3356}
3357
3358// OrderId sets the optional parameter "orderId": Filters to capture one
3359// of the given order IDs.
3360func (c *ReportsGetCall) OrderId(orderId ...string) *ReportsGetCall {
3361	c.urlParams_.SetMulti("orderId", append([]string{}, orderId...))
3362	return c
3363}
3364
3365// PublisherId sets the optional parameter "publisherId": The IDs of the
3366// publishers to look up, if applicable.
3367func (c *ReportsGetCall) PublisherId(publisherId ...string) *ReportsGetCall {
3368	c.urlParams_.SetMulti("publisherId", append([]string{}, publisherId...))
3369	return c
3370}
3371
3372// StartDate sets the optional parameter "startDate": The start date
3373// (inclusive), in RFC 3339 format, for the report data to be returned.
3374// Defaults to one day before endDate, if that is given, or yesterday.
3375func (c *ReportsGetCall) StartDate(startDate string) *ReportsGetCall {
3376	c.urlParams_.Set("startDate", startDate)
3377	return c
3378}
3379
3380// StartIndex sets the optional parameter "startIndex": Offset on which
3381// to return results when paging.
3382func (c *ReportsGetCall) StartIndex(startIndex int64) *ReportsGetCall {
3383	c.urlParams_.Set("startIndex", fmt.Sprint(startIndex))
3384	return c
3385}
3386
3387// Status sets the optional parameter "status": Filters out all events
3388// that do not have the given status. Valid values: 'active',
3389// 'canceled', or 'invalid'.
3390//
3391// Possible values:
3392//   "active" - Event is currently active.
3393//   "canceled" - Event is currently canceled.
3394//   "invalid" - Event is currently invalid.
3395func (c *ReportsGetCall) Status(status string) *ReportsGetCall {
3396	c.urlParams_.Set("status", status)
3397	return c
3398}
3399
3400// Fields allows partial responses to be retrieved. See
3401// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
3402// for more information.
3403func (c *ReportsGetCall) Fields(s ...googleapi.Field) *ReportsGetCall {
3404	c.urlParams_.Set("fields", googleapi.CombineFields(s))
3405	return c
3406}
3407
3408// IfNoneMatch sets the optional parameter which makes the operation
3409// fail if the object's ETag matches the given value. This is useful for
3410// getting updates only after the object has changed since the last
3411// request. Use googleapi.IsNotModified to check whether the response
3412// error from Do is the result of In-None-Match.
3413func (c *ReportsGetCall) IfNoneMatch(entityTag string) *ReportsGetCall {
3414	c.ifNoneMatch_ = entityTag
3415	return c
3416}
3417
3418// Context sets the context to be used in this call's Do method. Any
3419// pending HTTP request will be aborted if the provided context is
3420// canceled.
3421func (c *ReportsGetCall) Context(ctx context.Context) *ReportsGetCall {
3422	c.ctx_ = ctx
3423	return c
3424}
3425
3426func (c *ReportsGetCall) doRequest(alt string) (*http.Response, error) {
3427	var body io.Reader = nil
3428	c.urlParams_.Set("alt", alt)
3429	urls := googleapi.ResolveRelative(c.s.BasePath, "{role}/{roleId}/report/{reportType}")
3430	urls += "?" + c.urlParams_.Encode()
3431	req, _ := http.NewRequest("GET", urls, body)
3432	googleapi.Expand(req.URL, map[string]string{
3433		"role":       c.role,
3434		"roleId":     c.roleId,
3435		"reportType": c.reportType,
3436	})
3437	req.Header.Set("User-Agent", c.s.userAgent())
3438	if c.ifNoneMatch_ != "" {
3439		req.Header.Set("If-None-Match", c.ifNoneMatch_)
3440	}
3441	if c.ctx_ != nil {
3442		return ctxhttp.Do(c.ctx_, c.s.client, req)
3443	}
3444	return c.s.client.Do(req)
3445}
3446
3447// Do executes the "gan.reports.get" call.
3448// Exactly one of *Report or error will be non-nil. Any non-2xx status
3449// code is an error. Response headers are in either
3450// *Report.ServerResponse.Header or (if a response was returned at all)
3451// in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to
3452// check whether the returned error was because http.StatusNotModified
3453// was returned.
3454func (c *ReportsGetCall) Do(opts ...googleapi.CallOption) (*Report, error) {
3455	gensupport.SetOptions(c.urlParams_, opts...)
3456	res, err := c.doRequest("json")
3457	if res != nil && res.StatusCode == http.StatusNotModified {
3458		if res.Body != nil {
3459			res.Body.Close()
3460		}
3461		return nil, &googleapi.Error{
3462			Code:   res.StatusCode,
3463			Header: res.Header,
3464		}
3465	}
3466	if err != nil {
3467		return nil, err
3468	}
3469	defer googleapi.CloseBody(res)
3470	if err := googleapi.CheckResponse(res); err != nil {
3471		return nil, err
3472	}
3473	ret := &Report{
3474		ServerResponse: googleapi.ServerResponse{
3475			Header:         res.Header,
3476			HTTPStatusCode: res.StatusCode,
3477		},
3478	}
3479	if err := json.NewDecoder(res.Body).Decode(&ret); err != nil {
3480		return nil, err
3481	}
3482	return ret, nil
3483	// {
3484	//   "description": "Retrieves a report of the specified type.",
3485	//   "httpMethod": "GET",
3486	//   "id": "gan.reports.get",
3487	//   "parameterOrder": [
3488	//     "role",
3489	//     "roleId",
3490	//     "reportType"
3491	//   ],
3492	//   "parameters": {
3493	//     "advertiserId": {
3494	//       "description": "The IDs of the advertisers to look up, if applicable.",
3495	//       "location": "query",
3496	//       "repeated": true,
3497	//       "type": "string"
3498	//     },
3499	//     "calculateTotals": {
3500	//       "description": "Whether or not to calculate totals rows. Optional.",
3501	//       "location": "query",
3502	//       "type": "boolean"
3503	//     },
3504	//     "endDate": {
3505	//       "description": "The end date (exclusive), in RFC 3339 format, for the report data to be returned. Defaults to one day after startDate, if that is given, or today. Optional.",
3506	//       "location": "query",
3507	//       "type": "string"
3508	//     },
3509	//     "eventType": {
3510	//       "description": "Filters out all events that are not of the given type. Valid values: 'action', 'transaction', or 'charge'. Optional.",
3511	//       "enum": [
3512	//         "action",
3513	//         "charge",
3514	//         "transaction"
3515	//       ],
3516	//       "enumDescriptions": [
3517	//         "Event type is action.",
3518	//         "Event type is charge.",
3519	//         "Event type is transaction."
3520	//       ],
3521	//       "location": "query",
3522	//       "type": "string"
3523	//     },
3524	//     "linkId": {
3525	//       "description": "Filters to capture one of given link IDs. Optional.",
3526	//       "location": "query",
3527	//       "repeated": true,
3528	//       "type": "string"
3529	//     },
3530	//     "maxResults": {
3531	//       "description": "Max number of items to return in this page. Optional. Defaults to return all results.",
3532	//       "format": "uint32",
3533	//       "location": "query",
3534	//       "minimum": "0",
3535	//       "type": "integer"
3536	//     },
3537	//     "orderId": {
3538	//       "description": "Filters to capture one of the given order IDs. Optional.",
3539	//       "location": "query",
3540	//       "repeated": true,
3541	//       "type": "string"
3542	//     },
3543	//     "publisherId": {
3544	//       "description": "The IDs of the publishers to look up, if applicable.",
3545	//       "location": "query",
3546	//       "repeated": true,
3547	//       "type": "string"
3548	//     },
3549	//     "reportType": {
3550	//       "description": "The type of report being requested. Valid values: 'order_delta'. Required.",
3551	//       "enum": [
3552	//         "order_delta"
3553	//       ],
3554	//       "enumDescriptions": [
3555	//         "The order delta report type."
3556	//       ],
3557	//       "location": "path",
3558	//       "required": true,
3559	//       "type": "string"
3560	//     },
3561	//     "role": {
3562	//       "description": "The role of the requester. Valid values: 'advertisers' or 'publishers'.",
3563	//       "enum": [
3564	//         "advertisers",
3565	//         "publishers"
3566	//       ],
3567	//       "enumDescriptions": [
3568	//         "The requester is requesting as an advertiser.",
3569	//         "The requester is requesting as a publisher."
3570	//       ],
3571	//       "location": "path",
3572	//       "required": true,
3573	//       "type": "string"
3574	//     },
3575	//     "roleId": {
3576	//       "description": "The ID of the requesting advertiser or publisher.",
3577	//       "location": "path",
3578	//       "required": true,
3579	//       "type": "string"
3580	//     },
3581	//     "startDate": {
3582	//       "description": "The start date (inclusive), in RFC 3339 format, for the report data to be returned. Defaults to one day before endDate, if that is given, or yesterday. Optional.",
3583	//       "location": "query",
3584	//       "type": "string"
3585	//     },
3586	//     "startIndex": {
3587	//       "description": "Offset on which to return results when paging. Optional.",
3588	//       "format": "uint32",
3589	//       "location": "query",
3590	//       "minimum": "0",
3591	//       "type": "integer"
3592	//     },
3593	//     "status": {
3594	//       "description": "Filters out all events that do not have the given status. Valid values: 'active', 'canceled', or 'invalid'. Optional.",
3595	//       "enum": [
3596	//         "active",
3597	//         "canceled",
3598	//         "invalid"
3599	//       ],
3600	//       "enumDescriptions": [
3601	//         "Event is currently active.",
3602	//         "Event is currently canceled.",
3603	//         "Event is currently invalid."
3604	//       ],
3605	//       "location": "query",
3606	//       "type": "string"
3607	//     }
3608	//   },
3609	//   "path": "{role}/{roleId}/report/{reportType}",
3610	//   "response": {
3611	//     "$ref": "Report"
3612	//   }
3613	// }
3614
3615}
3616