123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929930931932933934935936937938939940941942943944945946947948949950951952953954955956957958959960961962963964965966967968969970971972973974975976977978979980981982983984985986987988989990991992993994995996997998999100010011002100310041005100610071008100910101011101210131014101510161017101810191020102110221023102410251026102710281029103010311032103310341035103610371038103910401041104210431044104510461047104810491050105110521053105410551056105710581059106010611062106310641065106610671068106910701071107210731074107510761077107810791080108110821083108410851086108710881089109010911092109310941095109610971098109911001101110211031104110511061107110811091110111111121113111411151116111711181119112011211122112311241125112611271128112911301131113211331134113511361137113811391140114111421143114411451146114711481149115011511152115311541155115611571158115911601161116211631164116511661167116811691170117111721173117411751176117711781179118011811182118311841185118611871188118911901191119211931194119511961197119811991200120112021203120412051206120712081209121012111212121312141215121612171218121912201221122212231224122512261227122812291230123112321233123412351236123712381239124012411242124312441245124612471248124912501251125212531254125512561257125812591260126112621263126412651266126712681269127012711272127312741275127612771278127912801281128212831284128512861287128812891290129112921293129412951296129712981299130013011302130313041305130613071308130913101311131213131314131513161317131813191320132113221323132413251326132713281329133013311332133313341335133613371338133913401341134213431344134513461347134813491350135113521353135413551356135713581359136013611362136313641365136613671368136913701371137213731374137513761377137813791380138113821383138413851386138713881389139013911392139313941395139613971398139914001401140214031404140514061407140814091410141114121413141414151416141714181419142014211422142314241425142614271428142914301431143214331434143514361437143814391440144114421443144414451446144714481449145014511452145314541455145614571458145914601461146214631464146514661467146814691470147114721473147414751476147714781479148014811482148314841485148614871488148914901491149214931494149514961497149814991500150115021503150415051506150715081509151015111512151315141515151615171518151915201521152215231524152515261527152815291530153115321533153415351536153715381539154015411542154315441545154615471548154915501551155215531554155515561557155815591560156115621563156415651566156715681569157015711572157315741575157615771578157915801581158215831584158515861587158815891590159115921593159415951596159715981599160016011602160316041605160616071608160916101611161216131614161516161617161816191620162116221623162416251626162716281629163016311632163316341635163616371638163916401641164216431644164516461647164816491650165116521653165416551656165716581659166016611662166316641665166616671668166916701671167216731674167516761677167816791680168116821683168416851686168716881689169016911692169316941695169616971698169917001701170217031704170517061707170817091710171117121713171417151716171717181719172017211722172317241725172617271728172917301731173217331734173517361737173817391740174117421743174417451746174717481749175017511752175317541755175617571758175917601761176217631764176517661767176817691770177117721773177417751776177717781779178017811782178317841785178617871788178917901791179217931794179517961797179817991800180118021803180418051806180718081809181018111812181318141815181618171818181918201821182218231824182518261827182818291830183118321833183418351836183718381839184018411842184318441845184618471848184918501851185218531854185518561857185818591860186118621863186418651866186718681869187018711872187318741875187618771878187918801881188218831884188518861887188818891890189118921893189418951896189718981899190019011902190319041905190619071908190919101911191219131914191519161917191819191920192119221923192419251926192719281929193019311932193319341935193619371938193919401941194219431944194519461947194819491950195119521953195419551956195719581959196019611962196319641965196619671968196919701971197219731974197519761977197819791980198119821983198419851986198719881989199019911992199319941995199619971998199920002001200220032004200520062007200820092010201120122013201420152016201720182019202020212022202320242025202620272028202920302031203220332034203520362037203820392040204120422043204420452046204720482049205020512052205320542055205620572058205920602061206220632064206520662067206820692070207120722073207420752076207720782079208020812082208320842085208620872088208920902091209220932094209520962097209820992100210121022103210421052106210721082109211021112112211321142115211621172118211921202121212221232124212521262127212821292130213121322133213421352136213721382139214021412142214321442145214621472148214921502151215221532154215521562157215821592160216121622163216421652166216721682169217021712172217321742175217621772178217921802181218221832184218521862187218821892190219121922193219421952196219721982199220022012202220322042205220622072208220922102211221222132214221522162217221822192220222122222223222422252226222722282229223022312232223322342235223622372238223922402241224222432244224522462247224822492250225122522253225422552256225722582259226022612262226322642265226622672268226922702271227222732274227522762277227822792280228122822283228422852286228722882289229022912292229322942295229622972298229923002301230223032304230523062307230823092310231123122313231423152316231723182319232023212322232323242325232623272328232923302331233223332334233523362337233823392340234123422343234423452346234723482349235023512352235323542355235623572358235923602361236223632364236523662367236823692370237123722373237423752376237723782379238023812382238323842385238623872388238923902391239223932394239523962397239823992400240124022403240424052406240724082409241024112412241324142415241624172418241924202421242224232424242524262427242824292430243124322433243424352436243724382439244024412442244324442445244624472448244924502451245224532454245524562457245824592460246124622463246424652466246724682469247024712472247324742475247624772478247924802481248224832484248524862487248824892490249124922493249424952496249724982499250025012502250325042505250625072508250925102511251225132514251525162517251825192520252125222523252425252526252725282529253025312532253325342535253625372538253925402541254225432544254525462547254825492550255125522553255425552556255725582559256025612562256325642565256625672568256925702571257225732574257525762577257825792580258125822583258425852586258725882589259025912592259325942595259625972598259926002601260226032604260526062607260826092610261126122613261426152616261726182619262026212622262326242625262626272628262926302631263226332634263526362637263826392640264126422643264426452646264726482649265026512652265326542655265626572658265926602661266226632664266526662667266826692670267126722673267426752676267726782679268026812682268326842685268626872688268926902691269226932694269526962697269826992700270127022703270427052706270727082709271027112712271327142715271627172718271927202721272227232724272527262727272827292730273127322733273427352736273727382739274027412742274327442745274627472748274927502751275227532754275527562757275827592760276127622763276427652766276727682769277027712772277327742775277627772778277927802781278227832784278527862787278827892790279127922793279427952796279727982799280028012802280328042805280628072808280928102811281228132814281528162817281828192820282128222823282428252826282728282829283028312832283328342835283628372838283928402841284228432844284528462847284828492850285128522853285428552856285728582859286028612862286328642865286628672868286928702871287228732874287528762877287828792880288128822883288428852886288728882889289028912892289328942895289628972898289929002901290229032904290529062907290829092910291129122913291429152916291729182919292029212922292329242925292629272928292929302931293229332934293529362937293829392940294129422943294429452946294729482949295029512952295329542955295629572958295929602961296229632964296529662967296829692970297129722973297429752976297729782979298029812982298329842985298629872988298929902991299229932994299529962997299829993000300130023003300430053006300730083009301030113012301330143015301630173018301930203021302230233024302530263027302830293030303130323033303430353036303730383039304030413042304330443045304630473048304930503051305230533054305530563057305830593060306130623063306430653066306730683069307030713072307330743075307630773078307930803081308230833084308530863087308830893090309130923093309430953096309730983099310031013102310331043105310631073108310931103111311231133114311531163117311831193120312131223123312431253126312731283129313031313132313331343135313631373138313931403141314231433144314531463147314831493150315131523153315431553156315731583159316031613162316331643165316631673168316931703171317231733174317531763177317831793180318131823183318431853186318731883189319031913192319331943195319631973198319932003201320232033204320532063207320832093210321132123213321432153216321732183219322032213222322332243225322632273228322932303231323232333234323532363237323832393240324132423243324432453246324732483249325032513252325332543255325632573258325932603261326232633264326532663267326832693270327132723273327432753276327732783279328032813282328332843285328632873288328932903291329232933294329532963297329832993300330133023303330433053306330733083309331033113312331333143315331633173318331933203321332233233324332533263327332833293330333133323333333433353336333733383339334033413342334333443345334633473348334933503351335233533354335533563357335833593360336133623363336433653366336733683369337033713372337333743375337633773378337933803381338233833384338533863387338833893390339133923393339433953396339733983399340034013402340334043405340634073408340934103411341234133414341534163417341834193420342134223423342434253426342734283429343034313432343334343435343634373438343934403441344234433444344534463447344834493450345134523453345434553456345734583459346034613462346334643465346634673468346934703471347234733474347534763477347834793480348134823483348434853486348734883489349034913492349334943495349634973498349935003501350235033504350535063507350835093510351135123513351435153516351735183519352035213522352335243525352635273528352935303531353235333534353535363537353835393540354135423543354435453546354735483549355035513552355335543555355635573558355935603561356235633564356535663567356835693570357135723573357435753576357735783579358035813582358335843585358635873588358935903591359235933594359535963597359835993600360136023603360436053606360736083609361036113612361336143615 |
- // Package gan provides access to the Google Affiliate Network API.
- //
- // See https://developers.google.com/affiliate-network/
- //
- // Usage example:
- //
- // import "google.golang.org/api/gan/v1beta1"
- // ...
- // ganService, err := gan.New(oauthHttpClient)
- package gan // import "google.golang.org/api/gan/v1beta1"
- import (
- "bytes"
- "encoding/json"
- "errors"
- "fmt"
- context "golang.org/x/net/context"
- ctxhttp "golang.org/x/net/context/ctxhttp"
- gensupport "google.golang.org/api/gensupport"
- googleapi "google.golang.org/api/googleapi"
- "io"
- "net/http"
- "net/url"
- "strconv"
- "strings"
- )
- // Always reference these packages, just in case the auto-generated code
- // below doesn't.
- var _ = bytes.NewBuffer
- var _ = strconv.Itoa
- var _ = fmt.Sprintf
- var _ = json.NewDecoder
- var _ = io.Copy
- var _ = url.Parse
- var _ = gensupport.MarshalJSON
- var _ = googleapi.Version
- var _ = errors.New
- var _ = strings.Replace
- var _ = context.Canceled
- var _ = ctxhttp.Do
- const apiId = "gan:v1beta1"
- const apiName = "gan"
- const apiVersion = "v1beta1"
- const basePath = "https://www.googleapis.com/gan/v1beta1/"
- func New(client *http.Client) (*Service, error) {
- if client == nil {
- return nil, errors.New("client is nil")
- }
- s := &Service{client: client, BasePath: basePath}
- s.Advertisers = NewAdvertisersService(s)
- s.CcOffers = NewCcOffersService(s)
- s.Events = NewEventsService(s)
- s.Links = NewLinksService(s)
- s.Publishers = NewPublishersService(s)
- s.Reports = NewReportsService(s)
- return s, nil
- }
- type Service struct {
- client *http.Client
- BasePath string // API endpoint base URL
- UserAgent string // optional additional User-Agent fragment
- Advertisers *AdvertisersService
- CcOffers *CcOffersService
- Events *EventsService
- Links *LinksService
- Publishers *PublishersService
- Reports *ReportsService
- }
- func (s *Service) userAgent() string {
- if s.UserAgent == "" {
- return googleapi.UserAgent
- }
- return googleapi.UserAgent + " " + s.UserAgent
- }
- func NewAdvertisersService(s *Service) *AdvertisersService {
- rs := &AdvertisersService{s: s}
- return rs
- }
- type AdvertisersService struct {
- s *Service
- }
- func NewCcOffersService(s *Service) *CcOffersService {
- rs := &CcOffersService{s: s}
- return rs
- }
- type CcOffersService struct {
- s *Service
- }
- func NewEventsService(s *Service) *EventsService {
- rs := &EventsService{s: s}
- return rs
- }
- type EventsService struct {
- s *Service
- }
- func NewLinksService(s *Service) *LinksService {
- rs := &LinksService{s: s}
- return rs
- }
- type LinksService struct {
- s *Service
- }
- func NewPublishersService(s *Service) *PublishersService {
- rs := &PublishersService{s: s}
- return rs
- }
- type PublishersService struct {
- s *Service
- }
- func NewReportsService(s *Service) *ReportsService {
- rs := &ReportsService{s: s}
- return rs
- }
- type ReportsService struct {
- s *Service
- }
- // Advertiser: An AdvertiserResource.
- type Advertiser struct {
- // AllowPublisherCreatedLinks: True if the advertiser allows publisher
- // created links, otherwise false.
- AllowPublisherCreatedLinks bool `json:"allowPublisherCreatedLinks,omitempty"`
- // Category: Category that this advertiser belongs to. A valid list of
- // categories can be found here:
- // http://www.google.com/support/affiliatenetwork/advertiser/bin/answer.py?hl=en&answer=107581
- Category string `json:"category,omitempty"`
- // CommissionDuration: The longest possible length of a commission (how
- // long the cookies on the customer's browser last before they expire).
- CommissionDuration int64 `json:"commissionDuration,omitempty"`
- // ContactEmail: Email that this advertiser would like publishers to
- // contact them with.
- ContactEmail string `json:"contactEmail,omitempty"`
- // ContactPhone: Phone that this advertiser would like publishers to
- // contact them with.
- ContactPhone string `json:"contactPhone,omitempty"`
- // DefaultLinkId: The default link id for this advertiser.
- DefaultLinkId int64 `json:"defaultLinkId,omitempty,string"`
- // Description: Description of the website the advertiser advertises
- // from.
- Description string `json:"description,omitempty"`
- // EpcNinetyDayAverage: The sum of fees paid to publishers divided by
- // the total number of clicks over the past three months. This value
- // should be multiplied by 100 at the time of display.
- EpcNinetyDayAverage *Money `json:"epcNinetyDayAverage,omitempty"`
- // EpcSevenDayAverage: The sum of fees paid to publishers divided by the
- // total number of clicks over the past seven days. This value should be
- // multiplied by 100 at the time of display.
- EpcSevenDayAverage *Money `json:"epcSevenDayAverage,omitempty"`
- // Id: The ID of this advertiser.
- Id int64 `json:"id,omitempty,string"`
- // Item: The requested advertiser.
- Item *Advertiser `json:"item,omitempty"`
- // JoinDate: Date that this advertiser was approved as a Google
- // Affiliate Network advertiser.
- JoinDate string `json:"joinDate,omitempty"`
- // Kind: The kind for an advertiser.
- Kind string `json:"kind,omitempty"`
- // LogoUrl: URL to the logo this advertiser uses on the Google Affiliate
- // Network.
- LogoUrl string `json:"logoUrl,omitempty"`
- // MerchantCenterIds: List of merchant center ids for this advertiser
- MerchantCenterIds googleapi.Int64s `json:"merchantCenterIds,omitempty"`
- // Name: The name of this advertiser.
- Name string `json:"name,omitempty"`
- // PayoutRank: A rank based on commissions paid to publishers over the
- // past 90 days. A number between 1 and 4 where 4 means the top quartile
- // (most money paid) and 1 means the bottom quartile (least money paid).
- PayoutRank string `json:"payoutRank,omitempty"`
- // ProductFeedsEnabled: Allows advertisers to submit product listings to
- // Google Product Search.
- ProductFeedsEnabled bool `json:"productFeedsEnabled,omitempty"`
- // RedirectDomains: List of redirect URLs for this advertiser
- RedirectDomains []string `json:"redirectDomains,omitempty"`
- // SiteUrl: URL of the website this advertiser advertises from.
- SiteUrl string `json:"siteUrl,omitempty"`
- // Status: The status of the requesting publisher's relationship this
- // advertiser.
- Status string `json:"status,omitempty"`
- // ServerResponse contains the HTTP response code and headers from the
- // server.
- googleapi.ServerResponse `json:"-"`
- // ForceSendFields is a list of field names (e.g.
- // "AllowPublisherCreatedLinks") to unconditionally include in API
- // requests. By default, fields with empty values are omitted from API
- // requests. However, any non-pointer, non-interface field appearing in
- // ForceSendFields will be sent to the server regardless of whether the
- // field is empty or not. This may be used to include empty fields in
- // Patch requests.
- ForceSendFields []string `json:"-"`
- }
- func (s *Advertiser) MarshalJSON() ([]byte, error) {
- type noMethod Advertiser
- raw := noMethod(*s)
- return gensupport.MarshalJSON(raw, s.ForceSendFields)
- }
- type Advertisers struct {
- // Items: The advertiser list.
- Items []*Advertiser `json:"items,omitempty"`
- // Kind: The kind for a page of advertisers.
- Kind string `json:"kind,omitempty"`
- // NextPageToken: The 'pageToken' to pass to the next request to get the
- // next page, if there are more to retrieve.
- NextPageToken string `json:"nextPageToken,omitempty"`
- // ServerResponse contains the HTTP response code and headers from the
- // server.
- googleapi.ServerResponse `json:"-"`
- // ForceSendFields is a list of field names (e.g. "Items") to
- // unconditionally include in API requests. By default, fields with
- // empty values are omitted from API requests. However, any non-pointer,
- // non-interface field appearing in ForceSendFields will be sent to the
- // server regardless of whether the field is empty or not. This may be
- // used to include empty fields in Patch requests.
- ForceSendFields []string `json:"-"`
- }
- func (s *Advertisers) MarshalJSON() ([]byte, error) {
- type noMethod Advertisers
- raw := noMethod(*s)
- return gensupport.MarshalJSON(raw, s.ForceSendFields)
- }
- // CcOffer: A credit card offer. There are many possible result fields.
- // We provide two different views of the data, or "projections." The
- // "full" projection includes every result field. And the "summary"
- // projection, which is the default, includes a smaller subset of the
- // fields. The fields included in the summary projection are marked as
- // such in their descriptions.
- type CcOffer struct {
- // AdditionalCardBenefits: More marketing copy about the card's
- // benefits. A summary field.
- AdditionalCardBenefits []string `json:"additionalCardBenefits,omitempty"`
- // AdditionalCardHolderFee: Any extra fees levied on card holders.
- AdditionalCardHolderFee string `json:"additionalCardHolderFee,omitempty"`
- // AgeMinimum: The youngest a recipient of this card may be.
- AgeMinimum float64 `json:"ageMinimum,omitempty"`
- // AgeMinimumDetails: Text describing the details of the age minimum
- // restriction.
- AgeMinimumDetails string `json:"ageMinimumDetails,omitempty"`
- // AnnualFee: The ongoing annual fee, in dollars.
- AnnualFee float64 `json:"annualFee,omitempty"`
- // AnnualFeeDisplay: Text describing the annual fee, including any
- // difference for the first year. A summary field.
- AnnualFeeDisplay string `json:"annualFeeDisplay,omitempty"`
- // AnnualRewardMaximum: The largest number of units you may accumulate
- // in a year.
- AnnualRewardMaximum float64 `json:"annualRewardMaximum,omitempty"`
- // ApprovedCategories: Possible categories for this card, eg "Low
- // Interest" or "Good." A summary field.
- ApprovedCategories []string `json:"approvedCategories,omitempty"`
- // AprDisplay: Text describing the purchase APR. A summary field.
- AprDisplay string `json:"aprDisplay,omitempty"`
- // BalanceComputationMethod: Text describing how the balance is
- // computed. A summary field.
- BalanceComputationMethod string `json:"balanceComputationMethod,omitempty"`
- // BalanceTransferTerms: Text describing the terms for balance
- // transfers. A summary field.
- BalanceTransferTerms string `json:"balanceTransferTerms,omitempty"`
- // BonusRewards: For cards with rewards programs, extra circumstances
- // whereby additional rewards may be granted.
- BonusRewards []*CcOfferBonusRewards `json:"bonusRewards,omitempty"`
- // CarRentalInsurance: If you get coverage when you use the card for the
- // given activity, this field describes it.
- CarRentalInsurance string `json:"carRentalInsurance,omitempty"`
- // CardBenefits: A list of what the issuer thinks are the most important
- // benefits of the card. Usually summarizes the rewards program, if
- // there is one. A summary field.
- CardBenefits []string `json:"cardBenefits,omitempty"`
- // CardName: The issuer's name for the card, including any trademark or
- // service mark designators. A summary field.
- CardName string `json:"cardName,omitempty"`
- // CardType: What kind of credit card this is, for example secured or
- // unsecured.
- CardType string `json:"cardType,omitempty"`
- // CashAdvanceTerms: Text describing the terms for cash advances. A
- // summary field.
- CashAdvanceTerms string `json:"cashAdvanceTerms,omitempty"`
- // CreditLimitMax: The high end for credit limits the issuer imposes on
- // recipients of this card.
- CreditLimitMax float64 `json:"creditLimitMax,omitempty"`
- // CreditLimitMin: The low end for credit limits the issuer imposes on
- // recipients of this card.
- CreditLimitMin float64 `json:"creditLimitMin,omitempty"`
- // CreditRatingDisplay: Text describing the credit ratings required for
- // recipients of this card, for example "Excellent/Good." A summary
- // field.
- CreditRatingDisplay string `json:"creditRatingDisplay,omitempty"`
- // DefaultFees: Fees for defaulting on your payments.
- DefaultFees []*CcOfferDefaultFees `json:"defaultFees,omitempty"`
- // Disclaimer: A notice that, if present, is referenced via an asterisk
- // by many of the other summary fields. If this field is present, it
- // will always start with an asterisk ("*"), and must be prominently
- // displayed with the offer. A summary field.
- Disclaimer string `json:"disclaimer,omitempty"`
- // EmergencyInsurance: If you get coverage when you use the card for the
- // given activity, this field describes it.
- EmergencyInsurance string `json:"emergencyInsurance,omitempty"`
- // ExistingCustomerOnly: Whether this card is only available to existing
- // customers of the issuer.
- ExistingCustomerOnly bool `json:"existingCustomerOnly,omitempty"`
- // ExtendedWarranty: If you get coverage when you use the card for the
- // given activity, this field describes it.
- ExtendedWarranty string `json:"extendedWarranty,omitempty"`
- // FirstYearAnnualFee: The annual fee for the first year, if different
- // from the ongoing fee. Optional.
- FirstYearAnnualFee float64 `json:"firstYearAnnualFee,omitempty"`
- // FlightAccidentInsurance: If you get coverage when you use the card
- // for the given activity, this field describes it.
- FlightAccidentInsurance string `json:"flightAccidentInsurance,omitempty"`
- // ForeignCurrencyTransactionFee: Fee for each transaction involving a
- // foreign currency.
- ForeignCurrencyTransactionFee string `json:"foreignCurrencyTransactionFee,omitempty"`
- // FraudLiability: If you get coverage when you use the card for the
- // given activity, this field describes it.
- FraudLiability string `json:"fraudLiability,omitempty"`
- // GracePeriodDisplay: Text describing the grace period before finance
- // charges apply. A summary field.
- GracePeriodDisplay string `json:"gracePeriodDisplay,omitempty"`
- // ImageUrl: The link to the image of the card that is shown on Connect
- // Commerce. A summary field.
- ImageUrl string `json:"imageUrl,omitempty"`
- // InitialSetupAndProcessingFee: Fee for setting up the card.
- InitialSetupAndProcessingFee string `json:"initialSetupAndProcessingFee,omitempty"`
- // IntroBalanceTransferTerms: Text describing the terms for introductory
- // period balance transfers. A summary field.
- IntroBalanceTransferTerms string `json:"introBalanceTransferTerms,omitempty"`
- // IntroCashAdvanceTerms: Text describing the terms for introductory
- // period cash advances. A summary field.
- IntroCashAdvanceTerms string `json:"introCashAdvanceTerms,omitempty"`
- // IntroPurchaseTerms: Text describing the terms for introductory period
- // purchases. A summary field.
- IntroPurchaseTerms string `json:"introPurchaseTerms,omitempty"`
- // Issuer: Name of card issuer. A summary field.
- Issuer string `json:"issuer,omitempty"`
- // IssuerId: The Google Affiliate Network ID of the advertiser making
- // this offer.
- IssuerId string `json:"issuerId,omitempty"`
- // IssuerWebsite: The generic link to the issuer's site.
- IssuerWebsite string `json:"issuerWebsite,omitempty"`
- // Kind: The kind for one credit card offer. A summary field.
- Kind string `json:"kind,omitempty"`
- // LandingPageUrl: The link to the issuer's page for this card. A
- // summary field.
- LandingPageUrl string `json:"landingPageUrl,omitempty"`
- // LatePaymentFee: Text describing how much a late payment will cost, eg
- // "up to $35." A summary field.
- LatePaymentFee string `json:"latePaymentFee,omitempty"`
- // LuggageInsurance: If you get coverage when you use the card for the
- // given activity, this field describes it.
- LuggageInsurance string `json:"luggageInsurance,omitempty"`
- // MaxPurchaseRate: The highest interest rate the issuer charges on this
- // card. Expressed as an absolute number, not as a percentage.
- MaxPurchaseRate float64 `json:"maxPurchaseRate,omitempty"`
- // MinPurchaseRate: The lowest interest rate the issuer charges on this
- // card. Expressed as an absolute number, not as a percentage.
- MinPurchaseRate float64 `json:"minPurchaseRate,omitempty"`
- // MinimumFinanceCharge: Text describing how much missing the grace
- // period will cost.
- MinimumFinanceCharge string `json:"minimumFinanceCharge,omitempty"`
- // Network: Which network (eg Visa) the card belongs to. A summary
- // field.
- Network string `json:"network,omitempty"`
- // OfferId: This offer's ID. A summary field.
- OfferId string `json:"offerId,omitempty"`
- // OffersImmediateCashReward: Whether a cash reward program lets you get
- // cash back sooner than end of year or other longish period.
- OffersImmediateCashReward bool `json:"offersImmediateCashReward,omitempty"`
- // OverLimitFee: Fee for exceeding the card's charge limit.
- OverLimitFee string `json:"overLimitFee,omitempty"`
- // ProhibitedCategories: Categories in which the issuer does not wish
- // the card to be displayed. A summary field.
- ProhibitedCategories []string `json:"prohibitedCategories,omitempty"`
- // PurchaseRateAdditionalDetails: Text describing any additional details
- // for the purchase rate. A summary field.
- PurchaseRateAdditionalDetails string `json:"purchaseRateAdditionalDetails,omitempty"`
- // PurchaseRateType: Fixed or variable.
- PurchaseRateType string `json:"purchaseRateType,omitempty"`
- // ReturnedPaymentFee: Text describing the fee for a payment that
- // doesn't clear. A summary field.
- ReturnedPaymentFee string `json:"returnedPaymentFee,omitempty"`
- // RewardPartner: The company that redeems the rewards, if different
- // from the issuer.
- RewardPartner string `json:"rewardPartner,omitempty"`
- // RewardUnit: For cards with rewards programs, the unit of reward. For
- // example, miles, cash back, points.
- RewardUnit string `json:"rewardUnit,omitempty"`
- // Rewards: For cards with rewards programs, detailed rules about how
- // the program works.
- Rewards []*CcOfferRewards `json:"rewards,omitempty"`
- // RewardsExpire: Whether accumulated rewards ever expire.
- RewardsExpire bool `json:"rewardsExpire,omitempty"`
- // RewardsHaveBlackoutDates: For airline miles rewards, tells whether
- // blackout dates apply to the miles.
- RewardsHaveBlackoutDates bool `json:"rewardsHaveBlackoutDates,omitempty"`
- // StatementCopyFee: Fee for requesting a copy of your statement.
- StatementCopyFee string `json:"statementCopyFee,omitempty"`
- // TrackingUrl: The link to ping to register a click on this offer. A
- // summary field.
- TrackingUrl string `json:"trackingUrl,omitempty"`
- // TravelInsurance: If you get coverage when you use the card for the
- // given activity, this field describes it.
- TravelInsurance string `json:"travelInsurance,omitempty"`
- // VariableRatesLastUpdated: When variable rates were last updated.
- VariableRatesLastUpdated string `json:"variableRatesLastUpdated,omitempty"`
- // VariableRatesUpdateFrequency: How often variable rates are updated.
- VariableRatesUpdateFrequency string `json:"variableRatesUpdateFrequency,omitempty"`
- // ForceSendFields is a list of field names (e.g.
- // "AdditionalCardBenefits") to unconditionally include in API requests.
- // By default, fields with empty values are omitted from API requests.
- // However, any non-pointer, non-interface field appearing in
- // ForceSendFields will be sent to the server regardless of whether the
- // field is empty or not. This may be used to include empty fields in
- // Patch requests.
- ForceSendFields []string `json:"-"`
- }
- func (s *CcOffer) MarshalJSON() ([]byte, error) {
- type noMethod CcOffer
- raw := noMethod(*s)
- return gensupport.MarshalJSON(raw, s.ForceSendFields)
- }
- type CcOfferBonusRewards struct {
- // Amount: How many units of reward will be granted.
- Amount float64 `json:"amount,omitempty"`
- // Details: The circumstances under which this rule applies, for
- // example, booking a flight via Orbitz.
- Details string `json:"details,omitempty"`
- // ForceSendFields is a list of field names (e.g. "Amount") to
- // unconditionally include in API requests. By default, fields with
- // empty values are omitted from API requests. However, any non-pointer,
- // non-interface field appearing in ForceSendFields will be sent to the
- // server regardless of whether the field is empty or not. This may be
- // used to include empty fields in Patch requests.
- ForceSendFields []string `json:"-"`
- }
- func (s *CcOfferBonusRewards) MarshalJSON() ([]byte, error) {
- type noMethod CcOfferBonusRewards
- raw := noMethod(*s)
- return gensupport.MarshalJSON(raw, s.ForceSendFields)
- }
- type CcOfferDefaultFees struct {
- // Category: The type of charge, for example Purchases.
- Category string `json:"category,omitempty"`
- // MaxRate: The highest rate the issuer may charge for defaulting on
- // debt in this category. Expressed as an absolute number, not as a
- // percentage.
- MaxRate float64 `json:"maxRate,omitempty"`
- // MinRate: The lowest rate the issuer may charge for defaulting on debt
- // in this category. Expressed as an absolute number, not as a
- // percentage.
- MinRate float64 `json:"minRate,omitempty"`
- // RateType: Fixed or variable.
- RateType string `json:"rateType,omitempty"`
- // ForceSendFields is a list of field names (e.g. "Category") to
- // unconditionally include in API requests. By default, fields with
- // empty values are omitted from API requests. However, any non-pointer,
- // non-interface field appearing in ForceSendFields will be sent to the
- // server regardless of whether the field is empty or not. This may be
- // used to include empty fields in Patch requests.
- ForceSendFields []string `json:"-"`
- }
- func (s *CcOfferDefaultFees) MarshalJSON() ([]byte, error) {
- type noMethod CcOfferDefaultFees
- raw := noMethod(*s)
- return gensupport.MarshalJSON(raw, s.ForceSendFields)
- }
- type CcOfferRewards struct {
- // AdditionalDetails: Other limits, for example, if this rule only
- // applies during an introductory period.
- AdditionalDetails string `json:"additionalDetails,omitempty"`
- // Amount: The number of units rewarded per purchase dollar.
- Amount float64 `json:"amount,omitempty"`
- // Category: The kind of purchases covered by this rule.
- Category string `json:"category,omitempty"`
- // ExpirationMonths: How long rewards granted by this rule last.
- ExpirationMonths float64 `json:"expirationMonths,omitempty"`
- // MaxRewardTier: The maximum purchase amount in the given category for
- // this rule to apply.
- MaxRewardTier float64 `json:"maxRewardTier,omitempty"`
- // MinRewardTier: The minimum purchase amount in the given category
- // before this rule applies.
- MinRewardTier float64 `json:"minRewardTier,omitempty"`
- // ForceSendFields is a list of field names (e.g. "AdditionalDetails")
- // to unconditionally include in API requests. By default, fields with
- // empty values are omitted from API requests. However, any non-pointer,
- // non-interface field appearing in ForceSendFields will be sent to the
- // server regardless of whether the field is empty or not. This may be
- // used to include empty fields in Patch requests.
- ForceSendFields []string `json:"-"`
- }
- func (s *CcOfferRewards) MarshalJSON() ([]byte, error) {
- type noMethod CcOfferRewards
- raw := noMethod(*s)
- return gensupport.MarshalJSON(raw, s.ForceSendFields)
- }
- type CcOffers struct {
- // Items: The credit card offers.
- Items []*CcOffer `json:"items,omitempty"`
- // Kind: The kind for a page of credit card offers.
- Kind string `json:"kind,omitempty"`
- // ServerResponse contains the HTTP response code and headers from the
- // server.
- googleapi.ServerResponse `json:"-"`
- // ForceSendFields is a list of field names (e.g. "Items") to
- // unconditionally include in API requests. By default, fields with
- // empty values are omitted from API requests. However, any non-pointer,
- // non-interface field appearing in ForceSendFields will be sent to the
- // server regardless of whether the field is empty or not. This may be
- // used to include empty fields in Patch requests.
- ForceSendFields []string `json:"-"`
- }
- func (s *CcOffers) MarshalJSON() ([]byte, error) {
- type noMethod CcOffers
- raw := noMethod(*s)
- return gensupport.MarshalJSON(raw, s.ForceSendFields)
- }
- // Event: An EventResource.
- type Event struct {
- // AdvertiserId: The ID of advertiser for this event.
- AdvertiserId int64 `json:"advertiserId,omitempty,string"`
- // AdvertiserName: The name of the advertiser for this event.
- AdvertiserName string `json:"advertiserName,omitempty"`
- // ChargeId: The charge ID for this event. Only returned for charge
- // events.
- ChargeId string `json:"chargeId,omitempty"`
- // ChargeType: Charge type of the event
- // (other|slotting_fee|monthly_minimum|tier_bonus|debit|credit). Only
- // returned for charge events.
- ChargeType string `json:"chargeType,omitempty"`
- // CommissionableSales: Amount of money exchanged during the
- // transaction. Only returned for charge and conversion events.
- CommissionableSales *Money `json:"commissionableSales,omitempty"`
- // Earnings: Earnings by the publisher.
- Earnings *Money `json:"earnings,omitempty"`
- // EventDate: The date-time this event was initiated as a RFC 3339
- // date-time value.
- EventDate string `json:"eventDate,omitempty"`
- // Kind: The kind for one event.
- Kind string `json:"kind,omitempty"`
- // MemberId: The ID of the member attached to this event. Only returned
- // for conversion events.
- MemberId string `json:"memberId,omitempty"`
- // ModifyDate: The date-time this event was last modified as a RFC 3339
- // date-time value.
- ModifyDate string `json:"modifyDate,omitempty"`
- // NetworkFee: Fee that the advertiser paid to the Google Affiliate
- // Network.
- NetworkFee *Money `json:"networkFee,omitempty"`
- // OrderId: The order ID for this event. Only returned for conversion
- // events.
- OrderId string `json:"orderId,omitempty"`
- // Products: Products associated with the event.
- Products []*EventProducts `json:"products,omitempty"`
- // PublisherFee: Fee that the advertiser paid to the publisher.
- PublisherFee *Money `json:"publisherFee,omitempty"`
- // PublisherId: The ID of the publisher for this event.
- PublisherId int64 `json:"publisherId,omitempty,string"`
- // PublisherName: The name of the publisher for this event.
- PublisherName string `json:"publisherName,omitempty"`
- // Status: Status of the event (active|canceled). Only returned for
- // charge and conversion events.
- Status string `json:"status,omitempty"`
- // Type: Type of the event (action|transaction|charge).
- Type string `json:"type,omitempty"`
- // ForceSendFields is a list of field names (e.g. "AdvertiserId") to
- // unconditionally include in API requests. By default, fields with
- // empty values are omitted from API requests. However, any non-pointer,
- // non-interface field appearing in ForceSendFields will be sent to the
- // server regardless of whether the field is empty or not. This may be
- // used to include empty fields in Patch requests.
- ForceSendFields []string `json:"-"`
- }
- func (s *Event) MarshalJSON() ([]byte, error) {
- type noMethod Event
- raw := noMethod(*s)
- return gensupport.MarshalJSON(raw, s.ForceSendFields)
- }
- type EventProducts struct {
- // CategoryId: Id of the category this product belongs to.
- CategoryId string `json:"categoryId,omitempty"`
- // CategoryName: Name of the category this product belongs to.
- CategoryName string `json:"categoryName,omitempty"`
- // Earnings: Amount earned by the publisher on this product.
- Earnings *Money `json:"earnings,omitempty"`
- // NetworkFee: Fee that the advertiser paid to the Google Affiliate
- // Network for this product.
- NetworkFee *Money `json:"networkFee,omitempty"`
- // PublisherFee: Fee that the advertiser paid to the publisehr for this
- // product.
- PublisherFee *Money `json:"publisherFee,omitempty"`
- // Quantity: Quantity of this product bought/exchanged.
- Quantity int64 `json:"quantity,omitempty,string"`
- // Sku: Sku of this product.
- Sku string `json:"sku,omitempty"`
- // SkuName: Sku name of this product.
- SkuName string `json:"skuName,omitempty"`
- // UnitPrice: Price per unit of this product.
- UnitPrice *Money `json:"unitPrice,omitempty"`
- // ForceSendFields is a list of field names (e.g. "CategoryId") to
- // unconditionally include in API requests. By default, fields with
- // empty values are omitted from API requests. However, any non-pointer,
- // non-interface field appearing in ForceSendFields will be sent to the
- // server regardless of whether the field is empty or not. This may be
- // used to include empty fields in Patch requests.
- ForceSendFields []string `json:"-"`
- }
- func (s *EventProducts) MarshalJSON() ([]byte, error) {
- type noMethod EventProducts
- raw := noMethod(*s)
- return gensupport.MarshalJSON(raw, s.ForceSendFields)
- }
- type Events struct {
- // Items: The event list.
- Items []*Event `json:"items,omitempty"`
- // Kind: The kind for a page of events.
- Kind string `json:"kind,omitempty"`
- // NextPageToken: The 'pageToken' to pass to the next request to get the
- // next page, if there are more to retrieve.
- NextPageToken string `json:"nextPageToken,omitempty"`
- // ServerResponse contains the HTTP response code and headers from the
- // server.
- googleapi.ServerResponse `json:"-"`
- // ForceSendFields is a list of field names (e.g. "Items") to
- // unconditionally include in API requests. By default, fields with
- // empty values are omitted from API requests. However, any non-pointer,
- // non-interface field appearing in ForceSendFields will be sent to the
- // server regardless of whether the field is empty or not. This may be
- // used to include empty fields in Patch requests.
- ForceSendFields []string `json:"-"`
- }
- func (s *Events) MarshalJSON() ([]byte, error) {
- type noMethod Events
- raw := noMethod(*s)
- return gensupport.MarshalJSON(raw, s.ForceSendFields)
- }
- // Link: A LinkResource.
- type Link struct {
- // AdvertiserId: The advertiser id for the advertiser who owns this
- // link.
- AdvertiserId int64 `json:"advertiserId,omitempty,string"`
- // Authorship: Authorship
- Authorship string `json:"authorship,omitempty"`
- // Availability: Availability.
- Availability string `json:"availability,omitempty"`
- // ClickTrackingUrl: Tracking url for clicks.
- ClickTrackingUrl string `json:"clickTrackingUrl,omitempty"`
- // CreateDate: Date that this link was created.
- CreateDate string `json:"createDate,omitempty"`
- // Description: Description.
- Description string `json:"description,omitempty"`
- // DestinationUrl: The destination URL for the link.
- DestinationUrl string `json:"destinationUrl,omitempty"`
- // Duration: Duration
- Duration string `json:"duration,omitempty"`
- // EndDate: Date that this link becomes inactive.
- EndDate string `json:"endDate,omitempty"`
- // EpcNinetyDayAverage: The sum of fees paid to publishers divided by
- // the total number of clicks over the past three months on this link.
- // This value should be multiplied by 100 at the time of display.
- EpcNinetyDayAverage *Money `json:"epcNinetyDayAverage,omitempty"`
- // EpcSevenDayAverage: The sum of fees paid to publishers divided by the
- // total number of clicks over the past seven days on this link. This
- // value should be multiplied by 100 at the time of display.
- EpcSevenDayAverage *Money `json:"epcSevenDayAverage,omitempty"`
- // Id: The ID of this link.
- Id int64 `json:"id,omitempty,string"`
- // ImageAltText: image alt text.
- ImageAltText string `json:"imageAltText,omitempty"`
- // ImpressionTrackingUrl: Tracking url for impressions.
- ImpressionTrackingUrl string `json:"impressionTrackingUrl,omitempty"`
- // IsActive: Flag for if this link is active.
- IsActive bool `json:"isActive,omitempty"`
- // Kind: The kind for one entity.
- Kind string `json:"kind,omitempty"`
- // LinkType: The link type.
- LinkType string `json:"linkType,omitempty"`
- // Name: The logical name for this link.
- Name string `json:"name,omitempty"`
- // PromotionType: Promotion Type
- PromotionType string `json:"promotionType,omitempty"`
- // SpecialOffers: Special offers on the link.
- SpecialOffers *LinkSpecialOffers `json:"specialOffers,omitempty"`
- // StartDate: Date that this link becomes active.
- StartDate string `json:"startDate,omitempty"`
- // ServerResponse contains the HTTP response code and headers from the
- // server.
- googleapi.ServerResponse `json:"-"`
- // ForceSendFields is a list of field names (e.g. "AdvertiserId") to
- // unconditionally include in API requests. By default, fields with
- // empty values are omitted from API requests. However, any non-pointer,
- // non-interface field appearing in ForceSendFields will be sent to the
- // server regardless of whether the field is empty or not. This may be
- // used to include empty fields in Patch requests.
- ForceSendFields []string `json:"-"`
- }
- func (s *Link) MarshalJSON() ([]byte, error) {
- type noMethod Link
- raw := noMethod(*s)
- return gensupport.MarshalJSON(raw, s.ForceSendFields)
- }
- // LinkSpecialOffers: Special offers on the link.
- type LinkSpecialOffers struct {
- // FreeGift: Whether there is a free gift
- FreeGift bool `json:"freeGift,omitempty"`
- // FreeShipping: Whether there is free shipping
- FreeShipping bool `json:"freeShipping,omitempty"`
- // FreeShippingMin: Minimum purchase amount for free shipping promotion
- FreeShippingMin *Money `json:"freeShippingMin,omitempty"`
- // PercentOff: Percent off on the purchase
- PercentOff float64 `json:"percentOff,omitempty"`
- // PercentOffMin: Minimum purchase amount for percent off promotion
- PercentOffMin *Money `json:"percentOffMin,omitempty"`
- // PriceCut: Price cut on the purchase
- PriceCut *Money `json:"priceCut,omitempty"`
- // PriceCutMin: Minimum purchase amount for price cut promotion
- PriceCutMin *Money `json:"priceCutMin,omitempty"`
- // PromotionCodes: List of promotion code associated with the link
- PromotionCodes []string `json:"promotionCodes,omitempty"`
- // ForceSendFields is a list of field names (e.g. "FreeGift") to
- // unconditionally include in API requests. By default, fields with
- // empty values are omitted from API requests. However, any non-pointer,
- // non-interface field appearing in ForceSendFields will be sent to the
- // server regardless of whether the field is empty or not. This may be
- // used to include empty fields in Patch requests.
- ForceSendFields []string `json:"-"`
- }
- func (s *LinkSpecialOffers) MarshalJSON() ([]byte, error) {
- type noMethod LinkSpecialOffers
- raw := noMethod(*s)
- return gensupport.MarshalJSON(raw, s.ForceSendFields)
- }
- type Links struct {
- // Items: The links.
- Items []*Link `json:"items,omitempty"`
- // Kind: The kind for a page of links.
- Kind string `json:"kind,omitempty"`
- // NextPageToken: The next page token.
- NextPageToken string `json:"nextPageToken,omitempty"`
- // ServerResponse contains the HTTP response code and headers from the
- // server.
- googleapi.ServerResponse `json:"-"`
- // ForceSendFields is a list of field names (e.g. "Items") to
- // unconditionally include in API requests. By default, fields with
- // empty values are omitted from API requests. However, any non-pointer,
- // non-interface field appearing in ForceSendFields will be sent to the
- // server regardless of whether the field is empty or not. This may be
- // used to include empty fields in Patch requests.
- ForceSendFields []string `json:"-"`
- }
- func (s *Links) MarshalJSON() ([]byte, error) {
- type noMethod Links
- raw := noMethod(*s)
- return gensupport.MarshalJSON(raw, s.ForceSendFields)
- }
- // Money: An ApiMoneyProto.
- type Money struct {
- // Amount: The amount of money.
- Amount float64 `json:"amount,omitempty"`
- // CurrencyCode: The 3-letter code of the currency in question.
- CurrencyCode string `json:"currencyCode,omitempty"`
- // ForceSendFields is a list of field names (e.g. "Amount") to
- // unconditionally include in API requests. By default, fields with
- // empty values are omitted from API requests. However, any non-pointer,
- // non-interface field appearing in ForceSendFields will be sent to the
- // server regardless of whether the field is empty or not. This may be
- // used to include empty fields in Patch requests.
- ForceSendFields []string `json:"-"`
- }
- func (s *Money) MarshalJSON() ([]byte, error) {
- type noMethod Money
- raw := noMethod(*s)
- return gensupport.MarshalJSON(raw, s.ForceSendFields)
- }
- // Publisher: A PublisherResource.
- type Publisher struct {
- // Classification: Classification that this publisher belongs to. See
- // this link for all publisher classifications:
- // http://www.google.com/support/affiliatenetwork/advertiser/bin/answer.py?hl=en&answer=107625&ctx=cb&src=cb&cbid=-k5fihzthfaik&cbrank=4
- Classification string `json:"classification,omitempty"`
- // EpcNinetyDayAverage: The sum of fees paid to this publisher divided
- // by the total number of clicks over the past three months. Values are
- // multiplied by 100 for display purposes.
- EpcNinetyDayAverage *Money `json:"epcNinetyDayAverage,omitempty"`
- // EpcSevenDayAverage: The sum of fees paid to this publisher divided by
- // the total number of clicks over the past seven days. Values are
- // multiplied by 100 for display purposes.
- EpcSevenDayAverage *Money `json:"epcSevenDayAverage,omitempty"`
- // Id: The ID of this publisher.
- Id int64 `json:"id,omitempty,string"`
- // Item: The requested publisher.
- Item *Publisher `json:"item,omitempty"`
- // JoinDate: Date that this publisher was approved as a Google Affiliate
- // Network publisher.
- JoinDate string `json:"joinDate,omitempty"`
- // Kind: The kind for a publisher.
- Kind string `json:"kind,omitempty"`
- // Name: The name of this publisher.
- Name string `json:"name,omitempty"`
- // PayoutRank: A rank based on commissions paid to this publisher over
- // the past 90 days. A number between 1 and 4 where 4 means the top
- // quartile (most money paid) and 1 means the bottom quartile (least
- // money paid).
- PayoutRank string `json:"payoutRank,omitempty"`
- // Sites: Websites that this publisher uses to advertise.
- Sites []string `json:"sites,omitempty"`
- // Status: The status of the requesting advertiser's relationship with
- // this publisher.
- Status string `json:"status,omitempty"`
- // ServerResponse contains the HTTP response code and headers from the
- // server.
- googleapi.ServerResponse `json:"-"`
- // ForceSendFields is a list of field names (e.g. "Classification") to
- // unconditionally include in API requests. By default, fields with
- // empty values are omitted from API requests. However, any non-pointer,
- // non-interface field appearing in ForceSendFields will be sent to the
- // server regardless of whether the field is empty or not. This may be
- // used to include empty fields in Patch requests.
- ForceSendFields []string `json:"-"`
- }
- func (s *Publisher) MarshalJSON() ([]byte, error) {
- type noMethod Publisher
- raw := noMethod(*s)
- return gensupport.MarshalJSON(raw, s.ForceSendFields)
- }
- type Publishers struct {
- // Items: The entity list.
- Items []*Publisher `json:"items,omitempty"`
- // Kind: The kind for a page of entities.
- Kind string `json:"kind,omitempty"`
- // NextPageToken: The 'pageToken' to pass to the next request to get the
- // next page, if there are more to retrieve.
- NextPageToken string `json:"nextPageToken,omitempty"`
- // ServerResponse contains the HTTP response code and headers from the
- // server.
- googleapi.ServerResponse `json:"-"`
- // ForceSendFields is a list of field names (e.g. "Items") to
- // unconditionally include in API requests. By default, fields with
- // empty values are omitted from API requests. However, any non-pointer,
- // non-interface field appearing in ForceSendFields will be sent to the
- // server regardless of whether the field is empty or not. This may be
- // used to include empty fields in Patch requests.
- ForceSendFields []string `json:"-"`
- }
- func (s *Publishers) MarshalJSON() ([]byte, error) {
- type noMethod Publishers
- raw := noMethod(*s)
- return gensupport.MarshalJSON(raw, s.ForceSendFields)
- }
- // Report: A ReportResource representing a report of a certain type
- // either for an advertiser or publisher.
- type Report struct {
- // ColumnNames: The column names for the report
- ColumnNames []string `json:"column_names,omitempty"`
- // EndDate: The end of the date range for this report, exclusive.
- EndDate string `json:"end_date,omitempty"`
- // Kind: The kind for a report.
- Kind string `json:"kind,omitempty"`
- // MatchingRowCount: The number of matching rows before paging is
- // applied.
- MatchingRowCount int64 `json:"matching_row_count,omitempty,string"`
- // Rows: The rows of data for the report
- Rows [][]interface{} `json:"rows,omitempty"`
- // StartDate: The start of the date range for this report, inclusive.
- StartDate string `json:"start_date,omitempty"`
- // TotalsRows: The totals rows for the report
- TotalsRows [][]interface{} `json:"totals_rows,omitempty"`
- // Type: The report type.
- Type string `json:"type,omitempty"`
- // ServerResponse contains the HTTP response code and headers from the
- // server.
- googleapi.ServerResponse `json:"-"`
- // ForceSendFields is a list of field names (e.g. "ColumnNames") to
- // unconditionally include in API requests. By default, fields with
- // empty values are omitted from API requests. However, any non-pointer,
- // non-interface field appearing in ForceSendFields will be sent to the
- // server regardless of whether the field is empty or not. This may be
- // used to include empty fields in Patch requests.
- ForceSendFields []string `json:"-"`
- }
- func (s *Report) MarshalJSON() ([]byte, error) {
- type noMethod Report
- raw := noMethod(*s)
- return gensupport.MarshalJSON(raw, s.ForceSendFields)
- }
- // method id "gan.advertisers.get":
- type AdvertisersGetCall struct {
- s *Service
- role string
- roleId string
- urlParams_ gensupport.URLParams
- ifNoneMatch_ string
- ctx_ context.Context
- }
- // Get: 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.
- func (r *AdvertisersService) Get(role string, roleId string) *AdvertisersGetCall {
- c := &AdvertisersGetCall{s: r.s, urlParams_: make(gensupport.URLParams)}
- c.role = role
- c.roleId = roleId
- return c
- }
- // AdvertiserId sets the optional parameter "advertiserId": The ID of
- // the advertiser to look up.
- func (c *AdvertisersGetCall) AdvertiserId(advertiserId string) *AdvertisersGetCall {
- c.urlParams_.Set("advertiserId", advertiserId)
- return c
- }
- // Fields allows partial responses to be retrieved. See
- // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
- // for more information.
- func (c *AdvertisersGetCall) Fields(s ...googleapi.Field) *AdvertisersGetCall {
- c.urlParams_.Set("fields", googleapi.CombineFields(s))
- return c
- }
- // IfNoneMatch sets the optional parameter which makes the operation
- // fail if the object's ETag matches the given value. This is useful for
- // getting updates only after the object has changed since the last
- // request. Use googleapi.IsNotModified to check whether the response
- // error from Do is the result of In-None-Match.
- func (c *AdvertisersGetCall) IfNoneMatch(entityTag string) *AdvertisersGetCall {
- c.ifNoneMatch_ = entityTag
- return c
- }
- // Context sets the context to be used in this call's Do method. Any
- // pending HTTP request will be aborted if the provided context is
- // canceled.
- func (c *AdvertisersGetCall) Context(ctx context.Context) *AdvertisersGetCall {
- c.ctx_ = ctx
- return c
- }
- func (c *AdvertisersGetCall) doRequest(alt string) (*http.Response, error) {
- var body io.Reader = nil
- c.urlParams_.Set("alt", alt)
- urls := googleapi.ResolveRelative(c.s.BasePath, "{role}/{roleId}/advertiser")
- urls += "?" + c.urlParams_.Encode()
- req, _ := http.NewRequest("GET", urls, body)
- googleapi.Expand(req.URL, map[string]string{
- "role": c.role,
- "roleId": c.roleId,
- })
- req.Header.Set("User-Agent", c.s.userAgent())
- if c.ifNoneMatch_ != "" {
- req.Header.Set("If-None-Match", c.ifNoneMatch_)
- }
- if c.ctx_ != nil {
- return ctxhttp.Do(c.ctx_, c.s.client, req)
- }
- return c.s.client.Do(req)
- }
- // Do executes the "gan.advertisers.get" call.
- // Exactly one of *Advertiser or error will be non-nil. Any non-2xx
- // status code is an error. Response headers are in either
- // *Advertiser.ServerResponse.Header or (if a response was returned at
- // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
- // to check whether the returned error was because
- // http.StatusNotModified was returned.
- func (c *AdvertisersGetCall) Do(opts ...googleapi.CallOption) (*Advertiser, error) {
- gensupport.SetOptions(c.urlParams_, opts...)
- res, err := c.doRequest("json")
- if res != nil && res.StatusCode == http.StatusNotModified {
- if res.Body != nil {
- res.Body.Close()
- }
- return nil, &googleapi.Error{
- Code: res.StatusCode,
- Header: res.Header,
- }
- }
- if err != nil {
- return nil, err
- }
- defer googleapi.CloseBody(res)
- if err := googleapi.CheckResponse(res); err != nil {
- return nil, err
- }
- ret := &Advertiser{
- ServerResponse: googleapi.ServerResponse{
- Header: res.Header,
- HTTPStatusCode: res.StatusCode,
- },
- }
- if err := json.NewDecoder(res.Body).Decode(&ret); err != nil {
- return nil, err
- }
- return ret, nil
- // {
- // "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.",
- // "httpMethod": "GET",
- // "id": "gan.advertisers.get",
- // "parameterOrder": [
- // "role",
- // "roleId"
- // ],
- // "parameters": {
- // "advertiserId": {
- // "description": "The ID of the advertiser to look up. Optional.",
- // "location": "query",
- // "type": "string"
- // },
- // "role": {
- // "description": "The role of the requester. Valid values: 'advertisers' or 'publishers'.",
- // "enum": [
- // "advertisers",
- // "publishers"
- // ],
- // "enumDescriptions": [
- // "The requester is requesting as an advertiser.",
- // "The requester is requesting as a publisher."
- // ],
- // "location": "path",
- // "required": true,
- // "type": "string"
- // },
- // "roleId": {
- // "description": "The ID of the requesting advertiser or publisher.",
- // "location": "path",
- // "required": true,
- // "type": "string"
- // }
- // },
- // "path": "{role}/{roleId}/advertiser",
- // "response": {
- // "$ref": "Advertiser"
- // }
- // }
- }
- // method id "gan.advertisers.list":
- type AdvertisersListCall struct {
- s *Service
- role string
- roleId string
- urlParams_ gensupport.URLParams
- ifNoneMatch_ string
- ctx_ context.Context
- }
- // List: Retrieves data about all advertisers that the requesting
- // advertiser/publisher has access to.
- func (r *AdvertisersService) List(role string, roleId string) *AdvertisersListCall {
- c := &AdvertisersListCall{s: r.s, urlParams_: make(gensupport.URLParams)}
- c.role = role
- c.roleId = roleId
- return c
- }
- // AdvertiserCategory sets the optional parameter "advertiserCategory":
- // Caret(^) delimted list of advertiser categories. Valid categories are
- // defined here:
- // 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
- // categories.
- func (c *AdvertisersListCall) AdvertiserCategory(advertiserCategory string) *AdvertisersListCall {
- c.urlParams_.Set("advertiserCategory", advertiserCategory)
- return c
- }
- // MaxResults sets the optional parameter "maxResults": Max number of
- // items to return in this page. Defaults to 20.
- func (c *AdvertisersListCall) MaxResults(maxResults int64) *AdvertisersListCall {
- c.urlParams_.Set("maxResults", fmt.Sprint(maxResults))
- return c
- }
- // MinNinetyDayEpc sets the optional parameter "minNinetyDayEpc":
- // Filters out all advertisers that have a ninety day EPC average lower
- // than the given value (inclusive). Min value: 0.0.
- func (c *AdvertisersListCall) MinNinetyDayEpc(minNinetyDayEpc float64) *AdvertisersListCall {
- c.urlParams_.Set("minNinetyDayEpc", fmt.Sprint(minNinetyDayEpc))
- return c
- }
- // MinPayoutRank sets the optional parameter "minPayoutRank": 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.
- func (c *AdvertisersListCall) MinPayoutRank(minPayoutRank int64) *AdvertisersListCall {
- c.urlParams_.Set("minPayoutRank", fmt.Sprint(minPayoutRank))
- return c
- }
- // MinSevenDayEpc sets the optional parameter "minSevenDayEpc": Filters
- // out all advertisers that have a seven day EPC average lower than the
- // given value (inclusive). Min value: 0.0.
- func (c *AdvertisersListCall) MinSevenDayEpc(minSevenDayEpc float64) *AdvertisersListCall {
- c.urlParams_.Set("minSevenDayEpc", fmt.Sprint(minSevenDayEpc))
- return c
- }
- // PageToken sets the optional parameter "pageToken": The value of
- // 'nextPageToken' from the previous page.
- func (c *AdvertisersListCall) PageToken(pageToken string) *AdvertisersListCall {
- c.urlParams_.Set("pageToken", pageToken)
- return c
- }
- // RelationshipStatus sets the optional parameter "relationshipStatus":
- // Filters out all advertisers for which do not have the given
- // relationship status with the requesting publisher.
- //
- // Possible values:
- // "approved" - An advertiser that has approved your application.
- // "available" - An advertiser program that's accepting new
- // publishers.
- // "deactivated" - 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.
- // "declined" - An advertiser that did not approve your application.
- // "pending" - An advertiser program that you've already applied to,
- // but they haven't yet decided to approve or decline your application.
- func (c *AdvertisersListCall) RelationshipStatus(relationshipStatus string) *AdvertisersListCall {
- c.urlParams_.Set("relationshipStatus", relationshipStatus)
- return c
- }
- // Fields allows partial responses to be retrieved. See
- // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
- // for more information.
- func (c *AdvertisersListCall) Fields(s ...googleapi.Field) *AdvertisersListCall {
- c.urlParams_.Set("fields", googleapi.CombineFields(s))
- return c
- }
- // IfNoneMatch sets the optional parameter which makes the operation
- // fail if the object's ETag matches the given value. This is useful for
- // getting updates only after the object has changed since the last
- // request. Use googleapi.IsNotModified to check whether the response
- // error from Do is the result of In-None-Match.
- func (c *AdvertisersListCall) IfNoneMatch(entityTag string) *AdvertisersListCall {
- c.ifNoneMatch_ = entityTag
- return c
- }
- // Context sets the context to be used in this call's Do method. Any
- // pending HTTP request will be aborted if the provided context is
- // canceled.
- func (c *AdvertisersListCall) Context(ctx context.Context) *AdvertisersListCall {
- c.ctx_ = ctx
- return c
- }
- func (c *AdvertisersListCall) doRequest(alt string) (*http.Response, error) {
- var body io.Reader = nil
- c.urlParams_.Set("alt", alt)
- urls := googleapi.ResolveRelative(c.s.BasePath, "{role}/{roleId}/advertisers")
- urls += "?" + c.urlParams_.Encode()
- req, _ := http.NewRequest("GET", urls, body)
- googleapi.Expand(req.URL, map[string]string{
- "role": c.role,
- "roleId": c.roleId,
- })
- req.Header.Set("User-Agent", c.s.userAgent())
- if c.ifNoneMatch_ != "" {
- req.Header.Set("If-None-Match", c.ifNoneMatch_)
- }
- if c.ctx_ != nil {
- return ctxhttp.Do(c.ctx_, c.s.client, req)
- }
- return c.s.client.Do(req)
- }
- // Do executes the "gan.advertisers.list" call.
- // Exactly one of *Advertisers or error will be non-nil. Any non-2xx
- // status code is an error. Response headers are in either
- // *Advertisers.ServerResponse.Header or (if a response was returned at
- // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
- // to check whether the returned error was because
- // http.StatusNotModified was returned.
- func (c *AdvertisersListCall) Do(opts ...googleapi.CallOption) (*Advertisers, error) {
- gensupport.SetOptions(c.urlParams_, opts...)
- res, err := c.doRequest("json")
- if res != nil && res.StatusCode == http.StatusNotModified {
- if res.Body != nil {
- res.Body.Close()
- }
- return nil, &googleapi.Error{
- Code: res.StatusCode,
- Header: res.Header,
- }
- }
- if err != nil {
- return nil, err
- }
- defer googleapi.CloseBody(res)
- if err := googleapi.CheckResponse(res); err != nil {
- return nil, err
- }
- ret := &Advertisers{
- ServerResponse: googleapi.ServerResponse{
- Header: res.Header,
- HTTPStatusCode: res.StatusCode,
- },
- }
- if err := json.NewDecoder(res.Body).Decode(&ret); err != nil {
- return nil, err
- }
- return ret, nil
- // {
- // "description": "Retrieves data about all advertisers that the requesting advertiser/publisher has access to.",
- // "httpMethod": "GET",
- // "id": "gan.advertisers.list",
- // "parameterOrder": [
- // "role",
- // "roleId"
- // ],
- // "parameters": {
- // "advertiserCategory": {
- // "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.",
- // "location": "query",
- // "type": "string"
- // },
- // "maxResults": {
- // "description": "Max number of items to return in this page. Optional. Defaults to 20.",
- // "format": "uint32",
- // "location": "query",
- // "maximum": "100",
- // "minimum": "0",
- // "type": "integer"
- // },
- // "minNinetyDayEpc": {
- // "description": "Filters out all advertisers that have a ninety day EPC average lower than the given value (inclusive). Min value: 0.0. Optional.",
- // "format": "double",
- // "location": "query",
- // "type": "number"
- // },
- // "minPayoutRank": {
- // "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.",
- // "format": "int32",
- // "location": "query",
- // "maximum": "4",
- // "minimum": "1",
- // "type": "integer"
- // },
- // "minSevenDayEpc": {
- // "description": "Filters out all advertisers that have a seven day EPC average lower than the given value (inclusive). Min value: 0.0. Optional.",
- // "format": "double",
- // "location": "query",
- // "type": "number"
- // },
- // "pageToken": {
- // "description": "The value of 'nextPageToken' from the previous page. Optional.",
- // "location": "query",
- // "type": "string"
- // },
- // "relationshipStatus": {
- // "description": "Filters out all advertisers for which do not have the given relationship status with the requesting publisher.",
- // "enum": [
- // "approved",
- // "available",
- // "deactivated",
- // "declined",
- // "pending"
- // ],
- // "enumDescriptions": [
- // "An advertiser that has approved your application.",
- // "An advertiser program that's accepting new publishers.",
- // "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.",
- // "An advertiser that did not approve your application.",
- // "An advertiser program that you've already applied to, but they haven't yet decided to approve or decline your application."
- // ],
- // "location": "query",
- // "type": "string"
- // },
- // "role": {
- // "description": "The role of the requester. Valid values: 'advertisers' or 'publishers'.",
- // "enum": [
- // "advertisers",
- // "publishers"
- // ],
- // "enumDescriptions": [
- // "The requester is requesting as an advertiser.",
- // "The requester is requesting as a publisher."
- // ],
- // "location": "path",
- // "required": true,
- // "type": "string"
- // },
- // "roleId": {
- // "description": "The ID of the requesting advertiser or publisher.",
- // "location": "path",
- // "required": true,
- // "type": "string"
- // }
- // },
- // "path": "{role}/{roleId}/advertisers",
- // "response": {
- // "$ref": "Advertisers"
- // }
- // }
- }
- // Pages invokes f for each page of results.
- // A non-nil error returned from f will halt the iteration.
- // The provided context supersedes any context provided to the Context method.
- func (c *AdvertisersListCall) Pages(ctx context.Context, f func(*Advertisers) error) error {
- c.ctx_ = ctx
- defer c.PageToken(c.urlParams_.Get("pageToken")) // reset paging to original point
- for {
- x, err := c.Do()
- if err != nil {
- return err
- }
- if err := f(x); err != nil {
- return err
- }
- if x.NextPageToken == "" {
- return nil
- }
- c.PageToken(x.NextPageToken)
- }
- }
- // method id "gan.ccOffers.list":
- type CcOffersListCall struct {
- s *Service
- publisher string
- urlParams_ gensupport.URLParams
- ifNoneMatch_ string
- ctx_ context.Context
- }
- // List: Retrieves credit card offers for the given publisher.
- func (r *CcOffersService) List(publisher string) *CcOffersListCall {
- c := &CcOffersListCall{s: r.s, urlParams_: make(gensupport.URLParams)}
- c.publisher = publisher
- return c
- }
- // Advertiser sets the optional parameter "advertiser": The advertiser
- // ID of a card issuer whose offers to include. Optional, may be
- // repeated.
- func (c *CcOffersListCall) Advertiser(advertiser ...string) *CcOffersListCall {
- c.urlParams_.SetMulti("advertiser", append([]string{}, advertiser...))
- return c
- }
- // Projection sets the optional parameter "projection": The set of
- // fields to return.
- //
- // Possible values:
- // "full" - Include all offer fields. This is the default.
- // "summary" - Include only the basic fields needed to display an
- // offer.
- func (c *CcOffersListCall) Projection(projection string) *CcOffersListCall {
- c.urlParams_.Set("projection", projection)
- return c
- }
- // Fields allows partial responses to be retrieved. See
- // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
- // for more information.
- func (c *CcOffersListCall) Fields(s ...googleapi.Field) *CcOffersListCall {
- c.urlParams_.Set("fields", googleapi.CombineFields(s))
- return c
- }
- // IfNoneMatch sets the optional parameter which makes the operation
- // fail if the object's ETag matches the given value. This is useful for
- // getting updates only after the object has changed since the last
- // request. Use googleapi.IsNotModified to check whether the response
- // error from Do is the result of In-None-Match.
- func (c *CcOffersListCall) IfNoneMatch(entityTag string) *CcOffersListCall {
- c.ifNoneMatch_ = entityTag
- return c
- }
- // Context sets the context to be used in this call's Do method. Any
- // pending HTTP request will be aborted if the provided context is
- // canceled.
- func (c *CcOffersListCall) Context(ctx context.Context) *CcOffersListCall {
- c.ctx_ = ctx
- return c
- }
- func (c *CcOffersListCall) doRequest(alt string) (*http.Response, error) {
- var body io.Reader = nil
- c.urlParams_.Set("alt", alt)
- urls := googleapi.ResolveRelative(c.s.BasePath, "publishers/{publisher}/ccOffers")
- urls += "?" + c.urlParams_.Encode()
- req, _ := http.NewRequest("GET", urls, body)
- googleapi.Expand(req.URL, map[string]string{
- "publisher": c.publisher,
- })
- req.Header.Set("User-Agent", c.s.userAgent())
- if c.ifNoneMatch_ != "" {
- req.Header.Set("If-None-Match", c.ifNoneMatch_)
- }
- if c.ctx_ != nil {
- return ctxhttp.Do(c.ctx_, c.s.client, req)
- }
- return c.s.client.Do(req)
- }
- // Do executes the "gan.ccOffers.list" call.
- // Exactly one of *CcOffers or error will be non-nil. Any non-2xx status
- // code is an error. Response headers are in either
- // *CcOffers.ServerResponse.Header or (if a response was returned at
- // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
- // to check whether the returned error was because
- // http.StatusNotModified was returned.
- func (c *CcOffersListCall) Do(opts ...googleapi.CallOption) (*CcOffers, error) {
- gensupport.SetOptions(c.urlParams_, opts...)
- res, err := c.doRequest("json")
- if res != nil && res.StatusCode == http.StatusNotModified {
- if res.Body != nil {
- res.Body.Close()
- }
- return nil, &googleapi.Error{
- Code: res.StatusCode,
- Header: res.Header,
- }
- }
- if err != nil {
- return nil, err
- }
- defer googleapi.CloseBody(res)
- if err := googleapi.CheckResponse(res); err != nil {
- return nil, err
- }
- ret := &CcOffers{
- ServerResponse: googleapi.ServerResponse{
- Header: res.Header,
- HTTPStatusCode: res.StatusCode,
- },
- }
- if err := json.NewDecoder(res.Body).Decode(&ret); err != nil {
- return nil, err
- }
- return ret, nil
- // {
- // "description": "Retrieves credit card offers for the given publisher.",
- // "httpMethod": "GET",
- // "id": "gan.ccOffers.list",
- // "parameterOrder": [
- // "publisher"
- // ],
- // "parameters": {
- // "advertiser": {
- // "description": "The advertiser ID of a card issuer whose offers to include. Optional, may be repeated.",
- // "location": "query",
- // "repeated": true,
- // "type": "string"
- // },
- // "projection": {
- // "description": "The set of fields to return.",
- // "enum": [
- // "full",
- // "summary"
- // ],
- // "enumDescriptions": [
- // "Include all offer fields. This is the default.",
- // "Include only the basic fields needed to display an offer."
- // ],
- // "location": "query",
- // "type": "string"
- // },
- // "publisher": {
- // "description": "The ID of the publisher in question.",
- // "location": "path",
- // "required": true,
- // "type": "string"
- // }
- // },
- // "path": "publishers/{publisher}/ccOffers",
- // "response": {
- // "$ref": "CcOffers"
- // }
- // }
- }
- // method id "gan.events.list":
- type EventsListCall struct {
- s *Service
- role string
- roleId string
- urlParams_ gensupport.URLParams
- ifNoneMatch_ string
- ctx_ context.Context
- }
- // List: Retrieves event data for a given advertiser/publisher.
- func (r *EventsService) List(role string, roleId string) *EventsListCall {
- c := &EventsListCall{s: r.s, urlParams_: make(gensupport.URLParams)}
- c.role = role
- c.roleId = roleId
- return c
- }
- // AdvertiserId sets the optional parameter "advertiserId": 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.
- func (c *EventsListCall) AdvertiserId(advertiserId string) *EventsListCall {
- c.urlParams_.Set("advertiserId", advertiserId)
- return c
- }
- // ChargeType sets the optional parameter "chargeType": Filters out all
- // charge events that are not of the given charge type. Valid values:
- // 'other', 'slotting_fee', 'monthly_minimum', 'tier_bonus', 'credit',
- // 'debit'.
- //
- // Possible values:
- // "credit" - A credit increases the publisher's payout amount and
- // decreases the advertiser's invoice amount.
- // "debit" - A debit reduces the publisher's payout and increases the
- // advertiser's invoice amount.
- // "monthly_minimum" - A payment made to Google by an advertiser as a
- // minimum monthly network fee.
- // "other" - Catch all. Default if unset
- // "slotting_fee" - A one time payment made from an advertiser to a
- // publisher.
- // "tier_bonus" - A payment from an advertiser to a publisher for the
- // publisher maintaining a high tier level
- func (c *EventsListCall) ChargeType(chargeType string) *EventsListCall {
- c.urlParams_.Set("chargeType", chargeType)
- return c
- }
- // EventDateMax sets the optional parameter "eventDateMax": Filters out
- // all events later than given date. Defaults to 24 hours after
- // eventMin.
- func (c *EventsListCall) EventDateMax(eventDateMax string) *EventsListCall {
- c.urlParams_.Set("eventDateMax", eventDateMax)
- return c
- }
- // EventDateMin sets the optional parameter "eventDateMin": Filters out
- // all events earlier than given date. Defaults to 24 hours from
- // current date/time.
- func (c *EventsListCall) EventDateMin(eventDateMin string) *EventsListCall {
- c.urlParams_.Set("eventDateMin", eventDateMin)
- return c
- }
- // LinkId sets the optional parameter "linkId": Caret(^) delimited list
- // of link IDs. Filters out all events that do not reference one of the
- // given link IDs.
- func (c *EventsListCall) LinkId(linkId string) *EventsListCall {
- c.urlParams_.Set("linkId", linkId)
- return c
- }
- // MaxResults sets the optional parameter "maxResults": Max number of
- // offers to return in this page. Defaults to 20.
- func (c *EventsListCall) MaxResults(maxResults int64) *EventsListCall {
- c.urlParams_.Set("maxResults", fmt.Sprint(maxResults))
- return c
- }
- // MemberId sets the optional parameter "memberId": Caret(^) delimited
- // list of member IDs. Filters out all events that do not reference one
- // of the given member IDs.
- func (c *EventsListCall) MemberId(memberId string) *EventsListCall {
- c.urlParams_.Set("memberId", memberId)
- return c
- }
- // ModifyDateMax sets the optional parameter "modifyDateMax": Filters
- // out all events modified later than given date. Defaults to 24 hours
- // after modifyDateMin, if modifyDateMin is explicitly set.
- func (c *EventsListCall) ModifyDateMax(modifyDateMax string) *EventsListCall {
- c.urlParams_.Set("modifyDateMax", modifyDateMax)
- return c
- }
- // ModifyDateMin sets the optional parameter "modifyDateMin": Filters
- // out all events modified earlier than given date. Defaults to 24
- // hours before the current modifyDateMax, if modifyDateMax is
- // explicitly set.
- func (c *EventsListCall) ModifyDateMin(modifyDateMin string) *EventsListCall {
- c.urlParams_.Set("modifyDateMin", modifyDateMin)
- return c
- }
- // OrderId sets the optional parameter "orderId": Caret(^) delimited
- // list of order IDs. Filters out all events that do not reference one
- // of the given order IDs.
- func (c *EventsListCall) OrderId(orderId string) *EventsListCall {
- c.urlParams_.Set("orderId", orderId)
- return c
- }
- // PageToken sets the optional parameter "pageToken": The value of
- // 'nextPageToken' from the previous page.
- func (c *EventsListCall) PageToken(pageToken string) *EventsListCall {
- c.urlParams_.Set("pageToken", pageToken)
- return c
- }
- // ProductCategory sets the optional parameter "productCategory":
- // Caret(^) delimited list of product categories. Filters out all events
- // that do not reference a product in one of the given product
- // categories.
- func (c *EventsListCall) ProductCategory(productCategory string) *EventsListCall {
- c.urlParams_.Set("productCategory", productCategory)
- return c
- }
- // PublisherId sets the optional parameter "publisherId": 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.
- func (c *EventsListCall) PublisherId(publisherId string) *EventsListCall {
- c.urlParams_.Set("publisherId", publisherId)
- return c
- }
- // Sku sets the optional parameter "sku": Caret(^) delimited list of
- // SKUs. Filters out all events that do not reference one of the given
- // SKU.
- func (c *EventsListCall) Sku(sku string) *EventsListCall {
- c.urlParams_.Set("sku", sku)
- return c
- }
- // Status sets the optional parameter "status": Filters out all events
- // that do not have the given status. Valid values: 'active',
- // 'canceled'.
- //
- // Possible values:
- // "active" - Event is currently active.
- // "canceled" - Event is currently canceled.
- func (c *EventsListCall) Status(status string) *EventsListCall {
- c.urlParams_.Set("status", status)
- return c
- }
- // Type sets the optional parameter "type": Filters out all events that
- // are not of the given type. Valid values: 'action', 'transaction',
- // 'charge'.
- //
- // Possible values:
- // "action" - 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.
- // "charge" - A charge event is typically a payment between an
- // advertiser, publisher or Google.
- // "transaction" - A conversion event, typically an e-commerce
- // transaction. Some advertisers use a transaction to record other types
- // of events, such as magazine subscriptions.
- func (c *EventsListCall) Type(type_ string) *EventsListCall {
- c.urlParams_.Set("type", type_)
- return c
- }
- // Fields allows partial responses to be retrieved. See
- // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
- // for more information.
- func (c *EventsListCall) Fields(s ...googleapi.Field) *EventsListCall {
- c.urlParams_.Set("fields", googleapi.CombineFields(s))
- return c
- }
- // IfNoneMatch sets the optional parameter which makes the operation
- // fail if the object's ETag matches the given value. This is useful for
- // getting updates only after the object has changed since the last
- // request. Use googleapi.IsNotModified to check whether the response
- // error from Do is the result of In-None-Match.
- func (c *EventsListCall) IfNoneMatch(entityTag string) *EventsListCall {
- c.ifNoneMatch_ = entityTag
- return c
- }
- // Context sets the context to be used in this call's Do method. Any
- // pending HTTP request will be aborted if the provided context is
- // canceled.
- func (c *EventsListCall) Context(ctx context.Context) *EventsListCall {
- c.ctx_ = ctx
- return c
- }
- func (c *EventsListCall) doRequest(alt string) (*http.Response, error) {
- var body io.Reader = nil
- c.urlParams_.Set("alt", alt)
- urls := googleapi.ResolveRelative(c.s.BasePath, "{role}/{roleId}/events")
- urls += "?" + c.urlParams_.Encode()
- req, _ := http.NewRequest("GET", urls, body)
- googleapi.Expand(req.URL, map[string]string{
- "role": c.role,
- "roleId": c.roleId,
- })
- req.Header.Set("User-Agent", c.s.userAgent())
- if c.ifNoneMatch_ != "" {
- req.Header.Set("If-None-Match", c.ifNoneMatch_)
- }
- if c.ctx_ != nil {
- return ctxhttp.Do(c.ctx_, c.s.client, req)
- }
- return c.s.client.Do(req)
- }
- // Do executes the "gan.events.list" call.
- // Exactly one of *Events or error will be non-nil. Any non-2xx status
- // code is an error. Response headers are in either
- // *Events.ServerResponse.Header or (if a response was returned at all)
- // in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to
- // check whether the returned error was because http.StatusNotModified
- // was returned.
- func (c *EventsListCall) Do(opts ...googleapi.CallOption) (*Events, error) {
- gensupport.SetOptions(c.urlParams_, opts...)
- res, err := c.doRequest("json")
- if res != nil && res.StatusCode == http.StatusNotModified {
- if res.Body != nil {
- res.Body.Close()
- }
- return nil, &googleapi.Error{
- Code: res.StatusCode,
- Header: res.Header,
- }
- }
- if err != nil {
- return nil, err
- }
- defer googleapi.CloseBody(res)
- if err := googleapi.CheckResponse(res); err != nil {
- return nil, err
- }
- ret := &Events{
- ServerResponse: googleapi.ServerResponse{
- Header: res.Header,
- HTTPStatusCode: res.StatusCode,
- },
- }
- if err := json.NewDecoder(res.Body).Decode(&ret); err != nil {
- return nil, err
- }
- return ret, nil
- // {
- // "description": "Retrieves event data for a given advertiser/publisher.",
- // "httpMethod": "GET",
- // "id": "gan.events.list",
- // "parameterOrder": [
- // "role",
- // "roleId"
- // ],
- // "parameters": {
- // "advertiserId": {
- // "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.",
- // "location": "query",
- // "type": "string"
- // },
- // "chargeType": {
- // "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.",
- // "enum": [
- // "credit",
- // "debit",
- // "monthly_minimum",
- // "other",
- // "slotting_fee",
- // "tier_bonus"
- // ],
- // "enumDescriptions": [
- // "A credit increases the publisher's payout amount and decreases the advertiser's invoice amount.",
- // "A debit reduces the publisher's payout and increases the advertiser's invoice amount.",
- // "A payment made to Google by an advertiser as a minimum monthly network fee.",
- // "Catch all. Default if unset",
- // "A one time payment made from an advertiser to a publisher.",
- // "A payment from an advertiser to a publisher for the publisher maintaining a high tier level"
- // ],
- // "location": "query",
- // "type": "string"
- // },
- // "eventDateMax": {
- // "description": "Filters out all events later than given date. Optional. Defaults to 24 hours after eventMin.",
- // "location": "query",
- // "type": "string"
- // },
- // "eventDateMin": {
- // "description": "Filters out all events earlier than given date. Optional. Defaults to 24 hours from current date/time.",
- // "location": "query",
- // "type": "string"
- // },
- // "linkId": {
- // "description": "Caret(^) delimited list of link IDs. Filters out all events that do not reference one of the given link IDs. Optional.",
- // "location": "query",
- // "type": "string"
- // },
- // "maxResults": {
- // "description": "Max number of offers to return in this page. Optional. Defaults to 20.",
- // "format": "uint32",
- // "location": "query",
- // "maximum": "100",
- // "minimum": "0",
- // "type": "integer"
- // },
- // "memberId": {
- // "description": "Caret(^) delimited list of member IDs. Filters out all events that do not reference one of the given member IDs. Optional.",
- // "location": "query",
- // "type": "string"
- // },
- // "modifyDateMax": {
- // "description": "Filters out all events modified later than given date. Optional. Defaults to 24 hours after modifyDateMin, if modifyDateMin is explicitly set.",
- // "location": "query",
- // "type": "string"
- // },
- // "modifyDateMin": {
- // "description": "Filters out all events modified earlier than given date. Optional. Defaults to 24 hours before the current modifyDateMax, if modifyDateMax is explicitly set.",
- // "location": "query",
- // "type": "string"
- // },
- // "orderId": {
- // "description": "Caret(^) delimited list of order IDs. Filters out all events that do not reference one of the given order IDs. Optional.",
- // "location": "query",
- // "type": "string"
- // },
- // "pageToken": {
- // "description": "The value of 'nextPageToken' from the previous page. Optional.",
- // "location": "query",
- // "type": "string"
- // },
- // "productCategory": {
- // "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.",
- // "location": "query",
- // "type": "string"
- // },
- // "publisherId": {
- // "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.",
- // "location": "query",
- // "type": "string"
- // },
- // "role": {
- // "description": "The role of the requester. Valid values: 'advertisers' or 'publishers'.",
- // "enum": [
- // "advertisers",
- // "publishers"
- // ],
- // "enumDescriptions": [
- // "The requester is requesting as an advertiser.",
- // "The requester is requesting as a publisher."
- // ],
- // "location": "path",
- // "required": true,
- // "type": "string"
- // },
- // "roleId": {
- // "description": "The ID of the requesting advertiser or publisher.",
- // "location": "path",
- // "required": true,
- // "type": "string"
- // },
- // "sku": {
- // "description": "Caret(^) delimited list of SKUs. Filters out all events that do not reference one of the given SKU. Optional.",
- // "location": "query",
- // "type": "string"
- // },
- // "status": {
- // "description": "Filters out all events that do not have the given status. Valid values: 'active', 'canceled'. Optional.",
- // "enum": [
- // "active",
- // "canceled"
- // ],
- // "enumDescriptions": [
- // "Event is currently active.",
- // "Event is currently canceled."
- // ],
- // "location": "query",
- // "type": "string"
- // },
- // "type": {
- // "description": "Filters out all events that are not of the given type. Valid values: 'action', 'transaction', 'charge'. Optional.",
- // "enum": [
- // "action",
- // "charge",
- // "transaction"
- // ],
- // "enumDescriptions": [
- // "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.",
- // "A charge event is typically a payment between an advertiser, publisher or Google.",
- // "A conversion event, typically an e-commerce transaction. Some advertisers use a transaction to record other types of events, such as magazine subscriptions."
- // ],
- // "location": "query",
- // "type": "string"
- // }
- // },
- // "path": "{role}/{roleId}/events",
- // "response": {
- // "$ref": "Events"
- // }
- // }
- }
- // Pages invokes f for each page of results.
- // A non-nil error returned from f will halt the iteration.
- // The provided context supersedes any context provided to the Context method.
- func (c *EventsListCall) Pages(ctx context.Context, f func(*Events) error) error {
- c.ctx_ = ctx
- defer c.PageToken(c.urlParams_.Get("pageToken")) // reset paging to original point
- for {
- x, err := c.Do()
- if err != nil {
- return err
- }
- if err := f(x); err != nil {
- return err
- }
- if x.NextPageToken == "" {
- return nil
- }
- c.PageToken(x.NextPageToken)
- }
- }
- // method id "gan.links.get":
- type LinksGetCall struct {
- s *Service
- role string
- roleId string
- linkId int64
- urlParams_ gensupport.URLParams
- ifNoneMatch_ string
- ctx_ context.Context
- }
- // Get: 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.
- func (r *LinksService) Get(role string, roleId string, linkId int64) *LinksGetCall {
- c := &LinksGetCall{s: r.s, urlParams_: make(gensupport.URLParams)}
- c.role = role
- c.roleId = roleId
- c.linkId = linkId
- return c
- }
- // Fields allows partial responses to be retrieved. See
- // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
- // for more information.
- func (c *LinksGetCall) Fields(s ...googleapi.Field) *LinksGetCall {
- c.urlParams_.Set("fields", googleapi.CombineFields(s))
- return c
- }
- // IfNoneMatch sets the optional parameter which makes the operation
- // fail if the object's ETag matches the given value. This is useful for
- // getting updates only after the object has changed since the last
- // request. Use googleapi.IsNotModified to check whether the response
- // error from Do is the result of In-None-Match.
- func (c *LinksGetCall) IfNoneMatch(entityTag string) *LinksGetCall {
- c.ifNoneMatch_ = entityTag
- return c
- }
- // Context sets the context to be used in this call's Do method. Any
- // pending HTTP request will be aborted if the provided context is
- // canceled.
- func (c *LinksGetCall) Context(ctx context.Context) *LinksGetCall {
- c.ctx_ = ctx
- return c
- }
- func (c *LinksGetCall) doRequest(alt string) (*http.Response, error) {
- var body io.Reader = nil
- c.urlParams_.Set("alt", alt)
- urls := googleapi.ResolveRelative(c.s.BasePath, "{role}/{roleId}/link/{linkId}")
- urls += "?" + c.urlParams_.Encode()
- req, _ := http.NewRequest("GET", urls, body)
- googleapi.Expand(req.URL, map[string]string{
- "role": c.role,
- "roleId": c.roleId,
- "linkId": strconv.FormatInt(c.linkId, 10),
- })
- req.Header.Set("User-Agent", c.s.userAgent())
- if c.ifNoneMatch_ != "" {
- req.Header.Set("If-None-Match", c.ifNoneMatch_)
- }
- if c.ctx_ != nil {
- return ctxhttp.Do(c.ctx_, c.s.client, req)
- }
- return c.s.client.Do(req)
- }
- // Do executes the "gan.links.get" call.
- // Exactly one of *Link or error will be non-nil. Any non-2xx status
- // code is an error. Response headers are in either
- // *Link.ServerResponse.Header or (if a response was returned at all) in
- // error.(*googleapi.Error).Header. Use googleapi.IsNotModified to check
- // whether the returned error was because http.StatusNotModified was
- // returned.
- func (c *LinksGetCall) Do(opts ...googleapi.CallOption) (*Link, error) {
- gensupport.SetOptions(c.urlParams_, opts...)
- res, err := c.doRequest("json")
- if res != nil && res.StatusCode == http.StatusNotModified {
- if res.Body != nil {
- res.Body.Close()
- }
- return nil, &googleapi.Error{
- Code: res.StatusCode,
- Header: res.Header,
- }
- }
- if err != nil {
- return nil, err
- }
- defer googleapi.CloseBody(res)
- if err := googleapi.CheckResponse(res); err != nil {
- return nil, err
- }
- ret := &Link{
- ServerResponse: googleapi.ServerResponse{
- Header: res.Header,
- HTTPStatusCode: res.StatusCode,
- },
- }
- if err := json.NewDecoder(res.Body).Decode(&ret); err != nil {
- return nil, err
- }
- return ret, nil
- // {
- // "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.",
- // "httpMethod": "GET",
- // "id": "gan.links.get",
- // "parameterOrder": [
- // "role",
- // "roleId",
- // "linkId"
- // ],
- // "parameters": {
- // "linkId": {
- // "description": "The ID of the link to look up.",
- // "format": "int64",
- // "location": "path",
- // "required": true,
- // "type": "string"
- // },
- // "role": {
- // "description": "The role of the requester. Valid values: 'advertisers' or 'publishers'.",
- // "enum": [
- // "advertisers",
- // "publishers"
- // ],
- // "enumDescriptions": [
- // "The requester is requesting as an advertiser.",
- // "The requester is requesting as a publisher."
- // ],
- // "location": "path",
- // "required": true,
- // "type": "string"
- // },
- // "roleId": {
- // "description": "The ID of the requesting advertiser or publisher.",
- // "location": "path",
- // "required": true,
- // "type": "string"
- // }
- // },
- // "path": "{role}/{roleId}/link/{linkId}",
- // "response": {
- // "$ref": "Link"
- // }
- // }
- }
- // method id "gan.links.insert":
- type LinksInsertCall struct {
- s *Service
- role string
- roleId string
- link *Link
- urlParams_ gensupport.URLParams
- ctx_ context.Context
- }
- // Insert: Inserts a new link.
- func (r *LinksService) Insert(role string, roleId string, link *Link) *LinksInsertCall {
- c := &LinksInsertCall{s: r.s, urlParams_: make(gensupport.URLParams)}
- c.role = role
- c.roleId = roleId
- c.link = link
- return c
- }
- // Fields allows partial responses to be retrieved. See
- // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
- // for more information.
- func (c *LinksInsertCall) Fields(s ...googleapi.Field) *LinksInsertCall {
- c.urlParams_.Set("fields", googleapi.CombineFields(s))
- return c
- }
- // Context sets the context to be used in this call's Do method. Any
- // pending HTTP request will be aborted if the provided context is
- // canceled.
- func (c *LinksInsertCall) Context(ctx context.Context) *LinksInsertCall {
- c.ctx_ = ctx
- return c
- }
- func (c *LinksInsertCall) doRequest(alt string) (*http.Response, error) {
- var body io.Reader = nil
- body, err := googleapi.WithoutDataWrapper.JSONReader(c.link)
- if err != nil {
- return nil, err
- }
- ctype := "application/json"
- c.urlParams_.Set("alt", alt)
- urls := googleapi.ResolveRelative(c.s.BasePath, "{role}/{roleId}/link")
- urls += "?" + c.urlParams_.Encode()
- req, _ := http.NewRequest("POST", urls, body)
- googleapi.Expand(req.URL, map[string]string{
- "role": c.role,
- "roleId": c.roleId,
- })
- req.Header.Set("Content-Type", ctype)
- req.Header.Set("User-Agent", c.s.userAgent())
- if c.ctx_ != nil {
- return ctxhttp.Do(c.ctx_, c.s.client, req)
- }
- return c.s.client.Do(req)
- }
- // Do executes the "gan.links.insert" call.
- // Exactly one of *Link or error will be non-nil. Any non-2xx status
- // code is an error. Response headers are in either
- // *Link.ServerResponse.Header or (if a response was returned at all) in
- // error.(*googleapi.Error).Header. Use googleapi.IsNotModified to check
- // whether the returned error was because http.StatusNotModified was
- // returned.
- func (c *LinksInsertCall) Do(opts ...googleapi.CallOption) (*Link, error) {
- gensupport.SetOptions(c.urlParams_, opts...)
- res, err := c.doRequest("json")
- if res != nil && res.StatusCode == http.StatusNotModified {
- if res.Body != nil {
- res.Body.Close()
- }
- return nil, &googleapi.Error{
- Code: res.StatusCode,
- Header: res.Header,
- }
- }
- if err != nil {
- return nil, err
- }
- defer googleapi.CloseBody(res)
- if err := googleapi.CheckResponse(res); err != nil {
- return nil, err
- }
- ret := &Link{
- ServerResponse: googleapi.ServerResponse{
- Header: res.Header,
- HTTPStatusCode: res.StatusCode,
- },
- }
- if err := json.NewDecoder(res.Body).Decode(&ret); err != nil {
- return nil, err
- }
- return ret, nil
- // {
- // "description": "Inserts a new link.",
- // "httpMethod": "POST",
- // "id": "gan.links.insert",
- // "parameterOrder": [
- // "role",
- // "roleId"
- // ],
- // "parameters": {
- // "role": {
- // "description": "The role of the requester. Valid values: 'advertisers' or 'publishers'.",
- // "enum": [
- // "advertisers",
- // "publishers"
- // ],
- // "enumDescriptions": [
- // "The requester is requesting as an advertiser.",
- // "The requester is requesting as a publisher."
- // ],
- // "location": "path",
- // "required": true,
- // "type": "string"
- // },
- // "roleId": {
- // "description": "The ID of the requesting advertiser or publisher.",
- // "location": "path",
- // "required": true,
- // "type": "string"
- // }
- // },
- // "path": "{role}/{roleId}/link",
- // "request": {
- // "$ref": "Link"
- // },
- // "response": {
- // "$ref": "Link"
- // }
- // }
- }
- // method id "gan.links.list":
- type LinksListCall struct {
- s *Service
- role string
- roleId string
- urlParams_ gensupport.URLParams
- ifNoneMatch_ string
- ctx_ context.Context
- }
- // List: Retrieves all links that match the query parameters.
- func (r *LinksService) List(role string, roleId string) *LinksListCall {
- c := &LinksListCall{s: r.s, urlParams_: make(gensupport.URLParams)}
- c.role = role
- c.roleId = roleId
- return c
- }
- // AdvertiserId sets the optional parameter "advertiserId": Limits the
- // resulting links to the ones belonging to the listed advertisers.
- func (c *LinksListCall) AdvertiserId(advertiserId ...int64) *LinksListCall {
- var advertiserId_ []string
- for _, v := range advertiserId {
- advertiserId_ = append(advertiserId_, fmt.Sprint(v))
- }
- c.urlParams_.SetMulti("advertiserId", advertiserId_)
- return c
- }
- // AssetSize sets the optional parameter "assetSize": The size of the
- // given asset.
- func (c *LinksListCall) AssetSize(assetSize ...string) *LinksListCall {
- c.urlParams_.SetMulti("assetSize", append([]string{}, assetSize...))
- return c
- }
- // Authorship sets the optional parameter "authorship": The role of the
- // author of the link.
- //
- // Possible values:
- // "advertiser"
- // "publisher"
- func (c *LinksListCall) Authorship(authorship string) *LinksListCall {
- c.urlParams_.Set("authorship", authorship)
- return c
- }
- // CreateDateMax sets the optional parameter "createDateMax": The end of
- // the create date range.
- func (c *LinksListCall) CreateDateMax(createDateMax string) *LinksListCall {
- c.urlParams_.Set("createDateMax", createDateMax)
- return c
- }
- // CreateDateMin sets the optional parameter "createDateMin": The
- // beginning of the create date range.
- func (c *LinksListCall) CreateDateMin(createDateMin string) *LinksListCall {
- c.urlParams_.Set("createDateMin", createDateMin)
- return c
- }
- // LinkType sets the optional parameter "linkType": The type of the
- // link.
- //
- // Possible values:
- // "banner"
- // "text"
- func (c *LinksListCall) LinkType(linkType string) *LinksListCall {
- c.urlParams_.Set("linkType", linkType)
- return c
- }
- // MaxResults sets the optional parameter "maxResults": Max number of
- // items to return in this page. Defaults to 20.
- func (c *LinksListCall) MaxResults(maxResults int64) *LinksListCall {
- c.urlParams_.Set("maxResults", fmt.Sprint(maxResults))
- return c
- }
- // PageToken sets the optional parameter "pageToken": The value of
- // 'nextPageToken' from the previous page.
- func (c *LinksListCall) PageToken(pageToken string) *LinksListCall {
- c.urlParams_.Set("pageToken", pageToken)
- return c
- }
- // PromotionType sets the optional parameter "promotionType": The
- // promotion type.
- //
- // Possible values:
- // "coupon"
- // "free_gift"
- // "free_shipping"
- // "percent_off"
- // "price_cut"
- func (c *LinksListCall) PromotionType(promotionType ...string) *LinksListCall {
- c.urlParams_.SetMulti("promotionType", append([]string{}, promotionType...))
- return c
- }
- // RelationshipStatus sets the optional parameter "relationshipStatus":
- // The status of the relationship.
- //
- // Possible values:
- // "approved"
- // "available"
- func (c *LinksListCall) RelationshipStatus(relationshipStatus string) *LinksListCall {
- c.urlParams_.Set("relationshipStatus", relationshipStatus)
- return c
- }
- // SearchText sets the optional parameter "searchText": Field for full
- // text search across title and merchandising text, supports link id
- // search.
- func (c *LinksListCall) SearchText(searchText string) *LinksListCall {
- c.urlParams_.Set("searchText", searchText)
- return c
- }
- // StartDateMax sets the optional parameter "startDateMax": The end of
- // the start date range.
- func (c *LinksListCall) StartDateMax(startDateMax string) *LinksListCall {
- c.urlParams_.Set("startDateMax", startDateMax)
- return c
- }
- // StartDateMin sets the optional parameter "startDateMin": The
- // beginning of the start date range.
- func (c *LinksListCall) StartDateMin(startDateMin string) *LinksListCall {
- c.urlParams_.Set("startDateMin", startDateMin)
- return c
- }
- // Fields allows partial responses to be retrieved. See
- // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
- // for more information.
- func (c *LinksListCall) Fields(s ...googleapi.Field) *LinksListCall {
- c.urlParams_.Set("fields", googleapi.CombineFields(s))
- return c
- }
- // IfNoneMatch sets the optional parameter which makes the operation
- // fail if the object's ETag matches the given value. This is useful for
- // getting updates only after the object has changed since the last
- // request. Use googleapi.IsNotModified to check whether the response
- // error from Do is the result of In-None-Match.
- func (c *LinksListCall) IfNoneMatch(entityTag string) *LinksListCall {
- c.ifNoneMatch_ = entityTag
- return c
- }
- // Context sets the context to be used in this call's Do method. Any
- // pending HTTP request will be aborted if the provided context is
- // canceled.
- func (c *LinksListCall) Context(ctx context.Context) *LinksListCall {
- c.ctx_ = ctx
- return c
- }
- func (c *LinksListCall) doRequest(alt string) (*http.Response, error) {
- var body io.Reader = nil
- c.urlParams_.Set("alt", alt)
- urls := googleapi.ResolveRelative(c.s.BasePath, "{role}/{roleId}/links")
- urls += "?" + c.urlParams_.Encode()
- req, _ := http.NewRequest("GET", urls, body)
- googleapi.Expand(req.URL, map[string]string{
- "role": c.role,
- "roleId": c.roleId,
- })
- req.Header.Set("User-Agent", c.s.userAgent())
- if c.ifNoneMatch_ != "" {
- req.Header.Set("If-None-Match", c.ifNoneMatch_)
- }
- if c.ctx_ != nil {
- return ctxhttp.Do(c.ctx_, c.s.client, req)
- }
- return c.s.client.Do(req)
- }
- // Do executes the "gan.links.list" call.
- // Exactly one of *Links or error will be non-nil. Any non-2xx status
- // code is an error. Response headers are in either
- // *Links.ServerResponse.Header or (if a response was returned at all)
- // in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to
- // check whether the returned error was because http.StatusNotModified
- // was returned.
- func (c *LinksListCall) Do(opts ...googleapi.CallOption) (*Links, error) {
- gensupport.SetOptions(c.urlParams_, opts...)
- res, err := c.doRequest("json")
- if res != nil && res.StatusCode == http.StatusNotModified {
- if res.Body != nil {
- res.Body.Close()
- }
- return nil, &googleapi.Error{
- Code: res.StatusCode,
- Header: res.Header,
- }
- }
- if err != nil {
- return nil, err
- }
- defer googleapi.CloseBody(res)
- if err := googleapi.CheckResponse(res); err != nil {
- return nil, err
- }
- ret := &Links{
- ServerResponse: googleapi.ServerResponse{
- Header: res.Header,
- HTTPStatusCode: res.StatusCode,
- },
- }
- if err := json.NewDecoder(res.Body).Decode(&ret); err != nil {
- return nil, err
- }
- return ret, nil
- // {
- // "description": "Retrieves all links that match the query parameters.",
- // "httpMethod": "GET",
- // "id": "gan.links.list",
- // "parameterOrder": [
- // "role",
- // "roleId"
- // ],
- // "parameters": {
- // "advertiserId": {
- // "description": "Limits the resulting links to the ones belonging to the listed advertisers.",
- // "format": "int64",
- // "location": "query",
- // "repeated": true,
- // "type": "string"
- // },
- // "assetSize": {
- // "description": "The size of the given asset.",
- // "location": "query",
- // "repeated": true,
- // "type": "string"
- // },
- // "authorship": {
- // "description": "The role of the author of the link.",
- // "enum": [
- // "advertiser",
- // "publisher"
- // ],
- // "enumDescriptions": [
- // "",
- // ""
- // ],
- // "location": "query",
- // "type": "string"
- // },
- // "createDateMax": {
- // "description": "The end of the create date range.",
- // "location": "query",
- // "type": "string"
- // },
- // "createDateMin": {
- // "description": "The beginning of the create date range.",
- // "location": "query",
- // "type": "string"
- // },
- // "linkType": {
- // "description": "The type of the link.",
- // "enum": [
- // "banner",
- // "text"
- // ],
- // "enumDescriptions": [
- // "",
- // ""
- // ],
- // "location": "query",
- // "type": "string"
- // },
- // "maxResults": {
- // "description": "Max number of items to return in this page. Optional. Defaults to 20.",
- // "format": "uint32",
- // "location": "query",
- // "maximum": "100",
- // "minimum": "0",
- // "type": "integer"
- // },
- // "pageToken": {
- // "description": "The value of 'nextPageToken' from the previous page. Optional.",
- // "location": "query",
- // "type": "string"
- // },
- // "promotionType": {
- // "description": "The promotion type.",
- // "enum": [
- // "coupon",
- // "free_gift",
- // "free_shipping",
- // "percent_off",
- // "price_cut"
- // ],
- // "enumDescriptions": [
- // "",
- // "",
- // "",
- // "",
- // ""
- // ],
- // "location": "query",
- // "repeated": true,
- // "type": "string"
- // },
- // "relationshipStatus": {
- // "description": "The status of the relationship.",
- // "enum": [
- // "approved",
- // "available"
- // ],
- // "enumDescriptions": [
- // "",
- // ""
- // ],
- // "location": "query",
- // "type": "string"
- // },
- // "role": {
- // "description": "The role of the requester. Valid values: 'advertisers' or 'publishers'.",
- // "enum": [
- // "advertisers",
- // "publishers"
- // ],
- // "enumDescriptions": [
- // "The requester is requesting as an advertiser.",
- // "The requester is requesting as a publisher."
- // ],
- // "location": "path",
- // "required": true,
- // "type": "string"
- // },
- // "roleId": {
- // "description": "The ID of the requesting advertiser or publisher.",
- // "location": "path",
- // "required": true,
- // "type": "string"
- // },
- // "searchText": {
- // "description": "Field for full text search across title and merchandising text, supports link id search.",
- // "location": "query",
- // "type": "string"
- // },
- // "startDateMax": {
- // "description": "The end of the start date range.",
- // "location": "query",
- // "type": "string"
- // },
- // "startDateMin": {
- // "description": "The beginning of the start date range.",
- // "location": "query",
- // "type": "string"
- // }
- // },
- // "path": "{role}/{roleId}/links",
- // "response": {
- // "$ref": "Links"
- // }
- // }
- }
- // Pages invokes f for each page of results.
- // A non-nil error returned from f will halt the iteration.
- // The provided context supersedes any context provided to the Context method.
- func (c *LinksListCall) Pages(ctx context.Context, f func(*Links) error) error {
- c.ctx_ = ctx
- defer c.PageToken(c.urlParams_.Get("pageToken")) // reset paging to original point
- for {
- x, err := c.Do()
- if err != nil {
- return err
- }
- if err := f(x); err != nil {
- return err
- }
- if x.NextPageToken == "" {
- return nil
- }
- c.PageToken(x.NextPageToken)
- }
- }
- // method id "gan.publishers.get":
- type PublishersGetCall struct {
- s *Service
- role string
- roleId string
- urlParams_ gensupport.URLParams
- ifNoneMatch_ string
- ctx_ context.Context
- }
- // Get: 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.
- func (r *PublishersService) Get(role string, roleId string) *PublishersGetCall {
- c := &PublishersGetCall{s: r.s, urlParams_: make(gensupport.URLParams)}
- c.role = role
- c.roleId = roleId
- return c
- }
- // PublisherId sets the optional parameter "publisherId": The ID of the
- // publisher to look up.
- func (c *PublishersGetCall) PublisherId(publisherId string) *PublishersGetCall {
- c.urlParams_.Set("publisherId", publisherId)
- return c
- }
- // Fields allows partial responses to be retrieved. See
- // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
- // for more information.
- func (c *PublishersGetCall) Fields(s ...googleapi.Field) *PublishersGetCall {
- c.urlParams_.Set("fields", googleapi.CombineFields(s))
- return c
- }
- // IfNoneMatch sets the optional parameter which makes the operation
- // fail if the object's ETag matches the given value. This is useful for
- // getting updates only after the object has changed since the last
- // request. Use googleapi.IsNotModified to check whether the response
- // error from Do is the result of In-None-Match.
- func (c *PublishersGetCall) IfNoneMatch(entityTag string) *PublishersGetCall {
- c.ifNoneMatch_ = entityTag
- return c
- }
- // Context sets the context to be used in this call's Do method. Any
- // pending HTTP request will be aborted if the provided context is
- // canceled.
- func (c *PublishersGetCall) Context(ctx context.Context) *PublishersGetCall {
- c.ctx_ = ctx
- return c
- }
- func (c *PublishersGetCall) doRequest(alt string) (*http.Response, error) {
- var body io.Reader = nil
- c.urlParams_.Set("alt", alt)
- urls := googleapi.ResolveRelative(c.s.BasePath, "{role}/{roleId}/publisher")
- urls += "?" + c.urlParams_.Encode()
- req, _ := http.NewRequest("GET", urls, body)
- googleapi.Expand(req.URL, map[string]string{
- "role": c.role,
- "roleId": c.roleId,
- })
- req.Header.Set("User-Agent", c.s.userAgent())
- if c.ifNoneMatch_ != "" {
- req.Header.Set("If-None-Match", c.ifNoneMatch_)
- }
- if c.ctx_ != nil {
- return ctxhttp.Do(c.ctx_, c.s.client, req)
- }
- return c.s.client.Do(req)
- }
- // Do executes the "gan.publishers.get" call.
- // Exactly one of *Publisher or error will be non-nil. Any non-2xx
- // status code is an error. Response headers are in either
- // *Publisher.ServerResponse.Header or (if a response was returned at
- // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
- // to check whether the returned error was because
- // http.StatusNotModified was returned.
- func (c *PublishersGetCall) Do(opts ...googleapi.CallOption) (*Publisher, error) {
- gensupport.SetOptions(c.urlParams_, opts...)
- res, err := c.doRequest("json")
- if res != nil && res.StatusCode == http.StatusNotModified {
- if res.Body != nil {
- res.Body.Close()
- }
- return nil, &googleapi.Error{
- Code: res.StatusCode,
- Header: res.Header,
- }
- }
- if err != nil {
- return nil, err
- }
- defer googleapi.CloseBody(res)
- if err := googleapi.CheckResponse(res); err != nil {
- return nil, err
- }
- ret := &Publisher{
- ServerResponse: googleapi.ServerResponse{
- Header: res.Header,
- HTTPStatusCode: res.StatusCode,
- },
- }
- if err := json.NewDecoder(res.Body).Decode(&ret); err != nil {
- return nil, err
- }
- return ret, nil
- // {
- // "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.",
- // "httpMethod": "GET",
- // "id": "gan.publishers.get",
- // "parameterOrder": [
- // "role",
- // "roleId"
- // ],
- // "parameters": {
- // "publisherId": {
- // "description": "The ID of the publisher to look up. Optional.",
- // "location": "query",
- // "type": "string"
- // },
- // "role": {
- // "description": "The role of the requester. Valid values: 'advertisers' or 'publishers'.",
- // "enum": [
- // "advertisers",
- // "publishers"
- // ],
- // "enumDescriptions": [
- // "The requester is requesting as an advertiser.",
- // "The requester is requesting as a publisher."
- // ],
- // "location": "path",
- // "required": true,
- // "type": "string"
- // },
- // "roleId": {
- // "description": "The ID of the requesting advertiser or publisher.",
- // "location": "path",
- // "required": true,
- // "type": "string"
- // }
- // },
- // "path": "{role}/{roleId}/publisher",
- // "response": {
- // "$ref": "Publisher"
- // }
- // }
- }
- // method id "gan.publishers.list":
- type PublishersListCall struct {
- s *Service
- role string
- roleId string
- urlParams_ gensupport.URLParams
- ifNoneMatch_ string
- ctx_ context.Context
- }
- // List: Retrieves data about all publishers that the requesting
- // advertiser/publisher has access to.
- func (r *PublishersService) List(role string, roleId string) *PublishersListCall {
- c := &PublishersListCall{s: r.s, urlParams_: make(gensupport.URLParams)}
- c.role = role
- c.roleId = roleId
- return c
- }
- // MaxResults sets the optional parameter "maxResults": Max number of
- // items to return in this page. Defaults to 20.
- func (c *PublishersListCall) MaxResults(maxResults int64) *PublishersListCall {
- c.urlParams_.Set("maxResults", fmt.Sprint(maxResults))
- return c
- }
- // MinNinetyDayEpc sets the optional parameter "minNinetyDayEpc":
- // Filters out all publishers that have a ninety day EPC average lower
- // than the given value (inclusive). Min value: 0.0.
- func (c *PublishersListCall) MinNinetyDayEpc(minNinetyDayEpc float64) *PublishersListCall {
- c.urlParams_.Set("minNinetyDayEpc", fmt.Sprint(minNinetyDayEpc))
- return c
- }
- // MinPayoutRank sets the optional parameter "minPayoutRank": 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.
- func (c *PublishersListCall) MinPayoutRank(minPayoutRank int64) *PublishersListCall {
- c.urlParams_.Set("minPayoutRank", fmt.Sprint(minPayoutRank))
- return c
- }
- // MinSevenDayEpc sets the optional parameter "minSevenDayEpc": Filters
- // out all publishers that have a seven day EPC average lower than the
- // given value (inclusive). Min value 0.0.
- func (c *PublishersListCall) MinSevenDayEpc(minSevenDayEpc float64) *PublishersListCall {
- c.urlParams_.Set("minSevenDayEpc", fmt.Sprint(minSevenDayEpc))
- return c
- }
- // PageToken sets the optional parameter "pageToken": The value of
- // 'nextPageToken' from the previous page.
- func (c *PublishersListCall) PageToken(pageToken string) *PublishersListCall {
- c.urlParams_.Set("pageToken", pageToken)
- return c
- }
- // PublisherCategory sets the optional parameter "publisherCategory":
- // 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.
- func (c *PublishersListCall) PublisherCategory(publisherCategory string) *PublishersListCall {
- c.urlParams_.Set("publisherCategory", publisherCategory)
- return c
- }
- // RelationshipStatus sets the optional parameter "relationshipStatus":
- // Filters out all publishers for which do not have the given
- // relationship status with the requesting publisher.
- //
- // Possible values:
- // "approved" - Publishers you've approved to your program.
- // "available" - Publishers available for you to recruit.
- // "deactivated" - A publisher that you terminated from your program.
- // Publishers also have the ability to remove themselves from your
- // program.
- // "declined" - A publisher that you did not approve to your program.
- // "pending" - Publishers that have applied to your program. We
- // recommend reviewing and deciding on pending publishers on a weekly
- // basis.
- func (c *PublishersListCall) RelationshipStatus(relationshipStatus string) *PublishersListCall {
- c.urlParams_.Set("relationshipStatus", relationshipStatus)
- return c
- }
- // Fields allows partial responses to be retrieved. See
- // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
- // for more information.
- func (c *PublishersListCall) Fields(s ...googleapi.Field) *PublishersListCall {
- c.urlParams_.Set("fields", googleapi.CombineFields(s))
- return c
- }
- // IfNoneMatch sets the optional parameter which makes the operation
- // fail if the object's ETag matches the given value. This is useful for
- // getting updates only after the object has changed since the last
- // request. Use googleapi.IsNotModified to check whether the response
- // error from Do is the result of In-None-Match.
- func (c *PublishersListCall) IfNoneMatch(entityTag string) *PublishersListCall {
- c.ifNoneMatch_ = entityTag
- return c
- }
- // Context sets the context to be used in this call's Do method. Any
- // pending HTTP request will be aborted if the provided context is
- // canceled.
- func (c *PublishersListCall) Context(ctx context.Context) *PublishersListCall {
- c.ctx_ = ctx
- return c
- }
- func (c *PublishersListCall) doRequest(alt string) (*http.Response, error) {
- var body io.Reader = nil
- c.urlParams_.Set("alt", alt)
- urls := googleapi.ResolveRelative(c.s.BasePath, "{role}/{roleId}/publishers")
- urls += "?" + c.urlParams_.Encode()
- req, _ := http.NewRequest("GET", urls, body)
- googleapi.Expand(req.URL, map[string]string{
- "role": c.role,
- "roleId": c.roleId,
- })
- req.Header.Set("User-Agent", c.s.userAgent())
- if c.ifNoneMatch_ != "" {
- req.Header.Set("If-None-Match", c.ifNoneMatch_)
- }
- if c.ctx_ != nil {
- return ctxhttp.Do(c.ctx_, c.s.client, req)
- }
- return c.s.client.Do(req)
- }
- // Do executes the "gan.publishers.list" call.
- // Exactly one of *Publishers or error will be non-nil. Any non-2xx
- // status code is an error. Response headers are in either
- // *Publishers.ServerResponse.Header or (if a response was returned at
- // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
- // to check whether the returned error was because
- // http.StatusNotModified was returned.
- func (c *PublishersListCall) Do(opts ...googleapi.CallOption) (*Publishers, error) {
- gensupport.SetOptions(c.urlParams_, opts...)
- res, err := c.doRequest("json")
- if res != nil && res.StatusCode == http.StatusNotModified {
- if res.Body != nil {
- res.Body.Close()
- }
- return nil, &googleapi.Error{
- Code: res.StatusCode,
- Header: res.Header,
- }
- }
- if err != nil {
- return nil, err
- }
- defer googleapi.CloseBody(res)
- if err := googleapi.CheckResponse(res); err != nil {
- return nil, err
- }
- ret := &Publishers{
- ServerResponse: googleapi.ServerResponse{
- Header: res.Header,
- HTTPStatusCode: res.StatusCode,
- },
- }
- if err := json.NewDecoder(res.Body).Decode(&ret); err != nil {
- return nil, err
- }
- return ret, nil
- // {
- // "description": "Retrieves data about all publishers that the requesting advertiser/publisher has access to.",
- // "httpMethod": "GET",
- // "id": "gan.publishers.list",
- // "parameterOrder": [
- // "role",
- // "roleId"
- // ],
- // "parameters": {
- // "maxResults": {
- // "description": "Max number of items to return in this page. Optional. Defaults to 20.",
- // "format": "uint32",
- // "location": "query",
- // "maximum": "100",
- // "minimum": "0",
- // "type": "integer"
- // },
- // "minNinetyDayEpc": {
- // "description": "Filters out all publishers that have a ninety day EPC average lower than the given value (inclusive). Min value: 0.0. Optional.",
- // "format": "double",
- // "location": "query",
- // "type": "number"
- // },
- // "minPayoutRank": {
- // "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.",
- // "format": "int32",
- // "location": "query",
- // "maximum": "4",
- // "minimum": "1",
- // "type": "integer"
- // },
- // "minSevenDayEpc": {
- // "description": "Filters out all publishers that have a seven day EPC average lower than the given value (inclusive). Min value 0.0. Optional.",
- // "format": "double",
- // "location": "query",
- // "type": "number"
- // },
- // "pageToken": {
- // "description": "The value of 'nextPageToken' from the previous page. Optional.",
- // "location": "query",
- // "type": "string"
- // },
- // "publisherCategory": {
- // "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.",
- // "location": "query",
- // "type": "string"
- // },
- // "relationshipStatus": {
- // "description": "Filters out all publishers for which do not have the given relationship status with the requesting publisher.",
- // "enum": [
- // "approved",
- // "available",
- // "deactivated",
- // "declined",
- // "pending"
- // ],
- // "enumDescriptions": [
- // "Publishers you've approved to your program.",
- // "Publishers available for you to recruit.",
- // "A publisher that you terminated from your program. Publishers also have the ability to remove themselves from your program.",
- // "A publisher that you did not approve to your program.",
- // "Publishers that have applied to your program. We recommend reviewing and deciding on pending publishers on a weekly basis."
- // ],
- // "location": "query",
- // "type": "string"
- // },
- // "role": {
- // "description": "The role of the requester. Valid values: 'advertisers' or 'publishers'.",
- // "enum": [
- // "advertisers",
- // "publishers"
- // ],
- // "enumDescriptions": [
- // "The requester is requesting as an advertiser.",
- // "The requester is requesting as a publisher."
- // ],
- // "location": "path",
- // "required": true,
- // "type": "string"
- // },
- // "roleId": {
- // "description": "The ID of the requesting advertiser or publisher.",
- // "location": "path",
- // "required": true,
- // "type": "string"
- // }
- // },
- // "path": "{role}/{roleId}/publishers",
- // "response": {
- // "$ref": "Publishers"
- // }
- // }
- }
- // Pages invokes f for each page of results.
- // A non-nil error returned from f will halt the iteration.
- // The provided context supersedes any context provided to the Context method.
- func (c *PublishersListCall) Pages(ctx context.Context, f func(*Publishers) error) error {
- c.ctx_ = ctx
- defer c.PageToken(c.urlParams_.Get("pageToken")) // reset paging to original point
- for {
- x, err := c.Do()
- if err != nil {
- return err
- }
- if err := f(x); err != nil {
- return err
- }
- if x.NextPageToken == "" {
- return nil
- }
- c.PageToken(x.NextPageToken)
- }
- }
- // method id "gan.reports.get":
- type ReportsGetCall struct {
- s *Service
- role string
- roleId string
- reportType string
- urlParams_ gensupport.URLParams
- ifNoneMatch_ string
- ctx_ context.Context
- }
- // Get: Retrieves a report of the specified type.
- func (r *ReportsService) Get(role string, roleId string, reportType string) *ReportsGetCall {
- c := &ReportsGetCall{s: r.s, urlParams_: make(gensupport.URLParams)}
- c.role = role
- c.roleId = roleId
- c.reportType = reportType
- return c
- }
- // AdvertiserId sets the optional parameter "advertiserId": The IDs of
- // the advertisers to look up, if applicable.
- func (c *ReportsGetCall) AdvertiserId(advertiserId ...string) *ReportsGetCall {
- c.urlParams_.SetMulti("advertiserId", append([]string{}, advertiserId...))
- return c
- }
- // CalculateTotals sets the optional parameter "calculateTotals":
- // Whether or not to calculate totals rows.
- func (c *ReportsGetCall) CalculateTotals(calculateTotals bool) *ReportsGetCall {
- c.urlParams_.Set("calculateTotals", fmt.Sprint(calculateTotals))
- return c
- }
- // EndDate sets the optional parameter "endDate": 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.
- func (c *ReportsGetCall) EndDate(endDate string) *ReportsGetCall {
- c.urlParams_.Set("endDate", endDate)
- return c
- }
- // EventType sets the optional parameter "eventType": Filters out all
- // events that are not of the given type. Valid values: 'action',
- // 'transaction', or 'charge'.
- //
- // Possible values:
- // "action" - Event type is action.
- // "charge" - Event type is charge.
- // "transaction" - Event type is transaction.
- func (c *ReportsGetCall) EventType(eventType string) *ReportsGetCall {
- c.urlParams_.Set("eventType", eventType)
- return c
- }
- // LinkId sets the optional parameter "linkId": Filters to capture one
- // of given link IDs.
- func (c *ReportsGetCall) LinkId(linkId ...string) *ReportsGetCall {
- c.urlParams_.SetMulti("linkId", append([]string{}, linkId...))
- return c
- }
- // MaxResults sets the optional parameter "maxResults": Max number of
- // items to return in this page. Defaults to return all results.
- func (c *ReportsGetCall) MaxResults(maxResults int64) *ReportsGetCall {
- c.urlParams_.Set("maxResults", fmt.Sprint(maxResults))
- return c
- }
- // OrderId sets the optional parameter "orderId": Filters to capture one
- // of the given order IDs.
- func (c *ReportsGetCall) OrderId(orderId ...string) *ReportsGetCall {
- c.urlParams_.SetMulti("orderId", append([]string{}, orderId...))
- return c
- }
- // PublisherId sets the optional parameter "publisherId": The IDs of the
- // publishers to look up, if applicable.
- func (c *ReportsGetCall) PublisherId(publisherId ...string) *ReportsGetCall {
- c.urlParams_.SetMulti("publisherId", append([]string{}, publisherId...))
- return c
- }
- // StartDate sets the optional parameter "startDate": 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.
- func (c *ReportsGetCall) StartDate(startDate string) *ReportsGetCall {
- c.urlParams_.Set("startDate", startDate)
- return c
- }
- // StartIndex sets the optional parameter "startIndex": Offset on which
- // to return results when paging.
- func (c *ReportsGetCall) StartIndex(startIndex int64) *ReportsGetCall {
- c.urlParams_.Set("startIndex", fmt.Sprint(startIndex))
- return c
- }
- // Status sets the optional parameter "status": Filters out all events
- // that do not have the given status. Valid values: 'active',
- // 'canceled', or 'invalid'.
- //
- // Possible values:
- // "active" - Event is currently active.
- // "canceled" - Event is currently canceled.
- // "invalid" - Event is currently invalid.
- func (c *ReportsGetCall) Status(status string) *ReportsGetCall {
- c.urlParams_.Set("status", status)
- return c
- }
- // Fields allows partial responses to be retrieved. See
- // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
- // for more information.
- func (c *ReportsGetCall) Fields(s ...googleapi.Field) *ReportsGetCall {
- c.urlParams_.Set("fields", googleapi.CombineFields(s))
- return c
- }
- // IfNoneMatch sets the optional parameter which makes the operation
- // fail if the object's ETag matches the given value. This is useful for
- // getting updates only after the object has changed since the last
- // request. Use googleapi.IsNotModified to check whether the response
- // error from Do is the result of In-None-Match.
- func (c *ReportsGetCall) IfNoneMatch(entityTag string) *ReportsGetCall {
- c.ifNoneMatch_ = entityTag
- return c
- }
- // Context sets the context to be used in this call's Do method. Any
- // pending HTTP request will be aborted if the provided context is
- // canceled.
- func (c *ReportsGetCall) Context(ctx context.Context) *ReportsGetCall {
- c.ctx_ = ctx
- return c
- }
- func (c *ReportsGetCall) doRequest(alt string) (*http.Response, error) {
- var body io.Reader = nil
- c.urlParams_.Set("alt", alt)
- urls := googleapi.ResolveRelative(c.s.BasePath, "{role}/{roleId}/report/{reportType}")
- urls += "?" + c.urlParams_.Encode()
- req, _ := http.NewRequest("GET", urls, body)
- googleapi.Expand(req.URL, map[string]string{
- "role": c.role,
- "roleId": c.roleId,
- "reportType": c.reportType,
- })
- req.Header.Set("User-Agent", c.s.userAgent())
- if c.ifNoneMatch_ != "" {
- req.Header.Set("If-None-Match", c.ifNoneMatch_)
- }
- if c.ctx_ != nil {
- return ctxhttp.Do(c.ctx_, c.s.client, req)
- }
- return c.s.client.Do(req)
- }
- // Do executes the "gan.reports.get" call.
- // Exactly one of *Report or error will be non-nil. Any non-2xx status
- // code is an error. Response headers are in either
- // *Report.ServerResponse.Header or (if a response was returned at all)
- // in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to
- // check whether the returned error was because http.StatusNotModified
- // was returned.
- func (c *ReportsGetCall) Do(opts ...googleapi.CallOption) (*Report, error) {
- gensupport.SetOptions(c.urlParams_, opts...)
- res, err := c.doRequest("json")
- if res != nil && res.StatusCode == http.StatusNotModified {
- if res.Body != nil {
- res.Body.Close()
- }
- return nil, &googleapi.Error{
- Code: res.StatusCode,
- Header: res.Header,
- }
- }
- if err != nil {
- return nil, err
- }
- defer googleapi.CloseBody(res)
- if err := googleapi.CheckResponse(res); err != nil {
- return nil, err
- }
- ret := &Report{
- ServerResponse: googleapi.ServerResponse{
- Header: res.Header,
- HTTPStatusCode: res.StatusCode,
- },
- }
- if err := json.NewDecoder(res.Body).Decode(&ret); err != nil {
- return nil, err
- }
- return ret, nil
- // {
- // "description": "Retrieves a report of the specified type.",
- // "httpMethod": "GET",
- // "id": "gan.reports.get",
- // "parameterOrder": [
- // "role",
- // "roleId",
- // "reportType"
- // ],
- // "parameters": {
- // "advertiserId": {
- // "description": "The IDs of the advertisers to look up, if applicable.",
- // "location": "query",
- // "repeated": true,
- // "type": "string"
- // },
- // "calculateTotals": {
- // "description": "Whether or not to calculate totals rows. Optional.",
- // "location": "query",
- // "type": "boolean"
- // },
- // "endDate": {
- // "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.",
- // "location": "query",
- // "type": "string"
- // },
- // "eventType": {
- // "description": "Filters out all events that are not of the given type. Valid values: 'action', 'transaction', or 'charge'. Optional.",
- // "enum": [
- // "action",
- // "charge",
- // "transaction"
- // ],
- // "enumDescriptions": [
- // "Event type is action.",
- // "Event type is charge.",
- // "Event type is transaction."
- // ],
- // "location": "query",
- // "type": "string"
- // },
- // "linkId": {
- // "description": "Filters to capture one of given link IDs. Optional.",
- // "location": "query",
- // "repeated": true,
- // "type": "string"
- // },
- // "maxResults": {
- // "description": "Max number of items to return in this page. Optional. Defaults to return all results.",
- // "format": "uint32",
- // "location": "query",
- // "minimum": "0",
- // "type": "integer"
- // },
- // "orderId": {
- // "description": "Filters to capture one of the given order IDs. Optional.",
- // "location": "query",
- // "repeated": true,
- // "type": "string"
- // },
- // "publisherId": {
- // "description": "The IDs of the publishers to look up, if applicable.",
- // "location": "query",
- // "repeated": true,
- // "type": "string"
- // },
- // "reportType": {
- // "description": "The type of report being requested. Valid values: 'order_delta'. Required.",
- // "enum": [
- // "order_delta"
- // ],
- // "enumDescriptions": [
- // "The order delta report type."
- // ],
- // "location": "path",
- // "required": true,
- // "type": "string"
- // },
- // "role": {
- // "description": "The role of the requester. Valid values: 'advertisers' or 'publishers'.",
- // "enum": [
- // "advertisers",
- // "publishers"
- // ],
- // "enumDescriptions": [
- // "The requester is requesting as an advertiser.",
- // "The requester is requesting as a publisher."
- // ],
- // "location": "path",
- // "required": true,
- // "type": "string"
- // },
- // "roleId": {
- // "description": "The ID of the requesting advertiser or publisher.",
- // "location": "path",
- // "required": true,
- // "type": "string"
- // },
- // "startDate": {
- // "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.",
- // "location": "query",
- // "type": "string"
- // },
- // "startIndex": {
- // "description": "Offset on which to return results when paging. Optional.",
- // "format": "uint32",
- // "location": "query",
- // "minimum": "0",
- // "type": "integer"
- // },
- // "status": {
- // "description": "Filters out all events that do not have the given status. Valid values: 'active', 'canceled', or 'invalid'. Optional.",
- // "enum": [
- // "active",
- // "canceled",
- // "invalid"
- // ],
- // "enumDescriptions": [
- // "Event is currently active.",
- // "Event is currently canceled.",
- // "Event is currently invalid."
- // ],
- // "location": "query",
- // "type": "string"
- // }
- // },
- // "path": "{role}/{roleId}/report/{reportType}",
- // "response": {
- // "$ref": "Report"
- // }
- // }
- }
|