content-gen.go 434 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929930931932933934935936937938939940941942943944945946947948949950951952953954955956957958959960961962963964965966967968969970971972973974975976977978979980981982983984985986987988989990991992993994995996997998999100010011002100310041005100610071008100910101011101210131014101510161017101810191020102110221023102410251026102710281029103010311032103310341035103610371038103910401041104210431044104510461047104810491050105110521053105410551056105710581059106010611062106310641065106610671068106910701071107210731074107510761077107810791080108110821083108410851086108710881089109010911092109310941095109610971098109911001101110211031104110511061107110811091110111111121113111411151116111711181119112011211122112311241125112611271128112911301131113211331134113511361137113811391140114111421143114411451146114711481149115011511152115311541155115611571158115911601161116211631164116511661167116811691170117111721173117411751176117711781179118011811182118311841185118611871188118911901191119211931194119511961197119811991200120112021203120412051206120712081209121012111212121312141215121612171218121912201221122212231224122512261227122812291230123112321233123412351236123712381239124012411242124312441245124612471248124912501251125212531254125512561257125812591260126112621263126412651266126712681269127012711272127312741275127612771278127912801281128212831284128512861287128812891290129112921293129412951296129712981299130013011302130313041305130613071308130913101311131213131314131513161317131813191320132113221323132413251326132713281329133013311332133313341335133613371338133913401341134213431344134513461347134813491350135113521353135413551356135713581359136013611362136313641365136613671368136913701371137213731374137513761377137813791380138113821383138413851386138713881389139013911392139313941395139613971398139914001401140214031404140514061407140814091410141114121413141414151416141714181419142014211422142314241425142614271428142914301431143214331434143514361437143814391440144114421443144414451446144714481449145014511452145314541455145614571458145914601461146214631464146514661467146814691470147114721473147414751476147714781479148014811482148314841485148614871488148914901491149214931494149514961497149814991500150115021503150415051506150715081509151015111512151315141515151615171518151915201521152215231524152515261527152815291530153115321533153415351536153715381539154015411542154315441545154615471548154915501551155215531554155515561557155815591560156115621563156415651566156715681569157015711572157315741575157615771578157915801581158215831584158515861587158815891590159115921593159415951596159715981599160016011602160316041605160616071608160916101611161216131614161516161617161816191620162116221623162416251626162716281629163016311632163316341635163616371638163916401641164216431644164516461647164816491650165116521653165416551656165716581659166016611662166316641665166616671668166916701671167216731674167516761677167816791680168116821683168416851686168716881689169016911692169316941695169616971698169917001701170217031704170517061707170817091710171117121713171417151716171717181719172017211722172317241725172617271728172917301731173217331734173517361737173817391740174117421743174417451746174717481749175017511752175317541755175617571758175917601761176217631764176517661767176817691770177117721773177417751776177717781779178017811782178317841785178617871788178917901791179217931794179517961797179817991800180118021803180418051806180718081809181018111812181318141815181618171818181918201821182218231824182518261827182818291830183118321833183418351836183718381839184018411842184318441845184618471848184918501851185218531854185518561857185818591860186118621863186418651866186718681869187018711872187318741875187618771878187918801881188218831884188518861887188818891890189118921893189418951896189718981899190019011902190319041905190619071908190919101911191219131914191519161917191819191920192119221923192419251926192719281929193019311932193319341935193619371938193919401941194219431944194519461947194819491950195119521953195419551956195719581959196019611962196319641965196619671968196919701971197219731974197519761977197819791980198119821983198419851986198719881989199019911992199319941995199619971998199920002001200220032004200520062007200820092010201120122013201420152016201720182019202020212022202320242025202620272028202920302031203220332034203520362037203820392040204120422043204420452046204720482049205020512052205320542055205620572058205920602061206220632064206520662067206820692070207120722073207420752076207720782079208020812082208320842085208620872088208920902091209220932094209520962097209820992100210121022103210421052106210721082109211021112112211321142115211621172118211921202121212221232124212521262127212821292130213121322133213421352136213721382139214021412142214321442145214621472148214921502151215221532154215521562157215821592160216121622163216421652166216721682169217021712172217321742175217621772178217921802181218221832184218521862187218821892190219121922193219421952196219721982199220022012202220322042205220622072208220922102211221222132214221522162217221822192220222122222223222422252226222722282229223022312232223322342235223622372238223922402241224222432244224522462247224822492250225122522253225422552256225722582259226022612262226322642265226622672268226922702271227222732274227522762277227822792280228122822283228422852286228722882289229022912292229322942295229622972298229923002301230223032304230523062307230823092310231123122313231423152316231723182319232023212322232323242325232623272328232923302331233223332334233523362337233823392340234123422343234423452346234723482349235023512352235323542355235623572358235923602361236223632364236523662367236823692370237123722373237423752376237723782379238023812382238323842385238623872388238923902391239223932394239523962397239823992400240124022403240424052406240724082409241024112412241324142415241624172418241924202421242224232424242524262427242824292430243124322433243424352436243724382439244024412442244324442445244624472448244924502451245224532454245524562457245824592460246124622463246424652466246724682469247024712472247324742475247624772478247924802481248224832484248524862487248824892490249124922493249424952496249724982499250025012502250325042505250625072508250925102511251225132514251525162517251825192520252125222523252425252526252725282529253025312532253325342535253625372538253925402541254225432544254525462547254825492550255125522553255425552556255725582559256025612562256325642565256625672568256925702571257225732574257525762577257825792580258125822583258425852586258725882589259025912592259325942595259625972598259926002601260226032604260526062607260826092610261126122613261426152616261726182619262026212622262326242625262626272628262926302631263226332634263526362637263826392640264126422643264426452646264726482649265026512652265326542655265626572658265926602661266226632664266526662667266826692670267126722673267426752676267726782679268026812682268326842685268626872688268926902691269226932694269526962697269826992700270127022703270427052706270727082709271027112712271327142715271627172718271927202721272227232724272527262727272827292730273127322733273427352736273727382739274027412742274327442745274627472748274927502751275227532754275527562757275827592760276127622763276427652766276727682769277027712772277327742775277627772778277927802781278227832784278527862787278827892790279127922793279427952796279727982799280028012802280328042805280628072808280928102811281228132814281528162817281828192820282128222823282428252826282728282829283028312832283328342835283628372838283928402841284228432844284528462847284828492850285128522853285428552856285728582859286028612862286328642865286628672868286928702871287228732874287528762877287828792880288128822883288428852886288728882889289028912892289328942895289628972898289929002901290229032904290529062907290829092910291129122913291429152916291729182919292029212922292329242925292629272928292929302931293229332934293529362937293829392940294129422943294429452946294729482949295029512952295329542955295629572958295929602961296229632964296529662967296829692970297129722973297429752976297729782979298029812982298329842985298629872988298929902991299229932994299529962997299829993000300130023003300430053006300730083009301030113012301330143015301630173018301930203021302230233024302530263027302830293030303130323033303430353036303730383039304030413042304330443045304630473048304930503051305230533054305530563057305830593060306130623063306430653066306730683069307030713072307330743075307630773078307930803081308230833084308530863087308830893090309130923093309430953096309730983099310031013102310331043105310631073108310931103111311231133114311531163117311831193120312131223123312431253126312731283129313031313132313331343135313631373138313931403141314231433144314531463147314831493150315131523153315431553156315731583159316031613162316331643165316631673168316931703171317231733174317531763177317831793180318131823183318431853186318731883189319031913192319331943195319631973198319932003201320232033204320532063207320832093210321132123213321432153216321732183219322032213222322332243225322632273228322932303231323232333234323532363237323832393240324132423243324432453246324732483249325032513252325332543255325632573258325932603261326232633264326532663267326832693270327132723273327432753276327732783279328032813282328332843285328632873288328932903291329232933294329532963297329832993300330133023303330433053306330733083309331033113312331333143315331633173318331933203321332233233324332533263327332833293330333133323333333433353336333733383339334033413342334333443345334633473348334933503351335233533354335533563357335833593360336133623363336433653366336733683369337033713372337333743375337633773378337933803381338233833384338533863387338833893390339133923393339433953396339733983399340034013402340334043405340634073408340934103411341234133414341534163417341834193420342134223423342434253426342734283429343034313432343334343435343634373438343934403441344234433444344534463447344834493450345134523453345434553456345734583459346034613462346334643465346634673468346934703471347234733474347534763477347834793480348134823483348434853486348734883489349034913492349334943495349634973498349935003501350235033504350535063507350835093510351135123513351435153516351735183519352035213522352335243525352635273528352935303531353235333534353535363537353835393540354135423543354435453546354735483549355035513552355335543555355635573558355935603561356235633564356535663567356835693570357135723573357435753576357735783579358035813582358335843585358635873588358935903591359235933594359535963597359835993600360136023603360436053606360736083609361036113612361336143615361636173618361936203621362236233624362536263627362836293630363136323633363436353636363736383639364036413642364336443645364636473648364936503651365236533654365536563657365836593660366136623663366436653666366736683669367036713672367336743675367636773678367936803681368236833684368536863687368836893690369136923693369436953696369736983699370037013702370337043705370637073708370937103711371237133714371537163717371837193720372137223723372437253726372737283729373037313732373337343735373637373738373937403741374237433744374537463747374837493750375137523753375437553756375737583759376037613762376337643765376637673768376937703771377237733774377537763777377837793780378137823783378437853786378737883789379037913792379337943795379637973798379938003801380238033804380538063807380838093810381138123813381438153816381738183819382038213822382338243825382638273828382938303831383238333834383538363837383838393840384138423843384438453846384738483849385038513852385338543855385638573858385938603861386238633864386538663867386838693870387138723873387438753876387738783879388038813882388338843885388638873888388938903891389238933894389538963897389838993900390139023903390439053906390739083909391039113912391339143915391639173918391939203921392239233924392539263927392839293930393139323933393439353936393739383939394039413942394339443945394639473948394939503951395239533954395539563957395839593960396139623963396439653966396739683969397039713972397339743975397639773978397939803981398239833984398539863987398839893990399139923993399439953996399739983999400040014002400340044005400640074008400940104011401240134014401540164017401840194020402140224023402440254026402740284029403040314032403340344035403640374038403940404041404240434044404540464047404840494050405140524053405440554056405740584059406040614062406340644065406640674068406940704071407240734074407540764077407840794080408140824083408440854086408740884089409040914092409340944095409640974098409941004101410241034104410541064107410841094110411141124113411441154116411741184119412041214122412341244125412641274128412941304131413241334134413541364137413841394140414141424143414441454146414741484149415041514152415341544155415641574158415941604161416241634164416541664167416841694170417141724173417441754176417741784179418041814182418341844185418641874188418941904191419241934194419541964197419841994200420142024203420442054206420742084209421042114212421342144215421642174218421942204221422242234224422542264227422842294230423142324233423442354236423742384239424042414242424342444245424642474248424942504251425242534254425542564257425842594260426142624263426442654266426742684269427042714272427342744275427642774278427942804281428242834284428542864287428842894290429142924293429442954296429742984299430043014302430343044305430643074308430943104311431243134314431543164317431843194320432143224323432443254326432743284329433043314332433343344335433643374338433943404341434243434344434543464347434843494350435143524353435443554356435743584359436043614362436343644365436643674368436943704371437243734374437543764377437843794380438143824383438443854386438743884389439043914392439343944395439643974398439944004401440244034404440544064407440844094410441144124413441444154416441744184419442044214422442344244425442644274428442944304431443244334434443544364437443844394440444144424443444444454446444744484449445044514452445344544455445644574458445944604461446244634464446544664467446844694470447144724473447444754476447744784479448044814482448344844485448644874488448944904491449244934494449544964497449844994500450145024503450445054506450745084509451045114512451345144515451645174518451945204521452245234524452545264527452845294530453145324533453445354536453745384539454045414542454345444545454645474548454945504551455245534554455545564557455845594560456145624563456445654566456745684569457045714572457345744575457645774578457945804581458245834584458545864587458845894590459145924593459445954596459745984599460046014602460346044605460646074608460946104611461246134614461546164617461846194620462146224623462446254626462746284629463046314632463346344635463646374638463946404641464246434644464546464647464846494650465146524653465446554656465746584659466046614662466346644665466646674668466946704671467246734674467546764677467846794680468146824683468446854686468746884689469046914692469346944695469646974698469947004701470247034704470547064707470847094710471147124713471447154716471747184719472047214722472347244725472647274728472947304731473247334734473547364737473847394740474147424743474447454746474747484749475047514752475347544755475647574758475947604761476247634764476547664767476847694770477147724773477447754776477747784779478047814782478347844785478647874788478947904791479247934794479547964797479847994800480148024803480448054806480748084809481048114812481348144815481648174818481948204821482248234824482548264827482848294830483148324833483448354836483748384839484048414842484348444845484648474848484948504851485248534854485548564857485848594860486148624863486448654866486748684869487048714872487348744875487648774878487948804881488248834884488548864887488848894890489148924893489448954896489748984899490049014902490349044905490649074908490949104911491249134914491549164917491849194920492149224923492449254926492749284929493049314932493349344935493649374938493949404941494249434944494549464947494849494950495149524953495449554956495749584959496049614962496349644965496649674968496949704971497249734974497549764977497849794980498149824983498449854986498749884989499049914992499349944995499649974998499950005001500250035004500550065007500850095010501150125013501450155016501750185019502050215022502350245025502650275028502950305031503250335034503550365037503850395040504150425043504450455046504750485049505050515052505350545055505650575058505950605061506250635064506550665067506850695070507150725073507450755076507750785079508050815082508350845085508650875088508950905091509250935094509550965097509850995100510151025103510451055106510751085109511051115112511351145115511651175118511951205121512251235124512551265127512851295130513151325133513451355136513751385139514051415142514351445145514651475148514951505151515251535154515551565157515851595160516151625163516451655166516751685169517051715172517351745175517651775178517951805181518251835184518551865187518851895190519151925193519451955196519751985199520052015202520352045205520652075208520952105211521252135214521552165217521852195220522152225223522452255226522752285229523052315232523352345235523652375238523952405241524252435244524552465247524852495250525152525253525452555256525752585259526052615262526352645265526652675268526952705271527252735274527552765277527852795280528152825283528452855286528752885289529052915292529352945295529652975298529953005301530253035304530553065307530853095310531153125313531453155316531753185319532053215322532353245325532653275328532953305331533253335334533553365337533853395340534153425343534453455346534753485349535053515352535353545355535653575358535953605361536253635364536553665367536853695370537153725373537453755376537753785379538053815382538353845385538653875388538953905391539253935394539553965397539853995400540154025403540454055406540754085409541054115412541354145415541654175418541954205421542254235424542554265427542854295430543154325433543454355436543754385439544054415442544354445445544654475448544954505451545254535454545554565457545854595460546154625463546454655466546754685469547054715472547354745475547654775478547954805481548254835484548554865487548854895490549154925493549454955496549754985499550055015502550355045505550655075508550955105511551255135514551555165517551855195520552155225523552455255526552755285529553055315532553355345535553655375538553955405541554255435544554555465547554855495550555155525553555455555556555755585559556055615562556355645565556655675568556955705571557255735574557555765577557855795580558155825583558455855586558755885589559055915592559355945595559655975598559956005601560256035604560556065607560856095610561156125613561456155616561756185619562056215622562356245625562656275628562956305631563256335634563556365637563856395640564156425643564456455646564756485649565056515652565356545655565656575658565956605661566256635664566556665667566856695670567156725673567456755676567756785679568056815682568356845685568656875688568956905691569256935694569556965697569856995700570157025703570457055706570757085709571057115712571357145715571657175718571957205721572257235724572557265727572857295730573157325733573457355736573757385739574057415742574357445745574657475748574957505751575257535754575557565757575857595760576157625763576457655766576757685769577057715772577357745775577657775778577957805781578257835784578557865787578857895790579157925793579457955796579757985799580058015802580358045805580658075808580958105811581258135814581558165817581858195820582158225823582458255826582758285829583058315832583358345835583658375838583958405841584258435844584558465847584858495850585158525853585458555856585758585859586058615862586358645865586658675868586958705871587258735874587558765877587858795880588158825883588458855886588758885889589058915892589358945895589658975898589959005901590259035904590559065907590859095910591159125913591459155916591759185919592059215922592359245925592659275928592959305931593259335934593559365937593859395940594159425943594459455946594759485949595059515952595359545955595659575958595959605961596259635964596559665967596859695970597159725973597459755976597759785979598059815982598359845985598659875988598959905991599259935994599559965997599859996000600160026003600460056006600760086009601060116012601360146015601660176018601960206021602260236024602560266027602860296030603160326033603460356036603760386039604060416042604360446045604660476048604960506051605260536054605560566057605860596060606160626063606460656066606760686069607060716072607360746075607660776078607960806081608260836084608560866087608860896090609160926093609460956096609760986099610061016102610361046105610661076108610961106111611261136114611561166117611861196120612161226123612461256126612761286129613061316132613361346135613661376138613961406141614261436144614561466147614861496150615161526153615461556156615761586159616061616162616361646165616661676168616961706171617261736174617561766177617861796180618161826183618461856186618761886189619061916192619361946195619661976198619962006201620262036204620562066207620862096210621162126213621462156216621762186219622062216222622362246225622662276228622962306231623262336234623562366237623862396240624162426243624462456246624762486249625062516252625362546255625662576258625962606261626262636264626562666267626862696270627162726273627462756276627762786279628062816282628362846285628662876288628962906291629262936294629562966297629862996300630163026303630463056306630763086309631063116312631363146315631663176318631963206321632263236324632563266327632863296330633163326333633463356336633763386339634063416342634363446345634663476348634963506351635263536354635563566357635863596360636163626363636463656366636763686369637063716372637363746375637663776378637963806381638263836384638563866387638863896390639163926393639463956396639763986399640064016402640364046405640664076408640964106411641264136414641564166417641864196420642164226423642464256426642764286429643064316432643364346435643664376438643964406441644264436444644564466447644864496450645164526453645464556456645764586459646064616462646364646465646664676468646964706471647264736474647564766477647864796480648164826483648464856486648764886489649064916492649364946495649664976498649965006501650265036504650565066507650865096510651165126513651465156516651765186519652065216522652365246525652665276528652965306531653265336534653565366537653865396540654165426543654465456546654765486549655065516552655365546555655665576558655965606561656265636564656565666567656865696570657165726573657465756576657765786579658065816582658365846585658665876588658965906591659265936594659565966597659865996600660166026603660466056606660766086609661066116612661366146615661666176618661966206621662266236624662566266627662866296630663166326633663466356636663766386639664066416642664366446645664666476648664966506651665266536654665566566657665866596660666166626663666466656666666766686669667066716672667366746675667666776678667966806681668266836684668566866687668866896690669166926693669466956696669766986699670067016702670367046705670667076708670967106711671267136714671567166717671867196720672167226723672467256726672767286729673067316732673367346735673667376738673967406741674267436744674567466747674867496750675167526753675467556756675767586759676067616762676367646765676667676768676967706771677267736774677567766777677867796780678167826783678467856786678767886789679067916792679367946795679667976798679968006801680268036804680568066807680868096810681168126813681468156816681768186819682068216822682368246825682668276828682968306831683268336834683568366837683868396840684168426843684468456846684768486849685068516852685368546855685668576858685968606861686268636864686568666867686868696870687168726873687468756876687768786879688068816882688368846885688668876888688968906891689268936894689568966897689868996900690169026903690469056906690769086909691069116912691369146915691669176918691969206921692269236924692569266927692869296930693169326933693469356936693769386939694069416942694369446945694669476948694969506951695269536954695569566957695869596960696169626963696469656966696769686969697069716972697369746975697669776978697969806981698269836984698569866987698869896990699169926993699469956996699769986999700070017002700370047005700670077008700970107011701270137014701570167017701870197020702170227023702470257026702770287029703070317032703370347035703670377038703970407041704270437044704570467047704870497050705170527053705470557056705770587059706070617062706370647065706670677068706970707071707270737074707570767077707870797080708170827083708470857086708770887089709070917092709370947095709670977098709971007101710271037104710571067107710871097110711171127113711471157116711771187119712071217122712371247125712671277128712971307131713271337134713571367137713871397140714171427143714471457146714771487149715071517152715371547155715671577158715971607161716271637164716571667167716871697170717171727173717471757176717771787179718071817182718371847185718671877188718971907191719271937194719571967197719871997200720172027203720472057206720772087209721072117212721372147215721672177218721972207221722272237224722572267227722872297230723172327233723472357236723772387239724072417242724372447245724672477248724972507251725272537254725572567257725872597260726172627263726472657266726772687269727072717272727372747275727672777278727972807281728272837284728572867287728872897290729172927293729472957296729772987299730073017302730373047305730673077308730973107311731273137314731573167317731873197320732173227323732473257326732773287329733073317332733373347335733673377338733973407341734273437344734573467347734873497350735173527353735473557356735773587359736073617362736373647365736673677368736973707371737273737374737573767377737873797380738173827383738473857386738773887389739073917392739373947395739673977398739974007401740274037404740574067407740874097410741174127413741474157416741774187419742074217422742374247425742674277428742974307431743274337434743574367437743874397440744174427443744474457446744774487449745074517452745374547455745674577458745974607461746274637464746574667467746874697470747174727473747474757476747774787479748074817482748374847485748674877488748974907491749274937494749574967497749874997500750175027503750475057506750775087509751075117512751375147515751675177518751975207521752275237524752575267527752875297530753175327533753475357536753775387539754075417542754375447545754675477548754975507551755275537554755575567557755875597560756175627563756475657566756775687569757075717572757375747575757675777578757975807581758275837584758575867587758875897590759175927593759475957596759775987599760076017602760376047605760676077608760976107611761276137614761576167617761876197620762176227623762476257626762776287629763076317632763376347635763676377638763976407641764276437644764576467647764876497650765176527653765476557656765776587659766076617662766376647665766676677668766976707671767276737674767576767677767876797680768176827683768476857686768776887689769076917692769376947695769676977698769977007701770277037704770577067707770877097710771177127713771477157716771777187719772077217722772377247725772677277728772977307731773277337734773577367737773877397740774177427743774477457746774777487749775077517752775377547755775677577758775977607761776277637764776577667767776877697770777177727773777477757776777777787779778077817782778377847785778677877788778977907791779277937794779577967797779877997800780178027803780478057806780778087809781078117812781378147815781678177818781978207821782278237824782578267827782878297830783178327833783478357836783778387839784078417842784378447845784678477848784978507851785278537854785578567857785878597860786178627863786478657866786778687869787078717872787378747875787678777878787978807881788278837884788578867887788878897890789178927893789478957896789778987899790079017902790379047905790679077908790979107911791279137914791579167917791879197920792179227923792479257926792779287929793079317932793379347935793679377938793979407941794279437944794579467947794879497950795179527953795479557956795779587959796079617962796379647965796679677968796979707971797279737974797579767977797879797980798179827983798479857986798779887989799079917992799379947995799679977998799980008001800280038004800580068007800880098010801180128013801480158016801780188019802080218022802380248025802680278028802980308031803280338034803580368037803880398040804180428043804480458046804780488049805080518052805380548055805680578058805980608061806280638064806580668067806880698070807180728073807480758076807780788079808080818082808380848085808680878088808980908091809280938094809580968097809880998100810181028103810481058106810781088109811081118112811381148115811681178118811981208121812281238124812581268127812881298130813181328133813481358136813781388139814081418142814381448145814681478148814981508151815281538154815581568157815881598160816181628163816481658166816781688169817081718172817381748175817681778178817981808181818281838184818581868187818881898190819181928193819481958196819781988199820082018202820382048205820682078208820982108211821282138214821582168217821882198220822182228223822482258226822782288229823082318232823382348235823682378238823982408241824282438244824582468247824882498250825182528253825482558256825782588259826082618262826382648265826682678268826982708271827282738274827582768277827882798280828182828283828482858286828782888289829082918292829382948295829682978298829983008301830283038304830583068307830883098310831183128313831483158316831783188319832083218322832383248325832683278328832983308331833283338334833583368337833883398340834183428343834483458346834783488349835083518352835383548355835683578358835983608361836283638364836583668367836883698370837183728373837483758376837783788379838083818382838383848385838683878388838983908391839283938394839583968397839883998400840184028403840484058406840784088409841084118412841384148415841684178418841984208421842284238424842584268427842884298430843184328433843484358436843784388439844084418442844384448445844684478448844984508451845284538454845584568457845884598460846184628463846484658466846784688469847084718472847384748475847684778478847984808481848284838484848584868487848884898490849184928493849484958496849784988499850085018502850385048505850685078508850985108511851285138514851585168517851885198520852185228523852485258526852785288529853085318532853385348535853685378538853985408541854285438544854585468547854885498550855185528553855485558556855785588559856085618562856385648565856685678568856985708571857285738574857585768577857885798580858185828583858485858586858785888589859085918592859385948595859685978598859986008601860286038604860586068607860886098610861186128613861486158616861786188619862086218622862386248625862686278628862986308631863286338634863586368637863886398640864186428643864486458646864786488649865086518652865386548655865686578658865986608661866286638664866586668667866886698670867186728673867486758676867786788679868086818682868386848685868686878688868986908691869286938694869586968697869886998700870187028703870487058706870787088709871087118712871387148715871687178718871987208721872287238724872587268727872887298730873187328733873487358736873787388739874087418742874387448745874687478748874987508751875287538754875587568757875887598760876187628763876487658766876787688769877087718772877387748775877687778778877987808781878287838784878587868787878887898790879187928793879487958796879787988799880088018802880388048805880688078808880988108811881288138814881588168817881888198820882188228823882488258826882788288829883088318832883388348835883688378838883988408841884288438844884588468847884888498850885188528853885488558856885788588859886088618862886388648865886688678868886988708871887288738874887588768877887888798880888188828883888488858886888788888889889088918892889388948895889688978898889989008901890289038904890589068907890889098910891189128913891489158916891789188919892089218922892389248925892689278928892989308931893289338934893589368937893889398940894189428943894489458946894789488949895089518952895389548955895689578958895989608961896289638964896589668967896889698970897189728973897489758976897789788979898089818982898389848985898689878988898989908991899289938994899589968997899889999000900190029003900490059006900790089009901090119012901390149015901690179018901990209021902290239024902590269027902890299030903190329033903490359036903790389039904090419042904390449045904690479048904990509051905290539054905590569057905890599060906190629063906490659066906790689069907090719072907390749075907690779078907990809081908290839084908590869087908890899090909190929093909490959096909790989099910091019102910391049105910691079108910991109111911291139114911591169117911891199120912191229123912491259126912791289129913091319132913391349135913691379138913991409141914291439144914591469147914891499150915191529153915491559156915791589159916091619162916391649165916691679168916991709171917291739174917591769177917891799180918191829183918491859186918791889189919091919192919391949195919691979198919992009201920292039204920592069207920892099210921192129213921492159216921792189219922092219222922392249225922692279228922992309231923292339234923592369237923892399240924192429243924492459246924792489249925092519252925392549255925692579258925992609261926292639264926592669267926892699270927192729273927492759276927792789279928092819282928392849285928692879288928992909291929292939294929592969297929892999300930193029303930493059306930793089309931093119312931393149315931693179318931993209321932293239324932593269327932893299330933193329333933493359336933793389339934093419342934393449345934693479348934993509351935293539354935593569357935893599360936193629363936493659366936793689369937093719372937393749375937693779378937993809381938293839384938593869387938893899390939193929393939493959396939793989399940094019402940394049405940694079408940994109411941294139414941594169417941894199420942194229423942494259426942794289429943094319432943394349435943694379438943994409441944294439444944594469447944894499450945194529453945494559456945794589459946094619462946394649465946694679468946994709471947294739474947594769477947894799480948194829483948494859486948794889489949094919492949394949495949694979498949995009501950295039504950595069507950895099510951195129513951495159516951795189519952095219522952395249525952695279528952995309531953295339534953595369537953895399540954195429543954495459546954795489549955095519552955395549555955695579558955995609561956295639564956595669567956895699570957195729573957495759576957795789579958095819582958395849585958695879588958995909591959295939594959595969597959895999600960196029603960496059606960796089609961096119612961396149615961696179618961996209621962296239624962596269627962896299630963196329633963496359636963796389639964096419642964396449645964696479648964996509651965296539654965596569657965896599660966196629663966496659666966796689669967096719672967396749675967696779678967996809681968296839684968596869687968896899690969196929693969496959696969796989699970097019702970397049705970697079708970997109711971297139714971597169717971897199720972197229723972497259726972797289729973097319732973397349735973697379738973997409741974297439744974597469747974897499750975197529753975497559756975797589759976097619762976397649765976697679768976997709771977297739774977597769777977897799780978197829783978497859786978797889789979097919792979397949795979697979798979998009801980298039804980598069807980898099810981198129813981498159816981798189819982098219822982398249825982698279828982998309831983298339834983598369837983898399840984198429843984498459846984798489849985098519852985398549855985698579858985998609861986298639864986598669867986898699870987198729873987498759876987798789879988098819882988398849885988698879888988998909891989298939894989598969897989898999900990199029903990499059906990799089909991099119912991399149915991699179918991999209921992299239924992599269927992899299930993199329933993499359936993799389939994099419942994399449945994699479948994999509951995299539954995599569957995899599960996199629963996499659966996799689969997099719972997399749975997699779978997999809981998299839984998599869987998899899990999199929993999499959996999799989999100001000110002100031000410005100061000710008100091001010011100121001310014100151001610017100181001910020100211002210023100241002510026100271002810029100301003110032100331003410035100361003710038100391004010041100421004310044100451004610047100481004910050100511005210053100541005510056100571005810059100601006110062100631006410065100661006710068100691007010071100721007310074100751007610077100781007910080100811008210083100841008510086100871008810089100901009110092100931009410095100961009710098100991010010101101021010310104101051010610107101081010910110101111011210113101141011510116101171011810119101201012110122101231012410125101261012710128101291013010131101321013310134101351013610137101381013910140101411014210143101441014510146101471014810149101501015110152101531015410155101561015710158101591016010161101621016310164101651016610167101681016910170101711017210173101741017510176101771017810179101801018110182101831018410185101861018710188101891019010191101921019310194101951019610197101981019910200102011020210203102041020510206102071020810209102101021110212102131021410215102161021710218102191022010221102221022310224102251022610227102281022910230102311023210233102341023510236102371023810239102401024110242102431024410245102461024710248102491025010251102521025310254102551025610257102581025910260102611026210263102641026510266102671026810269102701027110272102731027410275102761027710278102791028010281102821028310284102851028610287102881028910290102911029210293102941029510296102971029810299103001030110302103031030410305103061030710308103091031010311103121031310314103151031610317103181031910320103211032210323103241032510326103271032810329103301033110332103331033410335103361033710338103391034010341103421034310344103451034610347103481034910350103511035210353103541035510356103571035810359103601036110362103631036410365103661036710368103691037010371103721037310374103751037610377103781037910380103811038210383103841038510386103871038810389103901039110392103931039410395103961039710398103991040010401104021040310404104051040610407104081040910410104111041210413104141041510416104171041810419104201042110422104231042410425104261042710428104291043010431104321043310434104351043610437104381043910440104411044210443104441044510446104471044810449104501045110452104531045410455104561045710458104591046010461104621046310464104651046610467104681046910470104711047210473104741047510476104771047810479104801048110482104831048410485104861048710488104891049010491104921049310494104951049610497104981049910500105011050210503105041050510506105071050810509105101051110512105131051410515105161051710518105191052010521105221052310524105251052610527105281052910530105311053210533105341053510536105371053810539105401054110542105431054410545105461054710548105491055010551105521055310554105551055610557105581055910560105611056210563105641056510566105671056810569105701057110572105731057410575105761057710578105791058010581105821058310584105851058610587105881058910590105911059210593105941059510596105971059810599106001060110602106031060410605106061060710608106091061010611106121061310614106151061610617106181061910620106211062210623106241062510626106271062810629106301063110632106331063410635106361063710638106391064010641106421064310644106451064610647106481064910650106511065210653106541065510656106571065810659106601066110662106631066410665106661066710668106691067010671106721067310674106751067610677106781067910680106811068210683106841068510686106871068810689106901069110692106931069410695106961069710698106991070010701107021070310704107051070610707107081070910710107111071210713107141071510716107171071810719107201072110722107231072410725107261072710728107291073010731107321073310734107351073610737107381073910740107411074210743107441074510746107471074810749107501075110752107531075410755107561075710758107591076010761107621076310764107651076610767107681076910770107711077210773107741077510776107771077810779107801078110782107831078410785107861078710788107891079010791107921079310794107951079610797107981079910800108011080210803108041080510806108071080810809108101081110812108131081410815108161081710818108191082010821108221082310824108251082610827108281082910830108311083210833108341083510836108371083810839108401084110842108431084410845108461084710848108491085010851108521085310854108551085610857108581085910860108611086210863108641086510866108671086810869108701087110872108731087410875108761087710878108791088010881108821088310884108851088610887108881088910890108911089210893108941089510896108971089810899109001090110902109031090410905109061090710908109091091010911109121091310914109151091610917109181091910920109211092210923109241092510926109271092810929109301093110932109331093410935109361093710938109391094010941109421094310944109451094610947109481094910950109511095210953109541095510956109571095810959109601096110962109631096410965109661096710968109691097010971109721097310974109751097610977109781097910980109811098210983109841098510986109871098810989109901099110992109931099410995109961099710998109991100011001110021100311004110051100611007110081100911010110111101211013110141101511016110171101811019110201102111022110231102411025110261102711028110291103011031110321103311034110351103611037110381103911040110411104211043110441104511046110471104811049110501105111052110531105411055110561105711058110591106011061110621106311064110651106611067110681106911070110711107211073110741107511076110771107811079110801108111082110831108411085110861108711088110891109011091110921109311094110951109611097110981109911100111011110211103111041110511106111071110811109111101111111112111131111411115111161111711118111191112011121111221112311124111251112611127111281112911130111311113211133111341113511136111371113811139111401114111142111431114411145111461114711148111491115011151111521115311154111551115611157111581115911160111611116211163111641116511166111671116811169111701117111172111731117411175111761117711178111791118011181111821118311184111851118611187111881118911190111911119211193111941119511196111971119811199112001120111202112031120411205112061120711208112091121011211112121121311214112151121611217112181121911220112211122211223112241122511226112271122811229112301123111232112331123411235112361123711238112391124011241112421124311244112451124611247112481124911250112511125211253112541125511256112571125811259112601126111262112631126411265112661126711268112691127011271112721127311274112751127611277112781127911280112811128211283112841128511286112871128811289112901129111292112931129411295112961129711298112991130011301113021130311304113051130611307113081130911310113111131211313113141131511316113171131811319113201132111322113231132411325113261132711328113291133011331113321133311334113351133611337113381133911340113411134211343113441134511346113471134811349113501135111352113531135411355113561135711358113591136011361113621136311364113651136611367113681136911370113711137211373113741137511376113771137811379113801138111382113831138411385113861138711388113891139011391113921139311394113951139611397113981139911400114011140211403114041140511406114071140811409114101141111412114131141411415114161141711418114191142011421114221142311424114251142611427114281142911430114311143211433114341143511436114371143811439114401144111442114431144411445114461144711448114491145011451114521145311454114551145611457114581145911460114611146211463114641146511466114671146811469114701147111472114731147411475114761147711478114791148011481114821148311484114851148611487114881148911490114911149211493114941149511496114971149811499115001150111502115031150411505115061150711508115091151011511115121151311514115151151611517115181151911520115211152211523115241152511526115271152811529115301153111532115331153411535115361153711538115391154011541115421154311544115451154611547115481154911550115511155211553115541155511556115571155811559115601156111562115631156411565115661156711568115691157011571115721157311574115751157611577115781157911580115811158211583115841158511586115871158811589115901159111592115931159411595115961159711598115991160011601116021160311604116051160611607116081160911610116111161211613116141161511616116171161811619116201162111622116231162411625116261162711628116291163011631116321163311634116351163611637116381163911640116411164211643116441164511646116471164811649116501165111652116531165411655116561165711658116591166011661116621166311664116651166611667116681166911670116711167211673116741167511676116771167811679116801168111682116831168411685116861168711688116891169011691116921169311694116951169611697116981169911700117011170211703117041170511706117071170811709117101171111712117131171411715117161171711718117191172011721117221172311724117251172611727117281172911730117311173211733117341173511736117371173811739117401174111742117431174411745117461174711748117491175011751117521175311754117551175611757117581175911760117611176211763117641176511766117671176811769117701177111772117731177411775117761177711778117791178011781117821178311784117851178611787117881178911790117911179211793117941179511796117971179811799118001180111802118031180411805118061180711808118091181011811118121181311814118151181611817118181181911820118211182211823118241182511826118271182811829118301183111832118331183411835118361183711838118391184011841118421184311844118451184611847118481184911850118511185211853118541185511856118571185811859118601186111862118631186411865118661186711868118691187011871118721187311874118751187611877118781187911880118811188211883118841188511886118871188811889118901189111892118931189411895118961189711898118991190011901119021190311904119051190611907119081190911910119111191211913119141191511916119171191811919119201192111922119231192411925119261192711928119291193011931119321193311934119351193611937119381193911940119411194211943119441194511946119471194811949119501195111952119531195411955119561195711958119591196011961119621196311964119651196611967119681196911970119711197211973119741197511976119771197811979119801198111982119831198411985119861198711988119891199011991119921199311994119951199611997119981199912000120011200212003120041200512006120071200812009120101201112012120131201412015120161201712018120191202012021120221202312024120251202612027120281202912030120311203212033120341203512036120371203812039120401204112042120431204412045120461204712048120491205012051120521205312054120551205612057120581205912060120611206212063120641206512066120671206812069120701207112072120731207412075120761207712078120791208012081120821208312084120851208612087120881208912090120911209212093120941209512096120971209812099121001210112102121031210412105121061210712108121091211012111121121211312114121151211612117121181211912120121211212212123121241212512126121271212812129121301213112132121331213412135121361213712138121391214012141121421214312144121451214612147121481214912150121511215212153121541215512156121571215812159121601216112162121631216412165121661216712168121691217012171121721217312174121751217612177121781217912180121811218212183121841218512186121871218812189121901219112192121931219412195121961219712198121991220012201122021220312204122051220612207122081220912210122111221212213122141221512216122171221812219122201222112222122231222412225122261222712228122291223012231122321223312234122351223612237122381223912240122411224212243122441224512246122471224812249122501225112252122531225412255122561225712258122591226012261122621226312264122651226612267122681226912270122711227212273122741227512276122771227812279122801228112282122831228412285122861228712288122891229012291122921229312294122951229612297122981229912300123011230212303123041230512306123071230812309123101231112312123131231412315123161231712318123191232012321123221232312324123251232612327123281232912330123311233212333123341233512336123371233812339123401234112342123431234412345123461234712348123491235012351123521235312354123551235612357123581235912360123611236212363123641236512366123671236812369123701237112372123731237412375123761237712378123791238012381123821238312384123851238612387123881238912390123911239212393123941239512396123971239812399124001240112402124031240412405124061240712408124091241012411124121241312414124151241612417124181241912420124211242212423124241242512426124271242812429124301243112432124331243412435124361243712438124391244012441124421244312444124451244612447124481244912450124511245212453124541245512456124571245812459124601246112462124631246412465124661246712468124691247012471124721247312474124751247612477124781247912480124811248212483124841248512486124871248812489124901249112492124931249412495124961249712498124991250012501125021250312504125051250612507125081250912510125111251212513125141251512516125171251812519125201252112522125231252412525125261252712528125291253012531125321253312534125351253612537125381253912540125411254212543125441254512546125471254812549125501255112552125531255412555125561255712558125591256012561125621256312564125651256612567125681256912570125711257212573125741257512576125771257812579125801258112582125831258412585125861258712588125891259012591125921259312594125951259612597125981259912600126011260212603126041260512606126071260812609126101261112612126131261412615126161261712618126191262012621126221262312624126251262612627126281262912630126311263212633126341263512636126371263812639126401264112642126431264412645126461264712648126491265012651126521265312654126551265612657126581265912660126611266212663126641266512666126671266812669126701267112672126731267412675126761267712678126791268012681126821268312684126851268612687126881268912690126911269212693126941269512696126971269812699127001270112702127031270412705127061270712708127091271012711127121271312714127151271612717127181271912720127211272212723127241272512726127271272812729127301273112732127331273412735127361273712738127391274012741127421274312744127451274612747127481274912750127511275212753127541275512756127571275812759127601276112762127631276412765127661276712768127691277012771127721277312774127751277612777127781277912780127811278212783127841278512786127871278812789127901279112792127931279412795127961279712798
  1. // Package content provides access to the Content API for Shopping.
  2. //
  3. // See https://developers.google.com/shopping-content
  4. //
  5. // Usage example:
  6. //
  7. // import "google.golang.org/api/content/v2"
  8. // ...
  9. // contentService, err := content.New(oauthHttpClient)
  10. package content // import "google.golang.org/api/content/v2"
  11. import (
  12. "bytes"
  13. "encoding/json"
  14. "errors"
  15. "fmt"
  16. context "golang.org/x/net/context"
  17. ctxhttp "golang.org/x/net/context/ctxhttp"
  18. gensupport "google.golang.org/api/gensupport"
  19. googleapi "google.golang.org/api/googleapi"
  20. "io"
  21. "net/http"
  22. "net/url"
  23. "strconv"
  24. "strings"
  25. )
  26. // Always reference these packages, just in case the auto-generated code
  27. // below doesn't.
  28. var _ = bytes.NewBuffer
  29. var _ = strconv.Itoa
  30. var _ = fmt.Sprintf
  31. var _ = json.NewDecoder
  32. var _ = io.Copy
  33. var _ = url.Parse
  34. var _ = gensupport.MarshalJSON
  35. var _ = googleapi.Version
  36. var _ = errors.New
  37. var _ = strings.Replace
  38. var _ = context.Canceled
  39. var _ = ctxhttp.Do
  40. const apiId = "content:v2"
  41. const apiName = "content"
  42. const apiVersion = "v2"
  43. const basePath = "https://www.googleapis.com/content/v2/"
  44. // OAuth2 scopes used by this API.
  45. const (
  46. // Manage your product listings and accounts for Google Shopping
  47. ContentScope = "https://www.googleapis.com/auth/content"
  48. )
  49. func New(client *http.Client) (*Service, error) {
  50. if client == nil {
  51. return nil, errors.New("client is nil")
  52. }
  53. s := &Service{client: client, BasePath: basePath}
  54. s.Accounts = NewAccountsService(s)
  55. s.Accountshipping = NewAccountshippingService(s)
  56. s.Accountstatuses = NewAccountstatusesService(s)
  57. s.Accounttax = NewAccounttaxService(s)
  58. s.Datafeeds = NewDatafeedsService(s)
  59. s.Datafeedstatuses = NewDatafeedstatusesService(s)
  60. s.Inventory = NewInventoryService(s)
  61. s.Orders = NewOrdersService(s)
  62. s.Products = NewProductsService(s)
  63. s.Productstatuses = NewProductstatusesService(s)
  64. return s, nil
  65. }
  66. type Service struct {
  67. client *http.Client
  68. BasePath string // API endpoint base URL
  69. UserAgent string // optional additional User-Agent fragment
  70. Accounts *AccountsService
  71. Accountshipping *AccountshippingService
  72. Accountstatuses *AccountstatusesService
  73. Accounttax *AccounttaxService
  74. Datafeeds *DatafeedsService
  75. Datafeedstatuses *DatafeedstatusesService
  76. Inventory *InventoryService
  77. Orders *OrdersService
  78. Products *ProductsService
  79. Productstatuses *ProductstatusesService
  80. }
  81. func (s *Service) userAgent() string {
  82. if s.UserAgent == "" {
  83. return googleapi.UserAgent
  84. }
  85. return googleapi.UserAgent + " " + s.UserAgent
  86. }
  87. func NewAccountsService(s *Service) *AccountsService {
  88. rs := &AccountsService{s: s}
  89. return rs
  90. }
  91. type AccountsService struct {
  92. s *Service
  93. }
  94. func NewAccountshippingService(s *Service) *AccountshippingService {
  95. rs := &AccountshippingService{s: s}
  96. return rs
  97. }
  98. type AccountshippingService struct {
  99. s *Service
  100. }
  101. func NewAccountstatusesService(s *Service) *AccountstatusesService {
  102. rs := &AccountstatusesService{s: s}
  103. return rs
  104. }
  105. type AccountstatusesService struct {
  106. s *Service
  107. }
  108. func NewAccounttaxService(s *Service) *AccounttaxService {
  109. rs := &AccounttaxService{s: s}
  110. return rs
  111. }
  112. type AccounttaxService struct {
  113. s *Service
  114. }
  115. func NewDatafeedsService(s *Service) *DatafeedsService {
  116. rs := &DatafeedsService{s: s}
  117. return rs
  118. }
  119. type DatafeedsService struct {
  120. s *Service
  121. }
  122. func NewDatafeedstatusesService(s *Service) *DatafeedstatusesService {
  123. rs := &DatafeedstatusesService{s: s}
  124. return rs
  125. }
  126. type DatafeedstatusesService struct {
  127. s *Service
  128. }
  129. func NewInventoryService(s *Service) *InventoryService {
  130. rs := &InventoryService{s: s}
  131. return rs
  132. }
  133. type InventoryService struct {
  134. s *Service
  135. }
  136. func NewOrdersService(s *Service) *OrdersService {
  137. rs := &OrdersService{s: s}
  138. return rs
  139. }
  140. type OrdersService struct {
  141. s *Service
  142. }
  143. func NewProductsService(s *Service) *ProductsService {
  144. rs := &ProductsService{s: s}
  145. return rs
  146. }
  147. type ProductsService struct {
  148. s *Service
  149. }
  150. func NewProductstatusesService(s *Service) *ProductstatusesService {
  151. rs := &ProductstatusesService{s: s}
  152. return rs
  153. }
  154. type ProductstatusesService struct {
  155. s *Service
  156. }
  157. // Account: Account data.
  158. type Account struct {
  159. // AdultContent: Indicates whether the merchant sells adult content.
  160. AdultContent bool `json:"adultContent,omitempty"`
  161. // AdwordsLinks: List of linked AdWords accounts, active or pending
  162. // approval. To create a new link request, add a new link with status
  163. // active to the list. It will remain is state pending until approved or
  164. // rejected in the AdWords interface. To delete an active link or to
  165. // cancel a link request, remove it from the list.
  166. AdwordsLinks []*AccountAdwordsLink `json:"adwordsLinks,omitempty"`
  167. // Id: Merchant Center account ID.
  168. Id uint64 `json:"id,omitempty,string"`
  169. // Kind: Identifies what kind of resource this is. Value: the fixed
  170. // string "content#account".
  171. Kind string `json:"kind,omitempty"`
  172. // Name: Display name for the account.
  173. Name string `json:"name,omitempty"`
  174. // ReviewsUrl: URL for individual seller reviews, i.e., reviews for each
  175. // child account.
  176. ReviewsUrl string `json:"reviewsUrl,omitempty"`
  177. // SellerId: Client-specific, locally-unique, internal ID for the child
  178. // account.
  179. SellerId string `json:"sellerId,omitempty"`
  180. // Users: Users with access to the account. Every account (except for
  181. // subaccounts) must have at least one admin user.
  182. Users []*AccountUser `json:"users,omitempty"`
  183. // WebsiteUrl: The merchant's website.
  184. WebsiteUrl string `json:"websiteUrl,omitempty"`
  185. // ServerResponse contains the HTTP response code and headers from the
  186. // server.
  187. googleapi.ServerResponse `json:"-"`
  188. // ForceSendFields is a list of field names (e.g. "AdultContent") to
  189. // unconditionally include in API requests. By default, fields with
  190. // empty values are omitted from API requests. However, any non-pointer,
  191. // non-interface field appearing in ForceSendFields will be sent to the
  192. // server regardless of whether the field is empty or not. This may be
  193. // used to include empty fields in Patch requests.
  194. ForceSendFields []string `json:"-"`
  195. }
  196. func (s *Account) MarshalJSON() ([]byte, error) {
  197. type noMethod Account
  198. raw := noMethod(*s)
  199. return gensupport.MarshalJSON(raw, s.ForceSendFields)
  200. }
  201. type AccountAdwordsLink struct {
  202. // AdwordsId: Customer ID of the AdWords account.
  203. AdwordsId uint64 `json:"adwordsId,omitempty,string"`
  204. // Status: Status of the link between this Merchant Center account and
  205. // the AdWords account. Upon retrieval, it represents the actual status
  206. // of the link and can be either active if it was approved in Google
  207. // AdWords or pending if it's pending approval. Upon insertion, it
  208. // represents the intended status of the link. Re-uploading a link with
  209. // status active when it's still pending or with status pending when
  210. // it's already active will have no effect: the status will remain
  211. // unchanged. Re-uploading a link with deprecated status inactive is
  212. // equivalent to not submitting the link at all and will delete the link
  213. // if it was active or cancel the link request if it was pending.
  214. Status string `json:"status,omitempty"`
  215. // ForceSendFields is a list of field names (e.g. "AdwordsId") to
  216. // unconditionally include in API requests. By default, fields with
  217. // empty values are omitted from API requests. However, any non-pointer,
  218. // non-interface field appearing in ForceSendFields will be sent to the
  219. // server regardless of whether the field is empty or not. This may be
  220. // used to include empty fields in Patch requests.
  221. ForceSendFields []string `json:"-"`
  222. }
  223. func (s *AccountAdwordsLink) MarshalJSON() ([]byte, error) {
  224. type noMethod AccountAdwordsLink
  225. raw := noMethod(*s)
  226. return gensupport.MarshalJSON(raw, s.ForceSendFields)
  227. }
  228. type AccountIdentifier struct {
  229. // AggregatorId: The aggregator ID, set for aggregators and subaccounts
  230. // (in that case, it represents the aggregator of the subaccount).
  231. AggregatorId uint64 `json:"aggregatorId,omitempty,string"`
  232. // MerchantId: The merchant account ID, set for individual accounts and
  233. // subaccounts.
  234. MerchantId uint64 `json:"merchantId,omitempty,string"`
  235. // ForceSendFields is a list of field names (e.g. "AggregatorId") to
  236. // unconditionally include in API requests. By default, fields with
  237. // empty values are omitted from API requests. However, any non-pointer,
  238. // non-interface field appearing in ForceSendFields will be sent to the
  239. // server regardless of whether the field is empty or not. This may be
  240. // used to include empty fields in Patch requests.
  241. ForceSendFields []string `json:"-"`
  242. }
  243. func (s *AccountIdentifier) MarshalJSON() ([]byte, error) {
  244. type noMethod AccountIdentifier
  245. raw := noMethod(*s)
  246. return gensupport.MarshalJSON(raw, s.ForceSendFields)
  247. }
  248. // AccountShipping: The shipping settings of a merchant account.
  249. type AccountShipping struct {
  250. // AccountId: The ID of the account to which these account shipping
  251. // settings belong.
  252. AccountId uint64 `json:"accountId,omitempty,string"`
  253. // CarrierRates: Carrier-based shipping calculations.
  254. CarrierRates []*AccountShippingCarrierRate `json:"carrierRates,omitempty"`
  255. // Kind: Identifies what kind of resource this is. Value: the fixed
  256. // string "content#accountShipping".
  257. Kind string `json:"kind,omitempty"`
  258. // LocationGroups: Location groups for shipping.
  259. LocationGroups []*AccountShippingLocationGroup `json:"locationGroups,omitempty"`
  260. // RateTables: Rate tables definitions.
  261. RateTables []*AccountShippingRateTable `json:"rateTables,omitempty"`
  262. // Services: Shipping services describing shipping fees calculation.
  263. Services []*AccountShippingShippingService `json:"services,omitempty"`
  264. // ServerResponse contains the HTTP response code and headers from the
  265. // server.
  266. googleapi.ServerResponse `json:"-"`
  267. // ForceSendFields is a list of field names (e.g. "AccountId") to
  268. // unconditionally include in API requests. By default, fields with
  269. // empty values are omitted from API requests. However, any non-pointer,
  270. // non-interface field appearing in ForceSendFields will be sent to the
  271. // server regardless of whether the field is empty or not. This may be
  272. // used to include empty fields in Patch requests.
  273. ForceSendFields []string `json:"-"`
  274. }
  275. func (s *AccountShipping) MarshalJSON() ([]byte, error) {
  276. type noMethod AccountShipping
  277. raw := noMethod(*s)
  278. return gensupport.MarshalJSON(raw, s.ForceSendFields)
  279. }
  280. // AccountShippingCarrierRate: A carrier-calculated shipping rate.
  281. type AccountShippingCarrierRate struct {
  282. // Carrier: The carrier that is responsible for the shipping, such as
  283. // "UPS", "FedEx", or "USPS".
  284. Carrier string `json:"carrier,omitempty"`
  285. // CarrierService: The carrier service, such as "Ground" or "2Day".
  286. CarrierService string `json:"carrierService,omitempty"`
  287. // ModifierFlatRate: Additive shipping rate modifier.
  288. ModifierFlatRate *Price `json:"modifierFlatRate,omitempty"`
  289. // ModifierPercent: Multiplicative shipping rate modifier in percent.
  290. // Represented as a floating point number without the percentage
  291. // character.
  292. ModifierPercent string `json:"modifierPercent,omitempty"`
  293. // Name: The name of the carrier rate.
  294. Name string `json:"name,omitempty"`
  295. // SaleCountry: The sale country for which this carrier rate is valid,
  296. // represented as a CLDR territory code.
  297. SaleCountry string `json:"saleCountry,omitempty"`
  298. // ShippingOrigin: Shipping origin represented as a postal code.
  299. ShippingOrigin string `json:"shippingOrigin,omitempty"`
  300. // ForceSendFields is a list of field names (e.g. "Carrier") to
  301. // unconditionally include in API requests. By default, fields with
  302. // empty values are omitted from API requests. However, any non-pointer,
  303. // non-interface field appearing in ForceSendFields will be sent to the
  304. // server regardless of whether the field is empty or not. This may be
  305. // used to include empty fields in Patch requests.
  306. ForceSendFields []string `json:"-"`
  307. }
  308. func (s *AccountShippingCarrierRate) MarshalJSON() ([]byte, error) {
  309. type noMethod AccountShippingCarrierRate
  310. raw := noMethod(*s)
  311. return gensupport.MarshalJSON(raw, s.ForceSendFields)
  312. }
  313. type AccountShippingCondition struct {
  314. // DeliveryLocationGroup: Delivery location in terms of a location group
  315. // name. A location group with this name must be specified among
  316. // location groups.
  317. DeliveryLocationGroup string `json:"deliveryLocationGroup,omitempty"`
  318. // DeliveryLocationId: Delivery location in terms of a location ID. Can
  319. // be used to represent administrative areas, smaller country
  320. // subdivisions, or cities.
  321. DeliveryLocationId int64 `json:"deliveryLocationId,omitempty,string"`
  322. // DeliveryPostalCode: Delivery location in terms of a postal code.
  323. DeliveryPostalCode string `json:"deliveryPostalCode,omitempty"`
  324. // DeliveryPostalCodeRange: Delivery location in terms of a postal code
  325. // range.
  326. DeliveryPostalCodeRange *AccountShippingPostalCodeRange `json:"deliveryPostalCodeRange,omitempty"`
  327. // PriceMax: Maximum shipping price. Forms an interval between the
  328. // maximum of smaller prices (exclusive) and this price (inclusive).
  329. PriceMax *Price `json:"priceMax,omitempty"`
  330. // ShippingLabel: Shipping label of the product. The products with the
  331. // label are matched.
  332. ShippingLabel string `json:"shippingLabel,omitempty"`
  333. // WeightMax: Maximum shipping weight. Forms an interval between the
  334. // maximum of smaller weight (exclusive) and this weight (inclusive).
  335. WeightMax *Weight `json:"weightMax,omitempty"`
  336. // ForceSendFields is a list of field names (e.g.
  337. // "DeliveryLocationGroup") to unconditionally include in API requests.
  338. // By default, fields with empty values are omitted from API requests.
  339. // However, any non-pointer, non-interface field appearing in
  340. // ForceSendFields will be sent to the server regardless of whether the
  341. // field is empty or not. This may be used to include empty fields in
  342. // Patch requests.
  343. ForceSendFields []string `json:"-"`
  344. }
  345. func (s *AccountShippingCondition) MarshalJSON() ([]byte, error) {
  346. type noMethod AccountShippingCondition
  347. raw := noMethod(*s)
  348. return gensupport.MarshalJSON(raw, s.ForceSendFields)
  349. }
  350. // AccountShippingLocationGroup: A user-defined locations group in a
  351. // given country. All the locations of the group must be of the same
  352. // type.
  353. type AccountShippingLocationGroup struct {
  354. // Country: The CLDR territory code of the country in which this
  355. // location group is.
  356. Country string `json:"country,omitempty"`
  357. // LocationIds: A location ID (also called criteria ID) representing
  358. // administrative areas, smaller country subdivisions (counties), or
  359. // cities.
  360. LocationIds googleapi.Int64s `json:"locationIds,omitempty"`
  361. // Name: The name of the location group.
  362. Name string `json:"name,omitempty"`
  363. // PostalCodeRanges: A postal code range representing a city or a set of
  364. // cities.
  365. PostalCodeRanges []*AccountShippingPostalCodeRange `json:"postalCodeRanges,omitempty"`
  366. // PostalCodes: A postal code representing a city or a set of cities.
  367. //
  368. // - A single postal code (e.g., 12345)
  369. // - A postal code prefix followed by a star (e.g., 1234*)
  370. PostalCodes []string `json:"postalCodes,omitempty"`
  371. // ForceSendFields is a list of field names (e.g. "Country") to
  372. // unconditionally include in API requests. By default, fields with
  373. // empty values are omitted from API requests. However, any non-pointer,
  374. // non-interface field appearing in ForceSendFields will be sent to the
  375. // server regardless of whether the field is empty or not. This may be
  376. // used to include empty fields in Patch requests.
  377. ForceSendFields []string `json:"-"`
  378. }
  379. func (s *AccountShippingLocationGroup) MarshalJSON() ([]byte, error) {
  380. type noMethod AccountShippingLocationGroup
  381. raw := noMethod(*s)
  382. return gensupport.MarshalJSON(raw, s.ForceSendFields)
  383. }
  384. // AccountShippingPostalCodeRange: A postal code range, that can be
  385. // either:
  386. // - A range of postal codes (e.g., start=12340, end=12359)
  387. // - A range of postal codes prefixes (e.g., start=1234* end=1235*).
  388. // Prefixes must be of the same length (e.g., start=12* end=2* is
  389. // invalid).
  390. type AccountShippingPostalCodeRange struct {
  391. // End: The last (inclusive) postal code or prefix of the range.
  392. End string `json:"end,omitempty"`
  393. // Start: The first (inclusive) postal code or prefix of the range.
  394. Start string `json:"start,omitempty"`
  395. // ForceSendFields is a list of field names (e.g. "End") to
  396. // unconditionally include in API requests. By default, fields with
  397. // empty values are omitted from API requests. However, any non-pointer,
  398. // non-interface field appearing in ForceSendFields will be sent to the
  399. // server regardless of whether the field is empty or not. This may be
  400. // used to include empty fields in Patch requests.
  401. ForceSendFields []string `json:"-"`
  402. }
  403. func (s *AccountShippingPostalCodeRange) MarshalJSON() ([]byte, error) {
  404. type noMethod AccountShippingPostalCodeRange
  405. raw := noMethod(*s)
  406. return gensupport.MarshalJSON(raw, s.ForceSendFields)
  407. }
  408. // AccountShippingRateTable: A single or bi-dimensional table of
  409. // shipping rates. Each dimension is defined in terms of consecutive
  410. // price/weight ranges, delivery locations, or shipping labels.
  411. type AccountShippingRateTable struct {
  412. // Content: One-dimensional table cells define one condition along the
  413. // same dimension. Bi-dimensional table cells use two dimensions with
  414. // respectively M and N distinct values and must contain exactly M * N
  415. // cells with distinct conditions (for each possible value pairs).
  416. Content []*AccountShippingRateTableCell `json:"content,omitempty"`
  417. // Name: The name of the rate table.
  418. Name string `json:"name,omitempty"`
  419. // SaleCountry: The sale country for which this table is valid,
  420. // represented as a CLDR territory code.
  421. SaleCountry string `json:"saleCountry,omitempty"`
  422. // ForceSendFields is a list of field names (e.g. "Content") to
  423. // unconditionally include in API requests. By default, fields with
  424. // empty values are omitted from API requests. However, any non-pointer,
  425. // non-interface field appearing in ForceSendFields will be sent to the
  426. // server regardless of whether the field is empty or not. This may be
  427. // used to include empty fields in Patch requests.
  428. ForceSendFields []string `json:"-"`
  429. }
  430. func (s *AccountShippingRateTable) MarshalJSON() ([]byte, error) {
  431. type noMethod AccountShippingRateTable
  432. raw := noMethod(*s)
  433. return gensupport.MarshalJSON(raw, s.ForceSendFields)
  434. }
  435. type AccountShippingRateTableCell struct {
  436. // Condition: Conditions for which the cell is valid. All cells in a
  437. // table must use the same dimension or pair of dimensions among price,
  438. // weight, shipping label or delivery location. If no condition is
  439. // specified, the cell acts as a catch-all and matches all the elements
  440. // that are not matched by other cells in this dimension.
  441. Condition *AccountShippingCondition `json:"condition,omitempty"`
  442. // Rate: The rate applicable if the cell conditions are matched.
  443. Rate *Price `json:"rate,omitempty"`
  444. // ForceSendFields is a list of field names (e.g. "Condition") to
  445. // unconditionally include in API requests. By default, fields with
  446. // empty values are omitted from API requests. However, any non-pointer,
  447. // non-interface field appearing in ForceSendFields will be sent to the
  448. // server regardless of whether the field is empty or not. This may be
  449. // used to include empty fields in Patch requests.
  450. ForceSendFields []string `json:"-"`
  451. }
  452. func (s *AccountShippingRateTableCell) MarshalJSON() ([]byte, error) {
  453. type noMethod AccountShippingRateTableCell
  454. raw := noMethod(*s)
  455. return gensupport.MarshalJSON(raw, s.ForceSendFields)
  456. }
  457. // AccountShippingShippingService: Shipping services provided in a
  458. // country.
  459. type AccountShippingShippingService struct {
  460. // Active: Whether the shipping service is available.
  461. Active bool `json:"active,omitempty"`
  462. // CalculationMethod: Calculation method for the "simple" case that
  463. // needs no rules.
  464. CalculationMethod *AccountShippingShippingServiceCalculationMethod `json:"calculationMethod,omitempty"`
  465. // CostRuleTree: Decision tree for "complicated" shipping cost
  466. // calculation.
  467. CostRuleTree *AccountShippingShippingServiceCostRule `json:"costRuleTree,omitempty"`
  468. // Name: The name of this shipping service.
  469. Name string `json:"name,omitempty"`
  470. // SaleCountry: The CLDR territory code of the sale country for which
  471. // this service can be used.
  472. SaleCountry string `json:"saleCountry,omitempty"`
  473. // ForceSendFields is a list of field names (e.g. "Active") to
  474. // unconditionally include in API requests. By default, fields with
  475. // empty values are omitted from API requests. However, any non-pointer,
  476. // non-interface field appearing in ForceSendFields will be sent to the
  477. // server regardless of whether the field is empty or not. This may be
  478. // used to include empty fields in Patch requests.
  479. ForceSendFields []string `json:"-"`
  480. }
  481. func (s *AccountShippingShippingService) MarshalJSON() ([]byte, error) {
  482. type noMethod AccountShippingShippingService
  483. raw := noMethod(*s)
  484. return gensupport.MarshalJSON(raw, s.ForceSendFields)
  485. }
  486. // AccountShippingShippingServiceCalculationMethod: Shipping cost
  487. // calculation method. Exactly one of the field is set.
  488. type AccountShippingShippingServiceCalculationMethod struct {
  489. // CarrierRate: Name of the carrier rate to use for the calculation.
  490. CarrierRate string `json:"carrierRate,omitempty"`
  491. // Excluded: Delivery is excluded. Valid only within cost rules tree.
  492. Excluded bool `json:"excluded,omitempty"`
  493. // FlatRate: Fixed price shipping, represented as a floating point
  494. // number associated with a currency.
  495. FlatRate *Price `json:"flatRate,omitempty"`
  496. // PercentageRate: Percentage of the price, represented as a floating
  497. // point number without the percentage character.
  498. PercentageRate string `json:"percentageRate,omitempty"`
  499. // RateTable: Name of the rate table to use for the calculation.
  500. RateTable string `json:"rateTable,omitempty"`
  501. // ForceSendFields is a list of field names (e.g. "CarrierRate") to
  502. // unconditionally include in API requests. By default, fields with
  503. // empty values are omitted from API requests. However, any non-pointer,
  504. // non-interface field appearing in ForceSendFields will be sent to the
  505. // server regardless of whether the field is empty or not. This may be
  506. // used to include empty fields in Patch requests.
  507. ForceSendFields []string `json:"-"`
  508. }
  509. func (s *AccountShippingShippingServiceCalculationMethod) MarshalJSON() ([]byte, error) {
  510. type noMethod AccountShippingShippingServiceCalculationMethod
  511. raw := noMethod(*s)
  512. return gensupport.MarshalJSON(raw, s.ForceSendFields)
  513. }
  514. // AccountShippingShippingServiceCostRule: Building block of the cost
  515. // calculation decision tree.
  516. // - The tree root should have no condition and no calculation method.
  517. // - All the children must have a condition on the same dimension. The
  518. // first child matching a condition is entered, therefore, price and
  519. // weight conditions form contiguous intervals.
  520. // - The last child of an element must have no condition and matches all
  521. // elements not previously matched.
  522. // - Children and calculation method are mutually exclusive, and exactly
  523. // one of them must be defined; the root must only have children.
  524. type AccountShippingShippingServiceCostRule struct {
  525. // CalculationMethod: Final calculation method to be used only in leaf
  526. // nodes.
  527. CalculationMethod *AccountShippingShippingServiceCalculationMethod `json:"calculationMethod,omitempty"`
  528. // Children: Subsequent rules to be applied, only for inner nodes. The
  529. // last child must not specify a condition and acts as a catch-all.
  530. Children []*AccountShippingShippingServiceCostRule `json:"children,omitempty"`
  531. // Condition: Condition for this rule to be applicable. If no condition
  532. // is specified, the rule acts as a catch-all.
  533. Condition *AccountShippingCondition `json:"condition,omitempty"`
  534. // ForceSendFields is a list of field names (e.g. "CalculationMethod")
  535. // to unconditionally include in API requests. By default, fields with
  536. // empty values are omitted from API requests. However, any non-pointer,
  537. // non-interface field appearing in ForceSendFields will be sent to the
  538. // server regardless of whether the field is empty or not. This may be
  539. // used to include empty fields in Patch requests.
  540. ForceSendFields []string `json:"-"`
  541. }
  542. func (s *AccountShippingShippingServiceCostRule) MarshalJSON() ([]byte, error) {
  543. type noMethod AccountShippingShippingServiceCostRule
  544. raw := noMethod(*s)
  545. return gensupport.MarshalJSON(raw, s.ForceSendFields)
  546. }
  547. // AccountStatus: The status of an account, i.e., information about its
  548. // products, which is computed offline and not returned immediately at
  549. // insertion time.
  550. type AccountStatus struct {
  551. // AccountId: The ID of the account for which the status is reported.
  552. AccountId string `json:"accountId,omitempty"`
  553. // DataQualityIssues: A list of data quality issues.
  554. DataQualityIssues []*AccountStatusDataQualityIssue `json:"dataQualityIssues,omitempty"`
  555. // Kind: Identifies what kind of resource this is. Value: the fixed
  556. // string "content#accountStatus".
  557. Kind string `json:"kind,omitempty"`
  558. // ServerResponse contains the HTTP response code and headers from the
  559. // server.
  560. googleapi.ServerResponse `json:"-"`
  561. // ForceSendFields is a list of field names (e.g. "AccountId") to
  562. // unconditionally include in API requests. By default, fields with
  563. // empty values are omitted from API requests. However, any non-pointer,
  564. // non-interface field appearing in ForceSendFields will be sent to the
  565. // server regardless of whether the field is empty or not. This may be
  566. // used to include empty fields in Patch requests.
  567. ForceSendFields []string `json:"-"`
  568. }
  569. func (s *AccountStatus) MarshalJSON() ([]byte, error) {
  570. type noMethod AccountStatus
  571. raw := noMethod(*s)
  572. return gensupport.MarshalJSON(raw, s.ForceSendFields)
  573. }
  574. type AccountStatusDataQualityIssue struct {
  575. // Country: Country for which this issue is reported.
  576. Country string `json:"country,omitempty"`
  577. // DisplayedValue: Actual value displayed on the landing page.
  578. DisplayedValue string `json:"displayedValue,omitempty"`
  579. // ExampleItems: Example items featuring the issue.
  580. ExampleItems []*AccountStatusExampleItem `json:"exampleItems,omitempty"`
  581. // Id: Issue identifier.
  582. Id string `json:"id,omitempty"`
  583. // LastChecked: Last time the account was checked for this issue.
  584. LastChecked string `json:"lastChecked,omitempty"`
  585. // NumItems: Number of items in the account found to have the said
  586. // issue.
  587. NumItems int64 `json:"numItems,omitempty"`
  588. // Severity: Severity of the problem.
  589. Severity string `json:"severity,omitempty"`
  590. // SubmittedValue: Submitted value that causes the issue.
  591. SubmittedValue string `json:"submittedValue,omitempty"`
  592. // ForceSendFields is a list of field names (e.g. "Country") to
  593. // unconditionally include in API requests. By default, fields with
  594. // empty values are omitted from API requests. However, any non-pointer,
  595. // non-interface field appearing in ForceSendFields will be sent to the
  596. // server regardless of whether the field is empty or not. This may be
  597. // used to include empty fields in Patch requests.
  598. ForceSendFields []string `json:"-"`
  599. }
  600. func (s *AccountStatusDataQualityIssue) MarshalJSON() ([]byte, error) {
  601. type noMethod AccountStatusDataQualityIssue
  602. raw := noMethod(*s)
  603. return gensupport.MarshalJSON(raw, s.ForceSendFields)
  604. }
  605. // AccountStatusExampleItem: An example of an item that has poor data
  606. // quality. An item value on the landing page differs from what is
  607. // submitted, or conflicts with a policy.
  608. type AccountStatusExampleItem struct {
  609. // ItemId: Unique item ID as specified in the uploaded product data.
  610. ItemId string `json:"itemId,omitempty"`
  611. // Link: Landing page of the item.
  612. Link string `json:"link,omitempty"`
  613. // SubmittedValue: The item value that was submitted.
  614. SubmittedValue string `json:"submittedValue,omitempty"`
  615. // Title: Title of the item.
  616. Title string `json:"title,omitempty"`
  617. // ValueOnLandingPage: The actual value on the landing page.
  618. ValueOnLandingPage string `json:"valueOnLandingPage,omitempty"`
  619. // ForceSendFields is a list of field names (e.g. "ItemId") to
  620. // unconditionally include in API requests. By default, fields with
  621. // empty values are omitted from API requests. However, any non-pointer,
  622. // non-interface field appearing in ForceSendFields will be sent to the
  623. // server regardless of whether the field is empty or not. This may be
  624. // used to include empty fields in Patch requests.
  625. ForceSendFields []string `json:"-"`
  626. }
  627. func (s *AccountStatusExampleItem) MarshalJSON() ([]byte, error) {
  628. type noMethod AccountStatusExampleItem
  629. raw := noMethod(*s)
  630. return gensupport.MarshalJSON(raw, s.ForceSendFields)
  631. }
  632. // AccountTax: The tax settings of a merchant account.
  633. type AccountTax struct {
  634. // AccountId: The ID of the account to which these account tax settings
  635. // belong.
  636. AccountId uint64 `json:"accountId,omitempty,string"`
  637. // Kind: Identifies what kind of resource this is. Value: the fixed
  638. // string "content#accountTax".
  639. Kind string `json:"kind,omitempty"`
  640. // Rules: Tax rules. Updating the tax rules will enable US taxes (not
  641. // reversible). Defining no rules is equivalent to not charging tax at
  642. // all.
  643. Rules []*AccountTaxTaxRule `json:"rules,omitempty"`
  644. // ServerResponse contains the HTTP response code and headers from the
  645. // server.
  646. googleapi.ServerResponse `json:"-"`
  647. // ForceSendFields is a list of field names (e.g. "AccountId") to
  648. // unconditionally include in API requests. By default, fields with
  649. // empty values are omitted from API requests. However, any non-pointer,
  650. // non-interface field appearing in ForceSendFields will be sent to the
  651. // server regardless of whether the field is empty or not. This may be
  652. // used to include empty fields in Patch requests.
  653. ForceSendFields []string `json:"-"`
  654. }
  655. func (s *AccountTax) MarshalJSON() ([]byte, error) {
  656. type noMethod AccountTax
  657. raw := noMethod(*s)
  658. return gensupport.MarshalJSON(raw, s.ForceSendFields)
  659. }
  660. // AccountTaxTaxRule: Tax calculation rule to apply in a state or
  661. // province (USA only).
  662. type AccountTaxTaxRule struct {
  663. // Country: Country code in which tax is applicable.
  664. Country string `json:"country,omitempty"`
  665. // LocationId: State (or province) is which the tax is applicable,
  666. // described by its location id (also called criteria id).
  667. LocationId uint64 `json:"locationId,omitempty,string"`
  668. // RatePercent: Explicit tax rate in percent, represented as a floating
  669. // point number without the percentage character. Must not be negative.
  670. RatePercent string `json:"ratePercent,omitempty"`
  671. // ShippingTaxed: If true, shipping charges are also taxed.
  672. ShippingTaxed bool `json:"shippingTaxed,omitempty"`
  673. // UseGlobalRate: Whether the tax rate is taken from a global tax table
  674. // or specified explicitly.
  675. UseGlobalRate bool `json:"useGlobalRate,omitempty"`
  676. // ForceSendFields is a list of field names (e.g. "Country") to
  677. // unconditionally include in API requests. By default, fields with
  678. // empty values are omitted from API requests. However, any non-pointer,
  679. // non-interface field appearing in ForceSendFields will be sent to the
  680. // server regardless of whether the field is empty or not. This may be
  681. // used to include empty fields in Patch requests.
  682. ForceSendFields []string `json:"-"`
  683. }
  684. func (s *AccountTaxTaxRule) MarshalJSON() ([]byte, error) {
  685. type noMethod AccountTaxTaxRule
  686. raw := noMethod(*s)
  687. return gensupport.MarshalJSON(raw, s.ForceSendFields)
  688. }
  689. type AccountUser struct {
  690. // Admin: Whether user is an admin.
  691. Admin *bool `json:"admin,omitempty"`
  692. // EmailAddress: User's email address.
  693. EmailAddress string `json:"emailAddress,omitempty"`
  694. // ForceSendFields is a list of field names (e.g. "Admin") to
  695. // unconditionally include in API requests. By default, fields with
  696. // empty values are omitted from API requests. However, any non-pointer,
  697. // non-interface field appearing in ForceSendFields will be sent to the
  698. // server regardless of whether the field is empty or not. This may be
  699. // used to include empty fields in Patch requests.
  700. ForceSendFields []string `json:"-"`
  701. }
  702. func (s *AccountUser) MarshalJSON() ([]byte, error) {
  703. type noMethod AccountUser
  704. raw := noMethod(*s)
  705. return gensupport.MarshalJSON(raw, s.ForceSendFields)
  706. }
  707. type AccountsAuthInfoResponse struct {
  708. // AccountIdentifiers: The account identifiers corresponding to the
  709. // authenticated user.
  710. // - For an individual account: only the merchant ID is defined
  711. // - For an aggregator: only the aggregator ID is defined
  712. // - For a subaccount of an MCA: both the merchant ID and the aggregator
  713. // ID are defined.
  714. AccountIdentifiers []*AccountIdentifier `json:"accountIdentifiers,omitempty"`
  715. // Kind: Identifies what kind of resource this is. Value: the fixed
  716. // string "content#accountsAuthInfoResponse".
  717. Kind string `json:"kind,omitempty"`
  718. // ServerResponse contains the HTTP response code and headers from the
  719. // server.
  720. googleapi.ServerResponse `json:"-"`
  721. // ForceSendFields is a list of field names (e.g. "AccountIdentifiers")
  722. // to unconditionally include in API requests. By default, fields with
  723. // empty values are omitted from API requests. However, any non-pointer,
  724. // non-interface field appearing in ForceSendFields will be sent to the
  725. // server regardless of whether the field is empty or not. This may be
  726. // used to include empty fields in Patch requests.
  727. ForceSendFields []string `json:"-"`
  728. }
  729. func (s *AccountsAuthInfoResponse) MarshalJSON() ([]byte, error) {
  730. type noMethod AccountsAuthInfoResponse
  731. raw := noMethod(*s)
  732. return gensupport.MarshalJSON(raw, s.ForceSendFields)
  733. }
  734. type AccountsCustomBatchRequest struct {
  735. // Entries: The request entries to be processed in the batch.
  736. Entries []*AccountsCustomBatchRequestEntry `json:"entries,omitempty"`
  737. // ForceSendFields is a list of field names (e.g. "Entries") to
  738. // unconditionally include in API requests. By default, fields with
  739. // empty values are omitted from API requests. However, any non-pointer,
  740. // non-interface field appearing in ForceSendFields will be sent to the
  741. // server regardless of whether the field is empty or not. This may be
  742. // used to include empty fields in Patch requests.
  743. ForceSendFields []string `json:"-"`
  744. }
  745. func (s *AccountsCustomBatchRequest) MarshalJSON() ([]byte, error) {
  746. type noMethod AccountsCustomBatchRequest
  747. raw := noMethod(*s)
  748. return gensupport.MarshalJSON(raw, s.ForceSendFields)
  749. }
  750. // AccountsCustomBatchRequestEntry: A batch entry encoding a single
  751. // non-batch accounts request.
  752. type AccountsCustomBatchRequestEntry struct {
  753. // Account: The account to create or update. Only defined if the method
  754. // is insert or update.
  755. Account *Account `json:"account,omitempty"`
  756. // AccountId: The ID of the account to get or delete. Only defined if
  757. // the method is get or delete.
  758. AccountId uint64 `json:"accountId,omitempty,string"`
  759. // BatchId: An entry ID, unique within the batch request.
  760. BatchId int64 `json:"batchId,omitempty"`
  761. // MerchantId: The ID of the managing account.
  762. MerchantId uint64 `json:"merchantId,omitempty,string"`
  763. Method string `json:"method,omitempty"`
  764. // ForceSendFields is a list of field names (e.g. "Account") to
  765. // unconditionally include in API requests. By default, fields with
  766. // empty values are omitted from API requests. However, any non-pointer,
  767. // non-interface field appearing in ForceSendFields will be sent to the
  768. // server regardless of whether the field is empty or not. This may be
  769. // used to include empty fields in Patch requests.
  770. ForceSendFields []string `json:"-"`
  771. }
  772. func (s *AccountsCustomBatchRequestEntry) MarshalJSON() ([]byte, error) {
  773. type noMethod AccountsCustomBatchRequestEntry
  774. raw := noMethod(*s)
  775. return gensupport.MarshalJSON(raw, s.ForceSendFields)
  776. }
  777. type AccountsCustomBatchResponse struct {
  778. // Entries: The result of the execution of the batch requests.
  779. Entries []*AccountsCustomBatchResponseEntry `json:"entries,omitempty"`
  780. // Kind: Identifies what kind of resource this is. Value: the fixed
  781. // string "content#accountsCustomBatchResponse".
  782. Kind string `json:"kind,omitempty"`
  783. // ServerResponse contains the HTTP response code and headers from the
  784. // server.
  785. googleapi.ServerResponse `json:"-"`
  786. // ForceSendFields is a list of field names (e.g. "Entries") to
  787. // unconditionally include in API requests. By default, fields with
  788. // empty values are omitted from API requests. However, any non-pointer,
  789. // non-interface field appearing in ForceSendFields will be sent to the
  790. // server regardless of whether the field is empty or not. This may be
  791. // used to include empty fields in Patch requests.
  792. ForceSendFields []string `json:"-"`
  793. }
  794. func (s *AccountsCustomBatchResponse) MarshalJSON() ([]byte, error) {
  795. type noMethod AccountsCustomBatchResponse
  796. raw := noMethod(*s)
  797. return gensupport.MarshalJSON(raw, s.ForceSendFields)
  798. }
  799. // AccountsCustomBatchResponseEntry: A batch entry encoding a single
  800. // non-batch accounts response.
  801. type AccountsCustomBatchResponseEntry struct {
  802. // Account: The retrieved, created, or updated account. Not defined if
  803. // the method was delete.
  804. Account *Account `json:"account,omitempty"`
  805. // BatchId: The ID of the request entry this entry responds to.
  806. BatchId int64 `json:"batchId,omitempty"`
  807. // Errors: A list of errors defined if and only if the request failed.
  808. Errors *Errors `json:"errors,omitempty"`
  809. // Kind: Identifies what kind of resource this is. Value: the fixed
  810. // string "content#accountsCustomBatchResponseEntry".
  811. Kind string `json:"kind,omitempty"`
  812. // ForceSendFields is a list of field names (e.g. "Account") to
  813. // unconditionally include in API requests. By default, fields with
  814. // empty values are omitted from API requests. However, any non-pointer,
  815. // non-interface field appearing in ForceSendFields will be sent to the
  816. // server regardless of whether the field is empty or not. This may be
  817. // used to include empty fields in Patch requests.
  818. ForceSendFields []string `json:"-"`
  819. }
  820. func (s *AccountsCustomBatchResponseEntry) MarshalJSON() ([]byte, error) {
  821. type noMethod AccountsCustomBatchResponseEntry
  822. raw := noMethod(*s)
  823. return gensupport.MarshalJSON(raw, s.ForceSendFields)
  824. }
  825. type AccountsListResponse struct {
  826. // Kind: Identifies what kind of resource this is. Value: the fixed
  827. // string "content#accountsListResponse".
  828. Kind string `json:"kind,omitempty"`
  829. // NextPageToken: The token for the retrieval of the next page of
  830. // accounts.
  831. NextPageToken string `json:"nextPageToken,omitempty"`
  832. Resources []*Account `json:"resources,omitempty"`
  833. // ServerResponse contains the HTTP response code and headers from the
  834. // server.
  835. googleapi.ServerResponse `json:"-"`
  836. // ForceSendFields is a list of field names (e.g. "Kind") to
  837. // unconditionally include in API requests. By default, fields with
  838. // empty values are omitted from API requests. However, any non-pointer,
  839. // non-interface field appearing in ForceSendFields will be sent to the
  840. // server regardless of whether the field is empty or not. This may be
  841. // used to include empty fields in Patch requests.
  842. ForceSendFields []string `json:"-"`
  843. }
  844. func (s *AccountsListResponse) MarshalJSON() ([]byte, error) {
  845. type noMethod AccountsListResponse
  846. raw := noMethod(*s)
  847. return gensupport.MarshalJSON(raw, s.ForceSendFields)
  848. }
  849. type AccountshippingCustomBatchRequest struct {
  850. // Entries: The request entries to be processed in the batch.
  851. Entries []*AccountshippingCustomBatchRequestEntry `json:"entries,omitempty"`
  852. // ForceSendFields is a list of field names (e.g. "Entries") to
  853. // unconditionally include in API requests. By default, fields with
  854. // empty values are omitted from API requests. However, any non-pointer,
  855. // non-interface field appearing in ForceSendFields will be sent to the
  856. // server regardless of whether the field is empty or not. This may be
  857. // used to include empty fields in Patch requests.
  858. ForceSendFields []string `json:"-"`
  859. }
  860. func (s *AccountshippingCustomBatchRequest) MarshalJSON() ([]byte, error) {
  861. type noMethod AccountshippingCustomBatchRequest
  862. raw := noMethod(*s)
  863. return gensupport.MarshalJSON(raw, s.ForceSendFields)
  864. }
  865. // AccountshippingCustomBatchRequestEntry: A batch entry encoding a
  866. // single non-batch accountshipping request.
  867. type AccountshippingCustomBatchRequestEntry struct {
  868. // AccountId: The ID of the account for which to get/update account
  869. // shipping settings.
  870. AccountId uint64 `json:"accountId,omitempty,string"`
  871. // AccountShipping: The account shipping settings to update. Only
  872. // defined if the method is update.
  873. AccountShipping *AccountShipping `json:"accountShipping,omitempty"`
  874. // BatchId: An entry ID, unique within the batch request.
  875. BatchId int64 `json:"batchId,omitempty"`
  876. // MerchantId: The ID of the managing account.
  877. MerchantId uint64 `json:"merchantId,omitempty,string"`
  878. Method string `json:"method,omitempty"`
  879. // ForceSendFields is a list of field names (e.g. "AccountId") to
  880. // unconditionally include in API requests. By default, fields with
  881. // empty values are omitted from API requests. However, any non-pointer,
  882. // non-interface field appearing in ForceSendFields will be sent to the
  883. // server regardless of whether the field is empty or not. This may be
  884. // used to include empty fields in Patch requests.
  885. ForceSendFields []string `json:"-"`
  886. }
  887. func (s *AccountshippingCustomBatchRequestEntry) MarshalJSON() ([]byte, error) {
  888. type noMethod AccountshippingCustomBatchRequestEntry
  889. raw := noMethod(*s)
  890. return gensupport.MarshalJSON(raw, s.ForceSendFields)
  891. }
  892. type AccountshippingCustomBatchResponse struct {
  893. // Entries: The result of the execution of the batch requests.
  894. Entries []*AccountshippingCustomBatchResponseEntry `json:"entries,omitempty"`
  895. // Kind: Identifies what kind of resource this is. Value: the fixed
  896. // string "content#accountshippingCustomBatchResponse".
  897. Kind string `json:"kind,omitempty"`
  898. // ServerResponse contains the HTTP response code and headers from the
  899. // server.
  900. googleapi.ServerResponse `json:"-"`
  901. // ForceSendFields is a list of field names (e.g. "Entries") to
  902. // unconditionally include in API requests. By default, fields with
  903. // empty values are omitted from API requests. However, any non-pointer,
  904. // non-interface field appearing in ForceSendFields will be sent to the
  905. // server regardless of whether the field is empty or not. This may be
  906. // used to include empty fields in Patch requests.
  907. ForceSendFields []string `json:"-"`
  908. }
  909. func (s *AccountshippingCustomBatchResponse) MarshalJSON() ([]byte, error) {
  910. type noMethod AccountshippingCustomBatchResponse
  911. raw := noMethod(*s)
  912. return gensupport.MarshalJSON(raw, s.ForceSendFields)
  913. }
  914. // AccountshippingCustomBatchResponseEntry: A batch entry encoding a
  915. // single non-batch accountshipping response.
  916. type AccountshippingCustomBatchResponseEntry struct {
  917. // AccountShipping: The retrieved or updated account shipping settings.
  918. AccountShipping *AccountShipping `json:"accountShipping,omitempty"`
  919. // BatchId: The ID of the request entry this entry responds to.
  920. BatchId int64 `json:"batchId,omitempty"`
  921. // Errors: A list of errors defined if and only if the request failed.
  922. Errors *Errors `json:"errors,omitempty"`
  923. // Kind: Identifies what kind of resource this is. Value: the fixed
  924. // string "content#accountshippingCustomBatchResponseEntry".
  925. Kind string `json:"kind,omitempty"`
  926. // ForceSendFields is a list of field names (e.g. "AccountShipping") to
  927. // unconditionally include in API requests. By default, fields with
  928. // empty values are omitted from API requests. However, any non-pointer,
  929. // non-interface field appearing in ForceSendFields will be sent to the
  930. // server regardless of whether the field is empty or not. This may be
  931. // used to include empty fields in Patch requests.
  932. ForceSendFields []string `json:"-"`
  933. }
  934. func (s *AccountshippingCustomBatchResponseEntry) MarshalJSON() ([]byte, error) {
  935. type noMethod AccountshippingCustomBatchResponseEntry
  936. raw := noMethod(*s)
  937. return gensupport.MarshalJSON(raw, s.ForceSendFields)
  938. }
  939. type AccountshippingListResponse struct {
  940. // Kind: Identifies what kind of resource this is. Value: the fixed
  941. // string "content#accountshippingListResponse".
  942. Kind string `json:"kind,omitempty"`
  943. // NextPageToken: The token for the retrieval of the next page of
  944. // account shipping settings.
  945. NextPageToken string `json:"nextPageToken,omitempty"`
  946. Resources []*AccountShipping `json:"resources,omitempty"`
  947. // ServerResponse contains the HTTP response code and headers from the
  948. // server.
  949. googleapi.ServerResponse `json:"-"`
  950. // ForceSendFields is a list of field names (e.g. "Kind") to
  951. // unconditionally include in API requests. By default, fields with
  952. // empty values are omitted from API requests. However, any non-pointer,
  953. // non-interface field appearing in ForceSendFields will be sent to the
  954. // server regardless of whether the field is empty or not. This may be
  955. // used to include empty fields in Patch requests.
  956. ForceSendFields []string `json:"-"`
  957. }
  958. func (s *AccountshippingListResponse) MarshalJSON() ([]byte, error) {
  959. type noMethod AccountshippingListResponse
  960. raw := noMethod(*s)
  961. return gensupport.MarshalJSON(raw, s.ForceSendFields)
  962. }
  963. type AccountstatusesCustomBatchRequest struct {
  964. // Entries: The request entries to be processed in the batch.
  965. Entries []*AccountstatusesCustomBatchRequestEntry `json:"entries,omitempty"`
  966. // ForceSendFields is a list of field names (e.g. "Entries") to
  967. // unconditionally include in API requests. By default, fields with
  968. // empty values are omitted from API requests. However, any non-pointer,
  969. // non-interface field appearing in ForceSendFields will be sent to the
  970. // server regardless of whether the field is empty or not. This may be
  971. // used to include empty fields in Patch requests.
  972. ForceSendFields []string `json:"-"`
  973. }
  974. func (s *AccountstatusesCustomBatchRequest) MarshalJSON() ([]byte, error) {
  975. type noMethod AccountstatusesCustomBatchRequest
  976. raw := noMethod(*s)
  977. return gensupport.MarshalJSON(raw, s.ForceSendFields)
  978. }
  979. // AccountstatusesCustomBatchRequestEntry: A batch entry encoding a
  980. // single non-batch accountstatuses request.
  981. type AccountstatusesCustomBatchRequestEntry struct {
  982. // AccountId: The ID of the (sub-)account whose status to get.
  983. AccountId uint64 `json:"accountId,omitempty,string"`
  984. // BatchId: An entry ID, unique within the batch request.
  985. BatchId int64 `json:"batchId,omitempty"`
  986. // MerchantId: The ID of the managing account.
  987. MerchantId uint64 `json:"merchantId,omitempty,string"`
  988. // Method: The method (get).
  989. Method string `json:"method,omitempty"`
  990. // ForceSendFields is a list of field names (e.g. "AccountId") to
  991. // unconditionally include in API requests. By default, fields with
  992. // empty values are omitted from API requests. However, any non-pointer,
  993. // non-interface field appearing in ForceSendFields will be sent to the
  994. // server regardless of whether the field is empty or not. This may be
  995. // used to include empty fields in Patch requests.
  996. ForceSendFields []string `json:"-"`
  997. }
  998. func (s *AccountstatusesCustomBatchRequestEntry) MarshalJSON() ([]byte, error) {
  999. type noMethod AccountstatusesCustomBatchRequestEntry
  1000. raw := noMethod(*s)
  1001. return gensupport.MarshalJSON(raw, s.ForceSendFields)
  1002. }
  1003. type AccountstatusesCustomBatchResponse struct {
  1004. // Entries: The result of the execution of the batch requests.
  1005. Entries []*AccountstatusesCustomBatchResponseEntry `json:"entries,omitempty"`
  1006. // Kind: Identifies what kind of resource this is. Value: the fixed
  1007. // string "content#accountstatusesCustomBatchResponse".
  1008. Kind string `json:"kind,omitempty"`
  1009. // ServerResponse contains the HTTP response code and headers from the
  1010. // server.
  1011. googleapi.ServerResponse `json:"-"`
  1012. // ForceSendFields is a list of field names (e.g. "Entries") to
  1013. // unconditionally include in API requests. By default, fields with
  1014. // empty values are omitted from API requests. However, any non-pointer,
  1015. // non-interface field appearing in ForceSendFields will be sent to the
  1016. // server regardless of whether the field is empty or not. This may be
  1017. // used to include empty fields in Patch requests.
  1018. ForceSendFields []string `json:"-"`
  1019. }
  1020. func (s *AccountstatusesCustomBatchResponse) MarshalJSON() ([]byte, error) {
  1021. type noMethod AccountstatusesCustomBatchResponse
  1022. raw := noMethod(*s)
  1023. return gensupport.MarshalJSON(raw, s.ForceSendFields)
  1024. }
  1025. // AccountstatusesCustomBatchResponseEntry: A batch entry encoding a
  1026. // single non-batch accountstatuses response.
  1027. type AccountstatusesCustomBatchResponseEntry struct {
  1028. // AccountStatus: The requested account status. Defined if and only if
  1029. // the request was successful.
  1030. AccountStatus *AccountStatus `json:"accountStatus,omitempty"`
  1031. // BatchId: The ID of the request entry this entry responds to.
  1032. BatchId int64 `json:"batchId,omitempty"`
  1033. // Errors: A list of errors defined if and only if the request failed.
  1034. Errors *Errors `json:"errors,omitempty"`
  1035. // ForceSendFields is a list of field names (e.g. "AccountStatus") to
  1036. // unconditionally include in API requests. By default, fields with
  1037. // empty values are omitted from API requests. However, any non-pointer,
  1038. // non-interface field appearing in ForceSendFields will be sent to the
  1039. // server regardless of whether the field is empty or not. This may be
  1040. // used to include empty fields in Patch requests.
  1041. ForceSendFields []string `json:"-"`
  1042. }
  1043. func (s *AccountstatusesCustomBatchResponseEntry) MarshalJSON() ([]byte, error) {
  1044. type noMethod AccountstatusesCustomBatchResponseEntry
  1045. raw := noMethod(*s)
  1046. return gensupport.MarshalJSON(raw, s.ForceSendFields)
  1047. }
  1048. type AccountstatusesListResponse struct {
  1049. // Kind: Identifies what kind of resource this is. Value: the fixed
  1050. // string "content#accountstatusesListResponse".
  1051. Kind string `json:"kind,omitempty"`
  1052. // NextPageToken: The token for the retrieval of the next page of
  1053. // account statuses.
  1054. NextPageToken string `json:"nextPageToken,omitempty"`
  1055. Resources []*AccountStatus `json:"resources,omitempty"`
  1056. // ServerResponse contains the HTTP response code and headers from the
  1057. // server.
  1058. googleapi.ServerResponse `json:"-"`
  1059. // ForceSendFields is a list of field names (e.g. "Kind") to
  1060. // unconditionally include in API requests. By default, fields with
  1061. // empty values are omitted from API requests. However, any non-pointer,
  1062. // non-interface field appearing in ForceSendFields will be sent to the
  1063. // server regardless of whether the field is empty or not. This may be
  1064. // used to include empty fields in Patch requests.
  1065. ForceSendFields []string `json:"-"`
  1066. }
  1067. func (s *AccountstatusesListResponse) MarshalJSON() ([]byte, error) {
  1068. type noMethod AccountstatusesListResponse
  1069. raw := noMethod(*s)
  1070. return gensupport.MarshalJSON(raw, s.ForceSendFields)
  1071. }
  1072. type AccounttaxCustomBatchRequest struct {
  1073. // Entries: The request entries to be processed in the batch.
  1074. Entries []*AccounttaxCustomBatchRequestEntry `json:"entries,omitempty"`
  1075. // ForceSendFields is a list of field names (e.g. "Entries") to
  1076. // unconditionally include in API requests. By default, fields with
  1077. // empty values are omitted from API requests. However, any non-pointer,
  1078. // non-interface field appearing in ForceSendFields will be sent to the
  1079. // server regardless of whether the field is empty or not. This may be
  1080. // used to include empty fields in Patch requests.
  1081. ForceSendFields []string `json:"-"`
  1082. }
  1083. func (s *AccounttaxCustomBatchRequest) MarshalJSON() ([]byte, error) {
  1084. type noMethod AccounttaxCustomBatchRequest
  1085. raw := noMethod(*s)
  1086. return gensupport.MarshalJSON(raw, s.ForceSendFields)
  1087. }
  1088. // AccounttaxCustomBatchRequestEntry: A batch entry encoding a single
  1089. // non-batch accounttax request.
  1090. type AccounttaxCustomBatchRequestEntry struct {
  1091. // AccountId: The ID of the account for which to get/update account tax
  1092. // settings.
  1093. AccountId uint64 `json:"accountId,omitempty,string"`
  1094. // AccountTax: The account tax settings to update. Only defined if the
  1095. // method is update.
  1096. AccountTax *AccountTax `json:"accountTax,omitempty"`
  1097. // BatchId: An entry ID, unique within the batch request.
  1098. BatchId int64 `json:"batchId,omitempty"`
  1099. // MerchantId: The ID of the managing account.
  1100. MerchantId uint64 `json:"merchantId,omitempty,string"`
  1101. Method string `json:"method,omitempty"`
  1102. // ForceSendFields is a list of field names (e.g. "AccountId") to
  1103. // unconditionally include in API requests. By default, fields with
  1104. // empty values are omitted from API requests. However, any non-pointer,
  1105. // non-interface field appearing in ForceSendFields will be sent to the
  1106. // server regardless of whether the field is empty or not. This may be
  1107. // used to include empty fields in Patch requests.
  1108. ForceSendFields []string `json:"-"`
  1109. }
  1110. func (s *AccounttaxCustomBatchRequestEntry) MarshalJSON() ([]byte, error) {
  1111. type noMethod AccounttaxCustomBatchRequestEntry
  1112. raw := noMethod(*s)
  1113. return gensupport.MarshalJSON(raw, s.ForceSendFields)
  1114. }
  1115. type AccounttaxCustomBatchResponse struct {
  1116. // Entries: The result of the execution of the batch requests.
  1117. Entries []*AccounttaxCustomBatchResponseEntry `json:"entries,omitempty"`
  1118. // Kind: Identifies what kind of resource this is. Value: the fixed
  1119. // string "content#accounttaxCustomBatchResponse".
  1120. Kind string `json:"kind,omitempty"`
  1121. // ServerResponse contains the HTTP response code and headers from the
  1122. // server.
  1123. googleapi.ServerResponse `json:"-"`
  1124. // ForceSendFields is a list of field names (e.g. "Entries") to
  1125. // unconditionally include in API requests. By default, fields with
  1126. // empty values are omitted from API requests. However, any non-pointer,
  1127. // non-interface field appearing in ForceSendFields will be sent to the
  1128. // server regardless of whether the field is empty or not. This may be
  1129. // used to include empty fields in Patch requests.
  1130. ForceSendFields []string `json:"-"`
  1131. }
  1132. func (s *AccounttaxCustomBatchResponse) MarshalJSON() ([]byte, error) {
  1133. type noMethod AccounttaxCustomBatchResponse
  1134. raw := noMethod(*s)
  1135. return gensupport.MarshalJSON(raw, s.ForceSendFields)
  1136. }
  1137. // AccounttaxCustomBatchResponseEntry: A batch entry encoding a single
  1138. // non-batch accounttax response.
  1139. type AccounttaxCustomBatchResponseEntry struct {
  1140. // AccountTax: The retrieved or updated account tax settings.
  1141. AccountTax *AccountTax `json:"accountTax,omitempty"`
  1142. // BatchId: The ID of the request entry this entry responds to.
  1143. BatchId int64 `json:"batchId,omitempty"`
  1144. // Errors: A list of errors defined if and only if the request failed.
  1145. Errors *Errors `json:"errors,omitempty"`
  1146. // Kind: Identifies what kind of resource this is. Value: the fixed
  1147. // string "content#accounttaxCustomBatchResponseEntry".
  1148. Kind string `json:"kind,omitempty"`
  1149. // ForceSendFields is a list of field names (e.g. "AccountTax") to
  1150. // unconditionally include in API requests. By default, fields with
  1151. // empty values are omitted from API requests. However, any non-pointer,
  1152. // non-interface field appearing in ForceSendFields will be sent to the
  1153. // server regardless of whether the field is empty or not. This may be
  1154. // used to include empty fields in Patch requests.
  1155. ForceSendFields []string `json:"-"`
  1156. }
  1157. func (s *AccounttaxCustomBatchResponseEntry) MarshalJSON() ([]byte, error) {
  1158. type noMethod AccounttaxCustomBatchResponseEntry
  1159. raw := noMethod(*s)
  1160. return gensupport.MarshalJSON(raw, s.ForceSendFields)
  1161. }
  1162. type AccounttaxListResponse struct {
  1163. // Kind: Identifies what kind of resource this is. Value: the fixed
  1164. // string "content#accounttaxListResponse".
  1165. Kind string `json:"kind,omitempty"`
  1166. // NextPageToken: The token for the retrieval of the next page of
  1167. // account tax settings.
  1168. NextPageToken string `json:"nextPageToken,omitempty"`
  1169. Resources []*AccountTax `json:"resources,omitempty"`
  1170. // ServerResponse contains the HTTP response code and headers from the
  1171. // server.
  1172. googleapi.ServerResponse `json:"-"`
  1173. // ForceSendFields is a list of field names (e.g. "Kind") to
  1174. // unconditionally include in API requests. By default, fields with
  1175. // empty values are omitted from API requests. However, any non-pointer,
  1176. // non-interface field appearing in ForceSendFields will be sent to the
  1177. // server regardless of whether the field is empty or not. This may be
  1178. // used to include empty fields in Patch requests.
  1179. ForceSendFields []string `json:"-"`
  1180. }
  1181. func (s *AccounttaxListResponse) MarshalJSON() ([]byte, error) {
  1182. type noMethod AccounttaxListResponse
  1183. raw := noMethod(*s)
  1184. return gensupport.MarshalJSON(raw, s.ForceSendFields)
  1185. }
  1186. // Datafeed: Datafeed data.
  1187. type Datafeed struct {
  1188. // AttributeLanguage: The two-letter ISO 639-1 language in which the
  1189. // attributes are defined in the data feed.
  1190. AttributeLanguage string `json:"attributeLanguage,omitempty"`
  1191. // ContentLanguage: The two-letter ISO 639-1 language of the items in
  1192. // the feed. Must be a valid language for targetCountry.
  1193. ContentLanguage string `json:"contentLanguage,omitempty"`
  1194. // ContentType: The type of data feed.
  1195. ContentType string `json:"contentType,omitempty"`
  1196. // FetchSchedule: Fetch schedule for the feed file.
  1197. FetchSchedule *DatafeedFetchSchedule `json:"fetchSchedule,omitempty"`
  1198. // FileName: The filename of the feed. All feeds must have a unique file
  1199. // name.
  1200. FileName string `json:"fileName,omitempty"`
  1201. // Format: Format of the feed file.
  1202. Format *DatafeedFormat `json:"format,omitempty"`
  1203. // Id: The ID of the data feed.
  1204. Id int64 `json:"id,omitempty,string"`
  1205. // IntendedDestinations: The list of intended destinations (corresponds
  1206. // to checked check boxes in Merchant Center).
  1207. IntendedDestinations []string `json:"intendedDestinations,omitempty"`
  1208. // Kind: Identifies what kind of resource this is. Value: the fixed
  1209. // string "content#datafeed".
  1210. Kind string `json:"kind,omitempty"`
  1211. // Name: A descriptive name of the data feed.
  1212. Name string `json:"name,omitempty"`
  1213. // TargetCountry: The country where the items in the feed will be
  1214. // included in the search index, represented as a CLDR territory code.
  1215. TargetCountry string `json:"targetCountry,omitempty"`
  1216. // ServerResponse contains the HTTP response code and headers from the
  1217. // server.
  1218. googleapi.ServerResponse `json:"-"`
  1219. // ForceSendFields is a list of field names (e.g. "AttributeLanguage")
  1220. // to unconditionally include in API requests. By default, fields with
  1221. // empty values are omitted from API requests. However, any non-pointer,
  1222. // non-interface field appearing in ForceSendFields will be sent to the
  1223. // server regardless of whether the field is empty or not. This may be
  1224. // used to include empty fields in Patch requests.
  1225. ForceSendFields []string `json:"-"`
  1226. }
  1227. func (s *Datafeed) MarshalJSON() ([]byte, error) {
  1228. type noMethod Datafeed
  1229. raw := noMethod(*s)
  1230. return gensupport.MarshalJSON(raw, s.ForceSendFields)
  1231. }
  1232. // DatafeedFetchSchedule: The required fields vary based on the
  1233. // frequency of fetching. For a monthly fetch schedule, day_of_month and
  1234. // hour are required. For a weekly fetch schedule, weekday and hour are
  1235. // required. For a daily fetch schedule, only hour is required.
  1236. type DatafeedFetchSchedule struct {
  1237. // DayOfMonth: The day of the month the feed file should be fetched
  1238. // (1-31).
  1239. DayOfMonth int64 `json:"dayOfMonth,omitempty"`
  1240. // FetchUrl: The URL where the feed file can be fetched. Google Merchant
  1241. // Center will support automatic scheduled uploads using the HTTP,
  1242. // HTTPS, FTP, or SFTP protocols, so the value will need to be a valid
  1243. // link using one of those four protocols.
  1244. FetchUrl string `json:"fetchUrl,omitempty"`
  1245. // Hour: The hour of the day the feed file should be fetched (0-23).
  1246. Hour int64 `json:"hour,omitempty"`
  1247. // Password: An optional password for fetch_url.
  1248. Password string `json:"password,omitempty"`
  1249. // TimeZone: Time zone used for schedule. UTC by default. E.g.,
  1250. // "America/Los_Angeles".
  1251. TimeZone string `json:"timeZone,omitempty"`
  1252. // Username: An optional user name for fetch_url.
  1253. Username string `json:"username,omitempty"`
  1254. // Weekday: The day of the week the feed file should be fetched.
  1255. Weekday string `json:"weekday,omitempty"`
  1256. // ForceSendFields is a list of field names (e.g. "DayOfMonth") to
  1257. // unconditionally include in API requests. By default, fields with
  1258. // empty values are omitted from API requests. However, any non-pointer,
  1259. // non-interface field appearing in ForceSendFields will be sent to the
  1260. // server regardless of whether the field is empty or not. This may be
  1261. // used to include empty fields in Patch requests.
  1262. ForceSendFields []string `json:"-"`
  1263. }
  1264. func (s *DatafeedFetchSchedule) MarshalJSON() ([]byte, error) {
  1265. type noMethod DatafeedFetchSchedule
  1266. raw := noMethod(*s)
  1267. return gensupport.MarshalJSON(raw, s.ForceSendFields)
  1268. }
  1269. type DatafeedFormat struct {
  1270. // ColumnDelimiter: Delimiter for the separation of values in a
  1271. // delimiter-separated values feed. If not specified, the delimiter will
  1272. // be auto-detected. Ignored for non-DSV data feeds.
  1273. ColumnDelimiter string `json:"columnDelimiter,omitempty"`
  1274. // FileEncoding: Character encoding scheme of the data feed. If not
  1275. // specified, the encoding will be auto-detected.
  1276. FileEncoding string `json:"fileEncoding,omitempty"`
  1277. // QuotingMode: Specifies how double quotes are interpreted. If not
  1278. // specified, the mode will be auto-detected. Ignored for non-DSV data
  1279. // feeds.
  1280. QuotingMode string `json:"quotingMode,omitempty"`
  1281. // ForceSendFields is a list of field names (e.g. "ColumnDelimiter") to
  1282. // unconditionally include in API requests. By default, fields with
  1283. // empty values are omitted from API requests. However, any non-pointer,
  1284. // non-interface field appearing in ForceSendFields will be sent to the
  1285. // server regardless of whether the field is empty or not. This may be
  1286. // used to include empty fields in Patch requests.
  1287. ForceSendFields []string `json:"-"`
  1288. }
  1289. func (s *DatafeedFormat) MarshalJSON() ([]byte, error) {
  1290. type noMethod DatafeedFormat
  1291. raw := noMethod(*s)
  1292. return gensupport.MarshalJSON(raw, s.ForceSendFields)
  1293. }
  1294. // DatafeedStatus: The status of a datafeed, i.e., the result of the
  1295. // last retrieval of the datafeed computed asynchronously when the feed
  1296. // processing is finished.
  1297. type DatafeedStatus struct {
  1298. // DatafeedId: The ID of the feed for which the status is reported.
  1299. DatafeedId uint64 `json:"datafeedId,omitempty,string"`
  1300. // Errors: The list of errors occurring in the feed.
  1301. Errors []*DatafeedStatusError `json:"errors,omitempty"`
  1302. // ItemsTotal: The number of items in the feed that were processed.
  1303. ItemsTotal uint64 `json:"itemsTotal,omitempty,string"`
  1304. // ItemsValid: The number of items in the feed that were valid.
  1305. ItemsValid uint64 `json:"itemsValid,omitempty,string"`
  1306. // Kind: Identifies what kind of resource this is. Value: the fixed
  1307. // string "content#datafeedStatus".
  1308. Kind string `json:"kind,omitempty"`
  1309. // LastUploadDate: The last date at which the feed was uploaded.
  1310. LastUploadDate string `json:"lastUploadDate,omitempty"`
  1311. // ProcessingStatus: The processing status of the feed.
  1312. ProcessingStatus string `json:"processingStatus,omitempty"`
  1313. // Warnings: The list of errors occurring in the feed.
  1314. Warnings []*DatafeedStatusError `json:"warnings,omitempty"`
  1315. // ServerResponse contains the HTTP response code and headers from the
  1316. // server.
  1317. googleapi.ServerResponse `json:"-"`
  1318. // ForceSendFields is a list of field names (e.g. "DatafeedId") to
  1319. // unconditionally include in API requests. By default, fields with
  1320. // empty values are omitted from API requests. However, any non-pointer,
  1321. // non-interface field appearing in ForceSendFields will be sent to the
  1322. // server regardless of whether the field is empty or not. This may be
  1323. // used to include empty fields in Patch requests.
  1324. ForceSendFields []string `json:"-"`
  1325. }
  1326. func (s *DatafeedStatus) MarshalJSON() ([]byte, error) {
  1327. type noMethod DatafeedStatus
  1328. raw := noMethod(*s)
  1329. return gensupport.MarshalJSON(raw, s.ForceSendFields)
  1330. }
  1331. // DatafeedStatusError: An error occurring in the feed, like "invalid
  1332. // price".
  1333. type DatafeedStatusError struct {
  1334. // Code: The code of the error, e.g., "validation/invalid_value".
  1335. Code string `json:"code,omitempty"`
  1336. // Count: The number of occurrences of the error in the feed.
  1337. Count uint64 `json:"count,omitempty,string"`
  1338. // Examples: A list of example occurrences of the error, grouped by
  1339. // product.
  1340. Examples []*DatafeedStatusExample `json:"examples,omitempty"`
  1341. // Message: The error message, e.g., "Invalid price".
  1342. Message string `json:"message,omitempty"`
  1343. // ForceSendFields is a list of field names (e.g. "Code") to
  1344. // unconditionally include in API requests. By default, fields with
  1345. // empty values are omitted from API requests. However, any non-pointer,
  1346. // non-interface field appearing in ForceSendFields will be sent to the
  1347. // server regardless of whether the field is empty or not. This may be
  1348. // used to include empty fields in Patch requests.
  1349. ForceSendFields []string `json:"-"`
  1350. }
  1351. func (s *DatafeedStatusError) MarshalJSON() ([]byte, error) {
  1352. type noMethod DatafeedStatusError
  1353. raw := noMethod(*s)
  1354. return gensupport.MarshalJSON(raw, s.ForceSendFields)
  1355. }
  1356. // DatafeedStatusExample: An example occurrence for a particular error.
  1357. type DatafeedStatusExample struct {
  1358. // ItemId: The ID of the example item.
  1359. ItemId string `json:"itemId,omitempty"`
  1360. // LineNumber: Line number in the data feed where the example is found.
  1361. LineNumber uint64 `json:"lineNumber,omitempty,string"`
  1362. // Value: The problematic value.
  1363. Value string `json:"value,omitempty"`
  1364. // ForceSendFields is a list of field names (e.g. "ItemId") to
  1365. // unconditionally include in API requests. By default, fields with
  1366. // empty values are omitted from API requests. However, any non-pointer,
  1367. // non-interface field appearing in ForceSendFields will be sent to the
  1368. // server regardless of whether the field is empty or not. This may be
  1369. // used to include empty fields in Patch requests.
  1370. ForceSendFields []string `json:"-"`
  1371. }
  1372. func (s *DatafeedStatusExample) MarshalJSON() ([]byte, error) {
  1373. type noMethod DatafeedStatusExample
  1374. raw := noMethod(*s)
  1375. return gensupport.MarshalJSON(raw, s.ForceSendFields)
  1376. }
  1377. type DatafeedsCustomBatchRequest struct {
  1378. // Entries: The request entries to be processed in the batch.
  1379. Entries []*DatafeedsCustomBatchRequestEntry `json:"entries,omitempty"`
  1380. // ForceSendFields is a list of field names (e.g. "Entries") to
  1381. // unconditionally include in API requests. By default, fields with
  1382. // empty values are omitted from API requests. However, any non-pointer,
  1383. // non-interface field appearing in ForceSendFields will be sent to the
  1384. // server regardless of whether the field is empty or not. This may be
  1385. // used to include empty fields in Patch requests.
  1386. ForceSendFields []string `json:"-"`
  1387. }
  1388. func (s *DatafeedsCustomBatchRequest) MarshalJSON() ([]byte, error) {
  1389. type noMethod DatafeedsCustomBatchRequest
  1390. raw := noMethod(*s)
  1391. return gensupport.MarshalJSON(raw, s.ForceSendFields)
  1392. }
  1393. // DatafeedsCustomBatchRequestEntry: A batch entry encoding a single
  1394. // non-batch datafeeds request.
  1395. type DatafeedsCustomBatchRequestEntry struct {
  1396. // BatchId: An entry ID, unique within the batch request.
  1397. BatchId int64 `json:"batchId,omitempty"`
  1398. // Datafeed: The data feed to insert.
  1399. Datafeed *Datafeed `json:"datafeed,omitempty"`
  1400. // DatafeedId: The ID of the data feed to get or delete.
  1401. DatafeedId uint64 `json:"datafeedId,omitempty,string"`
  1402. // MerchantId: The ID of the managing account.
  1403. MerchantId uint64 `json:"merchantId,omitempty,string"`
  1404. Method string `json:"method,omitempty"`
  1405. // ForceSendFields is a list of field names (e.g. "BatchId") to
  1406. // unconditionally include in API requests. By default, fields with
  1407. // empty values are omitted from API requests. However, any non-pointer,
  1408. // non-interface field appearing in ForceSendFields will be sent to the
  1409. // server regardless of whether the field is empty or not. This may be
  1410. // used to include empty fields in Patch requests.
  1411. ForceSendFields []string `json:"-"`
  1412. }
  1413. func (s *DatafeedsCustomBatchRequestEntry) MarshalJSON() ([]byte, error) {
  1414. type noMethod DatafeedsCustomBatchRequestEntry
  1415. raw := noMethod(*s)
  1416. return gensupport.MarshalJSON(raw, s.ForceSendFields)
  1417. }
  1418. type DatafeedsCustomBatchResponse struct {
  1419. // Entries: The result of the execution of the batch requests.
  1420. Entries []*DatafeedsCustomBatchResponseEntry `json:"entries,omitempty"`
  1421. // Kind: Identifies what kind of resource this is. Value: the fixed
  1422. // string "content#datafeedsCustomBatchResponse".
  1423. Kind string `json:"kind,omitempty"`
  1424. // ServerResponse contains the HTTP response code and headers from the
  1425. // server.
  1426. googleapi.ServerResponse `json:"-"`
  1427. // ForceSendFields is a list of field names (e.g. "Entries") to
  1428. // unconditionally include in API requests. By default, fields with
  1429. // empty values are omitted from API requests. However, any non-pointer,
  1430. // non-interface field appearing in ForceSendFields will be sent to the
  1431. // server regardless of whether the field is empty or not. This may be
  1432. // used to include empty fields in Patch requests.
  1433. ForceSendFields []string `json:"-"`
  1434. }
  1435. func (s *DatafeedsCustomBatchResponse) MarshalJSON() ([]byte, error) {
  1436. type noMethod DatafeedsCustomBatchResponse
  1437. raw := noMethod(*s)
  1438. return gensupport.MarshalJSON(raw, s.ForceSendFields)
  1439. }
  1440. // DatafeedsCustomBatchResponseEntry: A batch entry encoding a single
  1441. // non-batch datafeeds response.
  1442. type DatafeedsCustomBatchResponseEntry struct {
  1443. // BatchId: The ID of the request entry this entry responds to.
  1444. BatchId int64 `json:"batchId,omitempty"`
  1445. // Datafeed: The requested data feed. Defined if and only if the request
  1446. // was successful.
  1447. Datafeed *Datafeed `json:"datafeed,omitempty"`
  1448. // Errors: A list of errors defined if and only if the request failed.
  1449. Errors *Errors `json:"errors,omitempty"`
  1450. // ForceSendFields is a list of field names (e.g. "BatchId") to
  1451. // unconditionally include in API requests. By default, fields with
  1452. // empty values are omitted from API requests. However, any non-pointer,
  1453. // non-interface field appearing in ForceSendFields will be sent to the
  1454. // server regardless of whether the field is empty or not. This may be
  1455. // used to include empty fields in Patch requests.
  1456. ForceSendFields []string `json:"-"`
  1457. }
  1458. func (s *DatafeedsCustomBatchResponseEntry) MarshalJSON() ([]byte, error) {
  1459. type noMethod DatafeedsCustomBatchResponseEntry
  1460. raw := noMethod(*s)
  1461. return gensupport.MarshalJSON(raw, s.ForceSendFields)
  1462. }
  1463. type DatafeedsListResponse struct {
  1464. // Kind: Identifies what kind of resource this is. Value: the fixed
  1465. // string "content#datafeedsListResponse".
  1466. Kind string `json:"kind,omitempty"`
  1467. // NextPageToken: The token for the retrieval of the next page of
  1468. // datafeeds.
  1469. NextPageToken string `json:"nextPageToken,omitempty"`
  1470. Resources []*Datafeed `json:"resources,omitempty"`
  1471. // ServerResponse contains the HTTP response code and headers from the
  1472. // server.
  1473. googleapi.ServerResponse `json:"-"`
  1474. // ForceSendFields is a list of field names (e.g. "Kind") to
  1475. // unconditionally include in API requests. By default, fields with
  1476. // empty values are omitted from API requests. However, any non-pointer,
  1477. // non-interface field appearing in ForceSendFields will be sent to the
  1478. // server regardless of whether the field is empty or not. This may be
  1479. // used to include empty fields in Patch requests.
  1480. ForceSendFields []string `json:"-"`
  1481. }
  1482. func (s *DatafeedsListResponse) MarshalJSON() ([]byte, error) {
  1483. type noMethod DatafeedsListResponse
  1484. raw := noMethod(*s)
  1485. return gensupport.MarshalJSON(raw, s.ForceSendFields)
  1486. }
  1487. type DatafeedstatusesCustomBatchRequest struct {
  1488. // Entries: The request entries to be processed in the batch.
  1489. Entries []*DatafeedstatusesCustomBatchRequestEntry `json:"entries,omitempty"`
  1490. // ForceSendFields is a list of field names (e.g. "Entries") to
  1491. // unconditionally include in API requests. By default, fields with
  1492. // empty values are omitted from API requests. However, any non-pointer,
  1493. // non-interface field appearing in ForceSendFields will be sent to the
  1494. // server regardless of whether the field is empty or not. This may be
  1495. // used to include empty fields in Patch requests.
  1496. ForceSendFields []string `json:"-"`
  1497. }
  1498. func (s *DatafeedstatusesCustomBatchRequest) MarshalJSON() ([]byte, error) {
  1499. type noMethod DatafeedstatusesCustomBatchRequest
  1500. raw := noMethod(*s)
  1501. return gensupport.MarshalJSON(raw, s.ForceSendFields)
  1502. }
  1503. // DatafeedstatusesCustomBatchRequestEntry: A batch entry encoding a
  1504. // single non-batch datafeedstatuses request.
  1505. type DatafeedstatusesCustomBatchRequestEntry struct {
  1506. // BatchId: An entry ID, unique within the batch request.
  1507. BatchId int64 `json:"batchId,omitempty"`
  1508. // DatafeedId: The ID of the data feed to get or delete.
  1509. DatafeedId uint64 `json:"datafeedId,omitempty,string"`
  1510. // MerchantId: The ID of the managing account.
  1511. MerchantId uint64 `json:"merchantId,omitempty,string"`
  1512. Method string `json:"method,omitempty"`
  1513. // ForceSendFields is a list of field names (e.g. "BatchId") to
  1514. // unconditionally include in API requests. By default, fields with
  1515. // empty values are omitted from API requests. However, any non-pointer,
  1516. // non-interface field appearing in ForceSendFields will be sent to the
  1517. // server regardless of whether the field is empty or not. This may be
  1518. // used to include empty fields in Patch requests.
  1519. ForceSendFields []string `json:"-"`
  1520. }
  1521. func (s *DatafeedstatusesCustomBatchRequestEntry) MarshalJSON() ([]byte, error) {
  1522. type noMethod DatafeedstatusesCustomBatchRequestEntry
  1523. raw := noMethod(*s)
  1524. return gensupport.MarshalJSON(raw, s.ForceSendFields)
  1525. }
  1526. type DatafeedstatusesCustomBatchResponse struct {
  1527. // Entries: The result of the execution of the batch requests.
  1528. Entries []*DatafeedstatusesCustomBatchResponseEntry `json:"entries,omitempty"`
  1529. // Kind: Identifies what kind of resource this is. Value: the fixed
  1530. // string "content#datafeedstatusesCustomBatchResponse".
  1531. Kind string `json:"kind,omitempty"`
  1532. // ServerResponse contains the HTTP response code and headers from the
  1533. // server.
  1534. googleapi.ServerResponse `json:"-"`
  1535. // ForceSendFields is a list of field names (e.g. "Entries") to
  1536. // unconditionally include in API requests. By default, fields with
  1537. // empty values are omitted from API requests. However, any non-pointer,
  1538. // non-interface field appearing in ForceSendFields will be sent to the
  1539. // server regardless of whether the field is empty or not. This may be
  1540. // used to include empty fields in Patch requests.
  1541. ForceSendFields []string `json:"-"`
  1542. }
  1543. func (s *DatafeedstatusesCustomBatchResponse) MarshalJSON() ([]byte, error) {
  1544. type noMethod DatafeedstatusesCustomBatchResponse
  1545. raw := noMethod(*s)
  1546. return gensupport.MarshalJSON(raw, s.ForceSendFields)
  1547. }
  1548. // DatafeedstatusesCustomBatchResponseEntry: A batch entry encoding a
  1549. // single non-batch datafeedstatuses response.
  1550. type DatafeedstatusesCustomBatchResponseEntry struct {
  1551. // BatchId: The ID of the request entry this entry responds to.
  1552. BatchId int64 `json:"batchId,omitempty"`
  1553. // DatafeedStatus: The requested data feed status. Defined if and only
  1554. // if the request was successful.
  1555. DatafeedStatus *DatafeedStatus `json:"datafeedStatus,omitempty"`
  1556. // Errors: A list of errors defined if and only if the request failed.
  1557. Errors *Errors `json:"errors,omitempty"`
  1558. // ForceSendFields is a list of field names (e.g. "BatchId") to
  1559. // unconditionally include in API requests. By default, fields with
  1560. // empty values are omitted from API requests. However, any non-pointer,
  1561. // non-interface field appearing in ForceSendFields will be sent to the
  1562. // server regardless of whether the field is empty or not. This may be
  1563. // used to include empty fields in Patch requests.
  1564. ForceSendFields []string `json:"-"`
  1565. }
  1566. func (s *DatafeedstatusesCustomBatchResponseEntry) MarshalJSON() ([]byte, error) {
  1567. type noMethod DatafeedstatusesCustomBatchResponseEntry
  1568. raw := noMethod(*s)
  1569. return gensupport.MarshalJSON(raw, s.ForceSendFields)
  1570. }
  1571. type DatafeedstatusesListResponse struct {
  1572. // Kind: Identifies what kind of resource this is. Value: the fixed
  1573. // string "content#datafeedstatusesListResponse".
  1574. Kind string `json:"kind,omitempty"`
  1575. // NextPageToken: The token for the retrieval of the next page of
  1576. // datafeed statuses.
  1577. NextPageToken string `json:"nextPageToken,omitempty"`
  1578. Resources []*DatafeedStatus `json:"resources,omitempty"`
  1579. // ServerResponse contains the HTTP response code and headers from the
  1580. // server.
  1581. googleapi.ServerResponse `json:"-"`
  1582. // ForceSendFields is a list of field names (e.g. "Kind") to
  1583. // unconditionally include in API requests. By default, fields with
  1584. // empty values are omitted from API requests. However, any non-pointer,
  1585. // non-interface field appearing in ForceSendFields will be sent to the
  1586. // server regardless of whether the field is empty or not. This may be
  1587. // used to include empty fields in Patch requests.
  1588. ForceSendFields []string `json:"-"`
  1589. }
  1590. func (s *DatafeedstatusesListResponse) MarshalJSON() ([]byte, error) {
  1591. type noMethod DatafeedstatusesListResponse
  1592. raw := noMethod(*s)
  1593. return gensupport.MarshalJSON(raw, s.ForceSendFields)
  1594. }
  1595. // Error: An error returned by the API.
  1596. type Error struct {
  1597. // Domain: The domain of the error.
  1598. Domain string `json:"domain,omitempty"`
  1599. // Message: A description of the error.
  1600. Message string `json:"message,omitempty"`
  1601. // Reason: The error code.
  1602. Reason string `json:"reason,omitempty"`
  1603. // ForceSendFields is a list of field names (e.g. "Domain") to
  1604. // unconditionally include in API requests. By default, fields with
  1605. // empty values are omitted from API requests. However, any non-pointer,
  1606. // non-interface field appearing in ForceSendFields will be sent to the
  1607. // server regardless of whether the field is empty or not. This may be
  1608. // used to include empty fields in Patch requests.
  1609. ForceSendFields []string `json:"-"`
  1610. }
  1611. func (s *Error) MarshalJSON() ([]byte, error) {
  1612. type noMethod Error
  1613. raw := noMethod(*s)
  1614. return gensupport.MarshalJSON(raw, s.ForceSendFields)
  1615. }
  1616. // Errors: A list of errors returned by a failed batch entry.
  1617. type Errors struct {
  1618. // Code: The HTTP status of the first error in errors.
  1619. Code int64 `json:"code,omitempty"`
  1620. // Errors: A list of errors.
  1621. Errors []*Error `json:"errors,omitempty"`
  1622. // Message: The message of the first error in errors.
  1623. Message string `json:"message,omitempty"`
  1624. // ForceSendFields is a list of field names (e.g. "Code") to
  1625. // unconditionally include in API requests. By default, fields with
  1626. // empty values are omitted from API requests. However, any non-pointer,
  1627. // non-interface field appearing in ForceSendFields will be sent to the
  1628. // server regardless of whether the field is empty or not. This may be
  1629. // used to include empty fields in Patch requests.
  1630. ForceSendFields []string `json:"-"`
  1631. }
  1632. func (s *Errors) MarshalJSON() ([]byte, error) {
  1633. type noMethod Errors
  1634. raw := noMethod(*s)
  1635. return gensupport.MarshalJSON(raw, s.ForceSendFields)
  1636. }
  1637. type Installment struct {
  1638. // Amount: The amount the buyer has to pay per month.
  1639. Amount *Price `json:"amount,omitempty"`
  1640. // Months: The number of installments the buyer has to pay.
  1641. Months int64 `json:"months,omitempty,string"`
  1642. // ForceSendFields is a list of field names (e.g. "Amount") to
  1643. // unconditionally include in API requests. By default, fields with
  1644. // empty values are omitted from API requests. However, any non-pointer,
  1645. // non-interface field appearing in ForceSendFields will be sent to the
  1646. // server regardless of whether the field is empty or not. This may be
  1647. // used to include empty fields in Patch requests.
  1648. ForceSendFields []string `json:"-"`
  1649. }
  1650. func (s *Installment) MarshalJSON() ([]byte, error) {
  1651. type noMethod Installment
  1652. raw := noMethod(*s)
  1653. return gensupport.MarshalJSON(raw, s.ForceSendFields)
  1654. }
  1655. type Inventory struct {
  1656. // Availability: The availability of the product.
  1657. Availability string `json:"availability,omitempty"`
  1658. // Installment: Number and amount of installments to pay for an item.
  1659. // Brazil only.
  1660. Installment *Installment `json:"installment,omitempty"`
  1661. // Kind: Identifies what kind of resource this is. Value: the fixed
  1662. // string "content#inventory".
  1663. Kind string `json:"kind,omitempty"`
  1664. // LoyaltyPoints: Loyalty points that users receive after purchasing the
  1665. // item. Japan only.
  1666. LoyaltyPoints *LoyaltyPoints `json:"loyaltyPoints,omitempty"`
  1667. // Price: The price of the product.
  1668. Price *Price `json:"price,omitempty"`
  1669. // Quantity: The quantity of the product. Must be equal to or greater
  1670. // than zero. Supported only for local products.
  1671. Quantity int64 `json:"quantity,omitempty"`
  1672. // SalePrice: The sale price of the product. Mandatory if
  1673. // sale_price_effective_date is defined.
  1674. SalePrice *Price `json:"salePrice,omitempty"`
  1675. // SalePriceEffectiveDate: A date range represented by a pair of ISO
  1676. // 8601 dates separated by a space, comma, or slash. Both dates might be
  1677. // specified as 'null' if undecided.
  1678. SalePriceEffectiveDate string `json:"salePriceEffectiveDate,omitempty"`
  1679. // SellOnGoogleQuantity: The quantity of the product that is reserved
  1680. // for sell-on-google ads. Supported only for online products.
  1681. SellOnGoogleQuantity int64 `json:"sellOnGoogleQuantity,omitempty"`
  1682. // ForceSendFields is a list of field names (e.g. "Availability") to
  1683. // unconditionally include in API requests. By default, fields with
  1684. // empty values are omitted from API requests. However, any non-pointer,
  1685. // non-interface field appearing in ForceSendFields will be sent to the
  1686. // server regardless of whether the field is empty or not. This may be
  1687. // used to include empty fields in Patch requests.
  1688. ForceSendFields []string `json:"-"`
  1689. }
  1690. func (s *Inventory) MarshalJSON() ([]byte, error) {
  1691. type noMethod Inventory
  1692. raw := noMethod(*s)
  1693. return gensupport.MarshalJSON(raw, s.ForceSendFields)
  1694. }
  1695. type InventoryCustomBatchRequest struct {
  1696. // Entries: The request entries to be processed in the batch.
  1697. Entries []*InventoryCustomBatchRequestEntry `json:"entries,omitempty"`
  1698. // ForceSendFields is a list of field names (e.g. "Entries") to
  1699. // unconditionally include in API requests. By default, fields with
  1700. // empty values are omitted from API requests. However, any non-pointer,
  1701. // non-interface field appearing in ForceSendFields will be sent to the
  1702. // server regardless of whether the field is empty or not. This may be
  1703. // used to include empty fields in Patch requests.
  1704. ForceSendFields []string `json:"-"`
  1705. }
  1706. func (s *InventoryCustomBatchRequest) MarshalJSON() ([]byte, error) {
  1707. type noMethod InventoryCustomBatchRequest
  1708. raw := noMethod(*s)
  1709. return gensupport.MarshalJSON(raw, s.ForceSendFields)
  1710. }
  1711. // InventoryCustomBatchRequestEntry: A batch entry encoding a single
  1712. // non-batch inventory request.
  1713. type InventoryCustomBatchRequestEntry struct {
  1714. // BatchId: An entry ID, unique within the batch request.
  1715. BatchId int64 `json:"batchId,omitempty"`
  1716. // Inventory: Price and availability of the product.
  1717. Inventory *Inventory `json:"inventory,omitempty"`
  1718. // MerchantId: The ID of the managing account.
  1719. MerchantId uint64 `json:"merchantId,omitempty,string"`
  1720. // ProductId: The ID of the product for which to update price and
  1721. // availability.
  1722. ProductId string `json:"productId,omitempty"`
  1723. // StoreCode: The code of the store for which to update price and
  1724. // availability. Use online to update price and availability of an
  1725. // online product.
  1726. StoreCode string `json:"storeCode,omitempty"`
  1727. // ForceSendFields is a list of field names (e.g. "BatchId") to
  1728. // unconditionally include in API requests. By default, fields with
  1729. // empty values are omitted from API requests. However, any non-pointer,
  1730. // non-interface field appearing in ForceSendFields will be sent to the
  1731. // server regardless of whether the field is empty or not. This may be
  1732. // used to include empty fields in Patch requests.
  1733. ForceSendFields []string `json:"-"`
  1734. }
  1735. func (s *InventoryCustomBatchRequestEntry) MarshalJSON() ([]byte, error) {
  1736. type noMethod InventoryCustomBatchRequestEntry
  1737. raw := noMethod(*s)
  1738. return gensupport.MarshalJSON(raw, s.ForceSendFields)
  1739. }
  1740. type InventoryCustomBatchResponse struct {
  1741. // Entries: The result of the execution of the batch requests.
  1742. Entries []*InventoryCustomBatchResponseEntry `json:"entries,omitempty"`
  1743. // Kind: Identifies what kind of resource this is. Value: the fixed
  1744. // string "content#inventoryCustomBatchResponse".
  1745. Kind string `json:"kind,omitempty"`
  1746. // ServerResponse contains the HTTP response code and headers from the
  1747. // server.
  1748. googleapi.ServerResponse `json:"-"`
  1749. // ForceSendFields is a list of field names (e.g. "Entries") to
  1750. // unconditionally include in API requests. By default, fields with
  1751. // empty values are omitted from API requests. However, any non-pointer,
  1752. // non-interface field appearing in ForceSendFields will be sent to the
  1753. // server regardless of whether the field is empty or not. This may be
  1754. // used to include empty fields in Patch requests.
  1755. ForceSendFields []string `json:"-"`
  1756. }
  1757. func (s *InventoryCustomBatchResponse) MarshalJSON() ([]byte, error) {
  1758. type noMethod InventoryCustomBatchResponse
  1759. raw := noMethod(*s)
  1760. return gensupport.MarshalJSON(raw, s.ForceSendFields)
  1761. }
  1762. // InventoryCustomBatchResponseEntry: A batch entry encoding a single
  1763. // non-batch inventory response.
  1764. type InventoryCustomBatchResponseEntry struct {
  1765. // BatchId: The ID of the request entry this entry responds to.
  1766. BatchId int64 `json:"batchId,omitempty"`
  1767. // Errors: A list of errors defined if and only if the request failed.
  1768. Errors *Errors `json:"errors,omitempty"`
  1769. // Kind: Identifies what kind of resource this is. Value: the fixed
  1770. // string "content#inventoryCustomBatchResponseEntry".
  1771. Kind string `json:"kind,omitempty"`
  1772. // ForceSendFields is a list of field names (e.g. "BatchId") to
  1773. // unconditionally include in API requests. By default, fields with
  1774. // empty values are omitted from API requests. However, any non-pointer,
  1775. // non-interface field appearing in ForceSendFields will be sent to the
  1776. // server regardless of whether the field is empty or not. This may be
  1777. // used to include empty fields in Patch requests.
  1778. ForceSendFields []string `json:"-"`
  1779. }
  1780. func (s *InventoryCustomBatchResponseEntry) MarshalJSON() ([]byte, error) {
  1781. type noMethod InventoryCustomBatchResponseEntry
  1782. raw := noMethod(*s)
  1783. return gensupport.MarshalJSON(raw, s.ForceSendFields)
  1784. }
  1785. type InventorySetRequest struct {
  1786. // Availability: The availability of the product.
  1787. Availability string `json:"availability,omitempty"`
  1788. // Installment: Number and amount of installments to pay for an item.
  1789. // Brazil only.
  1790. Installment *Installment `json:"installment,omitempty"`
  1791. // LoyaltyPoints: Loyalty points that users receive after purchasing the
  1792. // item. Japan only.
  1793. LoyaltyPoints *LoyaltyPoints `json:"loyaltyPoints,omitempty"`
  1794. // Price: The price of the product.
  1795. Price *Price `json:"price,omitempty"`
  1796. // Quantity: The quantity of the product. Must be equal to or greater
  1797. // than zero. Supported only for local products.
  1798. Quantity int64 `json:"quantity,omitempty"`
  1799. // SalePrice: The sale price of the product. Mandatory if
  1800. // sale_price_effective_date is defined.
  1801. SalePrice *Price `json:"salePrice,omitempty"`
  1802. // SalePriceEffectiveDate: A date range represented by a pair of ISO
  1803. // 8601 dates separated by a space, comma, or slash. Both dates might be
  1804. // specified as 'null' if undecided.
  1805. SalePriceEffectiveDate string `json:"salePriceEffectiveDate,omitempty"`
  1806. // SellOnGoogleQuantity: The quantity of the product that is reserved
  1807. // for sell-on-google ads. Supported only for online products.
  1808. SellOnGoogleQuantity int64 `json:"sellOnGoogleQuantity,omitempty"`
  1809. // ForceSendFields is a list of field names (e.g. "Availability") to
  1810. // unconditionally include in API requests. By default, fields with
  1811. // empty values are omitted from API requests. However, any non-pointer,
  1812. // non-interface field appearing in ForceSendFields will be sent to the
  1813. // server regardless of whether the field is empty or not. This may be
  1814. // used to include empty fields in Patch requests.
  1815. ForceSendFields []string `json:"-"`
  1816. }
  1817. func (s *InventorySetRequest) MarshalJSON() ([]byte, error) {
  1818. type noMethod InventorySetRequest
  1819. raw := noMethod(*s)
  1820. return gensupport.MarshalJSON(raw, s.ForceSendFields)
  1821. }
  1822. type InventorySetResponse struct {
  1823. // Kind: Identifies what kind of resource this is. Value: the fixed
  1824. // string "content#inventorySetResponse".
  1825. Kind string `json:"kind,omitempty"`
  1826. // ServerResponse contains the HTTP response code and headers from the
  1827. // server.
  1828. googleapi.ServerResponse `json:"-"`
  1829. // ForceSendFields is a list of field names (e.g. "Kind") to
  1830. // unconditionally include in API requests. By default, fields with
  1831. // empty values are omitted from API requests. However, any non-pointer,
  1832. // non-interface field appearing in ForceSendFields will be sent to the
  1833. // server regardless of whether the field is empty or not. This may be
  1834. // used to include empty fields in Patch requests.
  1835. ForceSendFields []string `json:"-"`
  1836. }
  1837. func (s *InventorySetResponse) MarshalJSON() ([]byte, error) {
  1838. type noMethod InventorySetResponse
  1839. raw := noMethod(*s)
  1840. return gensupport.MarshalJSON(raw, s.ForceSendFields)
  1841. }
  1842. type LoyaltyPoints struct {
  1843. // Name: Name of loyalty points program. It is recommended to limit the
  1844. // name to 12 full-width characters or 24 Roman characters.
  1845. Name string `json:"name,omitempty"`
  1846. // PointsValue: The retailer's loyalty points in absolute value.
  1847. PointsValue int64 `json:"pointsValue,omitempty,string"`
  1848. // Ratio: The ratio of a point when converted to currency. Google
  1849. // assumes currency based on Merchant Center settings. If ratio is left
  1850. // out, it defaults to 1.0.
  1851. Ratio float64 `json:"ratio,omitempty"`
  1852. // ForceSendFields is a list of field names (e.g. "Name") to
  1853. // unconditionally include in API requests. By default, fields with
  1854. // empty values are omitted from API requests. However, any non-pointer,
  1855. // non-interface field appearing in ForceSendFields will be sent to the
  1856. // server regardless of whether the field is empty or not. This may be
  1857. // used to include empty fields in Patch requests.
  1858. ForceSendFields []string `json:"-"`
  1859. }
  1860. func (s *LoyaltyPoints) MarshalJSON() ([]byte, error) {
  1861. type noMethod LoyaltyPoints
  1862. raw := noMethod(*s)
  1863. return gensupport.MarshalJSON(raw, s.ForceSendFields)
  1864. }
  1865. type Order struct {
  1866. // Acknowledged: Whether the order was acknowledged.
  1867. Acknowledged bool `json:"acknowledged,omitempty"`
  1868. // Customer: The details of the customer who placed the order.
  1869. Customer *OrderCustomer `json:"customer,omitempty"`
  1870. // DeliveryDetails: The details for the delivery.
  1871. DeliveryDetails *OrderDeliveryDetails `json:"deliveryDetails,omitempty"`
  1872. // Id: The REST id of the order. Globally unique.
  1873. Id string `json:"id,omitempty"`
  1874. // Kind: Identifies what kind of resource this is. Value: the fixed
  1875. // string "content#order".
  1876. Kind string `json:"kind,omitempty"`
  1877. // LineItems: Line items that are ordered.
  1878. LineItems []*OrderLineItem `json:"lineItems,omitempty"`
  1879. MerchantId uint64 `json:"merchantId,omitempty,string"`
  1880. // MerchantOrderId: Merchant-provided id of the order.
  1881. MerchantOrderId string `json:"merchantOrderId,omitempty"`
  1882. // NetAmount: The net amount for the order. For example, if an order was
  1883. // originally for a grand total of $100 and a refund was issued for $20,
  1884. // the net amount will be $80.
  1885. NetAmount *Price `json:"netAmount,omitempty"`
  1886. // PaymentMethod: The details of the payment method.
  1887. PaymentMethod *OrderPaymentMethod `json:"paymentMethod,omitempty"`
  1888. // PaymentStatus: The status of the payment.
  1889. PaymentStatus string `json:"paymentStatus,omitempty"`
  1890. // PlacedDate: The date when the order was placed, in ISO 8601 format.
  1891. PlacedDate string `json:"placedDate,omitempty"`
  1892. // Refunds: Refunds for the order.
  1893. Refunds []*OrderRefund `json:"refunds,omitempty"`
  1894. // Shipments: Shipments of the order.
  1895. Shipments []*OrderShipment `json:"shipments,omitempty"`
  1896. // ShippingCost: The total cost of shipping for all items.
  1897. ShippingCost *Price `json:"shippingCost,omitempty"`
  1898. // ShippingCostTax: The tax for the total shipping cost.
  1899. ShippingCostTax *Price `json:"shippingCostTax,omitempty"`
  1900. // ShippingOption: The requested shipping option.
  1901. ShippingOption string `json:"shippingOption,omitempty"`
  1902. // Status: The status of the order.
  1903. Status string `json:"status,omitempty"`
  1904. // ServerResponse contains the HTTP response code and headers from the
  1905. // server.
  1906. googleapi.ServerResponse `json:"-"`
  1907. // ForceSendFields is a list of field names (e.g. "Acknowledged") to
  1908. // unconditionally include in API requests. By default, fields with
  1909. // empty values are omitted from API requests. However, any non-pointer,
  1910. // non-interface field appearing in ForceSendFields will be sent to the
  1911. // server regardless of whether the field is empty or not. This may be
  1912. // used to include empty fields in Patch requests.
  1913. ForceSendFields []string `json:"-"`
  1914. }
  1915. func (s *Order) MarshalJSON() ([]byte, error) {
  1916. type noMethod Order
  1917. raw := noMethod(*s)
  1918. return gensupport.MarshalJSON(raw, s.ForceSendFields)
  1919. }
  1920. type OrderAddress struct {
  1921. // Country: CLDR country code (e.g. "US").
  1922. Country string `json:"country,omitempty"`
  1923. // FullAddress: Strings representing the lines of the printed label for
  1924. // mailing the order, for example:
  1925. // John Smith
  1926. // 1600 Amphitheatre Parkway
  1927. // Mountain View, CA, 94043
  1928. // United States
  1929. FullAddress []string `json:"fullAddress,omitempty"`
  1930. // IsPostOfficeBox: Whether the address is a post office box.
  1931. IsPostOfficeBox bool `json:"isPostOfficeBox,omitempty"`
  1932. // Locality: City, town or commune. May also include dependent
  1933. // localities or sublocalities (e.g. neighborhoods or suburbs).
  1934. Locality string `json:"locality,omitempty"`
  1935. // PostalCode: Postal Code or ZIP (e.g. "94043").
  1936. PostalCode string `json:"postalCode,omitempty"`
  1937. // RecipientName: Name of the recipient.
  1938. RecipientName string `json:"recipientName,omitempty"`
  1939. // Region: Top-level administrative subdivision of the country (e.g.
  1940. // "CA").
  1941. Region string `json:"region,omitempty"`
  1942. // StreetAddress: Street-level part of the address.
  1943. StreetAddress []string `json:"streetAddress,omitempty"`
  1944. // ForceSendFields is a list of field names (e.g. "Country") to
  1945. // unconditionally include in API requests. By default, fields with
  1946. // empty values are omitted from API requests. However, any non-pointer,
  1947. // non-interface field appearing in ForceSendFields will be sent to the
  1948. // server regardless of whether the field is empty or not. This may be
  1949. // used to include empty fields in Patch requests.
  1950. ForceSendFields []string `json:"-"`
  1951. }
  1952. func (s *OrderAddress) MarshalJSON() ([]byte, error) {
  1953. type noMethod OrderAddress
  1954. raw := noMethod(*s)
  1955. return gensupport.MarshalJSON(raw, s.ForceSendFields)
  1956. }
  1957. type OrderCancellation struct {
  1958. // Actor: The actor that created the cancellation.
  1959. Actor string `json:"actor,omitempty"`
  1960. // CreationDate: Date on which the cancellation has been created, in ISO
  1961. // 8601 format.
  1962. CreationDate string `json:"creationDate,omitempty"`
  1963. // Quantity: The quantity that was canceled.
  1964. Quantity int64 `json:"quantity,omitempty"`
  1965. // Reason: The reason for the cancellation.
  1966. Reason string `json:"reason,omitempty"`
  1967. // ReasonText: The explanation of the reason.
  1968. ReasonText string `json:"reasonText,omitempty"`
  1969. // ForceSendFields is a list of field names (e.g. "Actor") to
  1970. // unconditionally include in API requests. By default, fields with
  1971. // empty values are omitted from API requests. However, any non-pointer,
  1972. // non-interface field appearing in ForceSendFields will be sent to the
  1973. // server regardless of whether the field is empty or not. This may be
  1974. // used to include empty fields in Patch requests.
  1975. ForceSendFields []string `json:"-"`
  1976. }
  1977. func (s *OrderCancellation) MarshalJSON() ([]byte, error) {
  1978. type noMethod OrderCancellation
  1979. raw := noMethod(*s)
  1980. return gensupport.MarshalJSON(raw, s.ForceSendFields)
  1981. }
  1982. type OrderCustomer struct {
  1983. // Email: Email address of the customer.
  1984. Email string `json:"email,omitempty"`
  1985. // ExplicitMarketingPreference: If set, this indicates the user had a
  1986. // choice to opt in or out of providing marketing rights to the
  1987. // merchant. If unset, this indicates the user has already made this
  1988. // choice in a previous purchase, and was thus not shown the marketing
  1989. // right opt in/out checkbox during the Purchases on Google checkout
  1990. // flow.
  1991. ExplicitMarketingPreference bool `json:"explicitMarketingPreference,omitempty"`
  1992. // FullName: Full name of the customer.
  1993. FullName string `json:"fullName,omitempty"`
  1994. // ForceSendFields is a list of field names (e.g. "Email") to
  1995. // unconditionally include in API requests. By default, fields with
  1996. // empty values are omitted from API requests. However, any non-pointer,
  1997. // non-interface field appearing in ForceSendFields will be sent to the
  1998. // server regardless of whether the field is empty or not. This may be
  1999. // used to include empty fields in Patch requests.
  2000. ForceSendFields []string `json:"-"`
  2001. }
  2002. func (s *OrderCustomer) MarshalJSON() ([]byte, error) {
  2003. type noMethod OrderCustomer
  2004. raw := noMethod(*s)
  2005. return gensupport.MarshalJSON(raw, s.ForceSendFields)
  2006. }
  2007. type OrderDeliveryDetails struct {
  2008. // Address: The delivery address
  2009. Address *OrderAddress `json:"address,omitempty"`
  2010. // PhoneNumber: The phone number of the person receiving the delivery.
  2011. PhoneNumber string `json:"phoneNumber,omitempty"`
  2012. // ForceSendFields is a list of field names (e.g. "Address") to
  2013. // unconditionally include in API requests. By default, fields with
  2014. // empty values are omitted from API requests. However, any non-pointer,
  2015. // non-interface field appearing in ForceSendFields will be sent to the
  2016. // server regardless of whether the field is empty or not. This may be
  2017. // used to include empty fields in Patch requests.
  2018. ForceSendFields []string `json:"-"`
  2019. }
  2020. func (s *OrderDeliveryDetails) MarshalJSON() ([]byte, error) {
  2021. type noMethod OrderDeliveryDetails
  2022. raw := noMethod(*s)
  2023. return gensupport.MarshalJSON(raw, s.ForceSendFields)
  2024. }
  2025. type OrderLineItem struct {
  2026. // Cancellations: Cancellations of the line item.
  2027. Cancellations []*OrderCancellation `json:"cancellations,omitempty"`
  2028. // Id: The id of the line item.
  2029. Id string `json:"id,omitempty"`
  2030. // Price: Total price for the line item. For example, if two items for
  2031. // $10 are purchased, the total price will be $20.
  2032. Price *Price `json:"price,omitempty"`
  2033. // Product: Product data from the time of the order placement.
  2034. Product *OrderLineItemProduct `json:"product,omitempty"`
  2035. // QuantityCanceled: Number of items canceled.
  2036. QuantityCanceled int64 `json:"quantityCanceled,omitempty"`
  2037. // QuantityDelivered: Number of items delivered.
  2038. QuantityDelivered int64 `json:"quantityDelivered,omitempty"`
  2039. // QuantityOrdered: Number of items ordered.
  2040. QuantityOrdered int64 `json:"quantityOrdered,omitempty"`
  2041. // QuantityPending: Number of items pending.
  2042. QuantityPending int64 `json:"quantityPending,omitempty"`
  2043. // QuantityReturned: Number of items returned.
  2044. QuantityReturned int64 `json:"quantityReturned,omitempty"`
  2045. // QuantityShipped: Number of items shipped.
  2046. QuantityShipped int64 `json:"quantityShipped,omitempty"`
  2047. // ReturnInfo: Details of the return policy for the line item.
  2048. ReturnInfo *OrderLineItemReturnInfo `json:"returnInfo,omitempty"`
  2049. // Returns: Returns of the line item.
  2050. Returns []*OrderReturn `json:"returns,omitempty"`
  2051. // ShippingDetails: Details of the requested shipping for the line item.
  2052. ShippingDetails *OrderLineItemShippingDetails `json:"shippingDetails,omitempty"`
  2053. // Tax: Total tax amount for the line item. For example, if two items
  2054. // are purchased, and each have a cost tax of $2, the total tax amount
  2055. // will be $4.
  2056. Tax *Price `json:"tax,omitempty"`
  2057. // ForceSendFields is a list of field names (e.g. "Cancellations") to
  2058. // unconditionally include in API requests. By default, fields with
  2059. // empty values are omitted from API requests. However, any non-pointer,
  2060. // non-interface field appearing in ForceSendFields will be sent to the
  2061. // server regardless of whether the field is empty or not. This may be
  2062. // used to include empty fields in Patch requests.
  2063. ForceSendFields []string `json:"-"`
  2064. }
  2065. func (s *OrderLineItem) MarshalJSON() ([]byte, error) {
  2066. type noMethod OrderLineItem
  2067. raw := noMethod(*s)
  2068. return gensupport.MarshalJSON(raw, s.ForceSendFields)
  2069. }
  2070. type OrderLineItemProduct struct {
  2071. // Brand: Brand of the item.
  2072. Brand string `json:"brand,omitempty"`
  2073. // Channel: The item's channel (online or local).
  2074. Channel string `json:"channel,omitempty"`
  2075. // Condition: Condition or state of the item.
  2076. Condition string `json:"condition,omitempty"`
  2077. // ContentLanguage: The two-letter ISO 639-1 language code for the item.
  2078. ContentLanguage string `json:"contentLanguage,omitempty"`
  2079. // Gtin: Global Trade Item Number (GTIN) of the item.
  2080. Gtin string `json:"gtin,omitempty"`
  2081. // Id: The REST id of the product.
  2082. Id string `json:"id,omitempty"`
  2083. // ImageLink: URL of an image of the item.
  2084. ImageLink string `json:"imageLink,omitempty"`
  2085. // ItemGroupId: Shared identifier for all variants of the same product.
  2086. ItemGroupId string `json:"itemGroupId,omitempty"`
  2087. // Mpn: Manufacturer Part Number (MPN) of the item.
  2088. Mpn string `json:"mpn,omitempty"`
  2089. // OfferId: An identifier of the item.
  2090. OfferId string `json:"offerId,omitempty"`
  2091. // Price: Price of the item.
  2092. Price *Price `json:"price,omitempty"`
  2093. // ShownImage: URL to the cached image shown to the user when order was
  2094. // placed.
  2095. ShownImage string `json:"shownImage,omitempty"`
  2096. // TargetCountry: The CLDR territory code of the target country of the
  2097. // product.
  2098. TargetCountry string `json:"targetCountry,omitempty"`
  2099. // Title: The title of the product.
  2100. Title string `json:"title,omitempty"`
  2101. // VariantAttributes: Variant attributes for the item. These are
  2102. // dimensions of the product, such as color, gender, material, pattern,
  2103. // and size. You can find a comprehensive list of variant attributes
  2104. // here.
  2105. VariantAttributes []*OrderLineItemProductVariantAttribute `json:"variantAttributes,omitempty"`
  2106. // ForceSendFields is a list of field names (e.g. "Brand") to
  2107. // unconditionally include in API requests. By default, fields with
  2108. // empty values are omitted from API requests. However, any non-pointer,
  2109. // non-interface field appearing in ForceSendFields will be sent to the
  2110. // server regardless of whether the field is empty or not. This may be
  2111. // used to include empty fields in Patch requests.
  2112. ForceSendFields []string `json:"-"`
  2113. }
  2114. func (s *OrderLineItemProduct) MarshalJSON() ([]byte, error) {
  2115. type noMethod OrderLineItemProduct
  2116. raw := noMethod(*s)
  2117. return gensupport.MarshalJSON(raw, s.ForceSendFields)
  2118. }
  2119. type OrderLineItemProductVariantAttribute struct {
  2120. // Dimension: The dimension of the variant.
  2121. Dimension string `json:"dimension,omitempty"`
  2122. // Value: The value for the dimension.
  2123. Value string `json:"value,omitempty"`
  2124. // ForceSendFields is a list of field names (e.g. "Dimension") to
  2125. // unconditionally include in API requests. By default, fields with
  2126. // empty values are omitted from API requests. However, any non-pointer,
  2127. // non-interface field appearing in ForceSendFields will be sent to the
  2128. // server regardless of whether the field is empty or not. This may be
  2129. // used to include empty fields in Patch requests.
  2130. ForceSendFields []string `json:"-"`
  2131. }
  2132. func (s *OrderLineItemProductVariantAttribute) MarshalJSON() ([]byte, error) {
  2133. type noMethod OrderLineItemProductVariantAttribute
  2134. raw := noMethod(*s)
  2135. return gensupport.MarshalJSON(raw, s.ForceSendFields)
  2136. }
  2137. type OrderLineItemReturnInfo struct {
  2138. // DaysToReturn: How many days later the item can be returned.
  2139. DaysToReturn int64 `json:"daysToReturn,omitempty"`
  2140. // IsReturnable: Whether the item is returnable.
  2141. IsReturnable bool `json:"isReturnable,omitempty"`
  2142. // PolicyUrl: URL of the item return policy.
  2143. PolicyUrl string `json:"policyUrl,omitempty"`
  2144. // ForceSendFields is a list of field names (e.g. "DaysToReturn") to
  2145. // unconditionally include in API requests. By default, fields with
  2146. // empty values are omitted from API requests. However, any non-pointer,
  2147. // non-interface field appearing in ForceSendFields will be sent to the
  2148. // server regardless of whether the field is empty or not. This may be
  2149. // used to include empty fields in Patch requests.
  2150. ForceSendFields []string `json:"-"`
  2151. }
  2152. func (s *OrderLineItemReturnInfo) MarshalJSON() ([]byte, error) {
  2153. type noMethod OrderLineItemReturnInfo
  2154. raw := noMethod(*s)
  2155. return gensupport.MarshalJSON(raw, s.ForceSendFields)
  2156. }
  2157. type OrderLineItemShippingDetails struct {
  2158. // DeliverByDate: The delivery by date, in ISO 8601 format.
  2159. DeliverByDate string `json:"deliverByDate,omitempty"`
  2160. // Method: Details of the shipping method.
  2161. Method *OrderLineItemShippingDetailsMethod `json:"method,omitempty"`
  2162. // ShipByDate: The ship by date, in ISO 8601 format.
  2163. ShipByDate string `json:"shipByDate,omitempty"`
  2164. // ForceSendFields is a list of field names (e.g. "DeliverByDate") to
  2165. // unconditionally include in API requests. By default, fields with
  2166. // empty values are omitted from API requests. However, any non-pointer,
  2167. // non-interface field appearing in ForceSendFields will be sent to the
  2168. // server regardless of whether the field is empty or not. This may be
  2169. // used to include empty fields in Patch requests.
  2170. ForceSendFields []string `json:"-"`
  2171. }
  2172. func (s *OrderLineItemShippingDetails) MarshalJSON() ([]byte, error) {
  2173. type noMethod OrderLineItemShippingDetails
  2174. raw := noMethod(*s)
  2175. return gensupport.MarshalJSON(raw, s.ForceSendFields)
  2176. }
  2177. type OrderLineItemShippingDetailsMethod struct {
  2178. // Carrier: The carrier for the shipping. Optional.
  2179. Carrier string `json:"carrier,omitempty"`
  2180. // MaxDaysInTransit: Maximum transit time.
  2181. MaxDaysInTransit int64 `json:"maxDaysInTransit,omitempty"`
  2182. // MethodName: The name of the shipping method.
  2183. MethodName string `json:"methodName,omitempty"`
  2184. // MinDaysInTransit: Minimum transit time.
  2185. MinDaysInTransit int64 `json:"minDaysInTransit,omitempty"`
  2186. // ForceSendFields is a list of field names (e.g. "Carrier") to
  2187. // unconditionally include in API requests. By default, fields with
  2188. // empty values are omitted from API requests. However, any non-pointer,
  2189. // non-interface field appearing in ForceSendFields will be sent to the
  2190. // server regardless of whether the field is empty or not. This may be
  2191. // used to include empty fields in Patch requests.
  2192. ForceSendFields []string `json:"-"`
  2193. }
  2194. func (s *OrderLineItemShippingDetailsMethod) MarshalJSON() ([]byte, error) {
  2195. type noMethod OrderLineItemShippingDetailsMethod
  2196. raw := noMethod(*s)
  2197. return gensupport.MarshalJSON(raw, s.ForceSendFields)
  2198. }
  2199. type OrderPaymentMethod struct {
  2200. // BillingAddress: The billing address.
  2201. BillingAddress *OrderAddress `json:"billingAddress,omitempty"`
  2202. // ExpirationMonth: The card expiration month (January = 1, February = 2
  2203. // etc.).
  2204. ExpirationMonth int64 `json:"expirationMonth,omitempty"`
  2205. // ExpirationYear: The card expiration year (4-digit, e.g. 2015).
  2206. ExpirationYear int64 `json:"expirationYear,omitempty"`
  2207. // LastFourDigits: The last four digits of the card number.
  2208. LastFourDigits string `json:"lastFourDigits,omitempty"`
  2209. // PhoneNumber: The billing phone number.
  2210. PhoneNumber string `json:"phoneNumber,omitempty"`
  2211. // Type: The type of instrument (VISA, Mastercard, etc).
  2212. Type string `json:"type,omitempty"`
  2213. // ForceSendFields is a list of field names (e.g. "BillingAddress") to
  2214. // unconditionally include in API requests. By default, fields with
  2215. // empty values are omitted from API requests. However, any non-pointer,
  2216. // non-interface field appearing in ForceSendFields will be sent to the
  2217. // server regardless of whether the field is empty or not. This may be
  2218. // used to include empty fields in Patch requests.
  2219. ForceSendFields []string `json:"-"`
  2220. }
  2221. func (s *OrderPaymentMethod) MarshalJSON() ([]byte, error) {
  2222. type noMethod OrderPaymentMethod
  2223. raw := noMethod(*s)
  2224. return gensupport.MarshalJSON(raw, s.ForceSendFields)
  2225. }
  2226. type OrderRefund struct {
  2227. // Actor: The actor that created the refund.
  2228. Actor string `json:"actor,omitempty"`
  2229. // Amount: The amount that is refunded.
  2230. Amount *Price `json:"amount,omitempty"`
  2231. // CreationDate: Date on which the item has been created, in ISO 8601
  2232. // format.
  2233. CreationDate string `json:"creationDate,omitempty"`
  2234. // Reason: The reason for the refund.
  2235. Reason string `json:"reason,omitempty"`
  2236. // ReasonText: The explanation of the reason.
  2237. ReasonText string `json:"reasonText,omitempty"`
  2238. // ForceSendFields is a list of field names (e.g. "Actor") to
  2239. // unconditionally include in API requests. By default, fields with
  2240. // empty values are omitted from API requests. However, any non-pointer,
  2241. // non-interface field appearing in ForceSendFields will be sent to the
  2242. // server regardless of whether the field is empty or not. This may be
  2243. // used to include empty fields in Patch requests.
  2244. ForceSendFields []string `json:"-"`
  2245. }
  2246. func (s *OrderRefund) MarshalJSON() ([]byte, error) {
  2247. type noMethod OrderRefund
  2248. raw := noMethod(*s)
  2249. return gensupport.MarshalJSON(raw, s.ForceSendFields)
  2250. }
  2251. type OrderReturn struct {
  2252. // Actor: The actor that created the refund.
  2253. Actor string `json:"actor,omitempty"`
  2254. // CreationDate: Date on which the item has been created, in ISO 8601
  2255. // format.
  2256. CreationDate string `json:"creationDate,omitempty"`
  2257. // Quantity: Quantity that is returned.
  2258. Quantity int64 `json:"quantity,omitempty"`
  2259. // Reason: The reason for the return.
  2260. Reason string `json:"reason,omitempty"`
  2261. // ReasonText: The explanation of the reason.
  2262. ReasonText string `json:"reasonText,omitempty"`
  2263. // ForceSendFields is a list of field names (e.g. "Actor") to
  2264. // unconditionally include in API requests. By default, fields with
  2265. // empty values are omitted from API requests. However, any non-pointer,
  2266. // non-interface field appearing in ForceSendFields will be sent to the
  2267. // server regardless of whether the field is empty or not. This may be
  2268. // used to include empty fields in Patch requests.
  2269. ForceSendFields []string `json:"-"`
  2270. }
  2271. func (s *OrderReturn) MarshalJSON() ([]byte, error) {
  2272. type noMethod OrderReturn
  2273. raw := noMethod(*s)
  2274. return gensupport.MarshalJSON(raw, s.ForceSendFields)
  2275. }
  2276. type OrderShipment struct {
  2277. // Carrier: The carrier handling the shipment.
  2278. Carrier string `json:"carrier,omitempty"`
  2279. // CreationDate: Date on which the shipment has been created, in ISO
  2280. // 8601 format.
  2281. CreationDate string `json:"creationDate,omitempty"`
  2282. // DeliveryDate: Date on which the shipment has been delivered, in ISO
  2283. // 8601 format. Present only if status is delievered
  2284. DeliveryDate string `json:"deliveryDate,omitempty"`
  2285. // Id: The id of the shipment.
  2286. Id string `json:"id,omitempty"`
  2287. // LineItems: The line items that are shipped.
  2288. LineItems []*OrderShipmentLineItemShipment `json:"lineItems,omitempty"`
  2289. // Status: The status of the shipment.
  2290. Status string `json:"status,omitempty"`
  2291. // TrackingId: The tracking id for the shipment.
  2292. TrackingId string `json:"trackingId,omitempty"`
  2293. // ForceSendFields is a list of field names (e.g. "Carrier") to
  2294. // unconditionally include in API requests. By default, fields with
  2295. // empty values are omitted from API requests. However, any non-pointer,
  2296. // non-interface field appearing in ForceSendFields will be sent to the
  2297. // server regardless of whether the field is empty or not. This may be
  2298. // used to include empty fields in Patch requests.
  2299. ForceSendFields []string `json:"-"`
  2300. }
  2301. func (s *OrderShipment) MarshalJSON() ([]byte, error) {
  2302. type noMethod OrderShipment
  2303. raw := noMethod(*s)
  2304. return gensupport.MarshalJSON(raw, s.ForceSendFields)
  2305. }
  2306. type OrderShipmentLineItemShipment struct {
  2307. // LineItemId: The id of the line item that is shipped.
  2308. LineItemId string `json:"lineItemId,omitempty"`
  2309. // Quantity: The quantity that is shipped.
  2310. Quantity int64 `json:"quantity,omitempty"`
  2311. // ForceSendFields is a list of field names (e.g. "LineItemId") to
  2312. // unconditionally include in API requests. By default, fields with
  2313. // empty values are omitted from API requests. However, any non-pointer,
  2314. // non-interface field appearing in ForceSendFields will be sent to the
  2315. // server regardless of whether the field is empty or not. This may be
  2316. // used to include empty fields in Patch requests.
  2317. ForceSendFields []string `json:"-"`
  2318. }
  2319. func (s *OrderShipmentLineItemShipment) MarshalJSON() ([]byte, error) {
  2320. type noMethod OrderShipmentLineItemShipment
  2321. raw := noMethod(*s)
  2322. return gensupport.MarshalJSON(raw, s.ForceSendFields)
  2323. }
  2324. type OrdersAcknowledgeRequest struct {
  2325. // OperationId: The ID of the operation. Unique across all operations
  2326. // for a given order.
  2327. OperationId string `json:"operationId,omitempty"`
  2328. // ForceSendFields is a list of field names (e.g. "OperationId") to
  2329. // unconditionally include in API requests. By default, fields with
  2330. // empty values are omitted from API requests. However, any non-pointer,
  2331. // non-interface field appearing in ForceSendFields will be sent to the
  2332. // server regardless of whether the field is empty or not. This may be
  2333. // used to include empty fields in Patch requests.
  2334. ForceSendFields []string `json:"-"`
  2335. }
  2336. func (s *OrdersAcknowledgeRequest) MarshalJSON() ([]byte, error) {
  2337. type noMethod OrdersAcknowledgeRequest
  2338. raw := noMethod(*s)
  2339. return gensupport.MarshalJSON(raw, s.ForceSendFields)
  2340. }
  2341. type OrdersAcknowledgeResponse struct {
  2342. // ExecutionStatus: The status of the execution.
  2343. ExecutionStatus string `json:"executionStatus,omitempty"`
  2344. // Kind: Identifies what kind of resource this is. Value: the fixed
  2345. // string "content#ordersAcknowledgeResponse".
  2346. Kind string `json:"kind,omitempty"`
  2347. // ServerResponse contains the HTTP response code and headers from the
  2348. // server.
  2349. googleapi.ServerResponse `json:"-"`
  2350. // ForceSendFields is a list of field names (e.g. "ExecutionStatus") to
  2351. // unconditionally include in API requests. By default, fields with
  2352. // empty values are omitted from API requests. However, any non-pointer,
  2353. // non-interface field appearing in ForceSendFields will be sent to the
  2354. // server regardless of whether the field is empty or not. This may be
  2355. // used to include empty fields in Patch requests.
  2356. ForceSendFields []string `json:"-"`
  2357. }
  2358. func (s *OrdersAcknowledgeResponse) MarshalJSON() ([]byte, error) {
  2359. type noMethod OrdersAcknowledgeResponse
  2360. raw := noMethod(*s)
  2361. return gensupport.MarshalJSON(raw, s.ForceSendFields)
  2362. }
  2363. type OrdersAdvanceTestOrderResponse struct {
  2364. // Kind: Identifies what kind of resource this is. Value: the fixed
  2365. // string "content#ordersAdvanceTestOrderResponse".
  2366. Kind string `json:"kind,omitempty"`
  2367. // ServerResponse contains the HTTP response code and headers from the
  2368. // server.
  2369. googleapi.ServerResponse `json:"-"`
  2370. // ForceSendFields is a list of field names (e.g. "Kind") to
  2371. // unconditionally include in API requests. By default, fields with
  2372. // empty values are omitted from API requests. However, any non-pointer,
  2373. // non-interface field appearing in ForceSendFields will be sent to the
  2374. // server regardless of whether the field is empty or not. This may be
  2375. // used to include empty fields in Patch requests.
  2376. ForceSendFields []string `json:"-"`
  2377. }
  2378. func (s *OrdersAdvanceTestOrderResponse) MarshalJSON() ([]byte, error) {
  2379. type noMethod OrdersAdvanceTestOrderResponse
  2380. raw := noMethod(*s)
  2381. return gensupport.MarshalJSON(raw, s.ForceSendFields)
  2382. }
  2383. type OrdersCancelLineItemRequest struct {
  2384. // Amount: Amount to refund for the cancelation. Optional. If not set,
  2385. // Google will calculate the default based on the price and tax of the
  2386. // items involved. The amount must not be larger than the net amount
  2387. // left on the order.
  2388. Amount *Price `json:"amount,omitempty"`
  2389. // LineItemId: The ID of the line item to cancel.
  2390. LineItemId string `json:"lineItemId,omitempty"`
  2391. // OperationId: The ID of the operation. Unique across all operations
  2392. // for a given order.
  2393. OperationId string `json:"operationId,omitempty"`
  2394. // Quantity: The quantity to cancel.
  2395. Quantity int64 `json:"quantity,omitempty"`
  2396. // Reason: The reason for the cancellation.
  2397. Reason string `json:"reason,omitempty"`
  2398. // ReasonText: The explanation of the reason.
  2399. ReasonText string `json:"reasonText,omitempty"`
  2400. // ForceSendFields is a list of field names (e.g. "Amount") to
  2401. // unconditionally include in API requests. By default, fields with
  2402. // empty values are omitted from API requests. However, any non-pointer,
  2403. // non-interface field appearing in ForceSendFields will be sent to the
  2404. // server regardless of whether the field is empty or not. This may be
  2405. // used to include empty fields in Patch requests.
  2406. ForceSendFields []string `json:"-"`
  2407. }
  2408. func (s *OrdersCancelLineItemRequest) MarshalJSON() ([]byte, error) {
  2409. type noMethod OrdersCancelLineItemRequest
  2410. raw := noMethod(*s)
  2411. return gensupport.MarshalJSON(raw, s.ForceSendFields)
  2412. }
  2413. type OrdersCancelLineItemResponse struct {
  2414. // ExecutionStatus: The status of the execution.
  2415. ExecutionStatus string `json:"executionStatus,omitempty"`
  2416. // Kind: Identifies what kind of resource this is. Value: the fixed
  2417. // string "content#ordersCancelLineItemResponse".
  2418. Kind string `json:"kind,omitempty"`
  2419. // ServerResponse contains the HTTP response code and headers from the
  2420. // server.
  2421. googleapi.ServerResponse `json:"-"`
  2422. // ForceSendFields is a list of field names (e.g. "ExecutionStatus") to
  2423. // unconditionally include in API requests. By default, fields with
  2424. // empty values are omitted from API requests. However, any non-pointer,
  2425. // non-interface field appearing in ForceSendFields will be sent to the
  2426. // server regardless of whether the field is empty or not. This may be
  2427. // used to include empty fields in Patch requests.
  2428. ForceSendFields []string `json:"-"`
  2429. }
  2430. func (s *OrdersCancelLineItemResponse) MarshalJSON() ([]byte, error) {
  2431. type noMethod OrdersCancelLineItemResponse
  2432. raw := noMethod(*s)
  2433. return gensupport.MarshalJSON(raw, s.ForceSendFields)
  2434. }
  2435. type OrdersCancelRequest struct {
  2436. // OperationId: The ID of the operation. Unique across all operations
  2437. // for a given order.
  2438. OperationId string `json:"operationId,omitempty"`
  2439. // Reason: The reason for the cancellation.
  2440. Reason string `json:"reason,omitempty"`
  2441. // ReasonText: The explanation of the reason.
  2442. ReasonText string `json:"reasonText,omitempty"`
  2443. // ForceSendFields is a list of field names (e.g. "OperationId") to
  2444. // unconditionally include in API requests. By default, fields with
  2445. // empty values are omitted from API requests. However, any non-pointer,
  2446. // non-interface field appearing in ForceSendFields will be sent to the
  2447. // server regardless of whether the field is empty or not. This may be
  2448. // used to include empty fields in Patch requests.
  2449. ForceSendFields []string `json:"-"`
  2450. }
  2451. func (s *OrdersCancelRequest) MarshalJSON() ([]byte, error) {
  2452. type noMethod OrdersCancelRequest
  2453. raw := noMethod(*s)
  2454. return gensupport.MarshalJSON(raw, s.ForceSendFields)
  2455. }
  2456. type OrdersCancelResponse struct {
  2457. // ExecutionStatus: The status of the execution.
  2458. ExecutionStatus string `json:"executionStatus,omitempty"`
  2459. // Kind: Identifies what kind of resource this is. Value: the fixed
  2460. // string "content#ordersCancelResponse".
  2461. Kind string `json:"kind,omitempty"`
  2462. // ServerResponse contains the HTTP response code and headers from the
  2463. // server.
  2464. googleapi.ServerResponse `json:"-"`
  2465. // ForceSendFields is a list of field names (e.g. "ExecutionStatus") to
  2466. // unconditionally include in API requests. By default, fields with
  2467. // empty values are omitted from API requests. However, any non-pointer,
  2468. // non-interface field appearing in ForceSendFields will be sent to the
  2469. // server regardless of whether the field is empty or not. This may be
  2470. // used to include empty fields in Patch requests.
  2471. ForceSendFields []string `json:"-"`
  2472. }
  2473. func (s *OrdersCancelResponse) MarshalJSON() ([]byte, error) {
  2474. type noMethod OrdersCancelResponse
  2475. raw := noMethod(*s)
  2476. return gensupport.MarshalJSON(raw, s.ForceSendFields)
  2477. }
  2478. type OrdersCreateTestOrderRequest struct {
  2479. // TemplateName: The test order template to use. Specify as an
  2480. // alternative to testOrder as a shortcut for retrieving a template and
  2481. // then creating an order using that template.
  2482. TemplateName string `json:"templateName,omitempty"`
  2483. // TestOrder: The test order to create.
  2484. TestOrder *TestOrder `json:"testOrder,omitempty"`
  2485. // ForceSendFields is a list of field names (e.g. "TemplateName") to
  2486. // unconditionally include in API requests. By default, fields with
  2487. // empty values are omitted from API requests. However, any non-pointer,
  2488. // non-interface field appearing in ForceSendFields will be sent to the
  2489. // server regardless of whether the field is empty or not. This may be
  2490. // used to include empty fields in Patch requests.
  2491. ForceSendFields []string `json:"-"`
  2492. }
  2493. func (s *OrdersCreateTestOrderRequest) MarshalJSON() ([]byte, error) {
  2494. type noMethod OrdersCreateTestOrderRequest
  2495. raw := noMethod(*s)
  2496. return gensupport.MarshalJSON(raw, s.ForceSendFields)
  2497. }
  2498. type OrdersCreateTestOrderResponse struct {
  2499. // Kind: Identifies what kind of resource this is. Value: the fixed
  2500. // string "content#ordersCreateTestOrderResponse".
  2501. Kind string `json:"kind,omitempty"`
  2502. // OrderId: The ID of the newly created test order.
  2503. OrderId string `json:"orderId,omitempty"`
  2504. // ServerResponse contains the HTTP response code and headers from the
  2505. // server.
  2506. googleapi.ServerResponse `json:"-"`
  2507. // ForceSendFields is a list of field names (e.g. "Kind") to
  2508. // unconditionally include in API requests. By default, fields with
  2509. // empty values are omitted from API requests. However, any non-pointer,
  2510. // non-interface field appearing in ForceSendFields will be sent to the
  2511. // server regardless of whether the field is empty or not. This may be
  2512. // used to include empty fields in Patch requests.
  2513. ForceSendFields []string `json:"-"`
  2514. }
  2515. func (s *OrdersCreateTestOrderResponse) MarshalJSON() ([]byte, error) {
  2516. type noMethod OrdersCreateTestOrderResponse
  2517. raw := noMethod(*s)
  2518. return gensupport.MarshalJSON(raw, s.ForceSendFields)
  2519. }
  2520. type OrdersCustomBatchRequest struct {
  2521. // Entries: The request entries to be processed in the batch.
  2522. Entries []*OrdersCustomBatchRequestEntry `json:"entries,omitempty"`
  2523. // ForceSendFields is a list of field names (e.g. "Entries") to
  2524. // unconditionally include in API requests. By default, fields with
  2525. // empty values are omitted from API requests. However, any non-pointer,
  2526. // non-interface field appearing in ForceSendFields will be sent to the
  2527. // server regardless of whether the field is empty or not. This may be
  2528. // used to include empty fields in Patch requests.
  2529. ForceSendFields []string `json:"-"`
  2530. }
  2531. func (s *OrdersCustomBatchRequest) MarshalJSON() ([]byte, error) {
  2532. type noMethod OrdersCustomBatchRequest
  2533. raw := noMethod(*s)
  2534. return gensupport.MarshalJSON(raw, s.ForceSendFields)
  2535. }
  2536. type OrdersCustomBatchRequestEntry struct {
  2537. // BatchId: An entry ID, unique within the batch request.
  2538. BatchId int64 `json:"batchId,omitempty"`
  2539. // Cancel: Required for cancel method.
  2540. Cancel *OrdersCustomBatchRequestEntryCancel `json:"cancel,omitempty"`
  2541. // CancelLineItem: Required for cancelLineItem method.
  2542. CancelLineItem *OrdersCustomBatchRequestEntryCancelLineItem `json:"cancelLineItem,omitempty"`
  2543. // MerchantId: The ID of the managing account.
  2544. MerchantId uint64 `json:"merchantId,omitempty,string"`
  2545. // MerchantOrderId: The merchant order id. Required for
  2546. // updateMerchantOrderId and getByMerchantOrderId methods.
  2547. MerchantOrderId string `json:"merchantOrderId,omitempty"`
  2548. // Method: The method to apply.
  2549. Method string `json:"method,omitempty"`
  2550. // OperationId: The ID of the operation. Unique across all operations
  2551. // for a given order. Required for all methods beside get and
  2552. // getByMerchantOrderId.
  2553. OperationId string `json:"operationId,omitempty"`
  2554. // OrderId: The ID of the order. Required for all methods beside
  2555. // getByMerchantOrderId.
  2556. OrderId string `json:"orderId,omitempty"`
  2557. // Refund: Required for refund method.
  2558. Refund *OrdersCustomBatchRequestEntryRefund `json:"refund,omitempty"`
  2559. // ReturnLineItem: Required for returnLineItem method.
  2560. ReturnLineItem *OrdersCustomBatchRequestEntryReturnLineItem `json:"returnLineItem,omitempty"`
  2561. // ShipLineItems: Required for shipLineItems method.
  2562. ShipLineItems *OrdersCustomBatchRequestEntryShipLineItems `json:"shipLineItems,omitempty"`
  2563. // UpdateShipment: Required for updateShipment method.
  2564. UpdateShipment *OrdersCustomBatchRequestEntryUpdateShipment `json:"updateShipment,omitempty"`
  2565. // ForceSendFields is a list of field names (e.g. "BatchId") to
  2566. // unconditionally include in API requests. By default, fields with
  2567. // empty values are omitted from API requests. However, any non-pointer,
  2568. // non-interface field appearing in ForceSendFields will be sent to the
  2569. // server regardless of whether the field is empty or not. This may be
  2570. // used to include empty fields in Patch requests.
  2571. ForceSendFields []string `json:"-"`
  2572. }
  2573. func (s *OrdersCustomBatchRequestEntry) MarshalJSON() ([]byte, error) {
  2574. type noMethod OrdersCustomBatchRequestEntry
  2575. raw := noMethod(*s)
  2576. return gensupport.MarshalJSON(raw, s.ForceSendFields)
  2577. }
  2578. type OrdersCustomBatchRequestEntryCancel struct {
  2579. // Reason: The reason for the cancellation.
  2580. Reason string `json:"reason,omitempty"`
  2581. // ReasonText: The explanation of the reason.
  2582. ReasonText string `json:"reasonText,omitempty"`
  2583. // ForceSendFields is a list of field names (e.g. "Reason") to
  2584. // unconditionally include in API requests. By default, fields with
  2585. // empty values are omitted from API requests. However, any non-pointer,
  2586. // non-interface field appearing in ForceSendFields will be sent to the
  2587. // server regardless of whether the field is empty or not. This may be
  2588. // used to include empty fields in Patch requests.
  2589. ForceSendFields []string `json:"-"`
  2590. }
  2591. func (s *OrdersCustomBatchRequestEntryCancel) MarshalJSON() ([]byte, error) {
  2592. type noMethod OrdersCustomBatchRequestEntryCancel
  2593. raw := noMethod(*s)
  2594. return gensupport.MarshalJSON(raw, s.ForceSendFields)
  2595. }
  2596. type OrdersCustomBatchRequestEntryCancelLineItem struct {
  2597. // Amount: Amount to refund for the cancelation. Optional. If not set,
  2598. // Google will calculate the default based on the price and tax of the
  2599. // items involved. The amount must not be larger than the net amount
  2600. // left on the order.
  2601. Amount *Price `json:"amount,omitempty"`
  2602. // LineItemId: The ID of the line item to cancel.
  2603. LineItemId string `json:"lineItemId,omitempty"`
  2604. // Quantity: The quantity to cancel.
  2605. Quantity int64 `json:"quantity,omitempty"`
  2606. // Reason: The reason for the cancellation.
  2607. Reason string `json:"reason,omitempty"`
  2608. // ReasonText: The explanation of the reason.
  2609. ReasonText string `json:"reasonText,omitempty"`
  2610. // ForceSendFields is a list of field names (e.g. "Amount") to
  2611. // unconditionally include in API requests. By default, fields with
  2612. // empty values are omitted from API requests. However, any non-pointer,
  2613. // non-interface field appearing in ForceSendFields will be sent to the
  2614. // server regardless of whether the field is empty or not. This may be
  2615. // used to include empty fields in Patch requests.
  2616. ForceSendFields []string `json:"-"`
  2617. }
  2618. func (s *OrdersCustomBatchRequestEntryCancelLineItem) MarshalJSON() ([]byte, error) {
  2619. type noMethod OrdersCustomBatchRequestEntryCancelLineItem
  2620. raw := noMethod(*s)
  2621. return gensupport.MarshalJSON(raw, s.ForceSendFields)
  2622. }
  2623. type OrdersCustomBatchRequestEntryRefund struct {
  2624. // Amount: The amount that is refunded.
  2625. Amount *Price `json:"amount,omitempty"`
  2626. // Reason: The reason for the refund.
  2627. Reason string `json:"reason,omitempty"`
  2628. // ReasonText: The explanation of the reason.
  2629. ReasonText string `json:"reasonText,omitempty"`
  2630. // ForceSendFields is a list of field names (e.g. "Amount") to
  2631. // unconditionally include in API requests. By default, fields with
  2632. // empty values are omitted from API requests. However, any non-pointer,
  2633. // non-interface field appearing in ForceSendFields will be sent to the
  2634. // server regardless of whether the field is empty or not. This may be
  2635. // used to include empty fields in Patch requests.
  2636. ForceSendFields []string `json:"-"`
  2637. }
  2638. func (s *OrdersCustomBatchRequestEntryRefund) MarshalJSON() ([]byte, error) {
  2639. type noMethod OrdersCustomBatchRequestEntryRefund
  2640. raw := noMethod(*s)
  2641. return gensupport.MarshalJSON(raw, s.ForceSendFields)
  2642. }
  2643. type OrdersCustomBatchRequestEntryReturnLineItem struct {
  2644. // LineItemId: The ID of the line item to return.
  2645. LineItemId string `json:"lineItemId,omitempty"`
  2646. // Quantity: The quantity to return.
  2647. Quantity int64 `json:"quantity,omitempty"`
  2648. // Reason: The reason for the return.
  2649. Reason string `json:"reason,omitempty"`
  2650. // ReasonText: The explanation of the reason.
  2651. ReasonText string `json:"reasonText,omitempty"`
  2652. // ForceSendFields is a list of field names (e.g. "LineItemId") to
  2653. // unconditionally include in API requests. By default, fields with
  2654. // empty values are omitted from API requests. However, any non-pointer,
  2655. // non-interface field appearing in ForceSendFields will be sent to the
  2656. // server regardless of whether the field is empty or not. This may be
  2657. // used to include empty fields in Patch requests.
  2658. ForceSendFields []string `json:"-"`
  2659. }
  2660. func (s *OrdersCustomBatchRequestEntryReturnLineItem) MarshalJSON() ([]byte, error) {
  2661. type noMethod OrdersCustomBatchRequestEntryReturnLineItem
  2662. raw := noMethod(*s)
  2663. return gensupport.MarshalJSON(raw, s.ForceSendFields)
  2664. }
  2665. type OrdersCustomBatchRequestEntryShipLineItems struct {
  2666. // Carrier: The carrier handling the shipment.
  2667. Carrier string `json:"carrier,omitempty"`
  2668. // LineItems: Line items to ship.
  2669. LineItems []*OrderShipmentLineItemShipment `json:"lineItems,omitempty"`
  2670. // ShipmentId: The ID of the shipment.
  2671. ShipmentId string `json:"shipmentId,omitempty"`
  2672. // TrackingId: The tracking id for the shipment.
  2673. TrackingId string `json:"trackingId,omitempty"`
  2674. // ForceSendFields is a list of field names (e.g. "Carrier") to
  2675. // unconditionally include in API requests. By default, fields with
  2676. // empty values are omitted from API requests. However, any non-pointer,
  2677. // non-interface field appearing in ForceSendFields will be sent to the
  2678. // server regardless of whether the field is empty or not. This may be
  2679. // used to include empty fields in Patch requests.
  2680. ForceSendFields []string `json:"-"`
  2681. }
  2682. func (s *OrdersCustomBatchRequestEntryShipLineItems) MarshalJSON() ([]byte, error) {
  2683. type noMethod OrdersCustomBatchRequestEntryShipLineItems
  2684. raw := noMethod(*s)
  2685. return gensupport.MarshalJSON(raw, s.ForceSendFields)
  2686. }
  2687. type OrdersCustomBatchRequestEntryUpdateShipment struct {
  2688. // Carrier: The carrier handling the shipment. Not updated if missing.
  2689. Carrier string `json:"carrier,omitempty"`
  2690. // ShipmentId: The ID of the shipment.
  2691. ShipmentId string `json:"shipmentId,omitempty"`
  2692. // Status: New status for the shipment. Not updated if missing.
  2693. Status string `json:"status,omitempty"`
  2694. // TrackingId: The tracking id for the shipment. Not updated if missing.
  2695. TrackingId string `json:"trackingId,omitempty"`
  2696. // ForceSendFields is a list of field names (e.g. "Carrier") to
  2697. // unconditionally include in API requests. By default, fields with
  2698. // empty values are omitted from API requests. However, any non-pointer,
  2699. // non-interface field appearing in ForceSendFields will be sent to the
  2700. // server regardless of whether the field is empty or not. This may be
  2701. // used to include empty fields in Patch requests.
  2702. ForceSendFields []string `json:"-"`
  2703. }
  2704. func (s *OrdersCustomBatchRequestEntryUpdateShipment) MarshalJSON() ([]byte, error) {
  2705. type noMethod OrdersCustomBatchRequestEntryUpdateShipment
  2706. raw := noMethod(*s)
  2707. return gensupport.MarshalJSON(raw, s.ForceSendFields)
  2708. }
  2709. type OrdersCustomBatchResponse struct {
  2710. // Entries: The result of the execution of the batch requests.
  2711. Entries []*OrdersCustomBatchResponseEntry `json:"entries,omitempty"`
  2712. // Kind: Identifies what kind of resource this is. Value: the fixed
  2713. // string "content#ordersCustomBatchResponse".
  2714. Kind string `json:"kind,omitempty"`
  2715. // ServerResponse contains the HTTP response code and headers from the
  2716. // server.
  2717. googleapi.ServerResponse `json:"-"`
  2718. // ForceSendFields is a list of field names (e.g. "Entries") to
  2719. // unconditionally include in API requests. By default, fields with
  2720. // empty values are omitted from API requests. However, any non-pointer,
  2721. // non-interface field appearing in ForceSendFields will be sent to the
  2722. // server regardless of whether the field is empty or not. This may be
  2723. // used to include empty fields in Patch requests.
  2724. ForceSendFields []string `json:"-"`
  2725. }
  2726. func (s *OrdersCustomBatchResponse) MarshalJSON() ([]byte, error) {
  2727. type noMethod OrdersCustomBatchResponse
  2728. raw := noMethod(*s)
  2729. return gensupport.MarshalJSON(raw, s.ForceSendFields)
  2730. }
  2731. type OrdersCustomBatchResponseEntry struct {
  2732. // BatchId: The ID of the request entry this entry responds to.
  2733. BatchId int64 `json:"batchId,omitempty"`
  2734. // Errors: A list of errors defined if and only if the request failed.
  2735. Errors *Errors `json:"errors,omitempty"`
  2736. // ExecutionStatus: The status of the execution. Only defined if the
  2737. // method is not get or getByMerchantOrderId and if the request was
  2738. // successful.
  2739. ExecutionStatus string `json:"executionStatus,omitempty"`
  2740. // Kind: Identifies what kind of resource this is. Value: the fixed
  2741. // string "content#ordersCustomBatchResponseEntry".
  2742. Kind string `json:"kind,omitempty"`
  2743. // Order: The retrieved order. Only defined if the method is get and if
  2744. // the request was successful.
  2745. Order *Order `json:"order,omitempty"`
  2746. // ForceSendFields is a list of field names (e.g. "BatchId") to
  2747. // unconditionally include in API requests. By default, fields with
  2748. // empty values are omitted from API requests. However, any non-pointer,
  2749. // non-interface field appearing in ForceSendFields will be sent to the
  2750. // server regardless of whether the field is empty or not. This may be
  2751. // used to include empty fields in Patch requests.
  2752. ForceSendFields []string `json:"-"`
  2753. }
  2754. func (s *OrdersCustomBatchResponseEntry) MarshalJSON() ([]byte, error) {
  2755. type noMethod OrdersCustomBatchResponseEntry
  2756. raw := noMethod(*s)
  2757. return gensupport.MarshalJSON(raw, s.ForceSendFields)
  2758. }
  2759. type OrdersGetByMerchantOrderIdResponse struct {
  2760. // Kind: Identifies what kind of resource this is. Value: the fixed
  2761. // string "content#ordersGetByMerchantOrderIdResponse".
  2762. Kind string `json:"kind,omitempty"`
  2763. // Order: The requested order.
  2764. Order *Order `json:"order,omitempty"`
  2765. // ServerResponse contains the HTTP response code and headers from the
  2766. // server.
  2767. googleapi.ServerResponse `json:"-"`
  2768. // ForceSendFields is a list of field names (e.g. "Kind") to
  2769. // unconditionally include in API requests. By default, fields with
  2770. // empty values are omitted from API requests. However, any non-pointer,
  2771. // non-interface field appearing in ForceSendFields will be sent to the
  2772. // server regardless of whether the field is empty or not. This may be
  2773. // used to include empty fields in Patch requests.
  2774. ForceSendFields []string `json:"-"`
  2775. }
  2776. func (s *OrdersGetByMerchantOrderIdResponse) MarshalJSON() ([]byte, error) {
  2777. type noMethod OrdersGetByMerchantOrderIdResponse
  2778. raw := noMethod(*s)
  2779. return gensupport.MarshalJSON(raw, s.ForceSendFields)
  2780. }
  2781. type OrdersGetTestOrderTemplateResponse struct {
  2782. // Kind: Identifies what kind of resource this is. Value: the fixed
  2783. // string "content#ordersGetTestOrderTemplateResponse".
  2784. Kind string `json:"kind,omitempty"`
  2785. // Template: The requested test order template.
  2786. Template *TestOrder `json:"template,omitempty"`
  2787. // ServerResponse contains the HTTP response code and headers from the
  2788. // server.
  2789. googleapi.ServerResponse `json:"-"`
  2790. // ForceSendFields is a list of field names (e.g. "Kind") to
  2791. // unconditionally include in API requests. By default, fields with
  2792. // empty values are omitted from API requests. However, any non-pointer,
  2793. // non-interface field appearing in ForceSendFields will be sent to the
  2794. // server regardless of whether the field is empty or not. This may be
  2795. // used to include empty fields in Patch requests.
  2796. ForceSendFields []string `json:"-"`
  2797. }
  2798. func (s *OrdersGetTestOrderTemplateResponse) MarshalJSON() ([]byte, error) {
  2799. type noMethod OrdersGetTestOrderTemplateResponse
  2800. raw := noMethod(*s)
  2801. return gensupport.MarshalJSON(raw, s.ForceSendFields)
  2802. }
  2803. type OrdersListResponse struct {
  2804. // Kind: Identifies what kind of resource this is. Value: the fixed
  2805. // string "content#ordersListResponse".
  2806. Kind string `json:"kind,omitempty"`
  2807. // NextPageToken: The token for the retrieval of the next page of
  2808. // orders.
  2809. NextPageToken string `json:"nextPageToken,omitempty"`
  2810. Resources []*Order `json:"resources,omitempty"`
  2811. // ServerResponse contains the HTTP response code and headers from the
  2812. // server.
  2813. googleapi.ServerResponse `json:"-"`
  2814. // ForceSendFields is a list of field names (e.g. "Kind") to
  2815. // unconditionally include in API requests. By default, fields with
  2816. // empty values are omitted from API requests. However, any non-pointer,
  2817. // non-interface field appearing in ForceSendFields will be sent to the
  2818. // server regardless of whether the field is empty or not. This may be
  2819. // used to include empty fields in Patch requests.
  2820. ForceSendFields []string `json:"-"`
  2821. }
  2822. func (s *OrdersListResponse) MarshalJSON() ([]byte, error) {
  2823. type noMethod OrdersListResponse
  2824. raw := noMethod(*s)
  2825. return gensupport.MarshalJSON(raw, s.ForceSendFields)
  2826. }
  2827. type OrdersRefundRequest struct {
  2828. // Amount: The amount that is refunded.
  2829. Amount *Price `json:"amount,omitempty"`
  2830. // OperationId: The ID of the operation. Unique across all operations
  2831. // for a given order.
  2832. OperationId string `json:"operationId,omitempty"`
  2833. // Reason: The reason for the refund.
  2834. Reason string `json:"reason,omitempty"`
  2835. // ReasonText: The explanation of the reason.
  2836. ReasonText string `json:"reasonText,omitempty"`
  2837. // ForceSendFields is a list of field names (e.g. "Amount") to
  2838. // unconditionally include in API requests. By default, fields with
  2839. // empty values are omitted from API requests. However, any non-pointer,
  2840. // non-interface field appearing in ForceSendFields will be sent to the
  2841. // server regardless of whether the field is empty or not. This may be
  2842. // used to include empty fields in Patch requests.
  2843. ForceSendFields []string `json:"-"`
  2844. }
  2845. func (s *OrdersRefundRequest) MarshalJSON() ([]byte, error) {
  2846. type noMethod OrdersRefundRequest
  2847. raw := noMethod(*s)
  2848. return gensupport.MarshalJSON(raw, s.ForceSendFields)
  2849. }
  2850. type OrdersRefundResponse struct {
  2851. // ExecutionStatus: The status of the execution.
  2852. ExecutionStatus string `json:"executionStatus,omitempty"`
  2853. // Kind: Identifies what kind of resource this is. Value: the fixed
  2854. // string "content#ordersRefundResponse".
  2855. Kind string `json:"kind,omitempty"`
  2856. // ServerResponse contains the HTTP response code and headers from the
  2857. // server.
  2858. googleapi.ServerResponse `json:"-"`
  2859. // ForceSendFields is a list of field names (e.g. "ExecutionStatus") to
  2860. // unconditionally include in API requests. By default, fields with
  2861. // empty values are omitted from API requests. However, any non-pointer,
  2862. // non-interface field appearing in ForceSendFields will be sent to the
  2863. // server regardless of whether the field is empty or not. This may be
  2864. // used to include empty fields in Patch requests.
  2865. ForceSendFields []string `json:"-"`
  2866. }
  2867. func (s *OrdersRefundResponse) MarshalJSON() ([]byte, error) {
  2868. type noMethod OrdersRefundResponse
  2869. raw := noMethod(*s)
  2870. return gensupport.MarshalJSON(raw, s.ForceSendFields)
  2871. }
  2872. type OrdersReturnLineItemRequest struct {
  2873. // LineItemId: The ID of the line item to return.
  2874. LineItemId string `json:"lineItemId,omitempty"`
  2875. // OperationId: The ID of the operation. Unique across all operations
  2876. // for a given order.
  2877. OperationId string `json:"operationId,omitempty"`
  2878. // Quantity: The quantity to return.
  2879. Quantity int64 `json:"quantity,omitempty"`
  2880. // Reason: The reason for the return.
  2881. Reason string `json:"reason,omitempty"`
  2882. // ReasonText: The explanation of the reason.
  2883. ReasonText string `json:"reasonText,omitempty"`
  2884. // ForceSendFields is a list of field names (e.g. "LineItemId") to
  2885. // unconditionally include in API requests. By default, fields with
  2886. // empty values are omitted from API requests. However, any non-pointer,
  2887. // non-interface field appearing in ForceSendFields will be sent to the
  2888. // server regardless of whether the field is empty or not. This may be
  2889. // used to include empty fields in Patch requests.
  2890. ForceSendFields []string `json:"-"`
  2891. }
  2892. func (s *OrdersReturnLineItemRequest) MarshalJSON() ([]byte, error) {
  2893. type noMethod OrdersReturnLineItemRequest
  2894. raw := noMethod(*s)
  2895. return gensupport.MarshalJSON(raw, s.ForceSendFields)
  2896. }
  2897. type OrdersReturnLineItemResponse struct {
  2898. // ExecutionStatus: The status of the execution.
  2899. ExecutionStatus string `json:"executionStatus,omitempty"`
  2900. // Kind: Identifies what kind of resource this is. Value: the fixed
  2901. // string "content#ordersReturnLineItemResponse".
  2902. Kind string `json:"kind,omitempty"`
  2903. // ServerResponse contains the HTTP response code and headers from the
  2904. // server.
  2905. googleapi.ServerResponse `json:"-"`
  2906. // ForceSendFields is a list of field names (e.g. "ExecutionStatus") to
  2907. // unconditionally include in API requests. By default, fields with
  2908. // empty values are omitted from API requests. However, any non-pointer,
  2909. // non-interface field appearing in ForceSendFields will be sent to the
  2910. // server regardless of whether the field is empty or not. This may be
  2911. // used to include empty fields in Patch requests.
  2912. ForceSendFields []string `json:"-"`
  2913. }
  2914. func (s *OrdersReturnLineItemResponse) MarshalJSON() ([]byte, error) {
  2915. type noMethod OrdersReturnLineItemResponse
  2916. raw := noMethod(*s)
  2917. return gensupport.MarshalJSON(raw, s.ForceSendFields)
  2918. }
  2919. type OrdersShipLineItemsRequest struct {
  2920. // Carrier: The carrier handling the shipment.
  2921. Carrier string `json:"carrier,omitempty"`
  2922. // LineItems: Line items to ship.
  2923. LineItems []*OrderShipmentLineItemShipment `json:"lineItems,omitempty"`
  2924. // OperationId: The ID of the operation. Unique across all operations
  2925. // for a given order.
  2926. OperationId string `json:"operationId,omitempty"`
  2927. // ShipmentId: The ID of the shipment.
  2928. ShipmentId string `json:"shipmentId,omitempty"`
  2929. // TrackingId: The tracking id for the shipment.
  2930. TrackingId string `json:"trackingId,omitempty"`
  2931. // ForceSendFields is a list of field names (e.g. "Carrier") to
  2932. // unconditionally include in API requests. By default, fields with
  2933. // empty values are omitted from API requests. However, any non-pointer,
  2934. // non-interface field appearing in ForceSendFields will be sent to the
  2935. // server regardless of whether the field is empty or not. This may be
  2936. // used to include empty fields in Patch requests.
  2937. ForceSendFields []string `json:"-"`
  2938. }
  2939. func (s *OrdersShipLineItemsRequest) MarshalJSON() ([]byte, error) {
  2940. type noMethod OrdersShipLineItemsRequest
  2941. raw := noMethod(*s)
  2942. return gensupport.MarshalJSON(raw, s.ForceSendFields)
  2943. }
  2944. type OrdersShipLineItemsResponse struct {
  2945. // ExecutionStatus: The status of the execution.
  2946. ExecutionStatus string `json:"executionStatus,omitempty"`
  2947. // Kind: Identifies what kind of resource this is. Value: the fixed
  2948. // string "content#ordersShipLineItemsResponse".
  2949. Kind string `json:"kind,omitempty"`
  2950. // ServerResponse contains the HTTP response code and headers from the
  2951. // server.
  2952. googleapi.ServerResponse `json:"-"`
  2953. // ForceSendFields is a list of field names (e.g. "ExecutionStatus") to
  2954. // unconditionally include in API requests. By default, fields with
  2955. // empty values are omitted from API requests. However, any non-pointer,
  2956. // non-interface field appearing in ForceSendFields will be sent to the
  2957. // server regardless of whether the field is empty or not. This may be
  2958. // used to include empty fields in Patch requests.
  2959. ForceSendFields []string `json:"-"`
  2960. }
  2961. func (s *OrdersShipLineItemsResponse) MarshalJSON() ([]byte, error) {
  2962. type noMethod OrdersShipLineItemsResponse
  2963. raw := noMethod(*s)
  2964. return gensupport.MarshalJSON(raw, s.ForceSendFields)
  2965. }
  2966. type OrdersUpdateMerchantOrderIdRequest struct {
  2967. // MerchantOrderId: The merchant order id to be assigned to the order.
  2968. // Must be unique per merchant.
  2969. MerchantOrderId string `json:"merchantOrderId,omitempty"`
  2970. // OperationId: The ID of the operation. Unique across all operations
  2971. // for a given order.
  2972. OperationId string `json:"operationId,omitempty"`
  2973. // ForceSendFields is a list of field names (e.g. "MerchantOrderId") to
  2974. // unconditionally include in API requests. By default, fields with
  2975. // empty values are omitted from API requests. However, any non-pointer,
  2976. // non-interface field appearing in ForceSendFields will be sent to the
  2977. // server regardless of whether the field is empty or not. This may be
  2978. // used to include empty fields in Patch requests.
  2979. ForceSendFields []string `json:"-"`
  2980. }
  2981. func (s *OrdersUpdateMerchantOrderIdRequest) MarshalJSON() ([]byte, error) {
  2982. type noMethod OrdersUpdateMerchantOrderIdRequest
  2983. raw := noMethod(*s)
  2984. return gensupport.MarshalJSON(raw, s.ForceSendFields)
  2985. }
  2986. type OrdersUpdateMerchantOrderIdResponse struct {
  2987. // ExecutionStatus: The status of the execution.
  2988. ExecutionStatus string `json:"executionStatus,omitempty"`
  2989. // Kind: Identifies what kind of resource this is. Value: the fixed
  2990. // string "content#ordersUpdateMerchantOrderIdResponse".
  2991. Kind string `json:"kind,omitempty"`
  2992. // ServerResponse contains the HTTP response code and headers from the
  2993. // server.
  2994. googleapi.ServerResponse `json:"-"`
  2995. // ForceSendFields is a list of field names (e.g. "ExecutionStatus") to
  2996. // unconditionally include in API requests. By default, fields with
  2997. // empty values are omitted from API requests. However, any non-pointer,
  2998. // non-interface field appearing in ForceSendFields will be sent to the
  2999. // server regardless of whether the field is empty or not. This may be
  3000. // used to include empty fields in Patch requests.
  3001. ForceSendFields []string `json:"-"`
  3002. }
  3003. func (s *OrdersUpdateMerchantOrderIdResponse) MarshalJSON() ([]byte, error) {
  3004. type noMethod OrdersUpdateMerchantOrderIdResponse
  3005. raw := noMethod(*s)
  3006. return gensupport.MarshalJSON(raw, s.ForceSendFields)
  3007. }
  3008. type OrdersUpdateShipmentRequest struct {
  3009. // Carrier: The carrier handling the shipment. Not updated if missing.
  3010. Carrier string `json:"carrier,omitempty"`
  3011. // OperationId: The ID of the operation. Unique across all operations
  3012. // for a given order.
  3013. OperationId string `json:"operationId,omitempty"`
  3014. // ShipmentId: The ID of the shipment.
  3015. ShipmentId string `json:"shipmentId,omitempty"`
  3016. // Status: New status for the shipment. Not updated if missing.
  3017. Status string `json:"status,omitempty"`
  3018. // TrackingId: The tracking id for the shipment. Not updated if missing.
  3019. TrackingId string `json:"trackingId,omitempty"`
  3020. // ForceSendFields is a list of field names (e.g. "Carrier") to
  3021. // unconditionally include in API requests. By default, fields with
  3022. // empty values are omitted from API requests. However, any non-pointer,
  3023. // non-interface field appearing in ForceSendFields will be sent to the
  3024. // server regardless of whether the field is empty or not. This may be
  3025. // used to include empty fields in Patch requests.
  3026. ForceSendFields []string `json:"-"`
  3027. }
  3028. func (s *OrdersUpdateShipmentRequest) MarshalJSON() ([]byte, error) {
  3029. type noMethod OrdersUpdateShipmentRequest
  3030. raw := noMethod(*s)
  3031. return gensupport.MarshalJSON(raw, s.ForceSendFields)
  3032. }
  3033. type OrdersUpdateShipmentResponse struct {
  3034. // ExecutionStatus: The status of the execution.
  3035. ExecutionStatus string `json:"executionStatus,omitempty"`
  3036. // Kind: Identifies what kind of resource this is. Value: the fixed
  3037. // string "content#ordersUpdateShipmentResponse".
  3038. Kind string `json:"kind,omitempty"`
  3039. // ServerResponse contains the HTTP response code and headers from the
  3040. // server.
  3041. googleapi.ServerResponse `json:"-"`
  3042. // ForceSendFields is a list of field names (e.g. "ExecutionStatus") to
  3043. // unconditionally include in API requests. By default, fields with
  3044. // empty values are omitted from API requests. However, any non-pointer,
  3045. // non-interface field appearing in ForceSendFields will be sent to the
  3046. // server regardless of whether the field is empty or not. This may be
  3047. // used to include empty fields in Patch requests.
  3048. ForceSendFields []string `json:"-"`
  3049. }
  3050. func (s *OrdersUpdateShipmentResponse) MarshalJSON() ([]byte, error) {
  3051. type noMethod OrdersUpdateShipmentResponse
  3052. raw := noMethod(*s)
  3053. return gensupport.MarshalJSON(raw, s.ForceSendFields)
  3054. }
  3055. type Price struct {
  3056. // Currency: The currency of the price.
  3057. Currency string `json:"currency,omitempty"`
  3058. // Value: The price represented as a number.
  3059. Value string `json:"value,omitempty"`
  3060. // ForceSendFields is a list of field names (e.g. "Currency") to
  3061. // unconditionally include in API requests. By default, fields with
  3062. // empty values are omitted from API requests. However, any non-pointer,
  3063. // non-interface field appearing in ForceSendFields will be sent to the
  3064. // server regardless of whether the field is empty or not. This may be
  3065. // used to include empty fields in Patch requests.
  3066. ForceSendFields []string `json:"-"`
  3067. }
  3068. func (s *Price) MarshalJSON() ([]byte, error) {
  3069. type noMethod Price
  3070. raw := noMethod(*s)
  3071. return gensupport.MarshalJSON(raw, s.ForceSendFields)
  3072. }
  3073. // Product: Product data.
  3074. type Product struct {
  3075. // AdditionalImageLinks: Additional URLs of images of the item.
  3076. AdditionalImageLinks []string `json:"additionalImageLinks,omitempty"`
  3077. // Adult: Set to true if the item is targeted towards adults.
  3078. Adult bool `json:"adult,omitempty"`
  3079. // AdwordsGrouping: Used to group items in an arbitrary way. Only for
  3080. // CPA%, discouraged otherwise.
  3081. AdwordsGrouping string `json:"adwordsGrouping,omitempty"`
  3082. // AdwordsLabels: Similar to adwords_grouping, but only works on CPC.
  3083. AdwordsLabels []string `json:"adwordsLabels,omitempty"`
  3084. // AdwordsRedirect: Allows advertisers to override the item URL when the
  3085. // product is shown within the context of Product Ads.
  3086. AdwordsRedirect string `json:"adwordsRedirect,omitempty"`
  3087. // AgeGroup: Target age group of the item.
  3088. AgeGroup string `json:"ageGroup,omitempty"`
  3089. // Aspects: Specifies the intended aspects for the product.
  3090. Aspects []*ProductAspect `json:"aspects,omitempty"`
  3091. // Availability: Availability status of the item.
  3092. Availability string `json:"availability,omitempty"`
  3093. // AvailabilityDate: The day a pre-ordered product becomes available for
  3094. // delivery, in ISO 8601 format.
  3095. AvailabilityDate string `json:"availabilityDate,omitempty"`
  3096. // Brand: Brand of the item.
  3097. Brand string `json:"brand,omitempty"`
  3098. // Channel: The item's channel (online or local).
  3099. Channel string `json:"channel,omitempty"`
  3100. // Color: Color of the item.
  3101. Color string `json:"color,omitempty"`
  3102. // Condition: Condition or state of the item.
  3103. Condition string `json:"condition,omitempty"`
  3104. // ContentLanguage: The two-letter ISO 639-1 language code for the item.
  3105. ContentLanguage string `json:"contentLanguage,omitempty"`
  3106. // CustomAttributes: A list of custom (merchant-provided) attributes. It
  3107. // can also be used for submitting any attribute of the feed
  3108. // specification in its generic form (e.g., { "name": "size type",
  3109. // "type": "text", "value": "regular" }). This is useful for submitting
  3110. // attributes not explicitly exposed by the API.
  3111. CustomAttributes []*ProductCustomAttribute `json:"customAttributes,omitempty"`
  3112. // CustomGroups: A list of custom (merchant-provided) custom attribute
  3113. // groups.
  3114. CustomGroups []*ProductCustomGroup `json:"customGroups,omitempty"`
  3115. // CustomLabel0: Custom label 0 for custom grouping of items in a
  3116. // Shopping campaign.
  3117. CustomLabel0 string `json:"customLabel0,omitempty"`
  3118. // CustomLabel1: Custom label 1 for custom grouping of items in a
  3119. // Shopping campaign.
  3120. CustomLabel1 string `json:"customLabel1,omitempty"`
  3121. // CustomLabel2: Custom label 2 for custom grouping of items in a
  3122. // Shopping campaign.
  3123. CustomLabel2 string `json:"customLabel2,omitempty"`
  3124. // CustomLabel3: Custom label 3 for custom grouping of items in a
  3125. // Shopping campaign.
  3126. CustomLabel3 string `json:"customLabel3,omitempty"`
  3127. // CustomLabel4: Custom label 4 for custom grouping of items in a
  3128. // Shopping campaign.
  3129. CustomLabel4 string `json:"customLabel4,omitempty"`
  3130. // Description: Description of the item.
  3131. Description string `json:"description,omitempty"`
  3132. // Destinations: Specifies the intended destinations for the product.
  3133. Destinations []*ProductDestination `json:"destinations,omitempty"`
  3134. // DisplayAdsId: An identifier for an item for dynamic remarketing
  3135. // campaigns.
  3136. DisplayAdsId string `json:"displayAdsId,omitempty"`
  3137. // DisplayAdsLink: URL directly to your item's landing page for dynamic
  3138. // remarketing campaigns.
  3139. DisplayAdsLink string `json:"displayAdsLink,omitempty"`
  3140. // DisplayAdsSimilarIds: Advertiser-specified recommendations.
  3141. DisplayAdsSimilarIds []string `json:"displayAdsSimilarIds,omitempty"`
  3142. // DisplayAdsTitle: Title of an item for dynamic remarketing campaigns.
  3143. DisplayAdsTitle string `json:"displayAdsTitle,omitempty"`
  3144. // DisplayAdsValue: Offer margin for dynamic remarketing campaigns.
  3145. DisplayAdsValue float64 `json:"displayAdsValue,omitempty"`
  3146. // EnergyEfficiencyClass: The energy efficiency class as defined in EU
  3147. // directive 2010/30/EU.
  3148. EnergyEfficiencyClass string `json:"energyEfficiencyClass,omitempty"`
  3149. // ExpirationDate: Date on which the item should expire, as specified
  3150. // upon insertion, in ISO 8601 format. The actual expiration date in
  3151. // Google Shopping is exposed in productstatuses as googleExpirationDate
  3152. // and might be earlier if expirationDate is too far in the future.
  3153. ExpirationDate string `json:"expirationDate,omitempty"`
  3154. // Gender: Target gender of the item.
  3155. Gender string `json:"gender,omitempty"`
  3156. // GoogleProductCategory: Google's category of the item (see Google
  3157. // product taxonomy).
  3158. GoogleProductCategory string `json:"googleProductCategory,omitempty"`
  3159. // Gtin: Global Trade Item Number (GTIN) of the item.
  3160. Gtin string `json:"gtin,omitempty"`
  3161. // Id: The REST id of the product.
  3162. Id string `json:"id,omitempty"`
  3163. // IdentifierExists: False when the item does not have unique product
  3164. // identifiers appropriate to its category, such as GTIN, MPN, and
  3165. // brand. Required according to the Unique Product Identifier Rules for
  3166. // all target countries except for Canada.
  3167. IdentifierExists bool `json:"identifierExists,omitempty"`
  3168. // ImageLink: URL of an image of the item.
  3169. ImageLink string `json:"imageLink,omitempty"`
  3170. // Installment: Number and amount of installments to pay for an item.
  3171. // Brazil only.
  3172. Installment *Installment `json:"installment,omitempty"`
  3173. // IsBundle: Whether the item is a merchant-defined bundle. A bundle is
  3174. // a custom grouping of different products sold by a merchant for a
  3175. // single price.
  3176. IsBundle bool `json:"isBundle,omitempty"`
  3177. // ItemGroupId: Shared identifier for all variants of the same product.
  3178. ItemGroupId string `json:"itemGroupId,omitempty"`
  3179. // Kind: Identifies what kind of resource this is. Value: the fixed
  3180. // string "content#product".
  3181. Kind string `json:"kind,omitempty"`
  3182. // Link: URL directly linking to your item's page on your website.
  3183. Link string `json:"link,omitempty"`
  3184. // LoyaltyPoints: Loyalty points that users receive after purchasing the
  3185. // item. Japan only.
  3186. LoyaltyPoints *LoyaltyPoints `json:"loyaltyPoints,omitempty"`
  3187. // Material: The material of which the item is made.
  3188. Material string `json:"material,omitempty"`
  3189. // MobileLink: Link to a mobile-optimized version of the landing page.
  3190. MobileLink string `json:"mobileLink,omitempty"`
  3191. // Mpn: Manufacturer Part Number (MPN) of the item.
  3192. Mpn string `json:"mpn,omitempty"`
  3193. // Multipack: The number of identical products in a merchant-defined
  3194. // multipack.
  3195. Multipack int64 `json:"multipack,omitempty,string"`
  3196. // OfferId: An identifier of the item.
  3197. OfferId string `json:"offerId,omitempty"`
  3198. // OnlineOnly: Whether an item is available for purchase only online.
  3199. OnlineOnly bool `json:"onlineOnly,omitempty"`
  3200. // Pattern: The item's pattern (e.g. polka dots).
  3201. Pattern string `json:"pattern,omitempty"`
  3202. // Price: Price of the item.
  3203. Price *Price `json:"price,omitempty"`
  3204. // ProductType: Your category of the item (formatted as in product feeds
  3205. // specification).
  3206. ProductType string `json:"productType,omitempty"`
  3207. // SalePrice: Advertised sale price of the item.
  3208. SalePrice *Price `json:"salePrice,omitempty"`
  3209. // SalePriceEffectiveDate: Date range during which the item is on sale
  3210. // (see product feed specifications).
  3211. SalePriceEffectiveDate string `json:"salePriceEffectiveDate,omitempty"`
  3212. // SellOnGoogleQuantity: The quantity of the product that is reserved
  3213. // for sell-on-google ads.
  3214. SellOnGoogleQuantity int64 `json:"sellOnGoogleQuantity,omitempty,string"`
  3215. // Shipping: Shipping rules.
  3216. Shipping []*ProductShipping `json:"shipping,omitempty"`
  3217. // ShippingHeight: Height of the item for shipping.
  3218. ShippingHeight *ProductShippingDimension `json:"shippingHeight,omitempty"`
  3219. // ShippingLabel: The shipping label of the product, used to group
  3220. // product in account-level shipping rules.
  3221. ShippingLabel string `json:"shippingLabel,omitempty"`
  3222. // ShippingLength: Length of the item for shipping.
  3223. ShippingLength *ProductShippingDimension `json:"shippingLength,omitempty"`
  3224. // ShippingWeight: Weight of the item for shipping.
  3225. ShippingWeight *ProductShippingWeight `json:"shippingWeight,omitempty"`
  3226. // ShippingWidth: Width of the item for shipping.
  3227. ShippingWidth *ProductShippingDimension `json:"shippingWidth,omitempty"`
  3228. // SizeSystem: System in which the size is specified. Recommended for
  3229. // apparel items.
  3230. SizeSystem string `json:"sizeSystem,omitempty"`
  3231. // SizeType: The cut of the item. Recommended for apparel items.
  3232. SizeType string `json:"sizeType,omitempty"`
  3233. // Sizes: Size of the item.
  3234. Sizes []string `json:"sizes,omitempty"`
  3235. // TargetCountry: The CLDR territory code for the item.
  3236. TargetCountry string `json:"targetCountry,omitempty"`
  3237. // Taxes: Tax information.
  3238. Taxes []*ProductTax `json:"taxes,omitempty"`
  3239. // Title: Title of the item.
  3240. Title string `json:"title,omitempty"`
  3241. // UnitPricingBaseMeasure: The preference of the denominator of the unit
  3242. // price.
  3243. UnitPricingBaseMeasure *ProductUnitPricingBaseMeasure `json:"unitPricingBaseMeasure,omitempty"`
  3244. // UnitPricingMeasure: The measure and dimension of an item.
  3245. UnitPricingMeasure *ProductUnitPricingMeasure `json:"unitPricingMeasure,omitempty"`
  3246. // ValidatedDestinations: The read-only list of intended destinations
  3247. // which passed validation.
  3248. ValidatedDestinations []string `json:"validatedDestinations,omitempty"`
  3249. // Warnings: Read-only warnings.
  3250. Warnings []*Error `json:"warnings,omitempty"`
  3251. // ServerResponse contains the HTTP response code and headers from the
  3252. // server.
  3253. googleapi.ServerResponse `json:"-"`
  3254. // ForceSendFields is a list of field names (e.g.
  3255. // "AdditionalImageLinks") to unconditionally include in API requests.
  3256. // By default, fields with empty values are omitted from API requests.
  3257. // However, any non-pointer, non-interface field appearing in
  3258. // ForceSendFields will be sent to the server regardless of whether the
  3259. // field is empty or not. This may be used to include empty fields in
  3260. // Patch requests.
  3261. ForceSendFields []string `json:"-"`
  3262. }
  3263. func (s *Product) MarshalJSON() ([]byte, error) {
  3264. type noMethod Product
  3265. raw := noMethod(*s)
  3266. return gensupport.MarshalJSON(raw, s.ForceSendFields)
  3267. }
  3268. type ProductAspect struct {
  3269. // AspectName: The name of the aspect.
  3270. AspectName string `json:"aspectName,omitempty"`
  3271. // DestinationName: The name of the destination. Leave out to apply to
  3272. // all destinations.
  3273. DestinationName string `json:"destinationName,omitempty"`
  3274. // Intention: Whether the aspect is required, excluded or should be
  3275. // validated.
  3276. Intention string `json:"intention,omitempty"`
  3277. // ForceSendFields is a list of field names (e.g. "AspectName") to
  3278. // unconditionally include in API requests. By default, fields with
  3279. // empty values are omitted from API requests. However, any non-pointer,
  3280. // non-interface field appearing in ForceSendFields will be sent to the
  3281. // server regardless of whether the field is empty or not. This may be
  3282. // used to include empty fields in Patch requests.
  3283. ForceSendFields []string `json:"-"`
  3284. }
  3285. func (s *ProductAspect) MarshalJSON() ([]byte, error) {
  3286. type noMethod ProductAspect
  3287. raw := noMethod(*s)
  3288. return gensupport.MarshalJSON(raw, s.ForceSendFields)
  3289. }
  3290. type ProductCustomAttribute struct {
  3291. // Name: The name of the attribute. Underscores will be replaced by
  3292. // spaces upon insertion.
  3293. Name string `json:"name,omitempty"`
  3294. // Type: The type of the attribute.
  3295. Type string `json:"type,omitempty"`
  3296. // Unit: Free-form unit of the attribute. Unit can only be used for
  3297. // values of type INT or FLOAT.
  3298. Unit string `json:"unit,omitempty"`
  3299. // Value: The value of the attribute.
  3300. Value string `json:"value,omitempty"`
  3301. // ForceSendFields is a list of field names (e.g. "Name") to
  3302. // unconditionally include in API requests. By default, fields with
  3303. // empty values are omitted from API requests. However, any non-pointer,
  3304. // non-interface field appearing in ForceSendFields will be sent to the
  3305. // server regardless of whether the field is empty or not. This may be
  3306. // used to include empty fields in Patch requests.
  3307. ForceSendFields []string `json:"-"`
  3308. }
  3309. func (s *ProductCustomAttribute) MarshalJSON() ([]byte, error) {
  3310. type noMethod ProductCustomAttribute
  3311. raw := noMethod(*s)
  3312. return gensupport.MarshalJSON(raw, s.ForceSendFields)
  3313. }
  3314. type ProductCustomGroup struct {
  3315. // Attributes: The sub-attributes.
  3316. Attributes []*ProductCustomAttribute `json:"attributes,omitempty"`
  3317. // Name: The name of the group. Underscores will be replaced by spaces
  3318. // upon insertion.
  3319. Name string `json:"name,omitempty"`
  3320. // ForceSendFields is a list of field names (e.g. "Attributes") to
  3321. // unconditionally include in API requests. By default, fields with
  3322. // empty values are omitted from API requests. However, any non-pointer,
  3323. // non-interface field appearing in ForceSendFields will be sent to the
  3324. // server regardless of whether the field is empty or not. This may be
  3325. // used to include empty fields in Patch requests.
  3326. ForceSendFields []string `json:"-"`
  3327. }
  3328. func (s *ProductCustomGroup) MarshalJSON() ([]byte, error) {
  3329. type noMethod ProductCustomGroup
  3330. raw := noMethod(*s)
  3331. return gensupport.MarshalJSON(raw, s.ForceSendFields)
  3332. }
  3333. type ProductDestination struct {
  3334. // DestinationName: The name of the destination.
  3335. DestinationName string `json:"destinationName,omitempty"`
  3336. // Intention: Whether the destination is required, excluded or should be
  3337. // validated.
  3338. Intention string `json:"intention,omitempty"`
  3339. // ForceSendFields is a list of field names (e.g. "DestinationName") to
  3340. // unconditionally include in API requests. By default, fields with
  3341. // empty values are omitted from API requests. However, any non-pointer,
  3342. // non-interface field appearing in ForceSendFields will be sent to the
  3343. // server regardless of whether the field is empty or not. This may be
  3344. // used to include empty fields in Patch requests.
  3345. ForceSendFields []string `json:"-"`
  3346. }
  3347. func (s *ProductDestination) MarshalJSON() ([]byte, error) {
  3348. type noMethod ProductDestination
  3349. raw := noMethod(*s)
  3350. return gensupport.MarshalJSON(raw, s.ForceSendFields)
  3351. }
  3352. type ProductShipping struct {
  3353. // Country: The CLDR territory code of the country to which an item will
  3354. // ship.
  3355. Country string `json:"country,omitempty"`
  3356. // LocationGroupName: The location where the shipping is applicable,
  3357. // represented by a location group name.
  3358. LocationGroupName string `json:"locationGroupName,omitempty"`
  3359. // LocationId: The numeric id of a location that the shipping rate
  3360. // applies to as defined in the AdWords API.
  3361. LocationId int64 `json:"locationId,omitempty,string"`
  3362. // PostalCode: The postal code range that the shipping rate applies to,
  3363. // represented by a postal code, a postal code prefix followed by a *
  3364. // wildcard, a range between two postal codes or two postal code
  3365. // prefixes of equal length.
  3366. PostalCode string `json:"postalCode,omitempty"`
  3367. // Price: Fixed shipping price, represented as a number.
  3368. Price *Price `json:"price,omitempty"`
  3369. // Region: The geographic region to which a shipping rate applies (e.g.
  3370. // zip code).
  3371. Region string `json:"region,omitempty"`
  3372. // Service: A free-form description of the service class or delivery
  3373. // speed.
  3374. Service string `json:"service,omitempty"`
  3375. // ForceSendFields is a list of field names (e.g. "Country") to
  3376. // unconditionally include in API requests. By default, fields with
  3377. // empty values are omitted from API requests. However, any non-pointer,
  3378. // non-interface field appearing in ForceSendFields will be sent to the
  3379. // server regardless of whether the field is empty or not. This may be
  3380. // used to include empty fields in Patch requests.
  3381. ForceSendFields []string `json:"-"`
  3382. }
  3383. func (s *ProductShipping) MarshalJSON() ([]byte, error) {
  3384. type noMethod ProductShipping
  3385. raw := noMethod(*s)
  3386. return gensupport.MarshalJSON(raw, s.ForceSendFields)
  3387. }
  3388. type ProductShippingDimension struct {
  3389. // Unit: The unit of value.
  3390. //
  3391. // Acceptable values are:
  3392. // - "cm"
  3393. // - "in"
  3394. Unit string `json:"unit,omitempty"`
  3395. // Value: The dimension of the product used to calculate the shipping
  3396. // cost of the item.
  3397. Value float64 `json:"value,omitempty"`
  3398. // ForceSendFields is a list of field names (e.g. "Unit") to
  3399. // unconditionally include in API requests. By default, fields with
  3400. // empty values are omitted from API requests. However, any non-pointer,
  3401. // non-interface field appearing in ForceSendFields will be sent to the
  3402. // server regardless of whether the field is empty or not. This may be
  3403. // used to include empty fields in Patch requests.
  3404. ForceSendFields []string `json:"-"`
  3405. }
  3406. func (s *ProductShippingDimension) MarshalJSON() ([]byte, error) {
  3407. type noMethod ProductShippingDimension
  3408. raw := noMethod(*s)
  3409. return gensupport.MarshalJSON(raw, s.ForceSendFields)
  3410. }
  3411. type ProductShippingWeight struct {
  3412. // Unit: The unit of value.
  3413. Unit string `json:"unit,omitempty"`
  3414. // Value: The weight of the product used to calculate the shipping cost
  3415. // of the item.
  3416. Value float64 `json:"value,omitempty"`
  3417. // ForceSendFields is a list of field names (e.g. "Unit") to
  3418. // unconditionally include in API requests. By default, fields with
  3419. // empty values are omitted from API requests. However, any non-pointer,
  3420. // non-interface field appearing in ForceSendFields will be sent to the
  3421. // server regardless of whether the field is empty or not. This may be
  3422. // used to include empty fields in Patch requests.
  3423. ForceSendFields []string `json:"-"`
  3424. }
  3425. func (s *ProductShippingWeight) MarshalJSON() ([]byte, error) {
  3426. type noMethod ProductShippingWeight
  3427. raw := noMethod(*s)
  3428. return gensupport.MarshalJSON(raw, s.ForceSendFields)
  3429. }
  3430. // ProductStatus: The status of a product, i.e., information about a
  3431. // product computed asynchronously by the data quality analysis.
  3432. type ProductStatus struct {
  3433. // CreationDate: Date on which the item has been created, in ISO 8601
  3434. // format.
  3435. CreationDate string `json:"creationDate,omitempty"`
  3436. // DataQualityIssues: A list of data quality issues associated with the
  3437. // product.
  3438. DataQualityIssues []*ProductStatusDataQualityIssue `json:"dataQualityIssues,omitempty"`
  3439. // DestinationStatuses: The intended destinations for the product.
  3440. DestinationStatuses []*ProductStatusDestinationStatus `json:"destinationStatuses,omitempty"`
  3441. // GoogleExpirationDate: Date on which the item expires in Google
  3442. // Shopping, in ISO 8601 format.
  3443. GoogleExpirationDate string `json:"googleExpirationDate,omitempty"`
  3444. // Kind: Identifies what kind of resource this is. Value: the fixed
  3445. // string "content#productStatus".
  3446. Kind string `json:"kind,omitempty"`
  3447. // LastUpdateDate: Date on which the item has been last updated, in ISO
  3448. // 8601 format.
  3449. LastUpdateDate string `json:"lastUpdateDate,omitempty"`
  3450. // Link: The link to the product.
  3451. Link string `json:"link,omitempty"`
  3452. // ProductId: The id of the product for which status is reported.
  3453. ProductId string `json:"productId,omitempty"`
  3454. // Title: The title of the product.
  3455. Title string `json:"title,omitempty"`
  3456. // ServerResponse contains the HTTP response code and headers from the
  3457. // server.
  3458. googleapi.ServerResponse `json:"-"`
  3459. // ForceSendFields is a list of field names (e.g. "CreationDate") to
  3460. // unconditionally include in API requests. By default, fields with
  3461. // empty values are omitted from API requests. However, any non-pointer,
  3462. // non-interface field appearing in ForceSendFields will be sent to the
  3463. // server regardless of whether the field is empty or not. This may be
  3464. // used to include empty fields in Patch requests.
  3465. ForceSendFields []string `json:"-"`
  3466. }
  3467. func (s *ProductStatus) MarshalJSON() ([]byte, error) {
  3468. type noMethod ProductStatus
  3469. raw := noMethod(*s)
  3470. return gensupport.MarshalJSON(raw, s.ForceSendFields)
  3471. }
  3472. type ProductStatusDataQualityIssue struct {
  3473. // Detail: A more detailed error string.
  3474. Detail string `json:"detail,omitempty"`
  3475. // FetchStatus: The fetch status for landing_page_errors.
  3476. FetchStatus string `json:"fetchStatus,omitempty"`
  3477. // Id: The id of the data quality issue.
  3478. Id string `json:"id,omitempty"`
  3479. // Location: The attribute name that is relevant for the issue.
  3480. Location string `json:"location,omitempty"`
  3481. // Severity: The severity of the data quality issue.
  3482. Severity string `json:"severity,omitempty"`
  3483. // Timestamp: The time stamp of the data quality issue.
  3484. Timestamp string `json:"timestamp,omitempty"`
  3485. // ValueOnLandingPage: The value of that attribute that was found on the
  3486. // landing page
  3487. ValueOnLandingPage string `json:"valueOnLandingPage,omitempty"`
  3488. // ValueProvided: The value the attribute had at time of evaluation.
  3489. ValueProvided string `json:"valueProvided,omitempty"`
  3490. // ForceSendFields is a list of field names (e.g. "Detail") to
  3491. // unconditionally include in API requests. By default, fields with
  3492. // empty values are omitted from API requests. However, any non-pointer,
  3493. // non-interface field appearing in ForceSendFields will be sent to the
  3494. // server regardless of whether the field is empty or not. This may be
  3495. // used to include empty fields in Patch requests.
  3496. ForceSendFields []string `json:"-"`
  3497. }
  3498. func (s *ProductStatusDataQualityIssue) MarshalJSON() ([]byte, error) {
  3499. type noMethod ProductStatusDataQualityIssue
  3500. raw := noMethod(*s)
  3501. return gensupport.MarshalJSON(raw, s.ForceSendFields)
  3502. }
  3503. type ProductStatusDestinationStatus struct {
  3504. // ApprovalStatus: The destination's approval status.
  3505. ApprovalStatus string `json:"approvalStatus,omitempty"`
  3506. // Destination: The name of the destination
  3507. Destination string `json:"destination,omitempty"`
  3508. // Intention: Whether the destination is required, excluded, selected by
  3509. // default or should be validated.
  3510. Intention string `json:"intention,omitempty"`
  3511. // ForceSendFields is a list of field names (e.g. "ApprovalStatus") to
  3512. // unconditionally include in API requests. By default, fields with
  3513. // empty values are omitted from API requests. However, any non-pointer,
  3514. // non-interface field appearing in ForceSendFields will be sent to the
  3515. // server regardless of whether the field is empty or not. This may be
  3516. // used to include empty fields in Patch requests.
  3517. ForceSendFields []string `json:"-"`
  3518. }
  3519. func (s *ProductStatusDestinationStatus) MarshalJSON() ([]byte, error) {
  3520. type noMethod ProductStatusDestinationStatus
  3521. raw := noMethod(*s)
  3522. return gensupport.MarshalJSON(raw, s.ForceSendFields)
  3523. }
  3524. type ProductTax struct {
  3525. // Country: The country within which the item is taxed, specified as a
  3526. // CLDR territory code.
  3527. Country string `json:"country,omitempty"`
  3528. // LocationId: The numeric id of a location that the tax rate applies to
  3529. // as defined in the AdWords API.
  3530. LocationId int64 `json:"locationId,omitempty,string"`
  3531. // PostalCode: The postal code range that the tax rate applies to,
  3532. // represented by a ZIP code, a ZIP code prefix using * wildcard, a
  3533. // range between two ZIP codes or two ZIP code prefixes of equal length.
  3534. // Examples: 94114, 94*, 94002-95460, 94*-95*.
  3535. PostalCode string `json:"postalCode,omitempty"`
  3536. // Rate: The percentage of tax rate that applies to the item price.
  3537. Rate float64 `json:"rate,omitempty"`
  3538. // Region: The geographic region to which the tax rate applies.
  3539. Region string `json:"region,omitempty"`
  3540. // TaxShip: Set to true if tax is charged on shipping.
  3541. TaxShip bool `json:"taxShip,omitempty"`
  3542. // ForceSendFields is a list of field names (e.g. "Country") to
  3543. // unconditionally include in API requests. By default, fields with
  3544. // empty values are omitted from API requests. However, any non-pointer,
  3545. // non-interface field appearing in ForceSendFields will be sent to the
  3546. // server regardless of whether the field is empty or not. This may be
  3547. // used to include empty fields in Patch requests.
  3548. ForceSendFields []string `json:"-"`
  3549. }
  3550. func (s *ProductTax) MarshalJSON() ([]byte, error) {
  3551. type noMethod ProductTax
  3552. raw := noMethod(*s)
  3553. return gensupport.MarshalJSON(raw, s.ForceSendFields)
  3554. }
  3555. type ProductUnitPricingBaseMeasure struct {
  3556. // Unit: The unit of the denominator.
  3557. Unit string `json:"unit,omitempty"`
  3558. // Value: The denominator of the unit price.
  3559. Value int64 `json:"value,omitempty,string"`
  3560. // ForceSendFields is a list of field names (e.g. "Unit") to
  3561. // unconditionally include in API requests. By default, fields with
  3562. // empty values are omitted from API requests. However, any non-pointer,
  3563. // non-interface field appearing in ForceSendFields will be sent to the
  3564. // server regardless of whether the field is empty or not. This may be
  3565. // used to include empty fields in Patch requests.
  3566. ForceSendFields []string `json:"-"`
  3567. }
  3568. func (s *ProductUnitPricingBaseMeasure) MarshalJSON() ([]byte, error) {
  3569. type noMethod ProductUnitPricingBaseMeasure
  3570. raw := noMethod(*s)
  3571. return gensupport.MarshalJSON(raw, s.ForceSendFields)
  3572. }
  3573. type ProductUnitPricingMeasure struct {
  3574. // Unit: The unit of the measure.
  3575. Unit string `json:"unit,omitempty"`
  3576. // Value: The measure of an item.
  3577. Value float64 `json:"value,omitempty"`
  3578. // ForceSendFields is a list of field names (e.g. "Unit") to
  3579. // unconditionally include in API requests. By default, fields with
  3580. // empty values are omitted from API requests. However, any non-pointer,
  3581. // non-interface field appearing in ForceSendFields will be sent to the
  3582. // server regardless of whether the field is empty or not. This may be
  3583. // used to include empty fields in Patch requests.
  3584. ForceSendFields []string `json:"-"`
  3585. }
  3586. func (s *ProductUnitPricingMeasure) MarshalJSON() ([]byte, error) {
  3587. type noMethod ProductUnitPricingMeasure
  3588. raw := noMethod(*s)
  3589. return gensupport.MarshalJSON(raw, s.ForceSendFields)
  3590. }
  3591. type ProductsCustomBatchRequest struct {
  3592. // Entries: The request entries to be processed in the batch.
  3593. Entries []*ProductsCustomBatchRequestEntry `json:"entries,omitempty"`
  3594. // ForceSendFields is a list of field names (e.g. "Entries") to
  3595. // unconditionally include in API requests. By default, fields with
  3596. // empty values are omitted from API requests. However, any non-pointer,
  3597. // non-interface field appearing in ForceSendFields will be sent to the
  3598. // server regardless of whether the field is empty or not. This may be
  3599. // used to include empty fields in Patch requests.
  3600. ForceSendFields []string `json:"-"`
  3601. }
  3602. func (s *ProductsCustomBatchRequest) MarshalJSON() ([]byte, error) {
  3603. type noMethod ProductsCustomBatchRequest
  3604. raw := noMethod(*s)
  3605. return gensupport.MarshalJSON(raw, s.ForceSendFields)
  3606. }
  3607. // ProductsCustomBatchRequestEntry: A batch entry encoding a single
  3608. // non-batch products request.
  3609. type ProductsCustomBatchRequestEntry struct {
  3610. // BatchId: An entry ID, unique within the batch request.
  3611. BatchId int64 `json:"batchId,omitempty"`
  3612. // MerchantId: The ID of the managing account.
  3613. MerchantId uint64 `json:"merchantId,omitempty,string"`
  3614. Method string `json:"method,omitempty"`
  3615. // Product: The product to insert. Only required if the method is
  3616. // insert.
  3617. Product *Product `json:"product,omitempty"`
  3618. // ProductId: The ID of the product to get or delete. Only defined if
  3619. // the method is get or delete.
  3620. ProductId string `json:"productId,omitempty"`
  3621. // ForceSendFields is a list of field names (e.g. "BatchId") to
  3622. // unconditionally include in API requests. By default, fields with
  3623. // empty values are omitted from API requests. However, any non-pointer,
  3624. // non-interface field appearing in ForceSendFields will be sent to the
  3625. // server regardless of whether the field is empty or not. This may be
  3626. // used to include empty fields in Patch requests.
  3627. ForceSendFields []string `json:"-"`
  3628. }
  3629. func (s *ProductsCustomBatchRequestEntry) MarshalJSON() ([]byte, error) {
  3630. type noMethod ProductsCustomBatchRequestEntry
  3631. raw := noMethod(*s)
  3632. return gensupport.MarshalJSON(raw, s.ForceSendFields)
  3633. }
  3634. type ProductsCustomBatchResponse struct {
  3635. // Entries: The result of the execution of the batch requests.
  3636. Entries []*ProductsCustomBatchResponseEntry `json:"entries,omitempty"`
  3637. // Kind: Identifies what kind of resource this is. Value: the fixed
  3638. // string "content#productsCustomBatchResponse".
  3639. Kind string `json:"kind,omitempty"`
  3640. // ServerResponse contains the HTTP response code and headers from the
  3641. // server.
  3642. googleapi.ServerResponse `json:"-"`
  3643. // ForceSendFields is a list of field names (e.g. "Entries") to
  3644. // unconditionally include in API requests. By default, fields with
  3645. // empty values are omitted from API requests. However, any non-pointer,
  3646. // non-interface field appearing in ForceSendFields will be sent to the
  3647. // server regardless of whether the field is empty or not. This may be
  3648. // used to include empty fields in Patch requests.
  3649. ForceSendFields []string `json:"-"`
  3650. }
  3651. func (s *ProductsCustomBatchResponse) MarshalJSON() ([]byte, error) {
  3652. type noMethod ProductsCustomBatchResponse
  3653. raw := noMethod(*s)
  3654. return gensupport.MarshalJSON(raw, s.ForceSendFields)
  3655. }
  3656. // ProductsCustomBatchResponseEntry: A batch entry encoding a single
  3657. // non-batch products response.
  3658. type ProductsCustomBatchResponseEntry struct {
  3659. // BatchId: The ID of the request entry this entry responds to.
  3660. BatchId int64 `json:"batchId,omitempty"`
  3661. // Errors: A list of errors defined if and only if the request failed.
  3662. Errors *Errors `json:"errors,omitempty"`
  3663. // Kind: Identifies what kind of resource this is. Value: the fixed
  3664. // string "content#productsCustomBatchResponseEntry".
  3665. Kind string `json:"kind,omitempty"`
  3666. // Product: The inserted product. Only defined if the method is insert
  3667. // and if the request was successful.
  3668. Product *Product `json:"product,omitempty"`
  3669. // ForceSendFields is a list of field names (e.g. "BatchId") to
  3670. // unconditionally include in API requests. By default, fields with
  3671. // empty values are omitted from API requests. However, any non-pointer,
  3672. // non-interface field appearing in ForceSendFields will be sent to the
  3673. // server regardless of whether the field is empty or not. This may be
  3674. // used to include empty fields in Patch requests.
  3675. ForceSendFields []string `json:"-"`
  3676. }
  3677. func (s *ProductsCustomBatchResponseEntry) MarshalJSON() ([]byte, error) {
  3678. type noMethod ProductsCustomBatchResponseEntry
  3679. raw := noMethod(*s)
  3680. return gensupport.MarshalJSON(raw, s.ForceSendFields)
  3681. }
  3682. type ProductsListResponse struct {
  3683. // Kind: Identifies what kind of resource this is. Value: the fixed
  3684. // string "content#productsListResponse".
  3685. Kind string `json:"kind,omitempty"`
  3686. // NextPageToken: The token for the retrieval of the next page of
  3687. // products.
  3688. NextPageToken string `json:"nextPageToken,omitempty"`
  3689. Resources []*Product `json:"resources,omitempty"`
  3690. // ServerResponse contains the HTTP response code and headers from the
  3691. // server.
  3692. googleapi.ServerResponse `json:"-"`
  3693. // ForceSendFields is a list of field names (e.g. "Kind") to
  3694. // unconditionally include in API requests. By default, fields with
  3695. // empty values are omitted from API requests. However, any non-pointer,
  3696. // non-interface field appearing in ForceSendFields will be sent to the
  3697. // server regardless of whether the field is empty or not. This may be
  3698. // used to include empty fields in Patch requests.
  3699. ForceSendFields []string `json:"-"`
  3700. }
  3701. func (s *ProductsListResponse) MarshalJSON() ([]byte, error) {
  3702. type noMethod ProductsListResponse
  3703. raw := noMethod(*s)
  3704. return gensupport.MarshalJSON(raw, s.ForceSendFields)
  3705. }
  3706. type ProductstatusesCustomBatchRequest struct {
  3707. // Entries: The request entries to be processed in the batch.
  3708. Entries []*ProductstatusesCustomBatchRequestEntry `json:"entries,omitempty"`
  3709. // ForceSendFields is a list of field names (e.g. "Entries") to
  3710. // unconditionally include in API requests. By default, fields with
  3711. // empty values are omitted from API requests. However, any non-pointer,
  3712. // non-interface field appearing in ForceSendFields will be sent to the
  3713. // server regardless of whether the field is empty or not. This may be
  3714. // used to include empty fields in Patch requests.
  3715. ForceSendFields []string `json:"-"`
  3716. }
  3717. func (s *ProductstatusesCustomBatchRequest) MarshalJSON() ([]byte, error) {
  3718. type noMethod ProductstatusesCustomBatchRequest
  3719. raw := noMethod(*s)
  3720. return gensupport.MarshalJSON(raw, s.ForceSendFields)
  3721. }
  3722. // ProductstatusesCustomBatchRequestEntry: A batch entry encoding a
  3723. // single non-batch productstatuses request.
  3724. type ProductstatusesCustomBatchRequestEntry struct {
  3725. // BatchId: An entry ID, unique within the batch request.
  3726. BatchId int64 `json:"batchId,omitempty"`
  3727. // MerchantId: The ID of the managing account.
  3728. MerchantId uint64 `json:"merchantId,omitempty,string"`
  3729. Method string `json:"method,omitempty"`
  3730. // ProductId: The ID of the product whose status to get.
  3731. ProductId string `json:"productId,omitempty"`
  3732. // ForceSendFields is a list of field names (e.g. "BatchId") to
  3733. // unconditionally include in API requests. By default, fields with
  3734. // empty values are omitted from API requests. However, any non-pointer,
  3735. // non-interface field appearing in ForceSendFields will be sent to the
  3736. // server regardless of whether the field is empty or not. This may be
  3737. // used to include empty fields in Patch requests.
  3738. ForceSendFields []string `json:"-"`
  3739. }
  3740. func (s *ProductstatusesCustomBatchRequestEntry) MarshalJSON() ([]byte, error) {
  3741. type noMethod ProductstatusesCustomBatchRequestEntry
  3742. raw := noMethod(*s)
  3743. return gensupport.MarshalJSON(raw, s.ForceSendFields)
  3744. }
  3745. type ProductstatusesCustomBatchResponse struct {
  3746. // Entries: The result of the execution of the batch requests.
  3747. Entries []*ProductstatusesCustomBatchResponseEntry `json:"entries,omitempty"`
  3748. // Kind: Identifies what kind of resource this is. Value: the fixed
  3749. // string "content#productstatusesCustomBatchResponse".
  3750. Kind string `json:"kind,omitempty"`
  3751. // ServerResponse contains the HTTP response code and headers from the
  3752. // server.
  3753. googleapi.ServerResponse `json:"-"`
  3754. // ForceSendFields is a list of field names (e.g. "Entries") to
  3755. // unconditionally include in API requests. By default, fields with
  3756. // empty values are omitted from API requests. However, any non-pointer,
  3757. // non-interface field appearing in ForceSendFields will be sent to the
  3758. // server regardless of whether the field is empty or not. This may be
  3759. // used to include empty fields in Patch requests.
  3760. ForceSendFields []string `json:"-"`
  3761. }
  3762. func (s *ProductstatusesCustomBatchResponse) MarshalJSON() ([]byte, error) {
  3763. type noMethod ProductstatusesCustomBatchResponse
  3764. raw := noMethod(*s)
  3765. return gensupport.MarshalJSON(raw, s.ForceSendFields)
  3766. }
  3767. // ProductstatusesCustomBatchResponseEntry: A batch entry encoding a
  3768. // single non-batch productstatuses response.
  3769. type ProductstatusesCustomBatchResponseEntry struct {
  3770. // BatchId: The ID of the request entry this entry responds to.
  3771. BatchId int64 `json:"batchId,omitempty"`
  3772. // Errors: A list of errors, if the request failed.
  3773. Errors *Errors `json:"errors,omitempty"`
  3774. // Kind: Identifies what kind of resource this is. Value: the fixed
  3775. // string "content#productstatusesCustomBatchResponseEntry".
  3776. Kind string `json:"kind,omitempty"`
  3777. // ProductStatus: The requested product status. Only defined if the
  3778. // request was successful.
  3779. ProductStatus *ProductStatus `json:"productStatus,omitempty"`
  3780. // ForceSendFields is a list of field names (e.g. "BatchId") to
  3781. // unconditionally include in API requests. By default, fields with
  3782. // empty values are omitted from API requests. However, any non-pointer,
  3783. // non-interface field appearing in ForceSendFields will be sent to the
  3784. // server regardless of whether the field is empty or not. This may be
  3785. // used to include empty fields in Patch requests.
  3786. ForceSendFields []string `json:"-"`
  3787. }
  3788. func (s *ProductstatusesCustomBatchResponseEntry) MarshalJSON() ([]byte, error) {
  3789. type noMethod ProductstatusesCustomBatchResponseEntry
  3790. raw := noMethod(*s)
  3791. return gensupport.MarshalJSON(raw, s.ForceSendFields)
  3792. }
  3793. type ProductstatusesListResponse struct {
  3794. // Kind: Identifies what kind of resource this is. Value: the fixed
  3795. // string "content#productstatusesListResponse".
  3796. Kind string `json:"kind,omitempty"`
  3797. // NextPageToken: The token for the retrieval of the next page of
  3798. // products statuses.
  3799. NextPageToken string `json:"nextPageToken,omitempty"`
  3800. Resources []*ProductStatus `json:"resources,omitempty"`
  3801. // ServerResponse contains the HTTP response code and headers from the
  3802. // server.
  3803. googleapi.ServerResponse `json:"-"`
  3804. // ForceSendFields is a list of field names (e.g. "Kind") to
  3805. // unconditionally include in API requests. By default, fields with
  3806. // empty values are omitted from API requests. However, any non-pointer,
  3807. // non-interface field appearing in ForceSendFields will be sent to the
  3808. // server regardless of whether the field is empty or not. This may be
  3809. // used to include empty fields in Patch requests.
  3810. ForceSendFields []string `json:"-"`
  3811. }
  3812. func (s *ProductstatusesListResponse) MarshalJSON() ([]byte, error) {
  3813. type noMethod ProductstatusesListResponse
  3814. raw := noMethod(*s)
  3815. return gensupport.MarshalJSON(raw, s.ForceSendFields)
  3816. }
  3817. type TestOrder struct {
  3818. // Customer: The details of the customer who placed the order.
  3819. Customer *TestOrderCustomer `json:"customer,omitempty"`
  3820. // Kind: Identifies what kind of resource this is. Value: the fixed
  3821. // string "content#testOrder".
  3822. Kind string `json:"kind,omitempty"`
  3823. // LineItems: Line items that are ordered. At least one line item must
  3824. // be provided.
  3825. LineItems []*TestOrderLineItem `json:"lineItems,omitempty"`
  3826. // PaymentMethod: The details of the payment method.
  3827. PaymentMethod *TestOrderPaymentMethod `json:"paymentMethod,omitempty"`
  3828. // PredefinedDeliveryAddress: Identifier of one of the predefined
  3829. // delivery addresses for the delivery.
  3830. PredefinedDeliveryAddress string `json:"predefinedDeliveryAddress,omitempty"`
  3831. // ShippingCost: The total cost of shipping for all items.
  3832. ShippingCost *Price `json:"shippingCost,omitempty"`
  3833. // ShippingCostTax: The tax for the total shipping cost.
  3834. ShippingCostTax *Price `json:"shippingCostTax,omitempty"`
  3835. // ShippingOption: The requested shipping option.
  3836. ShippingOption string `json:"shippingOption,omitempty"`
  3837. // ForceSendFields is a list of field names (e.g. "Customer") to
  3838. // unconditionally include in API requests. By default, fields with
  3839. // empty values are omitted from API requests. However, any non-pointer,
  3840. // non-interface field appearing in ForceSendFields will be sent to the
  3841. // server regardless of whether the field is empty or not. This may be
  3842. // used to include empty fields in Patch requests.
  3843. ForceSendFields []string `json:"-"`
  3844. }
  3845. func (s *TestOrder) MarshalJSON() ([]byte, error) {
  3846. type noMethod TestOrder
  3847. raw := noMethod(*s)
  3848. return gensupport.MarshalJSON(raw, s.ForceSendFields)
  3849. }
  3850. type TestOrderCustomer struct {
  3851. // Email: Email address of the customer.
  3852. Email string `json:"email,omitempty"`
  3853. // ExplicitMarketingPreference: If set, this indicates the user had a
  3854. // choice to opt in or out of providing marketing rights to the
  3855. // merchant. If unset, this indicates the user has already made this
  3856. // choice in a previous purchase, and was thus not shown the marketing
  3857. // right opt in/out checkbox during the Purchases on Google checkout
  3858. // flow. Optional.
  3859. ExplicitMarketingPreference bool `json:"explicitMarketingPreference,omitempty"`
  3860. // FullName: Full name of the customer.
  3861. FullName string `json:"fullName,omitempty"`
  3862. // ForceSendFields is a list of field names (e.g. "Email") to
  3863. // unconditionally include in API requests. By default, fields with
  3864. // empty values are omitted from API requests. However, any non-pointer,
  3865. // non-interface field appearing in ForceSendFields will be sent to the
  3866. // server regardless of whether the field is empty or not. This may be
  3867. // used to include empty fields in Patch requests.
  3868. ForceSendFields []string `json:"-"`
  3869. }
  3870. func (s *TestOrderCustomer) MarshalJSON() ([]byte, error) {
  3871. type noMethod TestOrderCustomer
  3872. raw := noMethod(*s)
  3873. return gensupport.MarshalJSON(raw, s.ForceSendFields)
  3874. }
  3875. type TestOrderLineItem struct {
  3876. // Product: Product data from the time of the order placement.
  3877. Product *TestOrderLineItemProduct `json:"product,omitempty"`
  3878. // QuantityOrdered: Number of items ordered.
  3879. QuantityOrdered int64 `json:"quantityOrdered,omitempty"`
  3880. // ReturnInfo: Details of the return policy for the line item.
  3881. ReturnInfo *OrderLineItemReturnInfo `json:"returnInfo,omitempty"`
  3882. // ShippingDetails: Details of the requested shipping for the line item.
  3883. ShippingDetails *OrderLineItemShippingDetails `json:"shippingDetails,omitempty"`
  3884. // UnitTax: Unit tax for the line item.
  3885. UnitTax *Price `json:"unitTax,omitempty"`
  3886. // ForceSendFields is a list of field names (e.g. "Product") to
  3887. // unconditionally include in API requests. By default, fields with
  3888. // empty values are omitted from API requests. However, any non-pointer,
  3889. // non-interface field appearing in ForceSendFields will be sent to the
  3890. // server regardless of whether the field is empty or not. This may be
  3891. // used to include empty fields in Patch requests.
  3892. ForceSendFields []string `json:"-"`
  3893. }
  3894. func (s *TestOrderLineItem) MarshalJSON() ([]byte, error) {
  3895. type noMethod TestOrderLineItem
  3896. raw := noMethod(*s)
  3897. return gensupport.MarshalJSON(raw, s.ForceSendFields)
  3898. }
  3899. type TestOrderLineItemProduct struct {
  3900. // Brand: Brand of the item.
  3901. Brand string `json:"brand,omitempty"`
  3902. // Channel: The item's channel.
  3903. Channel string `json:"channel,omitempty"`
  3904. // Condition: Condition or state of the item.
  3905. Condition string `json:"condition,omitempty"`
  3906. // ContentLanguage: The two-letter ISO 639-1 language code for the item.
  3907. ContentLanguage string `json:"contentLanguage,omitempty"`
  3908. // Gtin: Global Trade Item Number (GTIN) of the item. Optional.
  3909. Gtin string `json:"gtin,omitempty"`
  3910. // ImageLink: URL of an image of the item.
  3911. ImageLink string `json:"imageLink,omitempty"`
  3912. // ItemGroupId: Shared identifier for all variants of the same product.
  3913. // Optional.
  3914. ItemGroupId string `json:"itemGroupId,omitempty"`
  3915. // Mpn: Manufacturer Part Number (MPN) of the item. Optional.
  3916. Mpn string `json:"mpn,omitempty"`
  3917. // OfferId: An identifier of the item.
  3918. OfferId string `json:"offerId,omitempty"`
  3919. // Price: The price for the product.
  3920. Price *Price `json:"price,omitempty"`
  3921. // TargetCountry: The CLDR territory code of the target country of the
  3922. // product.
  3923. TargetCountry string `json:"targetCountry,omitempty"`
  3924. // Title: The title of the product.
  3925. Title string `json:"title,omitempty"`
  3926. // VariantAttributes: Variant attributes for the item. Optional.
  3927. VariantAttributes []*OrderLineItemProductVariantAttribute `json:"variantAttributes,omitempty"`
  3928. // ForceSendFields is a list of field names (e.g. "Brand") to
  3929. // unconditionally include in API requests. By default, fields with
  3930. // empty values are omitted from API requests. However, any non-pointer,
  3931. // non-interface field appearing in ForceSendFields will be sent to the
  3932. // server regardless of whether the field is empty or not. This may be
  3933. // used to include empty fields in Patch requests.
  3934. ForceSendFields []string `json:"-"`
  3935. }
  3936. func (s *TestOrderLineItemProduct) MarshalJSON() ([]byte, error) {
  3937. type noMethod TestOrderLineItemProduct
  3938. raw := noMethod(*s)
  3939. return gensupport.MarshalJSON(raw, s.ForceSendFields)
  3940. }
  3941. type TestOrderPaymentMethod struct {
  3942. // ExpirationMonth: The card expiration month (January = 1, February = 2
  3943. // etc.).
  3944. ExpirationMonth int64 `json:"expirationMonth,omitempty"`
  3945. // ExpirationYear: The card expiration year (4-digit, e.g. 2015).
  3946. ExpirationYear int64 `json:"expirationYear,omitempty"`
  3947. // LastFourDigits: The last four digits of the card number.
  3948. LastFourDigits string `json:"lastFourDigits,omitempty"`
  3949. // PredefinedBillingAddress: The billing address.
  3950. PredefinedBillingAddress string `json:"predefinedBillingAddress,omitempty"`
  3951. // Type: The type of instrument. Note that real orders might have
  3952. // different values than the four values accepted by createTestOrder.
  3953. Type string `json:"type,omitempty"`
  3954. // ForceSendFields is a list of field names (e.g. "ExpirationMonth") to
  3955. // unconditionally include in API requests. By default, fields with
  3956. // empty values are omitted from API requests. However, any non-pointer,
  3957. // non-interface field appearing in ForceSendFields will be sent to the
  3958. // server regardless of whether the field is empty or not. This may be
  3959. // used to include empty fields in Patch requests.
  3960. ForceSendFields []string `json:"-"`
  3961. }
  3962. func (s *TestOrderPaymentMethod) MarshalJSON() ([]byte, error) {
  3963. type noMethod TestOrderPaymentMethod
  3964. raw := noMethod(*s)
  3965. return gensupport.MarshalJSON(raw, s.ForceSendFields)
  3966. }
  3967. type Weight struct {
  3968. // Unit: The weight unit.
  3969. Unit string `json:"unit,omitempty"`
  3970. // Value: The weight represented as a number.
  3971. Value string `json:"value,omitempty"`
  3972. // ForceSendFields is a list of field names (e.g. "Unit") to
  3973. // unconditionally include in API requests. By default, fields with
  3974. // empty values are omitted from API requests. However, any non-pointer,
  3975. // non-interface field appearing in ForceSendFields will be sent to the
  3976. // server regardless of whether the field is empty or not. This may be
  3977. // used to include empty fields in Patch requests.
  3978. ForceSendFields []string `json:"-"`
  3979. }
  3980. func (s *Weight) MarshalJSON() ([]byte, error) {
  3981. type noMethod Weight
  3982. raw := noMethod(*s)
  3983. return gensupport.MarshalJSON(raw, s.ForceSendFields)
  3984. }
  3985. // method id "content.accounts.authinfo":
  3986. type AccountsAuthinfoCall struct {
  3987. s *Service
  3988. urlParams_ gensupport.URLParams
  3989. ifNoneMatch_ string
  3990. ctx_ context.Context
  3991. }
  3992. // Authinfo: Returns information about the authenticated user.
  3993. func (r *AccountsService) Authinfo() *AccountsAuthinfoCall {
  3994. c := &AccountsAuthinfoCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  3995. return c
  3996. }
  3997. // Fields allows partial responses to be retrieved. See
  3998. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  3999. // for more information.
  4000. func (c *AccountsAuthinfoCall) Fields(s ...googleapi.Field) *AccountsAuthinfoCall {
  4001. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  4002. return c
  4003. }
  4004. // IfNoneMatch sets the optional parameter which makes the operation
  4005. // fail if the object's ETag matches the given value. This is useful for
  4006. // getting updates only after the object has changed since the last
  4007. // request. Use googleapi.IsNotModified to check whether the response
  4008. // error from Do is the result of In-None-Match.
  4009. func (c *AccountsAuthinfoCall) IfNoneMatch(entityTag string) *AccountsAuthinfoCall {
  4010. c.ifNoneMatch_ = entityTag
  4011. return c
  4012. }
  4013. // Context sets the context to be used in this call's Do method. Any
  4014. // pending HTTP request will be aborted if the provided context is
  4015. // canceled.
  4016. func (c *AccountsAuthinfoCall) Context(ctx context.Context) *AccountsAuthinfoCall {
  4017. c.ctx_ = ctx
  4018. return c
  4019. }
  4020. func (c *AccountsAuthinfoCall) doRequest(alt string) (*http.Response, error) {
  4021. var body io.Reader = nil
  4022. c.urlParams_.Set("alt", alt)
  4023. urls := googleapi.ResolveRelative(c.s.BasePath, "accounts/authinfo")
  4024. urls += "?" + c.urlParams_.Encode()
  4025. req, _ := http.NewRequest("GET", urls, body)
  4026. googleapi.SetOpaque(req.URL)
  4027. req.Header.Set("User-Agent", c.s.userAgent())
  4028. if c.ifNoneMatch_ != "" {
  4029. req.Header.Set("If-None-Match", c.ifNoneMatch_)
  4030. }
  4031. if c.ctx_ != nil {
  4032. return ctxhttp.Do(c.ctx_, c.s.client, req)
  4033. }
  4034. return c.s.client.Do(req)
  4035. }
  4036. // Do executes the "content.accounts.authinfo" call.
  4037. // Exactly one of *AccountsAuthInfoResponse or error will be non-nil.
  4038. // Any non-2xx status code is an error. Response headers are in either
  4039. // *AccountsAuthInfoResponse.ServerResponse.Header or (if a response was
  4040. // returned at all) in error.(*googleapi.Error).Header. Use
  4041. // googleapi.IsNotModified to check whether the returned error was
  4042. // because http.StatusNotModified was returned.
  4043. func (c *AccountsAuthinfoCall) Do(opts ...googleapi.CallOption) (*AccountsAuthInfoResponse, error) {
  4044. gensupport.SetOptions(c.urlParams_, opts...)
  4045. res, err := c.doRequest("json")
  4046. if res != nil && res.StatusCode == http.StatusNotModified {
  4047. if res.Body != nil {
  4048. res.Body.Close()
  4049. }
  4050. return nil, &googleapi.Error{
  4051. Code: res.StatusCode,
  4052. Header: res.Header,
  4053. }
  4054. }
  4055. if err != nil {
  4056. return nil, err
  4057. }
  4058. defer googleapi.CloseBody(res)
  4059. if err := googleapi.CheckResponse(res); err != nil {
  4060. return nil, err
  4061. }
  4062. ret := &AccountsAuthInfoResponse{
  4063. ServerResponse: googleapi.ServerResponse{
  4064. Header: res.Header,
  4065. HTTPStatusCode: res.StatusCode,
  4066. },
  4067. }
  4068. if err := json.NewDecoder(res.Body).Decode(&ret); err != nil {
  4069. return nil, err
  4070. }
  4071. return ret, nil
  4072. // {
  4073. // "description": "Returns information about the authenticated user.",
  4074. // "httpMethod": "GET",
  4075. // "id": "content.accounts.authinfo",
  4076. // "path": "accounts/authinfo",
  4077. // "response": {
  4078. // "$ref": "AccountsAuthInfoResponse"
  4079. // },
  4080. // "scopes": [
  4081. // "https://www.googleapis.com/auth/content"
  4082. // ]
  4083. // }
  4084. }
  4085. // method id "content.accounts.custombatch":
  4086. type AccountsCustombatchCall struct {
  4087. s *Service
  4088. accountscustombatchrequest *AccountsCustomBatchRequest
  4089. urlParams_ gensupport.URLParams
  4090. ctx_ context.Context
  4091. }
  4092. // Custombatch: Retrieves, inserts, updates, and deletes multiple
  4093. // Merchant Center (sub-)accounts in a single request.
  4094. func (r *AccountsService) Custombatch(accountscustombatchrequest *AccountsCustomBatchRequest) *AccountsCustombatchCall {
  4095. c := &AccountsCustombatchCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  4096. c.accountscustombatchrequest = accountscustombatchrequest
  4097. return c
  4098. }
  4099. // DryRun sets the optional parameter "dryRun": Flag to run the request
  4100. // in dry-run mode.
  4101. func (c *AccountsCustombatchCall) DryRun(dryRun bool) *AccountsCustombatchCall {
  4102. c.urlParams_.Set("dryRun", fmt.Sprint(dryRun))
  4103. return c
  4104. }
  4105. // Fields allows partial responses to be retrieved. See
  4106. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  4107. // for more information.
  4108. func (c *AccountsCustombatchCall) Fields(s ...googleapi.Field) *AccountsCustombatchCall {
  4109. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  4110. return c
  4111. }
  4112. // Context sets the context to be used in this call's Do method. Any
  4113. // pending HTTP request will be aborted if the provided context is
  4114. // canceled.
  4115. func (c *AccountsCustombatchCall) Context(ctx context.Context) *AccountsCustombatchCall {
  4116. c.ctx_ = ctx
  4117. return c
  4118. }
  4119. func (c *AccountsCustombatchCall) doRequest(alt string) (*http.Response, error) {
  4120. var body io.Reader = nil
  4121. body, err := googleapi.WithoutDataWrapper.JSONReader(c.accountscustombatchrequest)
  4122. if err != nil {
  4123. return nil, err
  4124. }
  4125. ctype := "application/json"
  4126. c.urlParams_.Set("alt", alt)
  4127. urls := googleapi.ResolveRelative(c.s.BasePath, "accounts/batch")
  4128. urls += "?" + c.urlParams_.Encode()
  4129. req, _ := http.NewRequest("POST", urls, body)
  4130. googleapi.SetOpaque(req.URL)
  4131. req.Header.Set("Content-Type", ctype)
  4132. req.Header.Set("User-Agent", c.s.userAgent())
  4133. if c.ctx_ != nil {
  4134. return ctxhttp.Do(c.ctx_, c.s.client, req)
  4135. }
  4136. return c.s.client.Do(req)
  4137. }
  4138. // Do executes the "content.accounts.custombatch" call.
  4139. // Exactly one of *AccountsCustomBatchResponse or error will be non-nil.
  4140. // Any non-2xx status code is an error. Response headers are in either
  4141. // *AccountsCustomBatchResponse.ServerResponse.Header or (if a response
  4142. // was returned at all) in error.(*googleapi.Error).Header. Use
  4143. // googleapi.IsNotModified to check whether the returned error was
  4144. // because http.StatusNotModified was returned.
  4145. func (c *AccountsCustombatchCall) Do(opts ...googleapi.CallOption) (*AccountsCustomBatchResponse, error) {
  4146. gensupport.SetOptions(c.urlParams_, opts...)
  4147. res, err := c.doRequest("json")
  4148. if res != nil && res.StatusCode == http.StatusNotModified {
  4149. if res.Body != nil {
  4150. res.Body.Close()
  4151. }
  4152. return nil, &googleapi.Error{
  4153. Code: res.StatusCode,
  4154. Header: res.Header,
  4155. }
  4156. }
  4157. if err != nil {
  4158. return nil, err
  4159. }
  4160. defer googleapi.CloseBody(res)
  4161. if err := googleapi.CheckResponse(res); err != nil {
  4162. return nil, err
  4163. }
  4164. ret := &AccountsCustomBatchResponse{
  4165. ServerResponse: googleapi.ServerResponse{
  4166. Header: res.Header,
  4167. HTTPStatusCode: res.StatusCode,
  4168. },
  4169. }
  4170. if err := json.NewDecoder(res.Body).Decode(&ret); err != nil {
  4171. return nil, err
  4172. }
  4173. return ret, nil
  4174. // {
  4175. // "description": "Retrieves, inserts, updates, and deletes multiple Merchant Center (sub-)accounts in a single request.",
  4176. // "httpMethod": "POST",
  4177. // "id": "content.accounts.custombatch",
  4178. // "parameters": {
  4179. // "dryRun": {
  4180. // "description": "Flag to run the request in dry-run mode.",
  4181. // "location": "query",
  4182. // "type": "boolean"
  4183. // }
  4184. // },
  4185. // "path": "accounts/batch",
  4186. // "request": {
  4187. // "$ref": "AccountsCustomBatchRequest"
  4188. // },
  4189. // "response": {
  4190. // "$ref": "AccountsCustomBatchResponse"
  4191. // },
  4192. // "scopes": [
  4193. // "https://www.googleapis.com/auth/content"
  4194. // ]
  4195. // }
  4196. }
  4197. // method id "content.accounts.delete":
  4198. type AccountsDeleteCall struct {
  4199. s *Service
  4200. merchantId uint64
  4201. accountId uint64
  4202. urlParams_ gensupport.URLParams
  4203. ctx_ context.Context
  4204. }
  4205. // Delete: Deletes a Merchant Center sub-account.
  4206. func (r *AccountsService) Delete(merchantId uint64, accountId uint64) *AccountsDeleteCall {
  4207. c := &AccountsDeleteCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  4208. c.merchantId = merchantId
  4209. c.accountId = accountId
  4210. return c
  4211. }
  4212. // DryRun sets the optional parameter "dryRun": Flag to run the request
  4213. // in dry-run mode.
  4214. func (c *AccountsDeleteCall) DryRun(dryRun bool) *AccountsDeleteCall {
  4215. c.urlParams_.Set("dryRun", fmt.Sprint(dryRun))
  4216. return c
  4217. }
  4218. // Fields allows partial responses to be retrieved. See
  4219. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  4220. // for more information.
  4221. func (c *AccountsDeleteCall) Fields(s ...googleapi.Field) *AccountsDeleteCall {
  4222. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  4223. return c
  4224. }
  4225. // Context sets the context to be used in this call's Do method. Any
  4226. // pending HTTP request will be aborted if the provided context is
  4227. // canceled.
  4228. func (c *AccountsDeleteCall) Context(ctx context.Context) *AccountsDeleteCall {
  4229. c.ctx_ = ctx
  4230. return c
  4231. }
  4232. func (c *AccountsDeleteCall) doRequest(alt string) (*http.Response, error) {
  4233. var body io.Reader = nil
  4234. c.urlParams_.Set("alt", alt)
  4235. urls := googleapi.ResolveRelative(c.s.BasePath, "{merchantId}/accounts/{accountId}")
  4236. urls += "?" + c.urlParams_.Encode()
  4237. req, _ := http.NewRequest("DELETE", urls, body)
  4238. googleapi.Expand(req.URL, map[string]string{
  4239. "merchantId": strconv.FormatUint(c.merchantId, 10),
  4240. "accountId": strconv.FormatUint(c.accountId, 10),
  4241. })
  4242. req.Header.Set("User-Agent", c.s.userAgent())
  4243. if c.ctx_ != nil {
  4244. return ctxhttp.Do(c.ctx_, c.s.client, req)
  4245. }
  4246. return c.s.client.Do(req)
  4247. }
  4248. // Do executes the "content.accounts.delete" call.
  4249. func (c *AccountsDeleteCall) Do(opts ...googleapi.CallOption) error {
  4250. gensupport.SetOptions(c.urlParams_, opts...)
  4251. res, err := c.doRequest("json")
  4252. if err != nil {
  4253. return err
  4254. }
  4255. defer googleapi.CloseBody(res)
  4256. if err := googleapi.CheckResponse(res); err != nil {
  4257. return err
  4258. }
  4259. return nil
  4260. // {
  4261. // "description": "Deletes a Merchant Center sub-account.",
  4262. // "httpMethod": "DELETE",
  4263. // "id": "content.accounts.delete",
  4264. // "parameterOrder": [
  4265. // "merchantId",
  4266. // "accountId"
  4267. // ],
  4268. // "parameters": {
  4269. // "accountId": {
  4270. // "description": "The ID of the account.",
  4271. // "format": "uint64",
  4272. // "location": "path",
  4273. // "required": true,
  4274. // "type": "string"
  4275. // },
  4276. // "dryRun": {
  4277. // "description": "Flag to run the request in dry-run mode.",
  4278. // "location": "query",
  4279. // "type": "boolean"
  4280. // },
  4281. // "merchantId": {
  4282. // "description": "The ID of the managing account.",
  4283. // "format": "uint64",
  4284. // "location": "path",
  4285. // "required": true,
  4286. // "type": "string"
  4287. // }
  4288. // },
  4289. // "path": "{merchantId}/accounts/{accountId}",
  4290. // "scopes": [
  4291. // "https://www.googleapis.com/auth/content"
  4292. // ]
  4293. // }
  4294. }
  4295. // method id "content.accounts.get":
  4296. type AccountsGetCall struct {
  4297. s *Service
  4298. merchantId uint64
  4299. accountId uint64
  4300. urlParams_ gensupport.URLParams
  4301. ifNoneMatch_ string
  4302. ctx_ context.Context
  4303. }
  4304. // Get: Retrieves a Merchant Center account.
  4305. func (r *AccountsService) Get(merchantId uint64, accountId uint64) *AccountsGetCall {
  4306. c := &AccountsGetCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  4307. c.merchantId = merchantId
  4308. c.accountId = accountId
  4309. return c
  4310. }
  4311. // Fields allows partial responses to be retrieved. See
  4312. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  4313. // for more information.
  4314. func (c *AccountsGetCall) Fields(s ...googleapi.Field) *AccountsGetCall {
  4315. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  4316. return c
  4317. }
  4318. // IfNoneMatch sets the optional parameter which makes the operation
  4319. // fail if the object's ETag matches the given value. This is useful for
  4320. // getting updates only after the object has changed since the last
  4321. // request. Use googleapi.IsNotModified to check whether the response
  4322. // error from Do is the result of In-None-Match.
  4323. func (c *AccountsGetCall) IfNoneMatch(entityTag string) *AccountsGetCall {
  4324. c.ifNoneMatch_ = entityTag
  4325. return c
  4326. }
  4327. // Context sets the context to be used in this call's Do method. Any
  4328. // pending HTTP request will be aborted if the provided context is
  4329. // canceled.
  4330. func (c *AccountsGetCall) Context(ctx context.Context) *AccountsGetCall {
  4331. c.ctx_ = ctx
  4332. return c
  4333. }
  4334. func (c *AccountsGetCall) doRequest(alt string) (*http.Response, error) {
  4335. var body io.Reader = nil
  4336. c.urlParams_.Set("alt", alt)
  4337. urls := googleapi.ResolveRelative(c.s.BasePath, "{merchantId}/accounts/{accountId}")
  4338. urls += "?" + c.urlParams_.Encode()
  4339. req, _ := http.NewRequest("GET", urls, body)
  4340. googleapi.Expand(req.URL, map[string]string{
  4341. "merchantId": strconv.FormatUint(c.merchantId, 10),
  4342. "accountId": strconv.FormatUint(c.accountId, 10),
  4343. })
  4344. req.Header.Set("User-Agent", c.s.userAgent())
  4345. if c.ifNoneMatch_ != "" {
  4346. req.Header.Set("If-None-Match", c.ifNoneMatch_)
  4347. }
  4348. if c.ctx_ != nil {
  4349. return ctxhttp.Do(c.ctx_, c.s.client, req)
  4350. }
  4351. return c.s.client.Do(req)
  4352. }
  4353. // Do executes the "content.accounts.get" call.
  4354. // Exactly one of *Account or error will be non-nil. Any non-2xx status
  4355. // code is an error. Response headers are in either
  4356. // *Account.ServerResponse.Header or (if a response was returned at all)
  4357. // in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to
  4358. // check whether the returned error was because http.StatusNotModified
  4359. // was returned.
  4360. func (c *AccountsGetCall) Do(opts ...googleapi.CallOption) (*Account, error) {
  4361. gensupport.SetOptions(c.urlParams_, opts...)
  4362. res, err := c.doRequest("json")
  4363. if res != nil && res.StatusCode == http.StatusNotModified {
  4364. if res.Body != nil {
  4365. res.Body.Close()
  4366. }
  4367. return nil, &googleapi.Error{
  4368. Code: res.StatusCode,
  4369. Header: res.Header,
  4370. }
  4371. }
  4372. if err != nil {
  4373. return nil, err
  4374. }
  4375. defer googleapi.CloseBody(res)
  4376. if err := googleapi.CheckResponse(res); err != nil {
  4377. return nil, err
  4378. }
  4379. ret := &Account{
  4380. ServerResponse: googleapi.ServerResponse{
  4381. Header: res.Header,
  4382. HTTPStatusCode: res.StatusCode,
  4383. },
  4384. }
  4385. if err := json.NewDecoder(res.Body).Decode(&ret); err != nil {
  4386. return nil, err
  4387. }
  4388. return ret, nil
  4389. // {
  4390. // "description": "Retrieves a Merchant Center account.",
  4391. // "httpMethod": "GET",
  4392. // "id": "content.accounts.get",
  4393. // "parameterOrder": [
  4394. // "merchantId",
  4395. // "accountId"
  4396. // ],
  4397. // "parameters": {
  4398. // "accountId": {
  4399. // "description": "The ID of the account.",
  4400. // "format": "uint64",
  4401. // "location": "path",
  4402. // "required": true,
  4403. // "type": "string"
  4404. // },
  4405. // "merchantId": {
  4406. // "description": "The ID of the managing account.",
  4407. // "format": "uint64",
  4408. // "location": "path",
  4409. // "required": true,
  4410. // "type": "string"
  4411. // }
  4412. // },
  4413. // "path": "{merchantId}/accounts/{accountId}",
  4414. // "response": {
  4415. // "$ref": "Account"
  4416. // },
  4417. // "scopes": [
  4418. // "https://www.googleapis.com/auth/content"
  4419. // ]
  4420. // }
  4421. }
  4422. // method id "content.accounts.insert":
  4423. type AccountsInsertCall struct {
  4424. s *Service
  4425. merchantId uint64
  4426. account *Account
  4427. urlParams_ gensupport.URLParams
  4428. ctx_ context.Context
  4429. }
  4430. // Insert: Creates a Merchant Center sub-account.
  4431. func (r *AccountsService) Insert(merchantId uint64, account *Account) *AccountsInsertCall {
  4432. c := &AccountsInsertCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  4433. c.merchantId = merchantId
  4434. c.account = account
  4435. return c
  4436. }
  4437. // DryRun sets the optional parameter "dryRun": Flag to run the request
  4438. // in dry-run mode.
  4439. func (c *AccountsInsertCall) DryRun(dryRun bool) *AccountsInsertCall {
  4440. c.urlParams_.Set("dryRun", fmt.Sprint(dryRun))
  4441. return c
  4442. }
  4443. // Fields allows partial responses to be retrieved. See
  4444. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  4445. // for more information.
  4446. func (c *AccountsInsertCall) Fields(s ...googleapi.Field) *AccountsInsertCall {
  4447. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  4448. return c
  4449. }
  4450. // Context sets the context to be used in this call's Do method. Any
  4451. // pending HTTP request will be aborted if the provided context is
  4452. // canceled.
  4453. func (c *AccountsInsertCall) Context(ctx context.Context) *AccountsInsertCall {
  4454. c.ctx_ = ctx
  4455. return c
  4456. }
  4457. func (c *AccountsInsertCall) doRequest(alt string) (*http.Response, error) {
  4458. var body io.Reader = nil
  4459. body, err := googleapi.WithoutDataWrapper.JSONReader(c.account)
  4460. if err != nil {
  4461. return nil, err
  4462. }
  4463. ctype := "application/json"
  4464. c.urlParams_.Set("alt", alt)
  4465. urls := googleapi.ResolveRelative(c.s.BasePath, "{merchantId}/accounts")
  4466. urls += "?" + c.urlParams_.Encode()
  4467. req, _ := http.NewRequest("POST", urls, body)
  4468. googleapi.Expand(req.URL, map[string]string{
  4469. "merchantId": strconv.FormatUint(c.merchantId, 10),
  4470. })
  4471. req.Header.Set("Content-Type", ctype)
  4472. req.Header.Set("User-Agent", c.s.userAgent())
  4473. if c.ctx_ != nil {
  4474. return ctxhttp.Do(c.ctx_, c.s.client, req)
  4475. }
  4476. return c.s.client.Do(req)
  4477. }
  4478. // Do executes the "content.accounts.insert" call.
  4479. // Exactly one of *Account or error will be non-nil. Any non-2xx status
  4480. // code is an error. Response headers are in either
  4481. // *Account.ServerResponse.Header or (if a response was returned at all)
  4482. // in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to
  4483. // check whether the returned error was because http.StatusNotModified
  4484. // was returned.
  4485. func (c *AccountsInsertCall) Do(opts ...googleapi.CallOption) (*Account, error) {
  4486. gensupport.SetOptions(c.urlParams_, opts...)
  4487. res, err := c.doRequest("json")
  4488. if res != nil && res.StatusCode == http.StatusNotModified {
  4489. if res.Body != nil {
  4490. res.Body.Close()
  4491. }
  4492. return nil, &googleapi.Error{
  4493. Code: res.StatusCode,
  4494. Header: res.Header,
  4495. }
  4496. }
  4497. if err != nil {
  4498. return nil, err
  4499. }
  4500. defer googleapi.CloseBody(res)
  4501. if err := googleapi.CheckResponse(res); err != nil {
  4502. return nil, err
  4503. }
  4504. ret := &Account{
  4505. ServerResponse: googleapi.ServerResponse{
  4506. Header: res.Header,
  4507. HTTPStatusCode: res.StatusCode,
  4508. },
  4509. }
  4510. if err := json.NewDecoder(res.Body).Decode(&ret); err != nil {
  4511. return nil, err
  4512. }
  4513. return ret, nil
  4514. // {
  4515. // "description": "Creates a Merchant Center sub-account.",
  4516. // "httpMethod": "POST",
  4517. // "id": "content.accounts.insert",
  4518. // "parameterOrder": [
  4519. // "merchantId"
  4520. // ],
  4521. // "parameters": {
  4522. // "dryRun": {
  4523. // "description": "Flag to run the request in dry-run mode.",
  4524. // "location": "query",
  4525. // "type": "boolean"
  4526. // },
  4527. // "merchantId": {
  4528. // "description": "The ID of the managing account.",
  4529. // "format": "uint64",
  4530. // "location": "path",
  4531. // "required": true,
  4532. // "type": "string"
  4533. // }
  4534. // },
  4535. // "path": "{merchantId}/accounts",
  4536. // "request": {
  4537. // "$ref": "Account"
  4538. // },
  4539. // "response": {
  4540. // "$ref": "Account"
  4541. // },
  4542. // "scopes": [
  4543. // "https://www.googleapis.com/auth/content"
  4544. // ]
  4545. // }
  4546. }
  4547. // method id "content.accounts.list":
  4548. type AccountsListCall struct {
  4549. s *Service
  4550. merchantId uint64
  4551. urlParams_ gensupport.URLParams
  4552. ifNoneMatch_ string
  4553. ctx_ context.Context
  4554. }
  4555. // List: Lists the sub-accounts in your Merchant Center account.
  4556. func (r *AccountsService) List(merchantId uint64) *AccountsListCall {
  4557. c := &AccountsListCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  4558. c.merchantId = merchantId
  4559. return c
  4560. }
  4561. // MaxResults sets the optional parameter "maxResults": The maximum
  4562. // number of accounts to return in the response, used for paging.
  4563. func (c *AccountsListCall) MaxResults(maxResults int64) *AccountsListCall {
  4564. c.urlParams_.Set("maxResults", fmt.Sprint(maxResults))
  4565. return c
  4566. }
  4567. // PageToken sets the optional parameter "pageToken": The token returned
  4568. // by the previous request.
  4569. func (c *AccountsListCall) PageToken(pageToken string) *AccountsListCall {
  4570. c.urlParams_.Set("pageToken", pageToken)
  4571. return c
  4572. }
  4573. // Fields allows partial responses to be retrieved. See
  4574. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  4575. // for more information.
  4576. func (c *AccountsListCall) Fields(s ...googleapi.Field) *AccountsListCall {
  4577. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  4578. return c
  4579. }
  4580. // IfNoneMatch sets the optional parameter which makes the operation
  4581. // fail if the object's ETag matches the given value. This is useful for
  4582. // getting updates only after the object has changed since the last
  4583. // request. Use googleapi.IsNotModified to check whether the response
  4584. // error from Do is the result of In-None-Match.
  4585. func (c *AccountsListCall) IfNoneMatch(entityTag string) *AccountsListCall {
  4586. c.ifNoneMatch_ = entityTag
  4587. return c
  4588. }
  4589. // Context sets the context to be used in this call's Do method. Any
  4590. // pending HTTP request will be aborted if the provided context is
  4591. // canceled.
  4592. func (c *AccountsListCall) Context(ctx context.Context) *AccountsListCall {
  4593. c.ctx_ = ctx
  4594. return c
  4595. }
  4596. func (c *AccountsListCall) doRequest(alt string) (*http.Response, error) {
  4597. var body io.Reader = nil
  4598. c.urlParams_.Set("alt", alt)
  4599. urls := googleapi.ResolveRelative(c.s.BasePath, "{merchantId}/accounts")
  4600. urls += "?" + c.urlParams_.Encode()
  4601. req, _ := http.NewRequest("GET", urls, body)
  4602. googleapi.Expand(req.URL, map[string]string{
  4603. "merchantId": strconv.FormatUint(c.merchantId, 10),
  4604. })
  4605. req.Header.Set("User-Agent", c.s.userAgent())
  4606. if c.ifNoneMatch_ != "" {
  4607. req.Header.Set("If-None-Match", c.ifNoneMatch_)
  4608. }
  4609. if c.ctx_ != nil {
  4610. return ctxhttp.Do(c.ctx_, c.s.client, req)
  4611. }
  4612. return c.s.client.Do(req)
  4613. }
  4614. // Do executes the "content.accounts.list" call.
  4615. // Exactly one of *AccountsListResponse or error will be non-nil. Any
  4616. // non-2xx status code is an error. Response headers are in either
  4617. // *AccountsListResponse.ServerResponse.Header or (if a response was
  4618. // returned at all) in error.(*googleapi.Error).Header. Use
  4619. // googleapi.IsNotModified to check whether the returned error was
  4620. // because http.StatusNotModified was returned.
  4621. func (c *AccountsListCall) Do(opts ...googleapi.CallOption) (*AccountsListResponse, error) {
  4622. gensupport.SetOptions(c.urlParams_, opts...)
  4623. res, err := c.doRequest("json")
  4624. if res != nil && res.StatusCode == http.StatusNotModified {
  4625. if res.Body != nil {
  4626. res.Body.Close()
  4627. }
  4628. return nil, &googleapi.Error{
  4629. Code: res.StatusCode,
  4630. Header: res.Header,
  4631. }
  4632. }
  4633. if err != nil {
  4634. return nil, err
  4635. }
  4636. defer googleapi.CloseBody(res)
  4637. if err := googleapi.CheckResponse(res); err != nil {
  4638. return nil, err
  4639. }
  4640. ret := &AccountsListResponse{
  4641. ServerResponse: googleapi.ServerResponse{
  4642. Header: res.Header,
  4643. HTTPStatusCode: res.StatusCode,
  4644. },
  4645. }
  4646. if err := json.NewDecoder(res.Body).Decode(&ret); err != nil {
  4647. return nil, err
  4648. }
  4649. return ret, nil
  4650. // {
  4651. // "description": "Lists the sub-accounts in your Merchant Center account.",
  4652. // "httpMethod": "GET",
  4653. // "id": "content.accounts.list",
  4654. // "parameterOrder": [
  4655. // "merchantId"
  4656. // ],
  4657. // "parameters": {
  4658. // "maxResults": {
  4659. // "description": "The maximum number of accounts to return in the response, used for paging.",
  4660. // "format": "uint32",
  4661. // "location": "query",
  4662. // "type": "integer"
  4663. // },
  4664. // "merchantId": {
  4665. // "description": "The ID of the managing account.",
  4666. // "format": "uint64",
  4667. // "location": "path",
  4668. // "required": true,
  4669. // "type": "string"
  4670. // },
  4671. // "pageToken": {
  4672. // "description": "The token returned by the previous request.",
  4673. // "location": "query",
  4674. // "type": "string"
  4675. // }
  4676. // },
  4677. // "path": "{merchantId}/accounts",
  4678. // "response": {
  4679. // "$ref": "AccountsListResponse"
  4680. // },
  4681. // "scopes": [
  4682. // "https://www.googleapis.com/auth/content"
  4683. // ]
  4684. // }
  4685. }
  4686. // Pages invokes f for each page of results.
  4687. // A non-nil error returned from f will halt the iteration.
  4688. // The provided context supersedes any context provided to the Context method.
  4689. func (c *AccountsListCall) Pages(ctx context.Context, f func(*AccountsListResponse) error) error {
  4690. c.ctx_ = ctx
  4691. defer c.PageToken(c.urlParams_.Get("pageToken")) // reset paging to original point
  4692. for {
  4693. x, err := c.Do()
  4694. if err != nil {
  4695. return err
  4696. }
  4697. if err := f(x); err != nil {
  4698. return err
  4699. }
  4700. if x.NextPageToken == "" {
  4701. return nil
  4702. }
  4703. c.PageToken(x.NextPageToken)
  4704. }
  4705. }
  4706. // method id "content.accounts.patch":
  4707. type AccountsPatchCall struct {
  4708. s *Service
  4709. merchantId uint64
  4710. accountId uint64
  4711. account *Account
  4712. urlParams_ gensupport.URLParams
  4713. ctx_ context.Context
  4714. }
  4715. // Patch: Updates a Merchant Center account. This method supports patch
  4716. // semantics.
  4717. func (r *AccountsService) Patch(merchantId uint64, accountId uint64, account *Account) *AccountsPatchCall {
  4718. c := &AccountsPatchCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  4719. c.merchantId = merchantId
  4720. c.accountId = accountId
  4721. c.account = account
  4722. return c
  4723. }
  4724. // DryRun sets the optional parameter "dryRun": Flag to run the request
  4725. // in dry-run mode.
  4726. func (c *AccountsPatchCall) DryRun(dryRun bool) *AccountsPatchCall {
  4727. c.urlParams_.Set("dryRun", fmt.Sprint(dryRun))
  4728. return c
  4729. }
  4730. // Fields allows partial responses to be retrieved. See
  4731. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  4732. // for more information.
  4733. func (c *AccountsPatchCall) Fields(s ...googleapi.Field) *AccountsPatchCall {
  4734. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  4735. return c
  4736. }
  4737. // Context sets the context to be used in this call's Do method. Any
  4738. // pending HTTP request will be aborted if the provided context is
  4739. // canceled.
  4740. func (c *AccountsPatchCall) Context(ctx context.Context) *AccountsPatchCall {
  4741. c.ctx_ = ctx
  4742. return c
  4743. }
  4744. func (c *AccountsPatchCall) doRequest(alt string) (*http.Response, error) {
  4745. var body io.Reader = nil
  4746. body, err := googleapi.WithoutDataWrapper.JSONReader(c.account)
  4747. if err != nil {
  4748. return nil, err
  4749. }
  4750. ctype := "application/json"
  4751. c.urlParams_.Set("alt", alt)
  4752. urls := googleapi.ResolveRelative(c.s.BasePath, "{merchantId}/accounts/{accountId}")
  4753. urls += "?" + c.urlParams_.Encode()
  4754. req, _ := http.NewRequest("PATCH", urls, body)
  4755. googleapi.Expand(req.URL, map[string]string{
  4756. "merchantId": strconv.FormatUint(c.merchantId, 10),
  4757. "accountId": strconv.FormatUint(c.accountId, 10),
  4758. })
  4759. req.Header.Set("Content-Type", ctype)
  4760. req.Header.Set("User-Agent", c.s.userAgent())
  4761. if c.ctx_ != nil {
  4762. return ctxhttp.Do(c.ctx_, c.s.client, req)
  4763. }
  4764. return c.s.client.Do(req)
  4765. }
  4766. // Do executes the "content.accounts.patch" call.
  4767. // Exactly one of *Account or error will be non-nil. Any non-2xx status
  4768. // code is an error. Response headers are in either
  4769. // *Account.ServerResponse.Header or (if a response was returned at all)
  4770. // in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to
  4771. // check whether the returned error was because http.StatusNotModified
  4772. // was returned.
  4773. func (c *AccountsPatchCall) Do(opts ...googleapi.CallOption) (*Account, error) {
  4774. gensupport.SetOptions(c.urlParams_, opts...)
  4775. res, err := c.doRequest("json")
  4776. if res != nil && res.StatusCode == http.StatusNotModified {
  4777. if res.Body != nil {
  4778. res.Body.Close()
  4779. }
  4780. return nil, &googleapi.Error{
  4781. Code: res.StatusCode,
  4782. Header: res.Header,
  4783. }
  4784. }
  4785. if err != nil {
  4786. return nil, err
  4787. }
  4788. defer googleapi.CloseBody(res)
  4789. if err := googleapi.CheckResponse(res); err != nil {
  4790. return nil, err
  4791. }
  4792. ret := &Account{
  4793. ServerResponse: googleapi.ServerResponse{
  4794. Header: res.Header,
  4795. HTTPStatusCode: res.StatusCode,
  4796. },
  4797. }
  4798. if err := json.NewDecoder(res.Body).Decode(&ret); err != nil {
  4799. return nil, err
  4800. }
  4801. return ret, nil
  4802. // {
  4803. // "description": "Updates a Merchant Center account. This method supports patch semantics.",
  4804. // "httpMethod": "PATCH",
  4805. // "id": "content.accounts.patch",
  4806. // "parameterOrder": [
  4807. // "merchantId",
  4808. // "accountId"
  4809. // ],
  4810. // "parameters": {
  4811. // "accountId": {
  4812. // "description": "The ID of the account.",
  4813. // "format": "uint64",
  4814. // "location": "path",
  4815. // "required": true,
  4816. // "type": "string"
  4817. // },
  4818. // "dryRun": {
  4819. // "description": "Flag to run the request in dry-run mode.",
  4820. // "location": "query",
  4821. // "type": "boolean"
  4822. // },
  4823. // "merchantId": {
  4824. // "description": "The ID of the managing account.",
  4825. // "format": "uint64",
  4826. // "location": "path",
  4827. // "required": true,
  4828. // "type": "string"
  4829. // }
  4830. // },
  4831. // "path": "{merchantId}/accounts/{accountId}",
  4832. // "request": {
  4833. // "$ref": "Account"
  4834. // },
  4835. // "response": {
  4836. // "$ref": "Account"
  4837. // },
  4838. // "scopes": [
  4839. // "https://www.googleapis.com/auth/content"
  4840. // ]
  4841. // }
  4842. }
  4843. // method id "content.accounts.update":
  4844. type AccountsUpdateCall struct {
  4845. s *Service
  4846. merchantId uint64
  4847. accountId uint64
  4848. account *Account
  4849. urlParams_ gensupport.URLParams
  4850. ctx_ context.Context
  4851. }
  4852. // Update: Updates a Merchant Center account.
  4853. func (r *AccountsService) Update(merchantId uint64, accountId uint64, account *Account) *AccountsUpdateCall {
  4854. c := &AccountsUpdateCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  4855. c.merchantId = merchantId
  4856. c.accountId = accountId
  4857. c.account = account
  4858. return c
  4859. }
  4860. // DryRun sets the optional parameter "dryRun": Flag to run the request
  4861. // in dry-run mode.
  4862. func (c *AccountsUpdateCall) DryRun(dryRun bool) *AccountsUpdateCall {
  4863. c.urlParams_.Set("dryRun", fmt.Sprint(dryRun))
  4864. return c
  4865. }
  4866. // Fields allows partial responses to be retrieved. See
  4867. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  4868. // for more information.
  4869. func (c *AccountsUpdateCall) Fields(s ...googleapi.Field) *AccountsUpdateCall {
  4870. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  4871. return c
  4872. }
  4873. // Context sets the context to be used in this call's Do method. Any
  4874. // pending HTTP request will be aborted if the provided context is
  4875. // canceled.
  4876. func (c *AccountsUpdateCall) Context(ctx context.Context) *AccountsUpdateCall {
  4877. c.ctx_ = ctx
  4878. return c
  4879. }
  4880. func (c *AccountsUpdateCall) doRequest(alt string) (*http.Response, error) {
  4881. var body io.Reader = nil
  4882. body, err := googleapi.WithoutDataWrapper.JSONReader(c.account)
  4883. if err != nil {
  4884. return nil, err
  4885. }
  4886. ctype := "application/json"
  4887. c.urlParams_.Set("alt", alt)
  4888. urls := googleapi.ResolveRelative(c.s.BasePath, "{merchantId}/accounts/{accountId}")
  4889. urls += "?" + c.urlParams_.Encode()
  4890. req, _ := http.NewRequest("PUT", urls, body)
  4891. googleapi.Expand(req.URL, map[string]string{
  4892. "merchantId": strconv.FormatUint(c.merchantId, 10),
  4893. "accountId": strconv.FormatUint(c.accountId, 10),
  4894. })
  4895. req.Header.Set("Content-Type", ctype)
  4896. req.Header.Set("User-Agent", c.s.userAgent())
  4897. if c.ctx_ != nil {
  4898. return ctxhttp.Do(c.ctx_, c.s.client, req)
  4899. }
  4900. return c.s.client.Do(req)
  4901. }
  4902. // Do executes the "content.accounts.update" call.
  4903. // Exactly one of *Account or error will be non-nil. Any non-2xx status
  4904. // code is an error. Response headers are in either
  4905. // *Account.ServerResponse.Header or (if a response was returned at all)
  4906. // in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to
  4907. // check whether the returned error was because http.StatusNotModified
  4908. // was returned.
  4909. func (c *AccountsUpdateCall) Do(opts ...googleapi.CallOption) (*Account, error) {
  4910. gensupport.SetOptions(c.urlParams_, opts...)
  4911. res, err := c.doRequest("json")
  4912. if res != nil && res.StatusCode == http.StatusNotModified {
  4913. if res.Body != nil {
  4914. res.Body.Close()
  4915. }
  4916. return nil, &googleapi.Error{
  4917. Code: res.StatusCode,
  4918. Header: res.Header,
  4919. }
  4920. }
  4921. if err != nil {
  4922. return nil, err
  4923. }
  4924. defer googleapi.CloseBody(res)
  4925. if err := googleapi.CheckResponse(res); err != nil {
  4926. return nil, err
  4927. }
  4928. ret := &Account{
  4929. ServerResponse: googleapi.ServerResponse{
  4930. Header: res.Header,
  4931. HTTPStatusCode: res.StatusCode,
  4932. },
  4933. }
  4934. if err := json.NewDecoder(res.Body).Decode(&ret); err != nil {
  4935. return nil, err
  4936. }
  4937. return ret, nil
  4938. // {
  4939. // "description": "Updates a Merchant Center account.",
  4940. // "httpMethod": "PUT",
  4941. // "id": "content.accounts.update",
  4942. // "parameterOrder": [
  4943. // "merchantId",
  4944. // "accountId"
  4945. // ],
  4946. // "parameters": {
  4947. // "accountId": {
  4948. // "description": "The ID of the account.",
  4949. // "format": "uint64",
  4950. // "location": "path",
  4951. // "required": true,
  4952. // "type": "string"
  4953. // },
  4954. // "dryRun": {
  4955. // "description": "Flag to run the request in dry-run mode.",
  4956. // "location": "query",
  4957. // "type": "boolean"
  4958. // },
  4959. // "merchantId": {
  4960. // "description": "The ID of the managing account.",
  4961. // "format": "uint64",
  4962. // "location": "path",
  4963. // "required": true,
  4964. // "type": "string"
  4965. // }
  4966. // },
  4967. // "path": "{merchantId}/accounts/{accountId}",
  4968. // "request": {
  4969. // "$ref": "Account"
  4970. // },
  4971. // "response": {
  4972. // "$ref": "Account"
  4973. // },
  4974. // "scopes": [
  4975. // "https://www.googleapis.com/auth/content"
  4976. // ]
  4977. // }
  4978. }
  4979. // method id "content.accountshipping.custombatch":
  4980. type AccountshippingCustombatchCall struct {
  4981. s *Service
  4982. accountshippingcustombatchrequest *AccountshippingCustomBatchRequest
  4983. urlParams_ gensupport.URLParams
  4984. ctx_ context.Context
  4985. }
  4986. // Custombatch: Retrieves and updates the shipping settings of multiple
  4987. // accounts in a single request.
  4988. func (r *AccountshippingService) Custombatch(accountshippingcustombatchrequest *AccountshippingCustomBatchRequest) *AccountshippingCustombatchCall {
  4989. c := &AccountshippingCustombatchCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  4990. c.accountshippingcustombatchrequest = accountshippingcustombatchrequest
  4991. return c
  4992. }
  4993. // DryRun sets the optional parameter "dryRun": Flag to run the request
  4994. // in dry-run mode.
  4995. func (c *AccountshippingCustombatchCall) DryRun(dryRun bool) *AccountshippingCustombatchCall {
  4996. c.urlParams_.Set("dryRun", fmt.Sprint(dryRun))
  4997. return c
  4998. }
  4999. // Fields allows partial responses to be retrieved. See
  5000. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  5001. // for more information.
  5002. func (c *AccountshippingCustombatchCall) Fields(s ...googleapi.Field) *AccountshippingCustombatchCall {
  5003. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  5004. return c
  5005. }
  5006. // Context sets the context to be used in this call's Do method. Any
  5007. // pending HTTP request will be aborted if the provided context is
  5008. // canceled.
  5009. func (c *AccountshippingCustombatchCall) Context(ctx context.Context) *AccountshippingCustombatchCall {
  5010. c.ctx_ = ctx
  5011. return c
  5012. }
  5013. func (c *AccountshippingCustombatchCall) doRequest(alt string) (*http.Response, error) {
  5014. var body io.Reader = nil
  5015. body, err := googleapi.WithoutDataWrapper.JSONReader(c.accountshippingcustombatchrequest)
  5016. if err != nil {
  5017. return nil, err
  5018. }
  5019. ctype := "application/json"
  5020. c.urlParams_.Set("alt", alt)
  5021. urls := googleapi.ResolveRelative(c.s.BasePath, "accountshipping/batch")
  5022. urls += "?" + c.urlParams_.Encode()
  5023. req, _ := http.NewRequest("POST", urls, body)
  5024. googleapi.SetOpaque(req.URL)
  5025. req.Header.Set("Content-Type", ctype)
  5026. req.Header.Set("User-Agent", c.s.userAgent())
  5027. if c.ctx_ != nil {
  5028. return ctxhttp.Do(c.ctx_, c.s.client, req)
  5029. }
  5030. return c.s.client.Do(req)
  5031. }
  5032. // Do executes the "content.accountshipping.custombatch" call.
  5033. // Exactly one of *AccountshippingCustomBatchResponse or error will be
  5034. // non-nil. Any non-2xx status code is an error. Response headers are in
  5035. // either *AccountshippingCustomBatchResponse.ServerResponse.Header or
  5036. // (if a response was returned at all) in
  5037. // error.(*googleapi.Error).Header. Use googleapi.IsNotModified to check
  5038. // whether the returned error was because http.StatusNotModified was
  5039. // returned.
  5040. func (c *AccountshippingCustombatchCall) Do(opts ...googleapi.CallOption) (*AccountshippingCustomBatchResponse, error) {
  5041. gensupport.SetOptions(c.urlParams_, opts...)
  5042. res, err := c.doRequest("json")
  5043. if res != nil && res.StatusCode == http.StatusNotModified {
  5044. if res.Body != nil {
  5045. res.Body.Close()
  5046. }
  5047. return nil, &googleapi.Error{
  5048. Code: res.StatusCode,
  5049. Header: res.Header,
  5050. }
  5051. }
  5052. if err != nil {
  5053. return nil, err
  5054. }
  5055. defer googleapi.CloseBody(res)
  5056. if err := googleapi.CheckResponse(res); err != nil {
  5057. return nil, err
  5058. }
  5059. ret := &AccountshippingCustomBatchResponse{
  5060. ServerResponse: googleapi.ServerResponse{
  5061. Header: res.Header,
  5062. HTTPStatusCode: res.StatusCode,
  5063. },
  5064. }
  5065. if err := json.NewDecoder(res.Body).Decode(&ret); err != nil {
  5066. return nil, err
  5067. }
  5068. return ret, nil
  5069. // {
  5070. // "description": "Retrieves and updates the shipping settings of multiple accounts in a single request.",
  5071. // "httpMethod": "POST",
  5072. // "id": "content.accountshipping.custombatch",
  5073. // "parameters": {
  5074. // "dryRun": {
  5075. // "description": "Flag to run the request in dry-run mode.",
  5076. // "location": "query",
  5077. // "type": "boolean"
  5078. // }
  5079. // },
  5080. // "path": "accountshipping/batch",
  5081. // "request": {
  5082. // "$ref": "AccountshippingCustomBatchRequest"
  5083. // },
  5084. // "response": {
  5085. // "$ref": "AccountshippingCustomBatchResponse"
  5086. // },
  5087. // "scopes": [
  5088. // "https://www.googleapis.com/auth/content"
  5089. // ]
  5090. // }
  5091. }
  5092. // method id "content.accountshipping.get":
  5093. type AccountshippingGetCall struct {
  5094. s *Service
  5095. merchantId uint64
  5096. accountId uint64
  5097. urlParams_ gensupport.URLParams
  5098. ifNoneMatch_ string
  5099. ctx_ context.Context
  5100. }
  5101. // Get: Retrieves the shipping settings of the account.
  5102. func (r *AccountshippingService) Get(merchantId uint64, accountId uint64) *AccountshippingGetCall {
  5103. c := &AccountshippingGetCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  5104. c.merchantId = merchantId
  5105. c.accountId = accountId
  5106. return c
  5107. }
  5108. // Fields allows partial responses to be retrieved. See
  5109. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  5110. // for more information.
  5111. func (c *AccountshippingGetCall) Fields(s ...googleapi.Field) *AccountshippingGetCall {
  5112. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  5113. return c
  5114. }
  5115. // IfNoneMatch sets the optional parameter which makes the operation
  5116. // fail if the object's ETag matches the given value. This is useful for
  5117. // getting updates only after the object has changed since the last
  5118. // request. Use googleapi.IsNotModified to check whether the response
  5119. // error from Do is the result of In-None-Match.
  5120. func (c *AccountshippingGetCall) IfNoneMatch(entityTag string) *AccountshippingGetCall {
  5121. c.ifNoneMatch_ = entityTag
  5122. return c
  5123. }
  5124. // Context sets the context to be used in this call's Do method. Any
  5125. // pending HTTP request will be aborted if the provided context is
  5126. // canceled.
  5127. func (c *AccountshippingGetCall) Context(ctx context.Context) *AccountshippingGetCall {
  5128. c.ctx_ = ctx
  5129. return c
  5130. }
  5131. func (c *AccountshippingGetCall) doRequest(alt string) (*http.Response, error) {
  5132. var body io.Reader = nil
  5133. c.urlParams_.Set("alt", alt)
  5134. urls := googleapi.ResolveRelative(c.s.BasePath, "{merchantId}/accountshipping/{accountId}")
  5135. urls += "?" + c.urlParams_.Encode()
  5136. req, _ := http.NewRequest("GET", urls, body)
  5137. googleapi.Expand(req.URL, map[string]string{
  5138. "merchantId": strconv.FormatUint(c.merchantId, 10),
  5139. "accountId": strconv.FormatUint(c.accountId, 10),
  5140. })
  5141. req.Header.Set("User-Agent", c.s.userAgent())
  5142. if c.ifNoneMatch_ != "" {
  5143. req.Header.Set("If-None-Match", c.ifNoneMatch_)
  5144. }
  5145. if c.ctx_ != nil {
  5146. return ctxhttp.Do(c.ctx_, c.s.client, req)
  5147. }
  5148. return c.s.client.Do(req)
  5149. }
  5150. // Do executes the "content.accountshipping.get" call.
  5151. // Exactly one of *AccountShipping or error will be non-nil. Any non-2xx
  5152. // status code is an error. Response headers are in either
  5153. // *AccountShipping.ServerResponse.Header or (if a response was returned
  5154. // at all) in error.(*googleapi.Error).Header. Use
  5155. // googleapi.IsNotModified to check whether the returned error was
  5156. // because http.StatusNotModified was returned.
  5157. func (c *AccountshippingGetCall) Do(opts ...googleapi.CallOption) (*AccountShipping, error) {
  5158. gensupport.SetOptions(c.urlParams_, opts...)
  5159. res, err := c.doRequest("json")
  5160. if res != nil && res.StatusCode == http.StatusNotModified {
  5161. if res.Body != nil {
  5162. res.Body.Close()
  5163. }
  5164. return nil, &googleapi.Error{
  5165. Code: res.StatusCode,
  5166. Header: res.Header,
  5167. }
  5168. }
  5169. if err != nil {
  5170. return nil, err
  5171. }
  5172. defer googleapi.CloseBody(res)
  5173. if err := googleapi.CheckResponse(res); err != nil {
  5174. return nil, err
  5175. }
  5176. ret := &AccountShipping{
  5177. ServerResponse: googleapi.ServerResponse{
  5178. Header: res.Header,
  5179. HTTPStatusCode: res.StatusCode,
  5180. },
  5181. }
  5182. if err := json.NewDecoder(res.Body).Decode(&ret); err != nil {
  5183. return nil, err
  5184. }
  5185. return ret, nil
  5186. // {
  5187. // "description": "Retrieves the shipping settings of the account.",
  5188. // "httpMethod": "GET",
  5189. // "id": "content.accountshipping.get",
  5190. // "parameterOrder": [
  5191. // "merchantId",
  5192. // "accountId"
  5193. // ],
  5194. // "parameters": {
  5195. // "accountId": {
  5196. // "description": "The ID of the account for which to get/update account shipping settings.",
  5197. // "format": "uint64",
  5198. // "location": "path",
  5199. // "required": true,
  5200. // "type": "string"
  5201. // },
  5202. // "merchantId": {
  5203. // "description": "The ID of the managing account.",
  5204. // "format": "uint64",
  5205. // "location": "path",
  5206. // "required": true,
  5207. // "type": "string"
  5208. // }
  5209. // },
  5210. // "path": "{merchantId}/accountshipping/{accountId}",
  5211. // "response": {
  5212. // "$ref": "AccountShipping"
  5213. // },
  5214. // "scopes": [
  5215. // "https://www.googleapis.com/auth/content"
  5216. // ]
  5217. // }
  5218. }
  5219. // method id "content.accountshipping.list":
  5220. type AccountshippingListCall struct {
  5221. s *Service
  5222. merchantId uint64
  5223. urlParams_ gensupport.URLParams
  5224. ifNoneMatch_ string
  5225. ctx_ context.Context
  5226. }
  5227. // List: Lists the shipping settings of the sub-accounts in your
  5228. // Merchant Center account.
  5229. func (r *AccountshippingService) List(merchantId uint64) *AccountshippingListCall {
  5230. c := &AccountshippingListCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  5231. c.merchantId = merchantId
  5232. return c
  5233. }
  5234. // MaxResults sets the optional parameter "maxResults": The maximum
  5235. // number of shipping settings to return in the response, used for
  5236. // paging.
  5237. func (c *AccountshippingListCall) MaxResults(maxResults int64) *AccountshippingListCall {
  5238. c.urlParams_.Set("maxResults", fmt.Sprint(maxResults))
  5239. return c
  5240. }
  5241. // PageToken sets the optional parameter "pageToken": The token returned
  5242. // by the previous request.
  5243. func (c *AccountshippingListCall) PageToken(pageToken string) *AccountshippingListCall {
  5244. c.urlParams_.Set("pageToken", pageToken)
  5245. return c
  5246. }
  5247. // Fields allows partial responses to be retrieved. See
  5248. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  5249. // for more information.
  5250. func (c *AccountshippingListCall) Fields(s ...googleapi.Field) *AccountshippingListCall {
  5251. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  5252. return c
  5253. }
  5254. // IfNoneMatch sets the optional parameter which makes the operation
  5255. // fail if the object's ETag matches the given value. This is useful for
  5256. // getting updates only after the object has changed since the last
  5257. // request. Use googleapi.IsNotModified to check whether the response
  5258. // error from Do is the result of In-None-Match.
  5259. func (c *AccountshippingListCall) IfNoneMatch(entityTag string) *AccountshippingListCall {
  5260. c.ifNoneMatch_ = entityTag
  5261. return c
  5262. }
  5263. // Context sets the context to be used in this call's Do method. Any
  5264. // pending HTTP request will be aborted if the provided context is
  5265. // canceled.
  5266. func (c *AccountshippingListCall) Context(ctx context.Context) *AccountshippingListCall {
  5267. c.ctx_ = ctx
  5268. return c
  5269. }
  5270. func (c *AccountshippingListCall) doRequest(alt string) (*http.Response, error) {
  5271. var body io.Reader = nil
  5272. c.urlParams_.Set("alt", alt)
  5273. urls := googleapi.ResolveRelative(c.s.BasePath, "{merchantId}/accountshipping")
  5274. urls += "?" + c.urlParams_.Encode()
  5275. req, _ := http.NewRequest("GET", urls, body)
  5276. googleapi.Expand(req.URL, map[string]string{
  5277. "merchantId": strconv.FormatUint(c.merchantId, 10),
  5278. })
  5279. req.Header.Set("User-Agent", c.s.userAgent())
  5280. if c.ifNoneMatch_ != "" {
  5281. req.Header.Set("If-None-Match", c.ifNoneMatch_)
  5282. }
  5283. if c.ctx_ != nil {
  5284. return ctxhttp.Do(c.ctx_, c.s.client, req)
  5285. }
  5286. return c.s.client.Do(req)
  5287. }
  5288. // Do executes the "content.accountshipping.list" call.
  5289. // Exactly one of *AccountshippingListResponse or error will be non-nil.
  5290. // Any non-2xx status code is an error. Response headers are in either
  5291. // *AccountshippingListResponse.ServerResponse.Header or (if a response
  5292. // was returned at all) in error.(*googleapi.Error).Header. Use
  5293. // googleapi.IsNotModified to check whether the returned error was
  5294. // because http.StatusNotModified was returned.
  5295. func (c *AccountshippingListCall) Do(opts ...googleapi.CallOption) (*AccountshippingListResponse, error) {
  5296. gensupport.SetOptions(c.urlParams_, opts...)
  5297. res, err := c.doRequest("json")
  5298. if res != nil && res.StatusCode == http.StatusNotModified {
  5299. if res.Body != nil {
  5300. res.Body.Close()
  5301. }
  5302. return nil, &googleapi.Error{
  5303. Code: res.StatusCode,
  5304. Header: res.Header,
  5305. }
  5306. }
  5307. if err != nil {
  5308. return nil, err
  5309. }
  5310. defer googleapi.CloseBody(res)
  5311. if err := googleapi.CheckResponse(res); err != nil {
  5312. return nil, err
  5313. }
  5314. ret := &AccountshippingListResponse{
  5315. ServerResponse: googleapi.ServerResponse{
  5316. Header: res.Header,
  5317. HTTPStatusCode: res.StatusCode,
  5318. },
  5319. }
  5320. if err := json.NewDecoder(res.Body).Decode(&ret); err != nil {
  5321. return nil, err
  5322. }
  5323. return ret, nil
  5324. // {
  5325. // "description": "Lists the shipping settings of the sub-accounts in your Merchant Center account.",
  5326. // "httpMethod": "GET",
  5327. // "id": "content.accountshipping.list",
  5328. // "parameterOrder": [
  5329. // "merchantId"
  5330. // ],
  5331. // "parameters": {
  5332. // "maxResults": {
  5333. // "description": "The maximum number of shipping settings to return in the response, used for paging.",
  5334. // "format": "uint32",
  5335. // "location": "query",
  5336. // "type": "integer"
  5337. // },
  5338. // "merchantId": {
  5339. // "description": "The ID of the managing account.",
  5340. // "format": "uint64",
  5341. // "location": "path",
  5342. // "required": true,
  5343. // "type": "string"
  5344. // },
  5345. // "pageToken": {
  5346. // "description": "The token returned by the previous request.",
  5347. // "location": "query",
  5348. // "type": "string"
  5349. // }
  5350. // },
  5351. // "path": "{merchantId}/accountshipping",
  5352. // "response": {
  5353. // "$ref": "AccountshippingListResponse"
  5354. // },
  5355. // "scopes": [
  5356. // "https://www.googleapis.com/auth/content"
  5357. // ]
  5358. // }
  5359. }
  5360. // Pages invokes f for each page of results.
  5361. // A non-nil error returned from f will halt the iteration.
  5362. // The provided context supersedes any context provided to the Context method.
  5363. func (c *AccountshippingListCall) Pages(ctx context.Context, f func(*AccountshippingListResponse) error) error {
  5364. c.ctx_ = ctx
  5365. defer c.PageToken(c.urlParams_.Get("pageToken")) // reset paging to original point
  5366. for {
  5367. x, err := c.Do()
  5368. if err != nil {
  5369. return err
  5370. }
  5371. if err := f(x); err != nil {
  5372. return err
  5373. }
  5374. if x.NextPageToken == "" {
  5375. return nil
  5376. }
  5377. c.PageToken(x.NextPageToken)
  5378. }
  5379. }
  5380. // method id "content.accountshipping.patch":
  5381. type AccountshippingPatchCall struct {
  5382. s *Service
  5383. merchantId uint64
  5384. accountId uint64
  5385. accountshipping *AccountShipping
  5386. urlParams_ gensupport.URLParams
  5387. ctx_ context.Context
  5388. }
  5389. // Patch: Updates the shipping settings of the account. This method
  5390. // supports patch semantics.
  5391. func (r *AccountshippingService) Patch(merchantId uint64, accountId uint64, accountshipping *AccountShipping) *AccountshippingPatchCall {
  5392. c := &AccountshippingPatchCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  5393. c.merchantId = merchantId
  5394. c.accountId = accountId
  5395. c.accountshipping = accountshipping
  5396. return c
  5397. }
  5398. // DryRun sets the optional parameter "dryRun": Flag to run the request
  5399. // in dry-run mode.
  5400. func (c *AccountshippingPatchCall) DryRun(dryRun bool) *AccountshippingPatchCall {
  5401. c.urlParams_.Set("dryRun", fmt.Sprint(dryRun))
  5402. return c
  5403. }
  5404. // Fields allows partial responses to be retrieved. See
  5405. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  5406. // for more information.
  5407. func (c *AccountshippingPatchCall) Fields(s ...googleapi.Field) *AccountshippingPatchCall {
  5408. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  5409. return c
  5410. }
  5411. // Context sets the context to be used in this call's Do method. Any
  5412. // pending HTTP request will be aborted if the provided context is
  5413. // canceled.
  5414. func (c *AccountshippingPatchCall) Context(ctx context.Context) *AccountshippingPatchCall {
  5415. c.ctx_ = ctx
  5416. return c
  5417. }
  5418. func (c *AccountshippingPatchCall) doRequest(alt string) (*http.Response, error) {
  5419. var body io.Reader = nil
  5420. body, err := googleapi.WithoutDataWrapper.JSONReader(c.accountshipping)
  5421. if err != nil {
  5422. return nil, err
  5423. }
  5424. ctype := "application/json"
  5425. c.urlParams_.Set("alt", alt)
  5426. urls := googleapi.ResolveRelative(c.s.BasePath, "{merchantId}/accountshipping/{accountId}")
  5427. urls += "?" + c.urlParams_.Encode()
  5428. req, _ := http.NewRequest("PATCH", urls, body)
  5429. googleapi.Expand(req.URL, map[string]string{
  5430. "merchantId": strconv.FormatUint(c.merchantId, 10),
  5431. "accountId": strconv.FormatUint(c.accountId, 10),
  5432. })
  5433. req.Header.Set("Content-Type", ctype)
  5434. req.Header.Set("User-Agent", c.s.userAgent())
  5435. if c.ctx_ != nil {
  5436. return ctxhttp.Do(c.ctx_, c.s.client, req)
  5437. }
  5438. return c.s.client.Do(req)
  5439. }
  5440. // Do executes the "content.accountshipping.patch" call.
  5441. // Exactly one of *AccountShipping or error will be non-nil. Any non-2xx
  5442. // status code is an error. Response headers are in either
  5443. // *AccountShipping.ServerResponse.Header or (if a response was returned
  5444. // at all) in error.(*googleapi.Error).Header. Use
  5445. // googleapi.IsNotModified to check whether the returned error was
  5446. // because http.StatusNotModified was returned.
  5447. func (c *AccountshippingPatchCall) Do(opts ...googleapi.CallOption) (*AccountShipping, error) {
  5448. gensupport.SetOptions(c.urlParams_, opts...)
  5449. res, err := c.doRequest("json")
  5450. if res != nil && res.StatusCode == http.StatusNotModified {
  5451. if res.Body != nil {
  5452. res.Body.Close()
  5453. }
  5454. return nil, &googleapi.Error{
  5455. Code: res.StatusCode,
  5456. Header: res.Header,
  5457. }
  5458. }
  5459. if err != nil {
  5460. return nil, err
  5461. }
  5462. defer googleapi.CloseBody(res)
  5463. if err := googleapi.CheckResponse(res); err != nil {
  5464. return nil, err
  5465. }
  5466. ret := &AccountShipping{
  5467. ServerResponse: googleapi.ServerResponse{
  5468. Header: res.Header,
  5469. HTTPStatusCode: res.StatusCode,
  5470. },
  5471. }
  5472. if err := json.NewDecoder(res.Body).Decode(&ret); err != nil {
  5473. return nil, err
  5474. }
  5475. return ret, nil
  5476. // {
  5477. // "description": "Updates the shipping settings of the account. This method supports patch semantics.",
  5478. // "httpMethod": "PATCH",
  5479. // "id": "content.accountshipping.patch",
  5480. // "parameterOrder": [
  5481. // "merchantId",
  5482. // "accountId"
  5483. // ],
  5484. // "parameters": {
  5485. // "accountId": {
  5486. // "description": "The ID of the account for which to get/update account shipping settings.",
  5487. // "format": "uint64",
  5488. // "location": "path",
  5489. // "required": true,
  5490. // "type": "string"
  5491. // },
  5492. // "dryRun": {
  5493. // "description": "Flag to run the request in dry-run mode.",
  5494. // "location": "query",
  5495. // "type": "boolean"
  5496. // },
  5497. // "merchantId": {
  5498. // "description": "The ID of the managing account.",
  5499. // "format": "uint64",
  5500. // "location": "path",
  5501. // "required": true,
  5502. // "type": "string"
  5503. // }
  5504. // },
  5505. // "path": "{merchantId}/accountshipping/{accountId}",
  5506. // "request": {
  5507. // "$ref": "AccountShipping"
  5508. // },
  5509. // "response": {
  5510. // "$ref": "AccountShipping"
  5511. // },
  5512. // "scopes": [
  5513. // "https://www.googleapis.com/auth/content"
  5514. // ]
  5515. // }
  5516. }
  5517. // method id "content.accountshipping.update":
  5518. type AccountshippingUpdateCall struct {
  5519. s *Service
  5520. merchantId uint64
  5521. accountId uint64
  5522. accountshipping *AccountShipping
  5523. urlParams_ gensupport.URLParams
  5524. ctx_ context.Context
  5525. }
  5526. // Update: Updates the shipping settings of the account.
  5527. func (r *AccountshippingService) Update(merchantId uint64, accountId uint64, accountshipping *AccountShipping) *AccountshippingUpdateCall {
  5528. c := &AccountshippingUpdateCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  5529. c.merchantId = merchantId
  5530. c.accountId = accountId
  5531. c.accountshipping = accountshipping
  5532. return c
  5533. }
  5534. // DryRun sets the optional parameter "dryRun": Flag to run the request
  5535. // in dry-run mode.
  5536. func (c *AccountshippingUpdateCall) DryRun(dryRun bool) *AccountshippingUpdateCall {
  5537. c.urlParams_.Set("dryRun", fmt.Sprint(dryRun))
  5538. return c
  5539. }
  5540. // Fields allows partial responses to be retrieved. See
  5541. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  5542. // for more information.
  5543. func (c *AccountshippingUpdateCall) Fields(s ...googleapi.Field) *AccountshippingUpdateCall {
  5544. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  5545. return c
  5546. }
  5547. // Context sets the context to be used in this call's Do method. Any
  5548. // pending HTTP request will be aborted if the provided context is
  5549. // canceled.
  5550. func (c *AccountshippingUpdateCall) Context(ctx context.Context) *AccountshippingUpdateCall {
  5551. c.ctx_ = ctx
  5552. return c
  5553. }
  5554. func (c *AccountshippingUpdateCall) doRequest(alt string) (*http.Response, error) {
  5555. var body io.Reader = nil
  5556. body, err := googleapi.WithoutDataWrapper.JSONReader(c.accountshipping)
  5557. if err != nil {
  5558. return nil, err
  5559. }
  5560. ctype := "application/json"
  5561. c.urlParams_.Set("alt", alt)
  5562. urls := googleapi.ResolveRelative(c.s.BasePath, "{merchantId}/accountshipping/{accountId}")
  5563. urls += "?" + c.urlParams_.Encode()
  5564. req, _ := http.NewRequest("PUT", urls, body)
  5565. googleapi.Expand(req.URL, map[string]string{
  5566. "merchantId": strconv.FormatUint(c.merchantId, 10),
  5567. "accountId": strconv.FormatUint(c.accountId, 10),
  5568. })
  5569. req.Header.Set("Content-Type", ctype)
  5570. req.Header.Set("User-Agent", c.s.userAgent())
  5571. if c.ctx_ != nil {
  5572. return ctxhttp.Do(c.ctx_, c.s.client, req)
  5573. }
  5574. return c.s.client.Do(req)
  5575. }
  5576. // Do executes the "content.accountshipping.update" call.
  5577. // Exactly one of *AccountShipping or error will be non-nil. Any non-2xx
  5578. // status code is an error. Response headers are in either
  5579. // *AccountShipping.ServerResponse.Header or (if a response was returned
  5580. // at all) in error.(*googleapi.Error).Header. Use
  5581. // googleapi.IsNotModified to check whether the returned error was
  5582. // because http.StatusNotModified was returned.
  5583. func (c *AccountshippingUpdateCall) Do(opts ...googleapi.CallOption) (*AccountShipping, error) {
  5584. gensupport.SetOptions(c.urlParams_, opts...)
  5585. res, err := c.doRequest("json")
  5586. if res != nil && res.StatusCode == http.StatusNotModified {
  5587. if res.Body != nil {
  5588. res.Body.Close()
  5589. }
  5590. return nil, &googleapi.Error{
  5591. Code: res.StatusCode,
  5592. Header: res.Header,
  5593. }
  5594. }
  5595. if err != nil {
  5596. return nil, err
  5597. }
  5598. defer googleapi.CloseBody(res)
  5599. if err := googleapi.CheckResponse(res); err != nil {
  5600. return nil, err
  5601. }
  5602. ret := &AccountShipping{
  5603. ServerResponse: googleapi.ServerResponse{
  5604. Header: res.Header,
  5605. HTTPStatusCode: res.StatusCode,
  5606. },
  5607. }
  5608. if err := json.NewDecoder(res.Body).Decode(&ret); err != nil {
  5609. return nil, err
  5610. }
  5611. return ret, nil
  5612. // {
  5613. // "description": "Updates the shipping settings of the account.",
  5614. // "httpMethod": "PUT",
  5615. // "id": "content.accountshipping.update",
  5616. // "parameterOrder": [
  5617. // "merchantId",
  5618. // "accountId"
  5619. // ],
  5620. // "parameters": {
  5621. // "accountId": {
  5622. // "description": "The ID of the account for which to get/update account shipping settings.",
  5623. // "format": "uint64",
  5624. // "location": "path",
  5625. // "required": true,
  5626. // "type": "string"
  5627. // },
  5628. // "dryRun": {
  5629. // "description": "Flag to run the request in dry-run mode.",
  5630. // "location": "query",
  5631. // "type": "boolean"
  5632. // },
  5633. // "merchantId": {
  5634. // "description": "The ID of the managing account.",
  5635. // "format": "uint64",
  5636. // "location": "path",
  5637. // "required": true,
  5638. // "type": "string"
  5639. // }
  5640. // },
  5641. // "path": "{merchantId}/accountshipping/{accountId}",
  5642. // "request": {
  5643. // "$ref": "AccountShipping"
  5644. // },
  5645. // "response": {
  5646. // "$ref": "AccountShipping"
  5647. // },
  5648. // "scopes": [
  5649. // "https://www.googleapis.com/auth/content"
  5650. // ]
  5651. // }
  5652. }
  5653. // method id "content.accountstatuses.custombatch":
  5654. type AccountstatusesCustombatchCall struct {
  5655. s *Service
  5656. accountstatusescustombatchrequest *AccountstatusesCustomBatchRequest
  5657. urlParams_ gensupport.URLParams
  5658. ctx_ context.Context
  5659. }
  5660. // Custombatch:
  5661. func (r *AccountstatusesService) Custombatch(accountstatusescustombatchrequest *AccountstatusesCustomBatchRequest) *AccountstatusesCustombatchCall {
  5662. c := &AccountstatusesCustombatchCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  5663. c.accountstatusescustombatchrequest = accountstatusescustombatchrequest
  5664. return c
  5665. }
  5666. // Fields allows partial responses to be retrieved. See
  5667. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  5668. // for more information.
  5669. func (c *AccountstatusesCustombatchCall) Fields(s ...googleapi.Field) *AccountstatusesCustombatchCall {
  5670. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  5671. return c
  5672. }
  5673. // Context sets the context to be used in this call's Do method. Any
  5674. // pending HTTP request will be aborted if the provided context is
  5675. // canceled.
  5676. func (c *AccountstatusesCustombatchCall) Context(ctx context.Context) *AccountstatusesCustombatchCall {
  5677. c.ctx_ = ctx
  5678. return c
  5679. }
  5680. func (c *AccountstatusesCustombatchCall) doRequest(alt string) (*http.Response, error) {
  5681. var body io.Reader = nil
  5682. body, err := googleapi.WithoutDataWrapper.JSONReader(c.accountstatusescustombatchrequest)
  5683. if err != nil {
  5684. return nil, err
  5685. }
  5686. ctype := "application/json"
  5687. c.urlParams_.Set("alt", alt)
  5688. urls := googleapi.ResolveRelative(c.s.BasePath, "accountstatuses/batch")
  5689. urls += "?" + c.urlParams_.Encode()
  5690. req, _ := http.NewRequest("POST", urls, body)
  5691. googleapi.SetOpaque(req.URL)
  5692. req.Header.Set("Content-Type", ctype)
  5693. req.Header.Set("User-Agent", c.s.userAgent())
  5694. if c.ctx_ != nil {
  5695. return ctxhttp.Do(c.ctx_, c.s.client, req)
  5696. }
  5697. return c.s.client.Do(req)
  5698. }
  5699. // Do executes the "content.accountstatuses.custombatch" call.
  5700. // Exactly one of *AccountstatusesCustomBatchResponse or error will be
  5701. // non-nil. Any non-2xx status code is an error. Response headers are in
  5702. // either *AccountstatusesCustomBatchResponse.ServerResponse.Header or
  5703. // (if a response was returned at all) in
  5704. // error.(*googleapi.Error).Header. Use googleapi.IsNotModified to check
  5705. // whether the returned error was because http.StatusNotModified was
  5706. // returned.
  5707. func (c *AccountstatusesCustombatchCall) Do(opts ...googleapi.CallOption) (*AccountstatusesCustomBatchResponse, error) {
  5708. gensupport.SetOptions(c.urlParams_, opts...)
  5709. res, err := c.doRequest("json")
  5710. if res != nil && res.StatusCode == http.StatusNotModified {
  5711. if res.Body != nil {
  5712. res.Body.Close()
  5713. }
  5714. return nil, &googleapi.Error{
  5715. Code: res.StatusCode,
  5716. Header: res.Header,
  5717. }
  5718. }
  5719. if err != nil {
  5720. return nil, err
  5721. }
  5722. defer googleapi.CloseBody(res)
  5723. if err := googleapi.CheckResponse(res); err != nil {
  5724. return nil, err
  5725. }
  5726. ret := &AccountstatusesCustomBatchResponse{
  5727. ServerResponse: googleapi.ServerResponse{
  5728. Header: res.Header,
  5729. HTTPStatusCode: res.StatusCode,
  5730. },
  5731. }
  5732. if err := json.NewDecoder(res.Body).Decode(&ret); err != nil {
  5733. return nil, err
  5734. }
  5735. return ret, nil
  5736. // {
  5737. // "httpMethod": "POST",
  5738. // "id": "content.accountstatuses.custombatch",
  5739. // "path": "accountstatuses/batch",
  5740. // "request": {
  5741. // "$ref": "AccountstatusesCustomBatchRequest"
  5742. // },
  5743. // "response": {
  5744. // "$ref": "AccountstatusesCustomBatchResponse"
  5745. // },
  5746. // "scopes": [
  5747. // "https://www.googleapis.com/auth/content"
  5748. // ]
  5749. // }
  5750. }
  5751. // method id "content.accountstatuses.get":
  5752. type AccountstatusesGetCall struct {
  5753. s *Service
  5754. merchantId uint64
  5755. accountId uint64
  5756. urlParams_ gensupport.URLParams
  5757. ifNoneMatch_ string
  5758. ctx_ context.Context
  5759. }
  5760. // Get: Retrieves the status of a Merchant Center account.
  5761. func (r *AccountstatusesService) Get(merchantId uint64, accountId uint64) *AccountstatusesGetCall {
  5762. c := &AccountstatusesGetCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  5763. c.merchantId = merchantId
  5764. c.accountId = accountId
  5765. return c
  5766. }
  5767. // Fields allows partial responses to be retrieved. See
  5768. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  5769. // for more information.
  5770. func (c *AccountstatusesGetCall) Fields(s ...googleapi.Field) *AccountstatusesGetCall {
  5771. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  5772. return c
  5773. }
  5774. // IfNoneMatch sets the optional parameter which makes the operation
  5775. // fail if the object's ETag matches the given value. This is useful for
  5776. // getting updates only after the object has changed since the last
  5777. // request. Use googleapi.IsNotModified to check whether the response
  5778. // error from Do is the result of In-None-Match.
  5779. func (c *AccountstatusesGetCall) IfNoneMatch(entityTag string) *AccountstatusesGetCall {
  5780. c.ifNoneMatch_ = entityTag
  5781. return c
  5782. }
  5783. // Context sets the context to be used in this call's Do method. Any
  5784. // pending HTTP request will be aborted if the provided context is
  5785. // canceled.
  5786. func (c *AccountstatusesGetCall) Context(ctx context.Context) *AccountstatusesGetCall {
  5787. c.ctx_ = ctx
  5788. return c
  5789. }
  5790. func (c *AccountstatusesGetCall) doRequest(alt string) (*http.Response, error) {
  5791. var body io.Reader = nil
  5792. c.urlParams_.Set("alt", alt)
  5793. urls := googleapi.ResolveRelative(c.s.BasePath, "{merchantId}/accountstatuses/{accountId}")
  5794. urls += "?" + c.urlParams_.Encode()
  5795. req, _ := http.NewRequest("GET", urls, body)
  5796. googleapi.Expand(req.URL, map[string]string{
  5797. "merchantId": strconv.FormatUint(c.merchantId, 10),
  5798. "accountId": strconv.FormatUint(c.accountId, 10),
  5799. })
  5800. req.Header.Set("User-Agent", c.s.userAgent())
  5801. if c.ifNoneMatch_ != "" {
  5802. req.Header.Set("If-None-Match", c.ifNoneMatch_)
  5803. }
  5804. if c.ctx_ != nil {
  5805. return ctxhttp.Do(c.ctx_, c.s.client, req)
  5806. }
  5807. return c.s.client.Do(req)
  5808. }
  5809. // Do executes the "content.accountstatuses.get" call.
  5810. // Exactly one of *AccountStatus or error will be non-nil. Any non-2xx
  5811. // status code is an error. Response headers are in either
  5812. // *AccountStatus.ServerResponse.Header or (if a response was returned
  5813. // at all) in error.(*googleapi.Error).Header. Use
  5814. // googleapi.IsNotModified to check whether the returned error was
  5815. // because http.StatusNotModified was returned.
  5816. func (c *AccountstatusesGetCall) Do(opts ...googleapi.CallOption) (*AccountStatus, error) {
  5817. gensupport.SetOptions(c.urlParams_, opts...)
  5818. res, err := c.doRequest("json")
  5819. if res != nil && res.StatusCode == http.StatusNotModified {
  5820. if res.Body != nil {
  5821. res.Body.Close()
  5822. }
  5823. return nil, &googleapi.Error{
  5824. Code: res.StatusCode,
  5825. Header: res.Header,
  5826. }
  5827. }
  5828. if err != nil {
  5829. return nil, err
  5830. }
  5831. defer googleapi.CloseBody(res)
  5832. if err := googleapi.CheckResponse(res); err != nil {
  5833. return nil, err
  5834. }
  5835. ret := &AccountStatus{
  5836. ServerResponse: googleapi.ServerResponse{
  5837. Header: res.Header,
  5838. HTTPStatusCode: res.StatusCode,
  5839. },
  5840. }
  5841. if err := json.NewDecoder(res.Body).Decode(&ret); err != nil {
  5842. return nil, err
  5843. }
  5844. return ret, nil
  5845. // {
  5846. // "description": "Retrieves the status of a Merchant Center account.",
  5847. // "httpMethod": "GET",
  5848. // "id": "content.accountstatuses.get",
  5849. // "parameterOrder": [
  5850. // "merchantId",
  5851. // "accountId"
  5852. // ],
  5853. // "parameters": {
  5854. // "accountId": {
  5855. // "description": "The ID of the account.",
  5856. // "format": "uint64",
  5857. // "location": "path",
  5858. // "required": true,
  5859. // "type": "string"
  5860. // },
  5861. // "merchantId": {
  5862. // "description": "The ID of the managing account.",
  5863. // "format": "uint64",
  5864. // "location": "path",
  5865. // "required": true,
  5866. // "type": "string"
  5867. // }
  5868. // },
  5869. // "path": "{merchantId}/accountstatuses/{accountId}",
  5870. // "response": {
  5871. // "$ref": "AccountStatus"
  5872. // },
  5873. // "scopes": [
  5874. // "https://www.googleapis.com/auth/content"
  5875. // ]
  5876. // }
  5877. }
  5878. // method id "content.accountstatuses.list":
  5879. type AccountstatusesListCall struct {
  5880. s *Service
  5881. merchantId uint64
  5882. urlParams_ gensupport.URLParams
  5883. ifNoneMatch_ string
  5884. ctx_ context.Context
  5885. }
  5886. // List: Lists the statuses of the sub-accounts in your Merchant Center
  5887. // account.
  5888. func (r *AccountstatusesService) List(merchantId uint64) *AccountstatusesListCall {
  5889. c := &AccountstatusesListCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  5890. c.merchantId = merchantId
  5891. return c
  5892. }
  5893. // MaxResults sets the optional parameter "maxResults": The maximum
  5894. // number of account statuses to return in the response, used for
  5895. // paging.
  5896. func (c *AccountstatusesListCall) MaxResults(maxResults int64) *AccountstatusesListCall {
  5897. c.urlParams_.Set("maxResults", fmt.Sprint(maxResults))
  5898. return c
  5899. }
  5900. // PageToken sets the optional parameter "pageToken": The token returned
  5901. // by the previous request.
  5902. func (c *AccountstatusesListCall) PageToken(pageToken string) *AccountstatusesListCall {
  5903. c.urlParams_.Set("pageToken", pageToken)
  5904. return c
  5905. }
  5906. // Fields allows partial responses to be retrieved. See
  5907. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  5908. // for more information.
  5909. func (c *AccountstatusesListCall) Fields(s ...googleapi.Field) *AccountstatusesListCall {
  5910. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  5911. return c
  5912. }
  5913. // IfNoneMatch sets the optional parameter which makes the operation
  5914. // fail if the object's ETag matches the given value. This is useful for
  5915. // getting updates only after the object has changed since the last
  5916. // request. Use googleapi.IsNotModified to check whether the response
  5917. // error from Do is the result of In-None-Match.
  5918. func (c *AccountstatusesListCall) IfNoneMatch(entityTag string) *AccountstatusesListCall {
  5919. c.ifNoneMatch_ = entityTag
  5920. return c
  5921. }
  5922. // Context sets the context to be used in this call's Do method. Any
  5923. // pending HTTP request will be aborted if the provided context is
  5924. // canceled.
  5925. func (c *AccountstatusesListCall) Context(ctx context.Context) *AccountstatusesListCall {
  5926. c.ctx_ = ctx
  5927. return c
  5928. }
  5929. func (c *AccountstatusesListCall) doRequest(alt string) (*http.Response, error) {
  5930. var body io.Reader = nil
  5931. c.urlParams_.Set("alt", alt)
  5932. urls := googleapi.ResolveRelative(c.s.BasePath, "{merchantId}/accountstatuses")
  5933. urls += "?" + c.urlParams_.Encode()
  5934. req, _ := http.NewRequest("GET", urls, body)
  5935. googleapi.Expand(req.URL, map[string]string{
  5936. "merchantId": strconv.FormatUint(c.merchantId, 10),
  5937. })
  5938. req.Header.Set("User-Agent", c.s.userAgent())
  5939. if c.ifNoneMatch_ != "" {
  5940. req.Header.Set("If-None-Match", c.ifNoneMatch_)
  5941. }
  5942. if c.ctx_ != nil {
  5943. return ctxhttp.Do(c.ctx_, c.s.client, req)
  5944. }
  5945. return c.s.client.Do(req)
  5946. }
  5947. // Do executes the "content.accountstatuses.list" call.
  5948. // Exactly one of *AccountstatusesListResponse or error will be non-nil.
  5949. // Any non-2xx status code is an error. Response headers are in either
  5950. // *AccountstatusesListResponse.ServerResponse.Header or (if a response
  5951. // was returned at all) in error.(*googleapi.Error).Header. Use
  5952. // googleapi.IsNotModified to check whether the returned error was
  5953. // because http.StatusNotModified was returned.
  5954. func (c *AccountstatusesListCall) Do(opts ...googleapi.CallOption) (*AccountstatusesListResponse, error) {
  5955. gensupport.SetOptions(c.urlParams_, opts...)
  5956. res, err := c.doRequest("json")
  5957. if res != nil && res.StatusCode == http.StatusNotModified {
  5958. if res.Body != nil {
  5959. res.Body.Close()
  5960. }
  5961. return nil, &googleapi.Error{
  5962. Code: res.StatusCode,
  5963. Header: res.Header,
  5964. }
  5965. }
  5966. if err != nil {
  5967. return nil, err
  5968. }
  5969. defer googleapi.CloseBody(res)
  5970. if err := googleapi.CheckResponse(res); err != nil {
  5971. return nil, err
  5972. }
  5973. ret := &AccountstatusesListResponse{
  5974. ServerResponse: googleapi.ServerResponse{
  5975. Header: res.Header,
  5976. HTTPStatusCode: res.StatusCode,
  5977. },
  5978. }
  5979. if err := json.NewDecoder(res.Body).Decode(&ret); err != nil {
  5980. return nil, err
  5981. }
  5982. return ret, nil
  5983. // {
  5984. // "description": "Lists the statuses of the sub-accounts in your Merchant Center account.",
  5985. // "httpMethod": "GET",
  5986. // "id": "content.accountstatuses.list",
  5987. // "parameterOrder": [
  5988. // "merchantId"
  5989. // ],
  5990. // "parameters": {
  5991. // "maxResults": {
  5992. // "description": "The maximum number of account statuses to return in the response, used for paging.",
  5993. // "format": "uint32",
  5994. // "location": "query",
  5995. // "type": "integer"
  5996. // },
  5997. // "merchantId": {
  5998. // "description": "The ID of the managing account.",
  5999. // "format": "uint64",
  6000. // "location": "path",
  6001. // "required": true,
  6002. // "type": "string"
  6003. // },
  6004. // "pageToken": {
  6005. // "description": "The token returned by the previous request.",
  6006. // "location": "query",
  6007. // "type": "string"
  6008. // }
  6009. // },
  6010. // "path": "{merchantId}/accountstatuses",
  6011. // "response": {
  6012. // "$ref": "AccountstatusesListResponse"
  6013. // },
  6014. // "scopes": [
  6015. // "https://www.googleapis.com/auth/content"
  6016. // ]
  6017. // }
  6018. }
  6019. // Pages invokes f for each page of results.
  6020. // A non-nil error returned from f will halt the iteration.
  6021. // The provided context supersedes any context provided to the Context method.
  6022. func (c *AccountstatusesListCall) Pages(ctx context.Context, f func(*AccountstatusesListResponse) error) error {
  6023. c.ctx_ = ctx
  6024. defer c.PageToken(c.urlParams_.Get("pageToken")) // reset paging to original point
  6025. for {
  6026. x, err := c.Do()
  6027. if err != nil {
  6028. return err
  6029. }
  6030. if err := f(x); err != nil {
  6031. return err
  6032. }
  6033. if x.NextPageToken == "" {
  6034. return nil
  6035. }
  6036. c.PageToken(x.NextPageToken)
  6037. }
  6038. }
  6039. // method id "content.accounttax.custombatch":
  6040. type AccounttaxCustombatchCall struct {
  6041. s *Service
  6042. accounttaxcustombatchrequest *AccounttaxCustomBatchRequest
  6043. urlParams_ gensupport.URLParams
  6044. ctx_ context.Context
  6045. }
  6046. // Custombatch: Retrieves and updates tax settings of multiple accounts
  6047. // in a single request.
  6048. func (r *AccounttaxService) Custombatch(accounttaxcustombatchrequest *AccounttaxCustomBatchRequest) *AccounttaxCustombatchCall {
  6049. c := &AccounttaxCustombatchCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  6050. c.accounttaxcustombatchrequest = accounttaxcustombatchrequest
  6051. return c
  6052. }
  6053. // DryRun sets the optional parameter "dryRun": Flag to run the request
  6054. // in dry-run mode.
  6055. func (c *AccounttaxCustombatchCall) DryRun(dryRun bool) *AccounttaxCustombatchCall {
  6056. c.urlParams_.Set("dryRun", fmt.Sprint(dryRun))
  6057. return c
  6058. }
  6059. // Fields allows partial responses to be retrieved. See
  6060. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  6061. // for more information.
  6062. func (c *AccounttaxCustombatchCall) Fields(s ...googleapi.Field) *AccounttaxCustombatchCall {
  6063. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  6064. return c
  6065. }
  6066. // Context sets the context to be used in this call's Do method. Any
  6067. // pending HTTP request will be aborted if the provided context is
  6068. // canceled.
  6069. func (c *AccounttaxCustombatchCall) Context(ctx context.Context) *AccounttaxCustombatchCall {
  6070. c.ctx_ = ctx
  6071. return c
  6072. }
  6073. func (c *AccounttaxCustombatchCall) doRequest(alt string) (*http.Response, error) {
  6074. var body io.Reader = nil
  6075. body, err := googleapi.WithoutDataWrapper.JSONReader(c.accounttaxcustombatchrequest)
  6076. if err != nil {
  6077. return nil, err
  6078. }
  6079. ctype := "application/json"
  6080. c.urlParams_.Set("alt", alt)
  6081. urls := googleapi.ResolveRelative(c.s.BasePath, "accounttax/batch")
  6082. urls += "?" + c.urlParams_.Encode()
  6083. req, _ := http.NewRequest("POST", urls, body)
  6084. googleapi.SetOpaque(req.URL)
  6085. req.Header.Set("Content-Type", ctype)
  6086. req.Header.Set("User-Agent", c.s.userAgent())
  6087. if c.ctx_ != nil {
  6088. return ctxhttp.Do(c.ctx_, c.s.client, req)
  6089. }
  6090. return c.s.client.Do(req)
  6091. }
  6092. // Do executes the "content.accounttax.custombatch" call.
  6093. // Exactly one of *AccounttaxCustomBatchResponse or error will be
  6094. // non-nil. Any non-2xx status code is an error. Response headers are in
  6095. // either *AccounttaxCustomBatchResponse.ServerResponse.Header or (if a
  6096. // response was returned at all) in error.(*googleapi.Error).Header. Use
  6097. // googleapi.IsNotModified to check whether the returned error was
  6098. // because http.StatusNotModified was returned.
  6099. func (c *AccounttaxCustombatchCall) Do(opts ...googleapi.CallOption) (*AccounttaxCustomBatchResponse, error) {
  6100. gensupport.SetOptions(c.urlParams_, opts...)
  6101. res, err := c.doRequest("json")
  6102. if res != nil && res.StatusCode == http.StatusNotModified {
  6103. if res.Body != nil {
  6104. res.Body.Close()
  6105. }
  6106. return nil, &googleapi.Error{
  6107. Code: res.StatusCode,
  6108. Header: res.Header,
  6109. }
  6110. }
  6111. if err != nil {
  6112. return nil, err
  6113. }
  6114. defer googleapi.CloseBody(res)
  6115. if err := googleapi.CheckResponse(res); err != nil {
  6116. return nil, err
  6117. }
  6118. ret := &AccounttaxCustomBatchResponse{
  6119. ServerResponse: googleapi.ServerResponse{
  6120. Header: res.Header,
  6121. HTTPStatusCode: res.StatusCode,
  6122. },
  6123. }
  6124. if err := json.NewDecoder(res.Body).Decode(&ret); err != nil {
  6125. return nil, err
  6126. }
  6127. return ret, nil
  6128. // {
  6129. // "description": "Retrieves and updates tax settings of multiple accounts in a single request.",
  6130. // "httpMethod": "POST",
  6131. // "id": "content.accounttax.custombatch",
  6132. // "parameters": {
  6133. // "dryRun": {
  6134. // "description": "Flag to run the request in dry-run mode.",
  6135. // "location": "query",
  6136. // "type": "boolean"
  6137. // }
  6138. // },
  6139. // "path": "accounttax/batch",
  6140. // "request": {
  6141. // "$ref": "AccounttaxCustomBatchRequest"
  6142. // },
  6143. // "response": {
  6144. // "$ref": "AccounttaxCustomBatchResponse"
  6145. // },
  6146. // "scopes": [
  6147. // "https://www.googleapis.com/auth/content"
  6148. // ]
  6149. // }
  6150. }
  6151. // method id "content.accounttax.get":
  6152. type AccounttaxGetCall struct {
  6153. s *Service
  6154. merchantId uint64
  6155. accountId uint64
  6156. urlParams_ gensupport.URLParams
  6157. ifNoneMatch_ string
  6158. ctx_ context.Context
  6159. }
  6160. // Get: Retrieves the tax settings of the account.
  6161. func (r *AccounttaxService) Get(merchantId uint64, accountId uint64) *AccounttaxGetCall {
  6162. c := &AccounttaxGetCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  6163. c.merchantId = merchantId
  6164. c.accountId = accountId
  6165. return c
  6166. }
  6167. // Fields allows partial responses to be retrieved. See
  6168. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  6169. // for more information.
  6170. func (c *AccounttaxGetCall) Fields(s ...googleapi.Field) *AccounttaxGetCall {
  6171. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  6172. return c
  6173. }
  6174. // IfNoneMatch sets the optional parameter which makes the operation
  6175. // fail if the object's ETag matches the given value. This is useful for
  6176. // getting updates only after the object has changed since the last
  6177. // request. Use googleapi.IsNotModified to check whether the response
  6178. // error from Do is the result of In-None-Match.
  6179. func (c *AccounttaxGetCall) IfNoneMatch(entityTag string) *AccounttaxGetCall {
  6180. c.ifNoneMatch_ = entityTag
  6181. return c
  6182. }
  6183. // Context sets the context to be used in this call's Do method. Any
  6184. // pending HTTP request will be aborted if the provided context is
  6185. // canceled.
  6186. func (c *AccounttaxGetCall) Context(ctx context.Context) *AccounttaxGetCall {
  6187. c.ctx_ = ctx
  6188. return c
  6189. }
  6190. func (c *AccounttaxGetCall) doRequest(alt string) (*http.Response, error) {
  6191. var body io.Reader = nil
  6192. c.urlParams_.Set("alt", alt)
  6193. urls := googleapi.ResolveRelative(c.s.BasePath, "{merchantId}/accounttax/{accountId}")
  6194. urls += "?" + c.urlParams_.Encode()
  6195. req, _ := http.NewRequest("GET", urls, body)
  6196. googleapi.Expand(req.URL, map[string]string{
  6197. "merchantId": strconv.FormatUint(c.merchantId, 10),
  6198. "accountId": strconv.FormatUint(c.accountId, 10),
  6199. })
  6200. req.Header.Set("User-Agent", c.s.userAgent())
  6201. if c.ifNoneMatch_ != "" {
  6202. req.Header.Set("If-None-Match", c.ifNoneMatch_)
  6203. }
  6204. if c.ctx_ != nil {
  6205. return ctxhttp.Do(c.ctx_, c.s.client, req)
  6206. }
  6207. return c.s.client.Do(req)
  6208. }
  6209. // Do executes the "content.accounttax.get" call.
  6210. // Exactly one of *AccountTax or error will be non-nil. Any non-2xx
  6211. // status code is an error. Response headers are in either
  6212. // *AccountTax.ServerResponse.Header or (if a response was returned at
  6213. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  6214. // to check whether the returned error was because
  6215. // http.StatusNotModified was returned.
  6216. func (c *AccounttaxGetCall) Do(opts ...googleapi.CallOption) (*AccountTax, error) {
  6217. gensupport.SetOptions(c.urlParams_, opts...)
  6218. res, err := c.doRequest("json")
  6219. if res != nil && res.StatusCode == http.StatusNotModified {
  6220. if res.Body != nil {
  6221. res.Body.Close()
  6222. }
  6223. return nil, &googleapi.Error{
  6224. Code: res.StatusCode,
  6225. Header: res.Header,
  6226. }
  6227. }
  6228. if err != nil {
  6229. return nil, err
  6230. }
  6231. defer googleapi.CloseBody(res)
  6232. if err := googleapi.CheckResponse(res); err != nil {
  6233. return nil, err
  6234. }
  6235. ret := &AccountTax{
  6236. ServerResponse: googleapi.ServerResponse{
  6237. Header: res.Header,
  6238. HTTPStatusCode: res.StatusCode,
  6239. },
  6240. }
  6241. if err := json.NewDecoder(res.Body).Decode(&ret); err != nil {
  6242. return nil, err
  6243. }
  6244. return ret, nil
  6245. // {
  6246. // "description": "Retrieves the tax settings of the account.",
  6247. // "httpMethod": "GET",
  6248. // "id": "content.accounttax.get",
  6249. // "parameterOrder": [
  6250. // "merchantId",
  6251. // "accountId"
  6252. // ],
  6253. // "parameters": {
  6254. // "accountId": {
  6255. // "description": "The ID of the account for which to get/update account tax settings.",
  6256. // "format": "uint64",
  6257. // "location": "path",
  6258. // "required": true,
  6259. // "type": "string"
  6260. // },
  6261. // "merchantId": {
  6262. // "description": "The ID of the managing account.",
  6263. // "format": "uint64",
  6264. // "location": "path",
  6265. // "required": true,
  6266. // "type": "string"
  6267. // }
  6268. // },
  6269. // "path": "{merchantId}/accounttax/{accountId}",
  6270. // "response": {
  6271. // "$ref": "AccountTax"
  6272. // },
  6273. // "scopes": [
  6274. // "https://www.googleapis.com/auth/content"
  6275. // ]
  6276. // }
  6277. }
  6278. // method id "content.accounttax.list":
  6279. type AccounttaxListCall struct {
  6280. s *Service
  6281. merchantId uint64
  6282. urlParams_ gensupport.URLParams
  6283. ifNoneMatch_ string
  6284. ctx_ context.Context
  6285. }
  6286. // List: Lists the tax settings of the sub-accounts in your Merchant
  6287. // Center account.
  6288. func (r *AccounttaxService) List(merchantId uint64) *AccounttaxListCall {
  6289. c := &AccounttaxListCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  6290. c.merchantId = merchantId
  6291. return c
  6292. }
  6293. // MaxResults sets the optional parameter "maxResults": The maximum
  6294. // number of tax settings to return in the response, used for paging.
  6295. func (c *AccounttaxListCall) MaxResults(maxResults int64) *AccounttaxListCall {
  6296. c.urlParams_.Set("maxResults", fmt.Sprint(maxResults))
  6297. return c
  6298. }
  6299. // PageToken sets the optional parameter "pageToken": The token returned
  6300. // by the previous request.
  6301. func (c *AccounttaxListCall) PageToken(pageToken string) *AccounttaxListCall {
  6302. c.urlParams_.Set("pageToken", pageToken)
  6303. return c
  6304. }
  6305. // Fields allows partial responses to be retrieved. See
  6306. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  6307. // for more information.
  6308. func (c *AccounttaxListCall) Fields(s ...googleapi.Field) *AccounttaxListCall {
  6309. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  6310. return c
  6311. }
  6312. // IfNoneMatch sets the optional parameter which makes the operation
  6313. // fail if the object's ETag matches the given value. This is useful for
  6314. // getting updates only after the object has changed since the last
  6315. // request. Use googleapi.IsNotModified to check whether the response
  6316. // error from Do is the result of In-None-Match.
  6317. func (c *AccounttaxListCall) IfNoneMatch(entityTag string) *AccounttaxListCall {
  6318. c.ifNoneMatch_ = entityTag
  6319. return c
  6320. }
  6321. // Context sets the context to be used in this call's Do method. Any
  6322. // pending HTTP request will be aborted if the provided context is
  6323. // canceled.
  6324. func (c *AccounttaxListCall) Context(ctx context.Context) *AccounttaxListCall {
  6325. c.ctx_ = ctx
  6326. return c
  6327. }
  6328. func (c *AccounttaxListCall) doRequest(alt string) (*http.Response, error) {
  6329. var body io.Reader = nil
  6330. c.urlParams_.Set("alt", alt)
  6331. urls := googleapi.ResolveRelative(c.s.BasePath, "{merchantId}/accounttax")
  6332. urls += "?" + c.urlParams_.Encode()
  6333. req, _ := http.NewRequest("GET", urls, body)
  6334. googleapi.Expand(req.URL, map[string]string{
  6335. "merchantId": strconv.FormatUint(c.merchantId, 10),
  6336. })
  6337. req.Header.Set("User-Agent", c.s.userAgent())
  6338. if c.ifNoneMatch_ != "" {
  6339. req.Header.Set("If-None-Match", c.ifNoneMatch_)
  6340. }
  6341. if c.ctx_ != nil {
  6342. return ctxhttp.Do(c.ctx_, c.s.client, req)
  6343. }
  6344. return c.s.client.Do(req)
  6345. }
  6346. // Do executes the "content.accounttax.list" call.
  6347. // Exactly one of *AccounttaxListResponse or error will be non-nil. Any
  6348. // non-2xx status code is an error. Response headers are in either
  6349. // *AccounttaxListResponse.ServerResponse.Header or (if a response was
  6350. // returned at all) in error.(*googleapi.Error).Header. Use
  6351. // googleapi.IsNotModified to check whether the returned error was
  6352. // because http.StatusNotModified was returned.
  6353. func (c *AccounttaxListCall) Do(opts ...googleapi.CallOption) (*AccounttaxListResponse, error) {
  6354. gensupport.SetOptions(c.urlParams_, opts...)
  6355. res, err := c.doRequest("json")
  6356. if res != nil && res.StatusCode == http.StatusNotModified {
  6357. if res.Body != nil {
  6358. res.Body.Close()
  6359. }
  6360. return nil, &googleapi.Error{
  6361. Code: res.StatusCode,
  6362. Header: res.Header,
  6363. }
  6364. }
  6365. if err != nil {
  6366. return nil, err
  6367. }
  6368. defer googleapi.CloseBody(res)
  6369. if err := googleapi.CheckResponse(res); err != nil {
  6370. return nil, err
  6371. }
  6372. ret := &AccounttaxListResponse{
  6373. ServerResponse: googleapi.ServerResponse{
  6374. Header: res.Header,
  6375. HTTPStatusCode: res.StatusCode,
  6376. },
  6377. }
  6378. if err := json.NewDecoder(res.Body).Decode(&ret); err != nil {
  6379. return nil, err
  6380. }
  6381. return ret, nil
  6382. // {
  6383. // "description": "Lists the tax settings of the sub-accounts in your Merchant Center account.",
  6384. // "httpMethod": "GET",
  6385. // "id": "content.accounttax.list",
  6386. // "parameterOrder": [
  6387. // "merchantId"
  6388. // ],
  6389. // "parameters": {
  6390. // "maxResults": {
  6391. // "description": "The maximum number of tax settings to return in the response, used for paging.",
  6392. // "format": "uint32",
  6393. // "location": "query",
  6394. // "type": "integer"
  6395. // },
  6396. // "merchantId": {
  6397. // "description": "The ID of the managing account.",
  6398. // "format": "uint64",
  6399. // "location": "path",
  6400. // "required": true,
  6401. // "type": "string"
  6402. // },
  6403. // "pageToken": {
  6404. // "description": "The token returned by the previous request.",
  6405. // "location": "query",
  6406. // "type": "string"
  6407. // }
  6408. // },
  6409. // "path": "{merchantId}/accounttax",
  6410. // "response": {
  6411. // "$ref": "AccounttaxListResponse"
  6412. // },
  6413. // "scopes": [
  6414. // "https://www.googleapis.com/auth/content"
  6415. // ]
  6416. // }
  6417. }
  6418. // Pages invokes f for each page of results.
  6419. // A non-nil error returned from f will halt the iteration.
  6420. // The provided context supersedes any context provided to the Context method.
  6421. func (c *AccounttaxListCall) Pages(ctx context.Context, f func(*AccounttaxListResponse) error) error {
  6422. c.ctx_ = ctx
  6423. defer c.PageToken(c.urlParams_.Get("pageToken")) // reset paging to original point
  6424. for {
  6425. x, err := c.Do()
  6426. if err != nil {
  6427. return err
  6428. }
  6429. if err := f(x); err != nil {
  6430. return err
  6431. }
  6432. if x.NextPageToken == "" {
  6433. return nil
  6434. }
  6435. c.PageToken(x.NextPageToken)
  6436. }
  6437. }
  6438. // method id "content.accounttax.patch":
  6439. type AccounttaxPatchCall struct {
  6440. s *Service
  6441. merchantId uint64
  6442. accountId uint64
  6443. accounttax *AccountTax
  6444. urlParams_ gensupport.URLParams
  6445. ctx_ context.Context
  6446. }
  6447. // Patch: Updates the tax settings of the account. This method supports
  6448. // patch semantics.
  6449. func (r *AccounttaxService) Patch(merchantId uint64, accountId uint64, accounttax *AccountTax) *AccounttaxPatchCall {
  6450. c := &AccounttaxPatchCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  6451. c.merchantId = merchantId
  6452. c.accountId = accountId
  6453. c.accounttax = accounttax
  6454. return c
  6455. }
  6456. // DryRun sets the optional parameter "dryRun": Flag to run the request
  6457. // in dry-run mode.
  6458. func (c *AccounttaxPatchCall) DryRun(dryRun bool) *AccounttaxPatchCall {
  6459. c.urlParams_.Set("dryRun", fmt.Sprint(dryRun))
  6460. return c
  6461. }
  6462. // Fields allows partial responses to be retrieved. See
  6463. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  6464. // for more information.
  6465. func (c *AccounttaxPatchCall) Fields(s ...googleapi.Field) *AccounttaxPatchCall {
  6466. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  6467. return c
  6468. }
  6469. // Context sets the context to be used in this call's Do method. Any
  6470. // pending HTTP request will be aborted if the provided context is
  6471. // canceled.
  6472. func (c *AccounttaxPatchCall) Context(ctx context.Context) *AccounttaxPatchCall {
  6473. c.ctx_ = ctx
  6474. return c
  6475. }
  6476. func (c *AccounttaxPatchCall) doRequest(alt string) (*http.Response, error) {
  6477. var body io.Reader = nil
  6478. body, err := googleapi.WithoutDataWrapper.JSONReader(c.accounttax)
  6479. if err != nil {
  6480. return nil, err
  6481. }
  6482. ctype := "application/json"
  6483. c.urlParams_.Set("alt", alt)
  6484. urls := googleapi.ResolveRelative(c.s.BasePath, "{merchantId}/accounttax/{accountId}")
  6485. urls += "?" + c.urlParams_.Encode()
  6486. req, _ := http.NewRequest("PATCH", urls, body)
  6487. googleapi.Expand(req.URL, map[string]string{
  6488. "merchantId": strconv.FormatUint(c.merchantId, 10),
  6489. "accountId": strconv.FormatUint(c.accountId, 10),
  6490. })
  6491. req.Header.Set("Content-Type", ctype)
  6492. req.Header.Set("User-Agent", c.s.userAgent())
  6493. if c.ctx_ != nil {
  6494. return ctxhttp.Do(c.ctx_, c.s.client, req)
  6495. }
  6496. return c.s.client.Do(req)
  6497. }
  6498. // Do executes the "content.accounttax.patch" call.
  6499. // Exactly one of *AccountTax or error will be non-nil. Any non-2xx
  6500. // status code is an error. Response headers are in either
  6501. // *AccountTax.ServerResponse.Header or (if a response was returned at
  6502. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  6503. // to check whether the returned error was because
  6504. // http.StatusNotModified was returned.
  6505. func (c *AccounttaxPatchCall) Do(opts ...googleapi.CallOption) (*AccountTax, error) {
  6506. gensupport.SetOptions(c.urlParams_, opts...)
  6507. res, err := c.doRequest("json")
  6508. if res != nil && res.StatusCode == http.StatusNotModified {
  6509. if res.Body != nil {
  6510. res.Body.Close()
  6511. }
  6512. return nil, &googleapi.Error{
  6513. Code: res.StatusCode,
  6514. Header: res.Header,
  6515. }
  6516. }
  6517. if err != nil {
  6518. return nil, err
  6519. }
  6520. defer googleapi.CloseBody(res)
  6521. if err := googleapi.CheckResponse(res); err != nil {
  6522. return nil, err
  6523. }
  6524. ret := &AccountTax{
  6525. ServerResponse: googleapi.ServerResponse{
  6526. Header: res.Header,
  6527. HTTPStatusCode: res.StatusCode,
  6528. },
  6529. }
  6530. if err := json.NewDecoder(res.Body).Decode(&ret); err != nil {
  6531. return nil, err
  6532. }
  6533. return ret, nil
  6534. // {
  6535. // "description": "Updates the tax settings of the account. This method supports patch semantics.",
  6536. // "httpMethod": "PATCH",
  6537. // "id": "content.accounttax.patch",
  6538. // "parameterOrder": [
  6539. // "merchantId",
  6540. // "accountId"
  6541. // ],
  6542. // "parameters": {
  6543. // "accountId": {
  6544. // "description": "The ID of the account for which to get/update account tax settings.",
  6545. // "format": "uint64",
  6546. // "location": "path",
  6547. // "required": true,
  6548. // "type": "string"
  6549. // },
  6550. // "dryRun": {
  6551. // "description": "Flag to run the request in dry-run mode.",
  6552. // "location": "query",
  6553. // "type": "boolean"
  6554. // },
  6555. // "merchantId": {
  6556. // "description": "The ID of the managing account.",
  6557. // "format": "uint64",
  6558. // "location": "path",
  6559. // "required": true,
  6560. // "type": "string"
  6561. // }
  6562. // },
  6563. // "path": "{merchantId}/accounttax/{accountId}",
  6564. // "request": {
  6565. // "$ref": "AccountTax"
  6566. // },
  6567. // "response": {
  6568. // "$ref": "AccountTax"
  6569. // },
  6570. // "scopes": [
  6571. // "https://www.googleapis.com/auth/content"
  6572. // ]
  6573. // }
  6574. }
  6575. // method id "content.accounttax.update":
  6576. type AccounttaxUpdateCall struct {
  6577. s *Service
  6578. merchantId uint64
  6579. accountId uint64
  6580. accounttax *AccountTax
  6581. urlParams_ gensupport.URLParams
  6582. ctx_ context.Context
  6583. }
  6584. // Update: Updates the tax settings of the account.
  6585. func (r *AccounttaxService) Update(merchantId uint64, accountId uint64, accounttax *AccountTax) *AccounttaxUpdateCall {
  6586. c := &AccounttaxUpdateCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  6587. c.merchantId = merchantId
  6588. c.accountId = accountId
  6589. c.accounttax = accounttax
  6590. return c
  6591. }
  6592. // DryRun sets the optional parameter "dryRun": Flag to run the request
  6593. // in dry-run mode.
  6594. func (c *AccounttaxUpdateCall) DryRun(dryRun bool) *AccounttaxUpdateCall {
  6595. c.urlParams_.Set("dryRun", fmt.Sprint(dryRun))
  6596. return c
  6597. }
  6598. // Fields allows partial responses to be retrieved. See
  6599. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  6600. // for more information.
  6601. func (c *AccounttaxUpdateCall) Fields(s ...googleapi.Field) *AccounttaxUpdateCall {
  6602. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  6603. return c
  6604. }
  6605. // Context sets the context to be used in this call's Do method. Any
  6606. // pending HTTP request will be aborted if the provided context is
  6607. // canceled.
  6608. func (c *AccounttaxUpdateCall) Context(ctx context.Context) *AccounttaxUpdateCall {
  6609. c.ctx_ = ctx
  6610. return c
  6611. }
  6612. func (c *AccounttaxUpdateCall) doRequest(alt string) (*http.Response, error) {
  6613. var body io.Reader = nil
  6614. body, err := googleapi.WithoutDataWrapper.JSONReader(c.accounttax)
  6615. if err != nil {
  6616. return nil, err
  6617. }
  6618. ctype := "application/json"
  6619. c.urlParams_.Set("alt", alt)
  6620. urls := googleapi.ResolveRelative(c.s.BasePath, "{merchantId}/accounttax/{accountId}")
  6621. urls += "?" + c.urlParams_.Encode()
  6622. req, _ := http.NewRequest("PUT", urls, body)
  6623. googleapi.Expand(req.URL, map[string]string{
  6624. "merchantId": strconv.FormatUint(c.merchantId, 10),
  6625. "accountId": strconv.FormatUint(c.accountId, 10),
  6626. })
  6627. req.Header.Set("Content-Type", ctype)
  6628. req.Header.Set("User-Agent", c.s.userAgent())
  6629. if c.ctx_ != nil {
  6630. return ctxhttp.Do(c.ctx_, c.s.client, req)
  6631. }
  6632. return c.s.client.Do(req)
  6633. }
  6634. // Do executes the "content.accounttax.update" call.
  6635. // Exactly one of *AccountTax or error will be non-nil. Any non-2xx
  6636. // status code is an error. Response headers are in either
  6637. // *AccountTax.ServerResponse.Header or (if a response was returned at
  6638. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  6639. // to check whether the returned error was because
  6640. // http.StatusNotModified was returned.
  6641. func (c *AccounttaxUpdateCall) Do(opts ...googleapi.CallOption) (*AccountTax, error) {
  6642. gensupport.SetOptions(c.urlParams_, opts...)
  6643. res, err := c.doRequest("json")
  6644. if res != nil && res.StatusCode == http.StatusNotModified {
  6645. if res.Body != nil {
  6646. res.Body.Close()
  6647. }
  6648. return nil, &googleapi.Error{
  6649. Code: res.StatusCode,
  6650. Header: res.Header,
  6651. }
  6652. }
  6653. if err != nil {
  6654. return nil, err
  6655. }
  6656. defer googleapi.CloseBody(res)
  6657. if err := googleapi.CheckResponse(res); err != nil {
  6658. return nil, err
  6659. }
  6660. ret := &AccountTax{
  6661. ServerResponse: googleapi.ServerResponse{
  6662. Header: res.Header,
  6663. HTTPStatusCode: res.StatusCode,
  6664. },
  6665. }
  6666. if err := json.NewDecoder(res.Body).Decode(&ret); err != nil {
  6667. return nil, err
  6668. }
  6669. return ret, nil
  6670. // {
  6671. // "description": "Updates the tax settings of the account.",
  6672. // "httpMethod": "PUT",
  6673. // "id": "content.accounttax.update",
  6674. // "parameterOrder": [
  6675. // "merchantId",
  6676. // "accountId"
  6677. // ],
  6678. // "parameters": {
  6679. // "accountId": {
  6680. // "description": "The ID of the account for which to get/update account tax settings.",
  6681. // "format": "uint64",
  6682. // "location": "path",
  6683. // "required": true,
  6684. // "type": "string"
  6685. // },
  6686. // "dryRun": {
  6687. // "description": "Flag to run the request in dry-run mode.",
  6688. // "location": "query",
  6689. // "type": "boolean"
  6690. // },
  6691. // "merchantId": {
  6692. // "description": "The ID of the managing account.",
  6693. // "format": "uint64",
  6694. // "location": "path",
  6695. // "required": true,
  6696. // "type": "string"
  6697. // }
  6698. // },
  6699. // "path": "{merchantId}/accounttax/{accountId}",
  6700. // "request": {
  6701. // "$ref": "AccountTax"
  6702. // },
  6703. // "response": {
  6704. // "$ref": "AccountTax"
  6705. // },
  6706. // "scopes": [
  6707. // "https://www.googleapis.com/auth/content"
  6708. // ]
  6709. // }
  6710. }
  6711. // method id "content.datafeeds.custombatch":
  6712. type DatafeedsCustombatchCall struct {
  6713. s *Service
  6714. datafeedscustombatchrequest *DatafeedsCustomBatchRequest
  6715. urlParams_ gensupport.URLParams
  6716. ctx_ context.Context
  6717. }
  6718. // Custombatch:
  6719. func (r *DatafeedsService) Custombatch(datafeedscustombatchrequest *DatafeedsCustomBatchRequest) *DatafeedsCustombatchCall {
  6720. c := &DatafeedsCustombatchCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  6721. c.datafeedscustombatchrequest = datafeedscustombatchrequest
  6722. return c
  6723. }
  6724. // DryRun sets the optional parameter "dryRun": Flag to run the request
  6725. // in dry-run mode.
  6726. func (c *DatafeedsCustombatchCall) DryRun(dryRun bool) *DatafeedsCustombatchCall {
  6727. c.urlParams_.Set("dryRun", fmt.Sprint(dryRun))
  6728. return c
  6729. }
  6730. // Fields allows partial responses to be retrieved. See
  6731. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  6732. // for more information.
  6733. func (c *DatafeedsCustombatchCall) Fields(s ...googleapi.Field) *DatafeedsCustombatchCall {
  6734. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  6735. return c
  6736. }
  6737. // Context sets the context to be used in this call's Do method. Any
  6738. // pending HTTP request will be aborted if the provided context is
  6739. // canceled.
  6740. func (c *DatafeedsCustombatchCall) Context(ctx context.Context) *DatafeedsCustombatchCall {
  6741. c.ctx_ = ctx
  6742. return c
  6743. }
  6744. func (c *DatafeedsCustombatchCall) doRequest(alt string) (*http.Response, error) {
  6745. var body io.Reader = nil
  6746. body, err := googleapi.WithoutDataWrapper.JSONReader(c.datafeedscustombatchrequest)
  6747. if err != nil {
  6748. return nil, err
  6749. }
  6750. ctype := "application/json"
  6751. c.urlParams_.Set("alt", alt)
  6752. urls := googleapi.ResolveRelative(c.s.BasePath, "datafeeds/batch")
  6753. urls += "?" + c.urlParams_.Encode()
  6754. req, _ := http.NewRequest("POST", urls, body)
  6755. googleapi.SetOpaque(req.URL)
  6756. req.Header.Set("Content-Type", ctype)
  6757. req.Header.Set("User-Agent", c.s.userAgent())
  6758. if c.ctx_ != nil {
  6759. return ctxhttp.Do(c.ctx_, c.s.client, req)
  6760. }
  6761. return c.s.client.Do(req)
  6762. }
  6763. // Do executes the "content.datafeeds.custombatch" call.
  6764. // Exactly one of *DatafeedsCustomBatchResponse or error will be
  6765. // non-nil. Any non-2xx status code is an error. Response headers are in
  6766. // either *DatafeedsCustomBatchResponse.ServerResponse.Header or (if a
  6767. // response was returned at all) in error.(*googleapi.Error).Header. Use
  6768. // googleapi.IsNotModified to check whether the returned error was
  6769. // because http.StatusNotModified was returned.
  6770. func (c *DatafeedsCustombatchCall) Do(opts ...googleapi.CallOption) (*DatafeedsCustomBatchResponse, error) {
  6771. gensupport.SetOptions(c.urlParams_, opts...)
  6772. res, err := c.doRequest("json")
  6773. if res != nil && res.StatusCode == http.StatusNotModified {
  6774. if res.Body != nil {
  6775. res.Body.Close()
  6776. }
  6777. return nil, &googleapi.Error{
  6778. Code: res.StatusCode,
  6779. Header: res.Header,
  6780. }
  6781. }
  6782. if err != nil {
  6783. return nil, err
  6784. }
  6785. defer googleapi.CloseBody(res)
  6786. if err := googleapi.CheckResponse(res); err != nil {
  6787. return nil, err
  6788. }
  6789. ret := &DatafeedsCustomBatchResponse{
  6790. ServerResponse: googleapi.ServerResponse{
  6791. Header: res.Header,
  6792. HTTPStatusCode: res.StatusCode,
  6793. },
  6794. }
  6795. if err := json.NewDecoder(res.Body).Decode(&ret); err != nil {
  6796. return nil, err
  6797. }
  6798. return ret, nil
  6799. // {
  6800. // "httpMethod": "POST",
  6801. // "id": "content.datafeeds.custombatch",
  6802. // "parameters": {
  6803. // "dryRun": {
  6804. // "description": "Flag to run the request in dry-run mode.",
  6805. // "location": "query",
  6806. // "type": "boolean"
  6807. // }
  6808. // },
  6809. // "path": "datafeeds/batch",
  6810. // "request": {
  6811. // "$ref": "DatafeedsCustomBatchRequest"
  6812. // },
  6813. // "response": {
  6814. // "$ref": "DatafeedsCustomBatchResponse"
  6815. // },
  6816. // "scopes": [
  6817. // "https://www.googleapis.com/auth/content"
  6818. // ]
  6819. // }
  6820. }
  6821. // method id "content.datafeeds.delete":
  6822. type DatafeedsDeleteCall struct {
  6823. s *Service
  6824. merchantId uint64
  6825. datafeedId uint64
  6826. urlParams_ gensupport.URLParams
  6827. ctx_ context.Context
  6828. }
  6829. // Delete: Deletes a datafeed from your Merchant Center account.
  6830. func (r *DatafeedsService) Delete(merchantId uint64, datafeedId uint64) *DatafeedsDeleteCall {
  6831. c := &DatafeedsDeleteCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  6832. c.merchantId = merchantId
  6833. c.datafeedId = datafeedId
  6834. return c
  6835. }
  6836. // DryRun sets the optional parameter "dryRun": Flag to run the request
  6837. // in dry-run mode.
  6838. func (c *DatafeedsDeleteCall) DryRun(dryRun bool) *DatafeedsDeleteCall {
  6839. c.urlParams_.Set("dryRun", fmt.Sprint(dryRun))
  6840. return c
  6841. }
  6842. // Fields allows partial responses to be retrieved. See
  6843. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  6844. // for more information.
  6845. func (c *DatafeedsDeleteCall) Fields(s ...googleapi.Field) *DatafeedsDeleteCall {
  6846. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  6847. return c
  6848. }
  6849. // Context sets the context to be used in this call's Do method. Any
  6850. // pending HTTP request will be aborted if the provided context is
  6851. // canceled.
  6852. func (c *DatafeedsDeleteCall) Context(ctx context.Context) *DatafeedsDeleteCall {
  6853. c.ctx_ = ctx
  6854. return c
  6855. }
  6856. func (c *DatafeedsDeleteCall) doRequest(alt string) (*http.Response, error) {
  6857. var body io.Reader = nil
  6858. c.urlParams_.Set("alt", alt)
  6859. urls := googleapi.ResolveRelative(c.s.BasePath, "{merchantId}/datafeeds/{datafeedId}")
  6860. urls += "?" + c.urlParams_.Encode()
  6861. req, _ := http.NewRequest("DELETE", urls, body)
  6862. googleapi.Expand(req.URL, map[string]string{
  6863. "merchantId": strconv.FormatUint(c.merchantId, 10),
  6864. "datafeedId": strconv.FormatUint(c.datafeedId, 10),
  6865. })
  6866. req.Header.Set("User-Agent", c.s.userAgent())
  6867. if c.ctx_ != nil {
  6868. return ctxhttp.Do(c.ctx_, c.s.client, req)
  6869. }
  6870. return c.s.client.Do(req)
  6871. }
  6872. // Do executes the "content.datafeeds.delete" call.
  6873. func (c *DatafeedsDeleteCall) Do(opts ...googleapi.CallOption) error {
  6874. gensupport.SetOptions(c.urlParams_, opts...)
  6875. res, err := c.doRequest("json")
  6876. if err != nil {
  6877. return err
  6878. }
  6879. defer googleapi.CloseBody(res)
  6880. if err := googleapi.CheckResponse(res); err != nil {
  6881. return err
  6882. }
  6883. return nil
  6884. // {
  6885. // "description": "Deletes a datafeed from your Merchant Center account.",
  6886. // "httpMethod": "DELETE",
  6887. // "id": "content.datafeeds.delete",
  6888. // "parameterOrder": [
  6889. // "merchantId",
  6890. // "datafeedId"
  6891. // ],
  6892. // "parameters": {
  6893. // "datafeedId": {
  6894. // "format": "uint64",
  6895. // "location": "path",
  6896. // "required": true,
  6897. // "type": "string"
  6898. // },
  6899. // "dryRun": {
  6900. // "description": "Flag to run the request in dry-run mode.",
  6901. // "location": "query",
  6902. // "type": "boolean"
  6903. // },
  6904. // "merchantId": {
  6905. // "format": "uint64",
  6906. // "location": "path",
  6907. // "required": true,
  6908. // "type": "string"
  6909. // }
  6910. // },
  6911. // "path": "{merchantId}/datafeeds/{datafeedId}",
  6912. // "scopes": [
  6913. // "https://www.googleapis.com/auth/content"
  6914. // ]
  6915. // }
  6916. }
  6917. // method id "content.datafeeds.get":
  6918. type DatafeedsGetCall struct {
  6919. s *Service
  6920. merchantId uint64
  6921. datafeedId uint64
  6922. urlParams_ gensupport.URLParams
  6923. ifNoneMatch_ string
  6924. ctx_ context.Context
  6925. }
  6926. // Get: Retrieves a datafeed from your Merchant Center account.
  6927. func (r *DatafeedsService) Get(merchantId uint64, datafeedId uint64) *DatafeedsGetCall {
  6928. c := &DatafeedsGetCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  6929. c.merchantId = merchantId
  6930. c.datafeedId = datafeedId
  6931. return c
  6932. }
  6933. // Fields allows partial responses to be retrieved. See
  6934. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  6935. // for more information.
  6936. func (c *DatafeedsGetCall) Fields(s ...googleapi.Field) *DatafeedsGetCall {
  6937. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  6938. return c
  6939. }
  6940. // IfNoneMatch sets the optional parameter which makes the operation
  6941. // fail if the object's ETag matches the given value. This is useful for
  6942. // getting updates only after the object has changed since the last
  6943. // request. Use googleapi.IsNotModified to check whether the response
  6944. // error from Do is the result of In-None-Match.
  6945. func (c *DatafeedsGetCall) IfNoneMatch(entityTag string) *DatafeedsGetCall {
  6946. c.ifNoneMatch_ = entityTag
  6947. return c
  6948. }
  6949. // Context sets the context to be used in this call's Do method. Any
  6950. // pending HTTP request will be aborted if the provided context is
  6951. // canceled.
  6952. func (c *DatafeedsGetCall) Context(ctx context.Context) *DatafeedsGetCall {
  6953. c.ctx_ = ctx
  6954. return c
  6955. }
  6956. func (c *DatafeedsGetCall) doRequest(alt string) (*http.Response, error) {
  6957. var body io.Reader = nil
  6958. c.urlParams_.Set("alt", alt)
  6959. urls := googleapi.ResolveRelative(c.s.BasePath, "{merchantId}/datafeeds/{datafeedId}")
  6960. urls += "?" + c.urlParams_.Encode()
  6961. req, _ := http.NewRequest("GET", urls, body)
  6962. googleapi.Expand(req.URL, map[string]string{
  6963. "merchantId": strconv.FormatUint(c.merchantId, 10),
  6964. "datafeedId": strconv.FormatUint(c.datafeedId, 10),
  6965. })
  6966. req.Header.Set("User-Agent", c.s.userAgent())
  6967. if c.ifNoneMatch_ != "" {
  6968. req.Header.Set("If-None-Match", c.ifNoneMatch_)
  6969. }
  6970. if c.ctx_ != nil {
  6971. return ctxhttp.Do(c.ctx_, c.s.client, req)
  6972. }
  6973. return c.s.client.Do(req)
  6974. }
  6975. // Do executes the "content.datafeeds.get" call.
  6976. // Exactly one of *Datafeed or error will be non-nil. Any non-2xx status
  6977. // code is an error. Response headers are in either
  6978. // *Datafeed.ServerResponse.Header or (if a response was returned at
  6979. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  6980. // to check whether the returned error was because
  6981. // http.StatusNotModified was returned.
  6982. func (c *DatafeedsGetCall) Do(opts ...googleapi.CallOption) (*Datafeed, error) {
  6983. gensupport.SetOptions(c.urlParams_, opts...)
  6984. res, err := c.doRequest("json")
  6985. if res != nil && res.StatusCode == http.StatusNotModified {
  6986. if res.Body != nil {
  6987. res.Body.Close()
  6988. }
  6989. return nil, &googleapi.Error{
  6990. Code: res.StatusCode,
  6991. Header: res.Header,
  6992. }
  6993. }
  6994. if err != nil {
  6995. return nil, err
  6996. }
  6997. defer googleapi.CloseBody(res)
  6998. if err := googleapi.CheckResponse(res); err != nil {
  6999. return nil, err
  7000. }
  7001. ret := &Datafeed{
  7002. ServerResponse: googleapi.ServerResponse{
  7003. Header: res.Header,
  7004. HTTPStatusCode: res.StatusCode,
  7005. },
  7006. }
  7007. if err := json.NewDecoder(res.Body).Decode(&ret); err != nil {
  7008. return nil, err
  7009. }
  7010. return ret, nil
  7011. // {
  7012. // "description": "Retrieves a datafeed from your Merchant Center account.",
  7013. // "httpMethod": "GET",
  7014. // "id": "content.datafeeds.get",
  7015. // "parameterOrder": [
  7016. // "merchantId",
  7017. // "datafeedId"
  7018. // ],
  7019. // "parameters": {
  7020. // "datafeedId": {
  7021. // "format": "uint64",
  7022. // "location": "path",
  7023. // "required": true,
  7024. // "type": "string"
  7025. // },
  7026. // "merchantId": {
  7027. // "format": "uint64",
  7028. // "location": "path",
  7029. // "required": true,
  7030. // "type": "string"
  7031. // }
  7032. // },
  7033. // "path": "{merchantId}/datafeeds/{datafeedId}",
  7034. // "response": {
  7035. // "$ref": "Datafeed"
  7036. // },
  7037. // "scopes": [
  7038. // "https://www.googleapis.com/auth/content"
  7039. // ]
  7040. // }
  7041. }
  7042. // method id "content.datafeeds.insert":
  7043. type DatafeedsInsertCall struct {
  7044. s *Service
  7045. merchantId uint64
  7046. datafeed *Datafeed
  7047. urlParams_ gensupport.URLParams
  7048. ctx_ context.Context
  7049. }
  7050. // Insert: Registers a datafeed with your Merchant Center account.
  7051. func (r *DatafeedsService) Insert(merchantId uint64, datafeed *Datafeed) *DatafeedsInsertCall {
  7052. c := &DatafeedsInsertCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  7053. c.merchantId = merchantId
  7054. c.datafeed = datafeed
  7055. return c
  7056. }
  7057. // DryRun sets the optional parameter "dryRun": Flag to run the request
  7058. // in dry-run mode.
  7059. func (c *DatafeedsInsertCall) DryRun(dryRun bool) *DatafeedsInsertCall {
  7060. c.urlParams_.Set("dryRun", fmt.Sprint(dryRun))
  7061. return c
  7062. }
  7063. // Fields allows partial responses to be retrieved. See
  7064. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  7065. // for more information.
  7066. func (c *DatafeedsInsertCall) Fields(s ...googleapi.Field) *DatafeedsInsertCall {
  7067. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  7068. return c
  7069. }
  7070. // Context sets the context to be used in this call's Do method. Any
  7071. // pending HTTP request will be aborted if the provided context is
  7072. // canceled.
  7073. func (c *DatafeedsInsertCall) Context(ctx context.Context) *DatafeedsInsertCall {
  7074. c.ctx_ = ctx
  7075. return c
  7076. }
  7077. func (c *DatafeedsInsertCall) doRequest(alt string) (*http.Response, error) {
  7078. var body io.Reader = nil
  7079. body, err := googleapi.WithoutDataWrapper.JSONReader(c.datafeed)
  7080. if err != nil {
  7081. return nil, err
  7082. }
  7083. ctype := "application/json"
  7084. c.urlParams_.Set("alt", alt)
  7085. urls := googleapi.ResolveRelative(c.s.BasePath, "{merchantId}/datafeeds")
  7086. urls += "?" + c.urlParams_.Encode()
  7087. req, _ := http.NewRequest("POST", urls, body)
  7088. googleapi.Expand(req.URL, map[string]string{
  7089. "merchantId": strconv.FormatUint(c.merchantId, 10),
  7090. })
  7091. req.Header.Set("Content-Type", ctype)
  7092. req.Header.Set("User-Agent", c.s.userAgent())
  7093. if c.ctx_ != nil {
  7094. return ctxhttp.Do(c.ctx_, c.s.client, req)
  7095. }
  7096. return c.s.client.Do(req)
  7097. }
  7098. // Do executes the "content.datafeeds.insert" call.
  7099. // Exactly one of *Datafeed or error will be non-nil. Any non-2xx status
  7100. // code is an error. Response headers are in either
  7101. // *Datafeed.ServerResponse.Header or (if a response was returned at
  7102. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  7103. // to check whether the returned error was because
  7104. // http.StatusNotModified was returned.
  7105. func (c *DatafeedsInsertCall) Do(opts ...googleapi.CallOption) (*Datafeed, error) {
  7106. gensupport.SetOptions(c.urlParams_, opts...)
  7107. res, err := c.doRequest("json")
  7108. if res != nil && res.StatusCode == http.StatusNotModified {
  7109. if res.Body != nil {
  7110. res.Body.Close()
  7111. }
  7112. return nil, &googleapi.Error{
  7113. Code: res.StatusCode,
  7114. Header: res.Header,
  7115. }
  7116. }
  7117. if err != nil {
  7118. return nil, err
  7119. }
  7120. defer googleapi.CloseBody(res)
  7121. if err := googleapi.CheckResponse(res); err != nil {
  7122. return nil, err
  7123. }
  7124. ret := &Datafeed{
  7125. ServerResponse: googleapi.ServerResponse{
  7126. Header: res.Header,
  7127. HTTPStatusCode: res.StatusCode,
  7128. },
  7129. }
  7130. if err := json.NewDecoder(res.Body).Decode(&ret); err != nil {
  7131. return nil, err
  7132. }
  7133. return ret, nil
  7134. // {
  7135. // "description": "Registers a datafeed with your Merchant Center account.",
  7136. // "httpMethod": "POST",
  7137. // "id": "content.datafeeds.insert",
  7138. // "parameterOrder": [
  7139. // "merchantId"
  7140. // ],
  7141. // "parameters": {
  7142. // "dryRun": {
  7143. // "description": "Flag to run the request in dry-run mode.",
  7144. // "location": "query",
  7145. // "type": "boolean"
  7146. // },
  7147. // "merchantId": {
  7148. // "format": "uint64",
  7149. // "location": "path",
  7150. // "required": true,
  7151. // "type": "string"
  7152. // }
  7153. // },
  7154. // "path": "{merchantId}/datafeeds",
  7155. // "request": {
  7156. // "$ref": "Datafeed"
  7157. // },
  7158. // "response": {
  7159. // "$ref": "Datafeed"
  7160. // },
  7161. // "scopes": [
  7162. // "https://www.googleapis.com/auth/content"
  7163. // ]
  7164. // }
  7165. }
  7166. // method id "content.datafeeds.list":
  7167. type DatafeedsListCall struct {
  7168. s *Service
  7169. merchantId uint64
  7170. urlParams_ gensupport.URLParams
  7171. ifNoneMatch_ string
  7172. ctx_ context.Context
  7173. }
  7174. // List: Lists the datafeeds in your Merchant Center account.
  7175. func (r *DatafeedsService) List(merchantId uint64) *DatafeedsListCall {
  7176. c := &DatafeedsListCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  7177. c.merchantId = merchantId
  7178. return c
  7179. }
  7180. // MaxResults sets the optional parameter "maxResults": The maximum
  7181. // number of products to return in the response, used for paging.
  7182. func (c *DatafeedsListCall) MaxResults(maxResults int64) *DatafeedsListCall {
  7183. c.urlParams_.Set("maxResults", fmt.Sprint(maxResults))
  7184. return c
  7185. }
  7186. // PageToken sets the optional parameter "pageToken": The token returned
  7187. // by the previous request.
  7188. func (c *DatafeedsListCall) PageToken(pageToken string) *DatafeedsListCall {
  7189. c.urlParams_.Set("pageToken", pageToken)
  7190. return c
  7191. }
  7192. // Fields allows partial responses to be retrieved. See
  7193. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  7194. // for more information.
  7195. func (c *DatafeedsListCall) Fields(s ...googleapi.Field) *DatafeedsListCall {
  7196. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  7197. return c
  7198. }
  7199. // IfNoneMatch sets the optional parameter which makes the operation
  7200. // fail if the object's ETag matches the given value. This is useful for
  7201. // getting updates only after the object has changed since the last
  7202. // request. Use googleapi.IsNotModified to check whether the response
  7203. // error from Do is the result of In-None-Match.
  7204. func (c *DatafeedsListCall) IfNoneMatch(entityTag string) *DatafeedsListCall {
  7205. c.ifNoneMatch_ = entityTag
  7206. return c
  7207. }
  7208. // Context sets the context to be used in this call's Do method. Any
  7209. // pending HTTP request will be aborted if the provided context is
  7210. // canceled.
  7211. func (c *DatafeedsListCall) Context(ctx context.Context) *DatafeedsListCall {
  7212. c.ctx_ = ctx
  7213. return c
  7214. }
  7215. func (c *DatafeedsListCall) doRequest(alt string) (*http.Response, error) {
  7216. var body io.Reader = nil
  7217. c.urlParams_.Set("alt", alt)
  7218. urls := googleapi.ResolveRelative(c.s.BasePath, "{merchantId}/datafeeds")
  7219. urls += "?" + c.urlParams_.Encode()
  7220. req, _ := http.NewRequest("GET", urls, body)
  7221. googleapi.Expand(req.URL, map[string]string{
  7222. "merchantId": strconv.FormatUint(c.merchantId, 10),
  7223. })
  7224. req.Header.Set("User-Agent", c.s.userAgent())
  7225. if c.ifNoneMatch_ != "" {
  7226. req.Header.Set("If-None-Match", c.ifNoneMatch_)
  7227. }
  7228. if c.ctx_ != nil {
  7229. return ctxhttp.Do(c.ctx_, c.s.client, req)
  7230. }
  7231. return c.s.client.Do(req)
  7232. }
  7233. // Do executes the "content.datafeeds.list" call.
  7234. // Exactly one of *DatafeedsListResponse or error will be non-nil. Any
  7235. // non-2xx status code is an error. Response headers are in either
  7236. // *DatafeedsListResponse.ServerResponse.Header or (if a response was
  7237. // returned at all) in error.(*googleapi.Error).Header. Use
  7238. // googleapi.IsNotModified to check whether the returned error was
  7239. // because http.StatusNotModified was returned.
  7240. func (c *DatafeedsListCall) Do(opts ...googleapi.CallOption) (*DatafeedsListResponse, error) {
  7241. gensupport.SetOptions(c.urlParams_, opts...)
  7242. res, err := c.doRequest("json")
  7243. if res != nil && res.StatusCode == http.StatusNotModified {
  7244. if res.Body != nil {
  7245. res.Body.Close()
  7246. }
  7247. return nil, &googleapi.Error{
  7248. Code: res.StatusCode,
  7249. Header: res.Header,
  7250. }
  7251. }
  7252. if err != nil {
  7253. return nil, err
  7254. }
  7255. defer googleapi.CloseBody(res)
  7256. if err := googleapi.CheckResponse(res); err != nil {
  7257. return nil, err
  7258. }
  7259. ret := &DatafeedsListResponse{
  7260. ServerResponse: googleapi.ServerResponse{
  7261. Header: res.Header,
  7262. HTTPStatusCode: res.StatusCode,
  7263. },
  7264. }
  7265. if err := json.NewDecoder(res.Body).Decode(&ret); err != nil {
  7266. return nil, err
  7267. }
  7268. return ret, nil
  7269. // {
  7270. // "description": "Lists the datafeeds in your Merchant Center account.",
  7271. // "httpMethod": "GET",
  7272. // "id": "content.datafeeds.list",
  7273. // "parameterOrder": [
  7274. // "merchantId"
  7275. // ],
  7276. // "parameters": {
  7277. // "maxResults": {
  7278. // "description": "The maximum number of products to return in the response, used for paging.",
  7279. // "format": "uint32",
  7280. // "location": "query",
  7281. // "type": "integer"
  7282. // },
  7283. // "merchantId": {
  7284. // "description": "The ID of the managing account.",
  7285. // "format": "uint64",
  7286. // "location": "path",
  7287. // "required": true,
  7288. // "type": "string"
  7289. // },
  7290. // "pageToken": {
  7291. // "description": "The token returned by the previous request.",
  7292. // "location": "query",
  7293. // "type": "string"
  7294. // }
  7295. // },
  7296. // "path": "{merchantId}/datafeeds",
  7297. // "response": {
  7298. // "$ref": "DatafeedsListResponse"
  7299. // },
  7300. // "scopes": [
  7301. // "https://www.googleapis.com/auth/content"
  7302. // ]
  7303. // }
  7304. }
  7305. // Pages invokes f for each page of results.
  7306. // A non-nil error returned from f will halt the iteration.
  7307. // The provided context supersedes any context provided to the Context method.
  7308. func (c *DatafeedsListCall) Pages(ctx context.Context, f func(*DatafeedsListResponse) error) error {
  7309. c.ctx_ = ctx
  7310. defer c.PageToken(c.urlParams_.Get("pageToken")) // reset paging to original point
  7311. for {
  7312. x, err := c.Do()
  7313. if err != nil {
  7314. return err
  7315. }
  7316. if err := f(x); err != nil {
  7317. return err
  7318. }
  7319. if x.NextPageToken == "" {
  7320. return nil
  7321. }
  7322. c.PageToken(x.NextPageToken)
  7323. }
  7324. }
  7325. // method id "content.datafeeds.patch":
  7326. type DatafeedsPatchCall struct {
  7327. s *Service
  7328. merchantId uint64
  7329. datafeedId uint64
  7330. datafeed *Datafeed
  7331. urlParams_ gensupport.URLParams
  7332. ctx_ context.Context
  7333. }
  7334. // Patch: Updates a datafeed of your Merchant Center account. This
  7335. // method supports patch semantics.
  7336. func (r *DatafeedsService) Patch(merchantId uint64, datafeedId uint64, datafeed *Datafeed) *DatafeedsPatchCall {
  7337. c := &DatafeedsPatchCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  7338. c.merchantId = merchantId
  7339. c.datafeedId = datafeedId
  7340. c.datafeed = datafeed
  7341. return c
  7342. }
  7343. // DryRun sets the optional parameter "dryRun": Flag to run the request
  7344. // in dry-run mode.
  7345. func (c *DatafeedsPatchCall) DryRun(dryRun bool) *DatafeedsPatchCall {
  7346. c.urlParams_.Set("dryRun", fmt.Sprint(dryRun))
  7347. return c
  7348. }
  7349. // Fields allows partial responses to be retrieved. See
  7350. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  7351. // for more information.
  7352. func (c *DatafeedsPatchCall) Fields(s ...googleapi.Field) *DatafeedsPatchCall {
  7353. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  7354. return c
  7355. }
  7356. // Context sets the context to be used in this call's Do method. Any
  7357. // pending HTTP request will be aborted if the provided context is
  7358. // canceled.
  7359. func (c *DatafeedsPatchCall) Context(ctx context.Context) *DatafeedsPatchCall {
  7360. c.ctx_ = ctx
  7361. return c
  7362. }
  7363. func (c *DatafeedsPatchCall) doRequest(alt string) (*http.Response, error) {
  7364. var body io.Reader = nil
  7365. body, err := googleapi.WithoutDataWrapper.JSONReader(c.datafeed)
  7366. if err != nil {
  7367. return nil, err
  7368. }
  7369. ctype := "application/json"
  7370. c.urlParams_.Set("alt", alt)
  7371. urls := googleapi.ResolveRelative(c.s.BasePath, "{merchantId}/datafeeds/{datafeedId}")
  7372. urls += "?" + c.urlParams_.Encode()
  7373. req, _ := http.NewRequest("PATCH", urls, body)
  7374. googleapi.Expand(req.URL, map[string]string{
  7375. "merchantId": strconv.FormatUint(c.merchantId, 10),
  7376. "datafeedId": strconv.FormatUint(c.datafeedId, 10),
  7377. })
  7378. req.Header.Set("Content-Type", ctype)
  7379. req.Header.Set("User-Agent", c.s.userAgent())
  7380. if c.ctx_ != nil {
  7381. return ctxhttp.Do(c.ctx_, c.s.client, req)
  7382. }
  7383. return c.s.client.Do(req)
  7384. }
  7385. // Do executes the "content.datafeeds.patch" call.
  7386. // Exactly one of *Datafeed or error will be non-nil. Any non-2xx status
  7387. // code is an error. Response headers are in either
  7388. // *Datafeed.ServerResponse.Header or (if a response was returned at
  7389. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  7390. // to check whether the returned error was because
  7391. // http.StatusNotModified was returned.
  7392. func (c *DatafeedsPatchCall) Do(opts ...googleapi.CallOption) (*Datafeed, error) {
  7393. gensupport.SetOptions(c.urlParams_, opts...)
  7394. res, err := c.doRequest("json")
  7395. if res != nil && res.StatusCode == http.StatusNotModified {
  7396. if res.Body != nil {
  7397. res.Body.Close()
  7398. }
  7399. return nil, &googleapi.Error{
  7400. Code: res.StatusCode,
  7401. Header: res.Header,
  7402. }
  7403. }
  7404. if err != nil {
  7405. return nil, err
  7406. }
  7407. defer googleapi.CloseBody(res)
  7408. if err := googleapi.CheckResponse(res); err != nil {
  7409. return nil, err
  7410. }
  7411. ret := &Datafeed{
  7412. ServerResponse: googleapi.ServerResponse{
  7413. Header: res.Header,
  7414. HTTPStatusCode: res.StatusCode,
  7415. },
  7416. }
  7417. if err := json.NewDecoder(res.Body).Decode(&ret); err != nil {
  7418. return nil, err
  7419. }
  7420. return ret, nil
  7421. // {
  7422. // "description": "Updates a datafeed of your Merchant Center account. This method supports patch semantics.",
  7423. // "httpMethod": "PATCH",
  7424. // "id": "content.datafeeds.patch",
  7425. // "parameterOrder": [
  7426. // "merchantId",
  7427. // "datafeedId"
  7428. // ],
  7429. // "parameters": {
  7430. // "datafeedId": {
  7431. // "format": "uint64",
  7432. // "location": "path",
  7433. // "required": true,
  7434. // "type": "string"
  7435. // },
  7436. // "dryRun": {
  7437. // "description": "Flag to run the request in dry-run mode.",
  7438. // "location": "query",
  7439. // "type": "boolean"
  7440. // },
  7441. // "merchantId": {
  7442. // "format": "uint64",
  7443. // "location": "path",
  7444. // "required": true,
  7445. // "type": "string"
  7446. // }
  7447. // },
  7448. // "path": "{merchantId}/datafeeds/{datafeedId}",
  7449. // "request": {
  7450. // "$ref": "Datafeed"
  7451. // },
  7452. // "response": {
  7453. // "$ref": "Datafeed"
  7454. // },
  7455. // "scopes": [
  7456. // "https://www.googleapis.com/auth/content"
  7457. // ]
  7458. // }
  7459. }
  7460. // method id "content.datafeeds.update":
  7461. type DatafeedsUpdateCall struct {
  7462. s *Service
  7463. merchantId uint64
  7464. datafeedId uint64
  7465. datafeed *Datafeed
  7466. urlParams_ gensupport.URLParams
  7467. ctx_ context.Context
  7468. }
  7469. // Update: Updates a datafeed of your Merchant Center account.
  7470. func (r *DatafeedsService) Update(merchantId uint64, datafeedId uint64, datafeed *Datafeed) *DatafeedsUpdateCall {
  7471. c := &DatafeedsUpdateCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  7472. c.merchantId = merchantId
  7473. c.datafeedId = datafeedId
  7474. c.datafeed = datafeed
  7475. return c
  7476. }
  7477. // DryRun sets the optional parameter "dryRun": Flag to run the request
  7478. // in dry-run mode.
  7479. func (c *DatafeedsUpdateCall) DryRun(dryRun bool) *DatafeedsUpdateCall {
  7480. c.urlParams_.Set("dryRun", fmt.Sprint(dryRun))
  7481. return c
  7482. }
  7483. // Fields allows partial responses to be retrieved. See
  7484. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  7485. // for more information.
  7486. func (c *DatafeedsUpdateCall) Fields(s ...googleapi.Field) *DatafeedsUpdateCall {
  7487. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  7488. return c
  7489. }
  7490. // Context sets the context to be used in this call's Do method. Any
  7491. // pending HTTP request will be aborted if the provided context is
  7492. // canceled.
  7493. func (c *DatafeedsUpdateCall) Context(ctx context.Context) *DatafeedsUpdateCall {
  7494. c.ctx_ = ctx
  7495. return c
  7496. }
  7497. func (c *DatafeedsUpdateCall) doRequest(alt string) (*http.Response, error) {
  7498. var body io.Reader = nil
  7499. body, err := googleapi.WithoutDataWrapper.JSONReader(c.datafeed)
  7500. if err != nil {
  7501. return nil, err
  7502. }
  7503. ctype := "application/json"
  7504. c.urlParams_.Set("alt", alt)
  7505. urls := googleapi.ResolveRelative(c.s.BasePath, "{merchantId}/datafeeds/{datafeedId}")
  7506. urls += "?" + c.urlParams_.Encode()
  7507. req, _ := http.NewRequest("PUT", urls, body)
  7508. googleapi.Expand(req.URL, map[string]string{
  7509. "merchantId": strconv.FormatUint(c.merchantId, 10),
  7510. "datafeedId": strconv.FormatUint(c.datafeedId, 10),
  7511. })
  7512. req.Header.Set("Content-Type", ctype)
  7513. req.Header.Set("User-Agent", c.s.userAgent())
  7514. if c.ctx_ != nil {
  7515. return ctxhttp.Do(c.ctx_, c.s.client, req)
  7516. }
  7517. return c.s.client.Do(req)
  7518. }
  7519. // Do executes the "content.datafeeds.update" call.
  7520. // Exactly one of *Datafeed or error will be non-nil. Any non-2xx status
  7521. // code is an error. Response headers are in either
  7522. // *Datafeed.ServerResponse.Header or (if a response was returned at
  7523. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  7524. // to check whether the returned error was because
  7525. // http.StatusNotModified was returned.
  7526. func (c *DatafeedsUpdateCall) Do(opts ...googleapi.CallOption) (*Datafeed, error) {
  7527. gensupport.SetOptions(c.urlParams_, opts...)
  7528. res, err := c.doRequest("json")
  7529. if res != nil && res.StatusCode == http.StatusNotModified {
  7530. if res.Body != nil {
  7531. res.Body.Close()
  7532. }
  7533. return nil, &googleapi.Error{
  7534. Code: res.StatusCode,
  7535. Header: res.Header,
  7536. }
  7537. }
  7538. if err != nil {
  7539. return nil, err
  7540. }
  7541. defer googleapi.CloseBody(res)
  7542. if err := googleapi.CheckResponse(res); err != nil {
  7543. return nil, err
  7544. }
  7545. ret := &Datafeed{
  7546. ServerResponse: googleapi.ServerResponse{
  7547. Header: res.Header,
  7548. HTTPStatusCode: res.StatusCode,
  7549. },
  7550. }
  7551. if err := json.NewDecoder(res.Body).Decode(&ret); err != nil {
  7552. return nil, err
  7553. }
  7554. return ret, nil
  7555. // {
  7556. // "description": "Updates a datafeed of your Merchant Center account.",
  7557. // "httpMethod": "PUT",
  7558. // "id": "content.datafeeds.update",
  7559. // "parameterOrder": [
  7560. // "merchantId",
  7561. // "datafeedId"
  7562. // ],
  7563. // "parameters": {
  7564. // "datafeedId": {
  7565. // "format": "uint64",
  7566. // "location": "path",
  7567. // "required": true,
  7568. // "type": "string"
  7569. // },
  7570. // "dryRun": {
  7571. // "description": "Flag to run the request in dry-run mode.",
  7572. // "location": "query",
  7573. // "type": "boolean"
  7574. // },
  7575. // "merchantId": {
  7576. // "format": "uint64",
  7577. // "location": "path",
  7578. // "required": true,
  7579. // "type": "string"
  7580. // }
  7581. // },
  7582. // "path": "{merchantId}/datafeeds/{datafeedId}",
  7583. // "request": {
  7584. // "$ref": "Datafeed"
  7585. // },
  7586. // "response": {
  7587. // "$ref": "Datafeed"
  7588. // },
  7589. // "scopes": [
  7590. // "https://www.googleapis.com/auth/content"
  7591. // ]
  7592. // }
  7593. }
  7594. // method id "content.datafeedstatuses.custombatch":
  7595. type DatafeedstatusesCustombatchCall struct {
  7596. s *Service
  7597. datafeedstatusescustombatchrequest *DatafeedstatusesCustomBatchRequest
  7598. urlParams_ gensupport.URLParams
  7599. ctx_ context.Context
  7600. }
  7601. // Custombatch:
  7602. func (r *DatafeedstatusesService) Custombatch(datafeedstatusescustombatchrequest *DatafeedstatusesCustomBatchRequest) *DatafeedstatusesCustombatchCall {
  7603. c := &DatafeedstatusesCustombatchCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  7604. c.datafeedstatusescustombatchrequest = datafeedstatusescustombatchrequest
  7605. return c
  7606. }
  7607. // Fields allows partial responses to be retrieved. See
  7608. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  7609. // for more information.
  7610. func (c *DatafeedstatusesCustombatchCall) Fields(s ...googleapi.Field) *DatafeedstatusesCustombatchCall {
  7611. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  7612. return c
  7613. }
  7614. // Context sets the context to be used in this call's Do method. Any
  7615. // pending HTTP request will be aborted if the provided context is
  7616. // canceled.
  7617. func (c *DatafeedstatusesCustombatchCall) Context(ctx context.Context) *DatafeedstatusesCustombatchCall {
  7618. c.ctx_ = ctx
  7619. return c
  7620. }
  7621. func (c *DatafeedstatusesCustombatchCall) doRequest(alt string) (*http.Response, error) {
  7622. var body io.Reader = nil
  7623. body, err := googleapi.WithoutDataWrapper.JSONReader(c.datafeedstatusescustombatchrequest)
  7624. if err != nil {
  7625. return nil, err
  7626. }
  7627. ctype := "application/json"
  7628. c.urlParams_.Set("alt", alt)
  7629. urls := googleapi.ResolveRelative(c.s.BasePath, "datafeedstatuses/batch")
  7630. urls += "?" + c.urlParams_.Encode()
  7631. req, _ := http.NewRequest("POST", urls, body)
  7632. googleapi.SetOpaque(req.URL)
  7633. req.Header.Set("Content-Type", ctype)
  7634. req.Header.Set("User-Agent", c.s.userAgent())
  7635. if c.ctx_ != nil {
  7636. return ctxhttp.Do(c.ctx_, c.s.client, req)
  7637. }
  7638. return c.s.client.Do(req)
  7639. }
  7640. // Do executes the "content.datafeedstatuses.custombatch" call.
  7641. // Exactly one of *DatafeedstatusesCustomBatchResponse or error will be
  7642. // non-nil. Any non-2xx status code is an error. Response headers are in
  7643. // either *DatafeedstatusesCustomBatchResponse.ServerResponse.Header or
  7644. // (if a response was returned at all) in
  7645. // error.(*googleapi.Error).Header. Use googleapi.IsNotModified to check
  7646. // whether the returned error was because http.StatusNotModified was
  7647. // returned.
  7648. func (c *DatafeedstatusesCustombatchCall) Do(opts ...googleapi.CallOption) (*DatafeedstatusesCustomBatchResponse, error) {
  7649. gensupport.SetOptions(c.urlParams_, opts...)
  7650. res, err := c.doRequest("json")
  7651. if res != nil && res.StatusCode == http.StatusNotModified {
  7652. if res.Body != nil {
  7653. res.Body.Close()
  7654. }
  7655. return nil, &googleapi.Error{
  7656. Code: res.StatusCode,
  7657. Header: res.Header,
  7658. }
  7659. }
  7660. if err != nil {
  7661. return nil, err
  7662. }
  7663. defer googleapi.CloseBody(res)
  7664. if err := googleapi.CheckResponse(res); err != nil {
  7665. return nil, err
  7666. }
  7667. ret := &DatafeedstatusesCustomBatchResponse{
  7668. ServerResponse: googleapi.ServerResponse{
  7669. Header: res.Header,
  7670. HTTPStatusCode: res.StatusCode,
  7671. },
  7672. }
  7673. if err := json.NewDecoder(res.Body).Decode(&ret); err != nil {
  7674. return nil, err
  7675. }
  7676. return ret, nil
  7677. // {
  7678. // "httpMethod": "POST",
  7679. // "id": "content.datafeedstatuses.custombatch",
  7680. // "path": "datafeedstatuses/batch",
  7681. // "request": {
  7682. // "$ref": "DatafeedstatusesCustomBatchRequest"
  7683. // },
  7684. // "response": {
  7685. // "$ref": "DatafeedstatusesCustomBatchResponse"
  7686. // },
  7687. // "scopes": [
  7688. // "https://www.googleapis.com/auth/content"
  7689. // ]
  7690. // }
  7691. }
  7692. // method id "content.datafeedstatuses.get":
  7693. type DatafeedstatusesGetCall struct {
  7694. s *Service
  7695. merchantId uint64
  7696. datafeedId uint64
  7697. urlParams_ gensupport.URLParams
  7698. ifNoneMatch_ string
  7699. ctx_ context.Context
  7700. }
  7701. // Get: Retrieves the status of a datafeed from your Merchant Center
  7702. // account.
  7703. func (r *DatafeedstatusesService) Get(merchantId uint64, datafeedId uint64) *DatafeedstatusesGetCall {
  7704. c := &DatafeedstatusesGetCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  7705. c.merchantId = merchantId
  7706. c.datafeedId = datafeedId
  7707. return c
  7708. }
  7709. // Fields allows partial responses to be retrieved. See
  7710. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  7711. // for more information.
  7712. func (c *DatafeedstatusesGetCall) Fields(s ...googleapi.Field) *DatafeedstatusesGetCall {
  7713. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  7714. return c
  7715. }
  7716. // IfNoneMatch sets the optional parameter which makes the operation
  7717. // fail if the object's ETag matches the given value. This is useful for
  7718. // getting updates only after the object has changed since the last
  7719. // request. Use googleapi.IsNotModified to check whether the response
  7720. // error from Do is the result of In-None-Match.
  7721. func (c *DatafeedstatusesGetCall) IfNoneMatch(entityTag string) *DatafeedstatusesGetCall {
  7722. c.ifNoneMatch_ = entityTag
  7723. return c
  7724. }
  7725. // Context sets the context to be used in this call's Do method. Any
  7726. // pending HTTP request will be aborted if the provided context is
  7727. // canceled.
  7728. func (c *DatafeedstatusesGetCall) Context(ctx context.Context) *DatafeedstatusesGetCall {
  7729. c.ctx_ = ctx
  7730. return c
  7731. }
  7732. func (c *DatafeedstatusesGetCall) doRequest(alt string) (*http.Response, error) {
  7733. var body io.Reader = nil
  7734. c.urlParams_.Set("alt", alt)
  7735. urls := googleapi.ResolveRelative(c.s.BasePath, "{merchantId}/datafeedstatuses/{datafeedId}")
  7736. urls += "?" + c.urlParams_.Encode()
  7737. req, _ := http.NewRequest("GET", urls, body)
  7738. googleapi.Expand(req.URL, map[string]string{
  7739. "merchantId": strconv.FormatUint(c.merchantId, 10),
  7740. "datafeedId": strconv.FormatUint(c.datafeedId, 10),
  7741. })
  7742. req.Header.Set("User-Agent", c.s.userAgent())
  7743. if c.ifNoneMatch_ != "" {
  7744. req.Header.Set("If-None-Match", c.ifNoneMatch_)
  7745. }
  7746. if c.ctx_ != nil {
  7747. return ctxhttp.Do(c.ctx_, c.s.client, req)
  7748. }
  7749. return c.s.client.Do(req)
  7750. }
  7751. // Do executes the "content.datafeedstatuses.get" call.
  7752. // Exactly one of *DatafeedStatus or error will be non-nil. Any non-2xx
  7753. // status code is an error. Response headers are in either
  7754. // *DatafeedStatus.ServerResponse.Header or (if a response was returned
  7755. // at all) in error.(*googleapi.Error).Header. Use
  7756. // googleapi.IsNotModified to check whether the returned error was
  7757. // because http.StatusNotModified was returned.
  7758. func (c *DatafeedstatusesGetCall) Do(opts ...googleapi.CallOption) (*DatafeedStatus, error) {
  7759. gensupport.SetOptions(c.urlParams_, opts...)
  7760. res, err := c.doRequest("json")
  7761. if res != nil && res.StatusCode == http.StatusNotModified {
  7762. if res.Body != nil {
  7763. res.Body.Close()
  7764. }
  7765. return nil, &googleapi.Error{
  7766. Code: res.StatusCode,
  7767. Header: res.Header,
  7768. }
  7769. }
  7770. if err != nil {
  7771. return nil, err
  7772. }
  7773. defer googleapi.CloseBody(res)
  7774. if err := googleapi.CheckResponse(res); err != nil {
  7775. return nil, err
  7776. }
  7777. ret := &DatafeedStatus{
  7778. ServerResponse: googleapi.ServerResponse{
  7779. Header: res.Header,
  7780. HTTPStatusCode: res.StatusCode,
  7781. },
  7782. }
  7783. if err := json.NewDecoder(res.Body).Decode(&ret); err != nil {
  7784. return nil, err
  7785. }
  7786. return ret, nil
  7787. // {
  7788. // "description": "Retrieves the status of a datafeed from your Merchant Center account.",
  7789. // "httpMethod": "GET",
  7790. // "id": "content.datafeedstatuses.get",
  7791. // "parameterOrder": [
  7792. // "merchantId",
  7793. // "datafeedId"
  7794. // ],
  7795. // "parameters": {
  7796. // "datafeedId": {
  7797. // "format": "uint64",
  7798. // "location": "path",
  7799. // "required": true,
  7800. // "type": "string"
  7801. // },
  7802. // "merchantId": {
  7803. // "format": "uint64",
  7804. // "location": "path",
  7805. // "required": true,
  7806. // "type": "string"
  7807. // }
  7808. // },
  7809. // "path": "{merchantId}/datafeedstatuses/{datafeedId}",
  7810. // "response": {
  7811. // "$ref": "DatafeedStatus"
  7812. // },
  7813. // "scopes": [
  7814. // "https://www.googleapis.com/auth/content"
  7815. // ]
  7816. // }
  7817. }
  7818. // method id "content.datafeedstatuses.list":
  7819. type DatafeedstatusesListCall struct {
  7820. s *Service
  7821. merchantId uint64
  7822. urlParams_ gensupport.URLParams
  7823. ifNoneMatch_ string
  7824. ctx_ context.Context
  7825. }
  7826. // List: Lists the statuses of the datafeeds in your Merchant Center
  7827. // account.
  7828. func (r *DatafeedstatusesService) List(merchantId uint64) *DatafeedstatusesListCall {
  7829. c := &DatafeedstatusesListCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  7830. c.merchantId = merchantId
  7831. return c
  7832. }
  7833. // MaxResults sets the optional parameter "maxResults": The maximum
  7834. // number of products to return in the response, used for paging.
  7835. func (c *DatafeedstatusesListCall) MaxResults(maxResults int64) *DatafeedstatusesListCall {
  7836. c.urlParams_.Set("maxResults", fmt.Sprint(maxResults))
  7837. return c
  7838. }
  7839. // PageToken sets the optional parameter "pageToken": The token returned
  7840. // by the previous request.
  7841. func (c *DatafeedstatusesListCall) PageToken(pageToken string) *DatafeedstatusesListCall {
  7842. c.urlParams_.Set("pageToken", pageToken)
  7843. return c
  7844. }
  7845. // Fields allows partial responses to be retrieved. See
  7846. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  7847. // for more information.
  7848. func (c *DatafeedstatusesListCall) Fields(s ...googleapi.Field) *DatafeedstatusesListCall {
  7849. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  7850. return c
  7851. }
  7852. // IfNoneMatch sets the optional parameter which makes the operation
  7853. // fail if the object's ETag matches the given value. This is useful for
  7854. // getting updates only after the object has changed since the last
  7855. // request. Use googleapi.IsNotModified to check whether the response
  7856. // error from Do is the result of In-None-Match.
  7857. func (c *DatafeedstatusesListCall) IfNoneMatch(entityTag string) *DatafeedstatusesListCall {
  7858. c.ifNoneMatch_ = entityTag
  7859. return c
  7860. }
  7861. // Context sets the context to be used in this call's Do method. Any
  7862. // pending HTTP request will be aborted if the provided context is
  7863. // canceled.
  7864. func (c *DatafeedstatusesListCall) Context(ctx context.Context) *DatafeedstatusesListCall {
  7865. c.ctx_ = ctx
  7866. return c
  7867. }
  7868. func (c *DatafeedstatusesListCall) doRequest(alt string) (*http.Response, error) {
  7869. var body io.Reader = nil
  7870. c.urlParams_.Set("alt", alt)
  7871. urls := googleapi.ResolveRelative(c.s.BasePath, "{merchantId}/datafeedstatuses")
  7872. urls += "?" + c.urlParams_.Encode()
  7873. req, _ := http.NewRequest("GET", urls, body)
  7874. googleapi.Expand(req.URL, map[string]string{
  7875. "merchantId": strconv.FormatUint(c.merchantId, 10),
  7876. })
  7877. req.Header.Set("User-Agent", c.s.userAgent())
  7878. if c.ifNoneMatch_ != "" {
  7879. req.Header.Set("If-None-Match", c.ifNoneMatch_)
  7880. }
  7881. if c.ctx_ != nil {
  7882. return ctxhttp.Do(c.ctx_, c.s.client, req)
  7883. }
  7884. return c.s.client.Do(req)
  7885. }
  7886. // Do executes the "content.datafeedstatuses.list" call.
  7887. // Exactly one of *DatafeedstatusesListResponse or error will be
  7888. // non-nil. Any non-2xx status code is an error. Response headers are in
  7889. // either *DatafeedstatusesListResponse.ServerResponse.Header or (if a
  7890. // response was returned at all) in error.(*googleapi.Error).Header. Use
  7891. // googleapi.IsNotModified to check whether the returned error was
  7892. // because http.StatusNotModified was returned.
  7893. func (c *DatafeedstatusesListCall) Do(opts ...googleapi.CallOption) (*DatafeedstatusesListResponse, error) {
  7894. gensupport.SetOptions(c.urlParams_, opts...)
  7895. res, err := c.doRequest("json")
  7896. if res != nil && res.StatusCode == http.StatusNotModified {
  7897. if res.Body != nil {
  7898. res.Body.Close()
  7899. }
  7900. return nil, &googleapi.Error{
  7901. Code: res.StatusCode,
  7902. Header: res.Header,
  7903. }
  7904. }
  7905. if err != nil {
  7906. return nil, err
  7907. }
  7908. defer googleapi.CloseBody(res)
  7909. if err := googleapi.CheckResponse(res); err != nil {
  7910. return nil, err
  7911. }
  7912. ret := &DatafeedstatusesListResponse{
  7913. ServerResponse: googleapi.ServerResponse{
  7914. Header: res.Header,
  7915. HTTPStatusCode: res.StatusCode,
  7916. },
  7917. }
  7918. if err := json.NewDecoder(res.Body).Decode(&ret); err != nil {
  7919. return nil, err
  7920. }
  7921. return ret, nil
  7922. // {
  7923. // "description": "Lists the statuses of the datafeeds in your Merchant Center account.",
  7924. // "httpMethod": "GET",
  7925. // "id": "content.datafeedstatuses.list",
  7926. // "parameterOrder": [
  7927. // "merchantId"
  7928. // ],
  7929. // "parameters": {
  7930. // "maxResults": {
  7931. // "description": "The maximum number of products to return in the response, used for paging.",
  7932. // "format": "uint32",
  7933. // "location": "query",
  7934. // "type": "integer"
  7935. // },
  7936. // "merchantId": {
  7937. // "description": "The ID of the managing account.",
  7938. // "format": "uint64",
  7939. // "location": "path",
  7940. // "required": true,
  7941. // "type": "string"
  7942. // },
  7943. // "pageToken": {
  7944. // "description": "The token returned by the previous request.",
  7945. // "location": "query",
  7946. // "type": "string"
  7947. // }
  7948. // },
  7949. // "path": "{merchantId}/datafeedstatuses",
  7950. // "response": {
  7951. // "$ref": "DatafeedstatusesListResponse"
  7952. // },
  7953. // "scopes": [
  7954. // "https://www.googleapis.com/auth/content"
  7955. // ]
  7956. // }
  7957. }
  7958. // Pages invokes f for each page of results.
  7959. // A non-nil error returned from f will halt the iteration.
  7960. // The provided context supersedes any context provided to the Context method.
  7961. func (c *DatafeedstatusesListCall) Pages(ctx context.Context, f func(*DatafeedstatusesListResponse) error) error {
  7962. c.ctx_ = ctx
  7963. defer c.PageToken(c.urlParams_.Get("pageToken")) // reset paging to original point
  7964. for {
  7965. x, err := c.Do()
  7966. if err != nil {
  7967. return err
  7968. }
  7969. if err := f(x); err != nil {
  7970. return err
  7971. }
  7972. if x.NextPageToken == "" {
  7973. return nil
  7974. }
  7975. c.PageToken(x.NextPageToken)
  7976. }
  7977. }
  7978. // method id "content.inventory.custombatch":
  7979. type InventoryCustombatchCall struct {
  7980. s *Service
  7981. inventorycustombatchrequest *InventoryCustomBatchRequest
  7982. urlParams_ gensupport.URLParams
  7983. ctx_ context.Context
  7984. }
  7985. // Custombatch: Updates price and availability for multiple products or
  7986. // stores in a single request. This operation does not update the
  7987. // expiration date of the products.
  7988. func (r *InventoryService) Custombatch(inventorycustombatchrequest *InventoryCustomBatchRequest) *InventoryCustombatchCall {
  7989. c := &InventoryCustombatchCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  7990. c.inventorycustombatchrequest = inventorycustombatchrequest
  7991. return c
  7992. }
  7993. // DryRun sets the optional parameter "dryRun": Flag to run the request
  7994. // in dry-run mode.
  7995. func (c *InventoryCustombatchCall) DryRun(dryRun bool) *InventoryCustombatchCall {
  7996. c.urlParams_.Set("dryRun", fmt.Sprint(dryRun))
  7997. return c
  7998. }
  7999. // Fields allows partial responses to be retrieved. See
  8000. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  8001. // for more information.
  8002. func (c *InventoryCustombatchCall) Fields(s ...googleapi.Field) *InventoryCustombatchCall {
  8003. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  8004. return c
  8005. }
  8006. // Context sets the context to be used in this call's Do method. Any
  8007. // pending HTTP request will be aborted if the provided context is
  8008. // canceled.
  8009. func (c *InventoryCustombatchCall) Context(ctx context.Context) *InventoryCustombatchCall {
  8010. c.ctx_ = ctx
  8011. return c
  8012. }
  8013. func (c *InventoryCustombatchCall) doRequest(alt string) (*http.Response, error) {
  8014. var body io.Reader = nil
  8015. body, err := googleapi.WithoutDataWrapper.JSONReader(c.inventorycustombatchrequest)
  8016. if err != nil {
  8017. return nil, err
  8018. }
  8019. ctype := "application/json"
  8020. c.urlParams_.Set("alt", alt)
  8021. urls := googleapi.ResolveRelative(c.s.BasePath, "inventory/batch")
  8022. urls += "?" + c.urlParams_.Encode()
  8023. req, _ := http.NewRequest("POST", urls, body)
  8024. googleapi.SetOpaque(req.URL)
  8025. req.Header.Set("Content-Type", ctype)
  8026. req.Header.Set("User-Agent", c.s.userAgent())
  8027. if c.ctx_ != nil {
  8028. return ctxhttp.Do(c.ctx_, c.s.client, req)
  8029. }
  8030. return c.s.client.Do(req)
  8031. }
  8032. // Do executes the "content.inventory.custombatch" call.
  8033. // Exactly one of *InventoryCustomBatchResponse or error will be
  8034. // non-nil. Any non-2xx status code is an error. Response headers are in
  8035. // either *InventoryCustomBatchResponse.ServerResponse.Header or (if a
  8036. // response was returned at all) in error.(*googleapi.Error).Header. Use
  8037. // googleapi.IsNotModified to check whether the returned error was
  8038. // because http.StatusNotModified was returned.
  8039. func (c *InventoryCustombatchCall) Do(opts ...googleapi.CallOption) (*InventoryCustomBatchResponse, error) {
  8040. gensupport.SetOptions(c.urlParams_, opts...)
  8041. res, err := c.doRequest("json")
  8042. if res != nil && res.StatusCode == http.StatusNotModified {
  8043. if res.Body != nil {
  8044. res.Body.Close()
  8045. }
  8046. return nil, &googleapi.Error{
  8047. Code: res.StatusCode,
  8048. Header: res.Header,
  8049. }
  8050. }
  8051. if err != nil {
  8052. return nil, err
  8053. }
  8054. defer googleapi.CloseBody(res)
  8055. if err := googleapi.CheckResponse(res); err != nil {
  8056. return nil, err
  8057. }
  8058. ret := &InventoryCustomBatchResponse{
  8059. ServerResponse: googleapi.ServerResponse{
  8060. Header: res.Header,
  8061. HTTPStatusCode: res.StatusCode,
  8062. },
  8063. }
  8064. if err := json.NewDecoder(res.Body).Decode(&ret); err != nil {
  8065. return nil, err
  8066. }
  8067. return ret, nil
  8068. // {
  8069. // "description": "Updates price and availability for multiple products or stores in a single request. This operation does not update the expiration date of the products.",
  8070. // "httpMethod": "POST",
  8071. // "id": "content.inventory.custombatch",
  8072. // "parameters": {
  8073. // "dryRun": {
  8074. // "description": "Flag to run the request in dry-run mode.",
  8075. // "location": "query",
  8076. // "type": "boolean"
  8077. // }
  8078. // },
  8079. // "path": "inventory/batch",
  8080. // "request": {
  8081. // "$ref": "InventoryCustomBatchRequest"
  8082. // },
  8083. // "response": {
  8084. // "$ref": "InventoryCustomBatchResponse"
  8085. // },
  8086. // "scopes": [
  8087. // "https://www.googleapis.com/auth/content"
  8088. // ]
  8089. // }
  8090. }
  8091. // method id "content.inventory.set":
  8092. type InventorySetCall struct {
  8093. s *Service
  8094. merchantId uint64
  8095. storeCode string
  8096. productId string
  8097. inventorysetrequest *InventorySetRequest
  8098. urlParams_ gensupport.URLParams
  8099. ctx_ context.Context
  8100. }
  8101. // Set: Updates price and availability of a product in your Merchant
  8102. // Center account. This operation does not update the expiration date of
  8103. // the product.
  8104. func (r *InventoryService) Set(merchantId uint64, storeCode string, productId string, inventorysetrequest *InventorySetRequest) *InventorySetCall {
  8105. c := &InventorySetCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  8106. c.merchantId = merchantId
  8107. c.storeCode = storeCode
  8108. c.productId = productId
  8109. c.inventorysetrequest = inventorysetrequest
  8110. return c
  8111. }
  8112. // DryRun sets the optional parameter "dryRun": Flag to run the request
  8113. // in dry-run mode.
  8114. func (c *InventorySetCall) DryRun(dryRun bool) *InventorySetCall {
  8115. c.urlParams_.Set("dryRun", fmt.Sprint(dryRun))
  8116. return c
  8117. }
  8118. // Fields allows partial responses to be retrieved. See
  8119. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  8120. // for more information.
  8121. func (c *InventorySetCall) Fields(s ...googleapi.Field) *InventorySetCall {
  8122. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  8123. return c
  8124. }
  8125. // Context sets the context to be used in this call's Do method. Any
  8126. // pending HTTP request will be aborted if the provided context is
  8127. // canceled.
  8128. func (c *InventorySetCall) Context(ctx context.Context) *InventorySetCall {
  8129. c.ctx_ = ctx
  8130. return c
  8131. }
  8132. func (c *InventorySetCall) doRequest(alt string) (*http.Response, error) {
  8133. var body io.Reader = nil
  8134. body, err := googleapi.WithoutDataWrapper.JSONReader(c.inventorysetrequest)
  8135. if err != nil {
  8136. return nil, err
  8137. }
  8138. ctype := "application/json"
  8139. c.urlParams_.Set("alt", alt)
  8140. urls := googleapi.ResolveRelative(c.s.BasePath, "{merchantId}/inventory/{storeCode}/products/{productId}")
  8141. urls += "?" + c.urlParams_.Encode()
  8142. req, _ := http.NewRequest("POST", urls, body)
  8143. googleapi.Expand(req.URL, map[string]string{
  8144. "merchantId": strconv.FormatUint(c.merchantId, 10),
  8145. "storeCode": c.storeCode,
  8146. "productId": c.productId,
  8147. })
  8148. req.Header.Set("Content-Type", ctype)
  8149. req.Header.Set("User-Agent", c.s.userAgent())
  8150. if c.ctx_ != nil {
  8151. return ctxhttp.Do(c.ctx_, c.s.client, req)
  8152. }
  8153. return c.s.client.Do(req)
  8154. }
  8155. // Do executes the "content.inventory.set" call.
  8156. // Exactly one of *InventorySetResponse or error will be non-nil. Any
  8157. // non-2xx status code is an error. Response headers are in either
  8158. // *InventorySetResponse.ServerResponse.Header or (if a response was
  8159. // returned at all) in error.(*googleapi.Error).Header. Use
  8160. // googleapi.IsNotModified to check whether the returned error was
  8161. // because http.StatusNotModified was returned.
  8162. func (c *InventorySetCall) Do(opts ...googleapi.CallOption) (*InventorySetResponse, error) {
  8163. gensupport.SetOptions(c.urlParams_, opts...)
  8164. res, err := c.doRequest("json")
  8165. if res != nil && res.StatusCode == http.StatusNotModified {
  8166. if res.Body != nil {
  8167. res.Body.Close()
  8168. }
  8169. return nil, &googleapi.Error{
  8170. Code: res.StatusCode,
  8171. Header: res.Header,
  8172. }
  8173. }
  8174. if err != nil {
  8175. return nil, err
  8176. }
  8177. defer googleapi.CloseBody(res)
  8178. if err := googleapi.CheckResponse(res); err != nil {
  8179. return nil, err
  8180. }
  8181. ret := &InventorySetResponse{
  8182. ServerResponse: googleapi.ServerResponse{
  8183. Header: res.Header,
  8184. HTTPStatusCode: res.StatusCode,
  8185. },
  8186. }
  8187. if err := json.NewDecoder(res.Body).Decode(&ret); err != nil {
  8188. return nil, err
  8189. }
  8190. return ret, nil
  8191. // {
  8192. // "description": "Updates price and availability of a product in your Merchant Center account. This operation does not update the expiration date of the product.",
  8193. // "httpMethod": "POST",
  8194. // "id": "content.inventory.set",
  8195. // "parameterOrder": [
  8196. // "merchantId",
  8197. // "storeCode",
  8198. // "productId"
  8199. // ],
  8200. // "parameters": {
  8201. // "dryRun": {
  8202. // "description": "Flag to run the request in dry-run mode.",
  8203. // "location": "query",
  8204. // "type": "boolean"
  8205. // },
  8206. // "merchantId": {
  8207. // "description": "The ID of the managing account.",
  8208. // "format": "uint64",
  8209. // "location": "path",
  8210. // "required": true,
  8211. // "type": "string"
  8212. // },
  8213. // "productId": {
  8214. // "description": "The ID of the product for which to update price and availability.",
  8215. // "location": "path",
  8216. // "required": true,
  8217. // "type": "string"
  8218. // },
  8219. // "storeCode": {
  8220. // "description": "The code of the store for which to update price and availability. Use online to update price and availability of an online product.",
  8221. // "location": "path",
  8222. // "required": true,
  8223. // "type": "string"
  8224. // }
  8225. // },
  8226. // "path": "{merchantId}/inventory/{storeCode}/products/{productId}",
  8227. // "request": {
  8228. // "$ref": "InventorySetRequest"
  8229. // },
  8230. // "response": {
  8231. // "$ref": "InventorySetResponse"
  8232. // },
  8233. // "scopes": [
  8234. // "https://www.googleapis.com/auth/content"
  8235. // ]
  8236. // }
  8237. }
  8238. // method id "content.orders.acknowledge":
  8239. type OrdersAcknowledgeCall struct {
  8240. s *Service
  8241. merchantId uint64
  8242. orderId string
  8243. ordersacknowledgerequest *OrdersAcknowledgeRequest
  8244. urlParams_ gensupport.URLParams
  8245. ctx_ context.Context
  8246. }
  8247. // Acknowledge: Marks an order as acknowledged.
  8248. func (r *OrdersService) Acknowledge(merchantId uint64, orderId string, ordersacknowledgerequest *OrdersAcknowledgeRequest) *OrdersAcknowledgeCall {
  8249. c := &OrdersAcknowledgeCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  8250. c.merchantId = merchantId
  8251. c.orderId = orderId
  8252. c.ordersacknowledgerequest = ordersacknowledgerequest
  8253. return c
  8254. }
  8255. // Fields allows partial responses to be retrieved. See
  8256. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  8257. // for more information.
  8258. func (c *OrdersAcknowledgeCall) Fields(s ...googleapi.Field) *OrdersAcknowledgeCall {
  8259. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  8260. return c
  8261. }
  8262. // Context sets the context to be used in this call's Do method. Any
  8263. // pending HTTP request will be aborted if the provided context is
  8264. // canceled.
  8265. func (c *OrdersAcknowledgeCall) Context(ctx context.Context) *OrdersAcknowledgeCall {
  8266. c.ctx_ = ctx
  8267. return c
  8268. }
  8269. func (c *OrdersAcknowledgeCall) doRequest(alt string) (*http.Response, error) {
  8270. var body io.Reader = nil
  8271. body, err := googleapi.WithoutDataWrapper.JSONReader(c.ordersacknowledgerequest)
  8272. if err != nil {
  8273. return nil, err
  8274. }
  8275. ctype := "application/json"
  8276. c.urlParams_.Set("alt", alt)
  8277. urls := googleapi.ResolveRelative(c.s.BasePath, "{merchantId}/orders/{orderId}/acknowledge")
  8278. urls += "?" + c.urlParams_.Encode()
  8279. req, _ := http.NewRequest("POST", urls, body)
  8280. googleapi.Expand(req.URL, map[string]string{
  8281. "merchantId": strconv.FormatUint(c.merchantId, 10),
  8282. "orderId": c.orderId,
  8283. })
  8284. req.Header.Set("Content-Type", ctype)
  8285. req.Header.Set("User-Agent", c.s.userAgent())
  8286. if c.ctx_ != nil {
  8287. return ctxhttp.Do(c.ctx_, c.s.client, req)
  8288. }
  8289. return c.s.client.Do(req)
  8290. }
  8291. // Do executes the "content.orders.acknowledge" call.
  8292. // Exactly one of *OrdersAcknowledgeResponse or error will be non-nil.
  8293. // Any non-2xx status code is an error. Response headers are in either
  8294. // *OrdersAcknowledgeResponse.ServerResponse.Header or (if a response
  8295. // was returned at all) in error.(*googleapi.Error).Header. Use
  8296. // googleapi.IsNotModified to check whether the returned error was
  8297. // because http.StatusNotModified was returned.
  8298. func (c *OrdersAcknowledgeCall) Do(opts ...googleapi.CallOption) (*OrdersAcknowledgeResponse, error) {
  8299. gensupport.SetOptions(c.urlParams_, opts...)
  8300. res, err := c.doRequest("json")
  8301. if res != nil && res.StatusCode == http.StatusNotModified {
  8302. if res.Body != nil {
  8303. res.Body.Close()
  8304. }
  8305. return nil, &googleapi.Error{
  8306. Code: res.StatusCode,
  8307. Header: res.Header,
  8308. }
  8309. }
  8310. if err != nil {
  8311. return nil, err
  8312. }
  8313. defer googleapi.CloseBody(res)
  8314. if err := googleapi.CheckResponse(res); err != nil {
  8315. return nil, err
  8316. }
  8317. ret := &OrdersAcknowledgeResponse{
  8318. ServerResponse: googleapi.ServerResponse{
  8319. Header: res.Header,
  8320. HTTPStatusCode: res.StatusCode,
  8321. },
  8322. }
  8323. if err := json.NewDecoder(res.Body).Decode(&ret); err != nil {
  8324. return nil, err
  8325. }
  8326. return ret, nil
  8327. // {
  8328. // "description": "Marks an order as acknowledged.",
  8329. // "httpMethod": "POST",
  8330. // "id": "content.orders.acknowledge",
  8331. // "parameterOrder": [
  8332. // "merchantId",
  8333. // "orderId"
  8334. // ],
  8335. // "parameters": {
  8336. // "merchantId": {
  8337. // "description": "The ID of the managing account.",
  8338. // "format": "uint64",
  8339. // "location": "path",
  8340. // "required": true,
  8341. // "type": "string"
  8342. // },
  8343. // "orderId": {
  8344. // "description": "The ID of the order.",
  8345. // "location": "path",
  8346. // "required": true,
  8347. // "type": "string"
  8348. // }
  8349. // },
  8350. // "path": "{merchantId}/orders/{orderId}/acknowledge",
  8351. // "request": {
  8352. // "$ref": "OrdersAcknowledgeRequest"
  8353. // },
  8354. // "response": {
  8355. // "$ref": "OrdersAcknowledgeResponse"
  8356. // },
  8357. // "scopes": [
  8358. // "https://www.googleapis.com/auth/content"
  8359. // ]
  8360. // }
  8361. }
  8362. // method id "content.orders.advancetestorder":
  8363. type OrdersAdvancetestorderCall struct {
  8364. s *Service
  8365. merchantId uint64
  8366. orderId string
  8367. urlParams_ gensupport.URLParams
  8368. ctx_ context.Context
  8369. }
  8370. // Advancetestorder: Sandbox only. Moves a test order from state
  8371. // "inProgress" to state "pendingShipment".
  8372. func (r *OrdersService) Advancetestorder(merchantId uint64, orderId string) *OrdersAdvancetestorderCall {
  8373. c := &OrdersAdvancetestorderCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  8374. c.merchantId = merchantId
  8375. c.orderId = orderId
  8376. return c
  8377. }
  8378. // Fields allows partial responses to be retrieved. See
  8379. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  8380. // for more information.
  8381. func (c *OrdersAdvancetestorderCall) Fields(s ...googleapi.Field) *OrdersAdvancetestorderCall {
  8382. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  8383. return c
  8384. }
  8385. // Context sets the context to be used in this call's Do method. Any
  8386. // pending HTTP request will be aborted if the provided context is
  8387. // canceled.
  8388. func (c *OrdersAdvancetestorderCall) Context(ctx context.Context) *OrdersAdvancetestorderCall {
  8389. c.ctx_ = ctx
  8390. return c
  8391. }
  8392. func (c *OrdersAdvancetestorderCall) doRequest(alt string) (*http.Response, error) {
  8393. var body io.Reader = nil
  8394. c.urlParams_.Set("alt", alt)
  8395. urls := googleapi.ResolveRelative(c.s.BasePath, "{merchantId}/testorders/{orderId}/advance")
  8396. urls += "?" + c.urlParams_.Encode()
  8397. req, _ := http.NewRequest("POST", urls, body)
  8398. googleapi.Expand(req.URL, map[string]string{
  8399. "merchantId": strconv.FormatUint(c.merchantId, 10),
  8400. "orderId": c.orderId,
  8401. })
  8402. req.Header.Set("User-Agent", c.s.userAgent())
  8403. if c.ctx_ != nil {
  8404. return ctxhttp.Do(c.ctx_, c.s.client, req)
  8405. }
  8406. return c.s.client.Do(req)
  8407. }
  8408. // Do executes the "content.orders.advancetestorder" call.
  8409. // Exactly one of *OrdersAdvanceTestOrderResponse or error will be
  8410. // non-nil. Any non-2xx status code is an error. Response headers are in
  8411. // either *OrdersAdvanceTestOrderResponse.ServerResponse.Header or (if a
  8412. // response was returned at all) in error.(*googleapi.Error).Header. Use
  8413. // googleapi.IsNotModified to check whether the returned error was
  8414. // because http.StatusNotModified was returned.
  8415. func (c *OrdersAdvancetestorderCall) Do(opts ...googleapi.CallOption) (*OrdersAdvanceTestOrderResponse, error) {
  8416. gensupport.SetOptions(c.urlParams_, opts...)
  8417. res, err := c.doRequest("json")
  8418. if res != nil && res.StatusCode == http.StatusNotModified {
  8419. if res.Body != nil {
  8420. res.Body.Close()
  8421. }
  8422. return nil, &googleapi.Error{
  8423. Code: res.StatusCode,
  8424. Header: res.Header,
  8425. }
  8426. }
  8427. if err != nil {
  8428. return nil, err
  8429. }
  8430. defer googleapi.CloseBody(res)
  8431. if err := googleapi.CheckResponse(res); err != nil {
  8432. return nil, err
  8433. }
  8434. ret := &OrdersAdvanceTestOrderResponse{
  8435. ServerResponse: googleapi.ServerResponse{
  8436. Header: res.Header,
  8437. HTTPStatusCode: res.StatusCode,
  8438. },
  8439. }
  8440. if err := json.NewDecoder(res.Body).Decode(&ret); err != nil {
  8441. return nil, err
  8442. }
  8443. return ret, nil
  8444. // {
  8445. // "description": "Sandbox only. Moves a test order from state \"inProgress\" to state \"pendingShipment\".",
  8446. // "httpMethod": "POST",
  8447. // "id": "content.orders.advancetestorder",
  8448. // "parameterOrder": [
  8449. // "merchantId",
  8450. // "orderId"
  8451. // ],
  8452. // "parameters": {
  8453. // "merchantId": {
  8454. // "description": "The ID of the managing account.",
  8455. // "format": "uint64",
  8456. // "location": "path",
  8457. // "required": true,
  8458. // "type": "string"
  8459. // },
  8460. // "orderId": {
  8461. // "description": "The ID of the test order to modify.",
  8462. // "location": "path",
  8463. // "required": true,
  8464. // "type": "string"
  8465. // }
  8466. // },
  8467. // "path": "{merchantId}/testorders/{orderId}/advance",
  8468. // "response": {
  8469. // "$ref": "OrdersAdvanceTestOrderResponse"
  8470. // },
  8471. // "scopes": [
  8472. // "https://www.googleapis.com/auth/content"
  8473. // ]
  8474. // }
  8475. }
  8476. // method id "content.orders.cancel":
  8477. type OrdersCancelCall struct {
  8478. s *Service
  8479. merchantId uint64
  8480. orderId string
  8481. orderscancelrequest *OrdersCancelRequest
  8482. urlParams_ gensupport.URLParams
  8483. ctx_ context.Context
  8484. }
  8485. // Cancel: Cancels all line items in an order.
  8486. func (r *OrdersService) Cancel(merchantId uint64, orderId string, orderscancelrequest *OrdersCancelRequest) *OrdersCancelCall {
  8487. c := &OrdersCancelCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  8488. c.merchantId = merchantId
  8489. c.orderId = orderId
  8490. c.orderscancelrequest = orderscancelrequest
  8491. return c
  8492. }
  8493. // Fields allows partial responses to be retrieved. See
  8494. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  8495. // for more information.
  8496. func (c *OrdersCancelCall) Fields(s ...googleapi.Field) *OrdersCancelCall {
  8497. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  8498. return c
  8499. }
  8500. // Context sets the context to be used in this call's Do method. Any
  8501. // pending HTTP request will be aborted if the provided context is
  8502. // canceled.
  8503. func (c *OrdersCancelCall) Context(ctx context.Context) *OrdersCancelCall {
  8504. c.ctx_ = ctx
  8505. return c
  8506. }
  8507. func (c *OrdersCancelCall) doRequest(alt string) (*http.Response, error) {
  8508. var body io.Reader = nil
  8509. body, err := googleapi.WithoutDataWrapper.JSONReader(c.orderscancelrequest)
  8510. if err != nil {
  8511. return nil, err
  8512. }
  8513. ctype := "application/json"
  8514. c.urlParams_.Set("alt", alt)
  8515. urls := googleapi.ResolveRelative(c.s.BasePath, "{merchantId}/orders/{orderId}/cancel")
  8516. urls += "?" + c.urlParams_.Encode()
  8517. req, _ := http.NewRequest("POST", urls, body)
  8518. googleapi.Expand(req.URL, map[string]string{
  8519. "merchantId": strconv.FormatUint(c.merchantId, 10),
  8520. "orderId": c.orderId,
  8521. })
  8522. req.Header.Set("Content-Type", ctype)
  8523. req.Header.Set("User-Agent", c.s.userAgent())
  8524. if c.ctx_ != nil {
  8525. return ctxhttp.Do(c.ctx_, c.s.client, req)
  8526. }
  8527. return c.s.client.Do(req)
  8528. }
  8529. // Do executes the "content.orders.cancel" call.
  8530. // Exactly one of *OrdersCancelResponse or error will be non-nil. Any
  8531. // non-2xx status code is an error. Response headers are in either
  8532. // *OrdersCancelResponse.ServerResponse.Header or (if a response was
  8533. // returned at all) in error.(*googleapi.Error).Header. Use
  8534. // googleapi.IsNotModified to check whether the returned error was
  8535. // because http.StatusNotModified was returned.
  8536. func (c *OrdersCancelCall) Do(opts ...googleapi.CallOption) (*OrdersCancelResponse, error) {
  8537. gensupport.SetOptions(c.urlParams_, opts...)
  8538. res, err := c.doRequest("json")
  8539. if res != nil && res.StatusCode == http.StatusNotModified {
  8540. if res.Body != nil {
  8541. res.Body.Close()
  8542. }
  8543. return nil, &googleapi.Error{
  8544. Code: res.StatusCode,
  8545. Header: res.Header,
  8546. }
  8547. }
  8548. if err != nil {
  8549. return nil, err
  8550. }
  8551. defer googleapi.CloseBody(res)
  8552. if err := googleapi.CheckResponse(res); err != nil {
  8553. return nil, err
  8554. }
  8555. ret := &OrdersCancelResponse{
  8556. ServerResponse: googleapi.ServerResponse{
  8557. Header: res.Header,
  8558. HTTPStatusCode: res.StatusCode,
  8559. },
  8560. }
  8561. if err := json.NewDecoder(res.Body).Decode(&ret); err != nil {
  8562. return nil, err
  8563. }
  8564. return ret, nil
  8565. // {
  8566. // "description": "Cancels all line items in an order.",
  8567. // "httpMethod": "POST",
  8568. // "id": "content.orders.cancel",
  8569. // "parameterOrder": [
  8570. // "merchantId",
  8571. // "orderId"
  8572. // ],
  8573. // "parameters": {
  8574. // "merchantId": {
  8575. // "description": "The ID of the managing account.",
  8576. // "format": "uint64",
  8577. // "location": "path",
  8578. // "required": true,
  8579. // "type": "string"
  8580. // },
  8581. // "orderId": {
  8582. // "description": "The ID of the order to cancel.",
  8583. // "location": "path",
  8584. // "required": true,
  8585. // "type": "string"
  8586. // }
  8587. // },
  8588. // "path": "{merchantId}/orders/{orderId}/cancel",
  8589. // "request": {
  8590. // "$ref": "OrdersCancelRequest"
  8591. // },
  8592. // "response": {
  8593. // "$ref": "OrdersCancelResponse"
  8594. // },
  8595. // "scopes": [
  8596. // "https://www.googleapis.com/auth/content"
  8597. // ]
  8598. // }
  8599. }
  8600. // method id "content.orders.cancellineitem":
  8601. type OrdersCancellineitemCall struct {
  8602. s *Service
  8603. merchantId uint64
  8604. orderId string
  8605. orderscancellineitemrequest *OrdersCancelLineItemRequest
  8606. urlParams_ gensupport.URLParams
  8607. ctx_ context.Context
  8608. }
  8609. // Cancellineitem: Cancels a line item.
  8610. func (r *OrdersService) Cancellineitem(merchantId uint64, orderId string, orderscancellineitemrequest *OrdersCancelLineItemRequest) *OrdersCancellineitemCall {
  8611. c := &OrdersCancellineitemCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  8612. c.merchantId = merchantId
  8613. c.orderId = orderId
  8614. c.orderscancellineitemrequest = orderscancellineitemrequest
  8615. return c
  8616. }
  8617. // Fields allows partial responses to be retrieved. See
  8618. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  8619. // for more information.
  8620. func (c *OrdersCancellineitemCall) Fields(s ...googleapi.Field) *OrdersCancellineitemCall {
  8621. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  8622. return c
  8623. }
  8624. // Context sets the context to be used in this call's Do method. Any
  8625. // pending HTTP request will be aborted if the provided context is
  8626. // canceled.
  8627. func (c *OrdersCancellineitemCall) Context(ctx context.Context) *OrdersCancellineitemCall {
  8628. c.ctx_ = ctx
  8629. return c
  8630. }
  8631. func (c *OrdersCancellineitemCall) doRequest(alt string) (*http.Response, error) {
  8632. var body io.Reader = nil
  8633. body, err := googleapi.WithoutDataWrapper.JSONReader(c.orderscancellineitemrequest)
  8634. if err != nil {
  8635. return nil, err
  8636. }
  8637. ctype := "application/json"
  8638. c.urlParams_.Set("alt", alt)
  8639. urls := googleapi.ResolveRelative(c.s.BasePath, "{merchantId}/orders/{orderId}/cancelLineItem")
  8640. urls += "?" + c.urlParams_.Encode()
  8641. req, _ := http.NewRequest("POST", urls, body)
  8642. googleapi.Expand(req.URL, map[string]string{
  8643. "merchantId": strconv.FormatUint(c.merchantId, 10),
  8644. "orderId": c.orderId,
  8645. })
  8646. req.Header.Set("Content-Type", ctype)
  8647. req.Header.Set("User-Agent", c.s.userAgent())
  8648. if c.ctx_ != nil {
  8649. return ctxhttp.Do(c.ctx_, c.s.client, req)
  8650. }
  8651. return c.s.client.Do(req)
  8652. }
  8653. // Do executes the "content.orders.cancellineitem" call.
  8654. // Exactly one of *OrdersCancelLineItemResponse or error will be
  8655. // non-nil. Any non-2xx status code is an error. Response headers are in
  8656. // either *OrdersCancelLineItemResponse.ServerResponse.Header or (if a
  8657. // response was returned at all) in error.(*googleapi.Error).Header. Use
  8658. // googleapi.IsNotModified to check whether the returned error was
  8659. // because http.StatusNotModified was returned.
  8660. func (c *OrdersCancellineitemCall) Do(opts ...googleapi.CallOption) (*OrdersCancelLineItemResponse, error) {
  8661. gensupport.SetOptions(c.urlParams_, opts...)
  8662. res, err := c.doRequest("json")
  8663. if res != nil && res.StatusCode == http.StatusNotModified {
  8664. if res.Body != nil {
  8665. res.Body.Close()
  8666. }
  8667. return nil, &googleapi.Error{
  8668. Code: res.StatusCode,
  8669. Header: res.Header,
  8670. }
  8671. }
  8672. if err != nil {
  8673. return nil, err
  8674. }
  8675. defer googleapi.CloseBody(res)
  8676. if err := googleapi.CheckResponse(res); err != nil {
  8677. return nil, err
  8678. }
  8679. ret := &OrdersCancelLineItemResponse{
  8680. ServerResponse: googleapi.ServerResponse{
  8681. Header: res.Header,
  8682. HTTPStatusCode: res.StatusCode,
  8683. },
  8684. }
  8685. if err := json.NewDecoder(res.Body).Decode(&ret); err != nil {
  8686. return nil, err
  8687. }
  8688. return ret, nil
  8689. // {
  8690. // "description": "Cancels a line item.",
  8691. // "httpMethod": "POST",
  8692. // "id": "content.orders.cancellineitem",
  8693. // "parameterOrder": [
  8694. // "merchantId",
  8695. // "orderId"
  8696. // ],
  8697. // "parameters": {
  8698. // "merchantId": {
  8699. // "description": "The ID of the managing account.",
  8700. // "format": "uint64",
  8701. // "location": "path",
  8702. // "required": true,
  8703. // "type": "string"
  8704. // },
  8705. // "orderId": {
  8706. // "description": "The ID of the order.",
  8707. // "location": "path",
  8708. // "required": true,
  8709. // "type": "string"
  8710. // }
  8711. // },
  8712. // "path": "{merchantId}/orders/{orderId}/cancelLineItem",
  8713. // "request": {
  8714. // "$ref": "OrdersCancelLineItemRequest"
  8715. // },
  8716. // "response": {
  8717. // "$ref": "OrdersCancelLineItemResponse"
  8718. // },
  8719. // "scopes": [
  8720. // "https://www.googleapis.com/auth/content"
  8721. // ]
  8722. // }
  8723. }
  8724. // method id "content.orders.createtestorder":
  8725. type OrdersCreatetestorderCall struct {
  8726. s *Service
  8727. merchantId uint64
  8728. orderscreatetestorderrequest *OrdersCreateTestOrderRequest
  8729. urlParams_ gensupport.URLParams
  8730. ctx_ context.Context
  8731. }
  8732. // Createtestorder: Sandbox only. Creates a test order.
  8733. func (r *OrdersService) Createtestorder(merchantId uint64, orderscreatetestorderrequest *OrdersCreateTestOrderRequest) *OrdersCreatetestorderCall {
  8734. c := &OrdersCreatetestorderCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  8735. c.merchantId = merchantId
  8736. c.orderscreatetestorderrequest = orderscreatetestorderrequest
  8737. return c
  8738. }
  8739. // Fields allows partial responses to be retrieved. See
  8740. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  8741. // for more information.
  8742. func (c *OrdersCreatetestorderCall) Fields(s ...googleapi.Field) *OrdersCreatetestorderCall {
  8743. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  8744. return c
  8745. }
  8746. // Context sets the context to be used in this call's Do method. Any
  8747. // pending HTTP request will be aborted if the provided context is
  8748. // canceled.
  8749. func (c *OrdersCreatetestorderCall) Context(ctx context.Context) *OrdersCreatetestorderCall {
  8750. c.ctx_ = ctx
  8751. return c
  8752. }
  8753. func (c *OrdersCreatetestorderCall) doRequest(alt string) (*http.Response, error) {
  8754. var body io.Reader = nil
  8755. body, err := googleapi.WithoutDataWrapper.JSONReader(c.orderscreatetestorderrequest)
  8756. if err != nil {
  8757. return nil, err
  8758. }
  8759. ctype := "application/json"
  8760. c.urlParams_.Set("alt", alt)
  8761. urls := googleapi.ResolveRelative(c.s.BasePath, "{merchantId}/testorders")
  8762. urls += "?" + c.urlParams_.Encode()
  8763. req, _ := http.NewRequest("POST", urls, body)
  8764. googleapi.Expand(req.URL, map[string]string{
  8765. "merchantId": strconv.FormatUint(c.merchantId, 10),
  8766. })
  8767. req.Header.Set("Content-Type", ctype)
  8768. req.Header.Set("User-Agent", c.s.userAgent())
  8769. if c.ctx_ != nil {
  8770. return ctxhttp.Do(c.ctx_, c.s.client, req)
  8771. }
  8772. return c.s.client.Do(req)
  8773. }
  8774. // Do executes the "content.orders.createtestorder" call.
  8775. // Exactly one of *OrdersCreateTestOrderResponse or error will be
  8776. // non-nil. Any non-2xx status code is an error. Response headers are in
  8777. // either *OrdersCreateTestOrderResponse.ServerResponse.Header or (if a
  8778. // response was returned at all) in error.(*googleapi.Error).Header. Use
  8779. // googleapi.IsNotModified to check whether the returned error was
  8780. // because http.StatusNotModified was returned.
  8781. func (c *OrdersCreatetestorderCall) Do(opts ...googleapi.CallOption) (*OrdersCreateTestOrderResponse, error) {
  8782. gensupport.SetOptions(c.urlParams_, opts...)
  8783. res, err := c.doRequest("json")
  8784. if res != nil && res.StatusCode == http.StatusNotModified {
  8785. if res.Body != nil {
  8786. res.Body.Close()
  8787. }
  8788. return nil, &googleapi.Error{
  8789. Code: res.StatusCode,
  8790. Header: res.Header,
  8791. }
  8792. }
  8793. if err != nil {
  8794. return nil, err
  8795. }
  8796. defer googleapi.CloseBody(res)
  8797. if err := googleapi.CheckResponse(res); err != nil {
  8798. return nil, err
  8799. }
  8800. ret := &OrdersCreateTestOrderResponse{
  8801. ServerResponse: googleapi.ServerResponse{
  8802. Header: res.Header,
  8803. HTTPStatusCode: res.StatusCode,
  8804. },
  8805. }
  8806. if err := json.NewDecoder(res.Body).Decode(&ret); err != nil {
  8807. return nil, err
  8808. }
  8809. return ret, nil
  8810. // {
  8811. // "description": "Sandbox only. Creates a test order.",
  8812. // "httpMethod": "POST",
  8813. // "id": "content.orders.createtestorder",
  8814. // "parameterOrder": [
  8815. // "merchantId"
  8816. // ],
  8817. // "parameters": {
  8818. // "merchantId": {
  8819. // "description": "The ID of the managing account.",
  8820. // "format": "uint64",
  8821. // "location": "path",
  8822. // "required": true,
  8823. // "type": "string"
  8824. // }
  8825. // },
  8826. // "path": "{merchantId}/testorders",
  8827. // "request": {
  8828. // "$ref": "OrdersCreateTestOrderRequest"
  8829. // },
  8830. // "response": {
  8831. // "$ref": "OrdersCreateTestOrderResponse"
  8832. // },
  8833. // "scopes": [
  8834. // "https://www.googleapis.com/auth/content"
  8835. // ]
  8836. // }
  8837. }
  8838. // method id "content.orders.custombatch":
  8839. type OrdersCustombatchCall struct {
  8840. s *Service
  8841. orderscustombatchrequest *OrdersCustomBatchRequest
  8842. urlParams_ gensupport.URLParams
  8843. ctx_ context.Context
  8844. }
  8845. // Custombatch: Retrieves or modifies multiple orders in a single
  8846. // request.
  8847. func (r *OrdersService) Custombatch(orderscustombatchrequest *OrdersCustomBatchRequest) *OrdersCustombatchCall {
  8848. c := &OrdersCustombatchCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  8849. c.orderscustombatchrequest = orderscustombatchrequest
  8850. return c
  8851. }
  8852. // Fields allows partial responses to be retrieved. See
  8853. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  8854. // for more information.
  8855. func (c *OrdersCustombatchCall) Fields(s ...googleapi.Field) *OrdersCustombatchCall {
  8856. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  8857. return c
  8858. }
  8859. // Context sets the context to be used in this call's Do method. Any
  8860. // pending HTTP request will be aborted if the provided context is
  8861. // canceled.
  8862. func (c *OrdersCustombatchCall) Context(ctx context.Context) *OrdersCustombatchCall {
  8863. c.ctx_ = ctx
  8864. return c
  8865. }
  8866. func (c *OrdersCustombatchCall) doRequest(alt string) (*http.Response, error) {
  8867. var body io.Reader = nil
  8868. body, err := googleapi.WithoutDataWrapper.JSONReader(c.orderscustombatchrequest)
  8869. if err != nil {
  8870. return nil, err
  8871. }
  8872. ctype := "application/json"
  8873. c.urlParams_.Set("alt", alt)
  8874. urls := googleapi.ResolveRelative(c.s.BasePath, "orders/batch")
  8875. urls += "?" + c.urlParams_.Encode()
  8876. req, _ := http.NewRequest("POST", urls, body)
  8877. googleapi.SetOpaque(req.URL)
  8878. req.Header.Set("Content-Type", ctype)
  8879. req.Header.Set("User-Agent", c.s.userAgent())
  8880. if c.ctx_ != nil {
  8881. return ctxhttp.Do(c.ctx_, c.s.client, req)
  8882. }
  8883. return c.s.client.Do(req)
  8884. }
  8885. // Do executes the "content.orders.custombatch" call.
  8886. // Exactly one of *OrdersCustomBatchResponse or error will be non-nil.
  8887. // Any non-2xx status code is an error. Response headers are in either
  8888. // *OrdersCustomBatchResponse.ServerResponse.Header or (if a response
  8889. // was returned at all) in error.(*googleapi.Error).Header. Use
  8890. // googleapi.IsNotModified to check whether the returned error was
  8891. // because http.StatusNotModified was returned.
  8892. func (c *OrdersCustombatchCall) Do(opts ...googleapi.CallOption) (*OrdersCustomBatchResponse, error) {
  8893. gensupport.SetOptions(c.urlParams_, opts...)
  8894. res, err := c.doRequest("json")
  8895. if res != nil && res.StatusCode == http.StatusNotModified {
  8896. if res.Body != nil {
  8897. res.Body.Close()
  8898. }
  8899. return nil, &googleapi.Error{
  8900. Code: res.StatusCode,
  8901. Header: res.Header,
  8902. }
  8903. }
  8904. if err != nil {
  8905. return nil, err
  8906. }
  8907. defer googleapi.CloseBody(res)
  8908. if err := googleapi.CheckResponse(res); err != nil {
  8909. return nil, err
  8910. }
  8911. ret := &OrdersCustomBatchResponse{
  8912. ServerResponse: googleapi.ServerResponse{
  8913. Header: res.Header,
  8914. HTTPStatusCode: res.StatusCode,
  8915. },
  8916. }
  8917. if err := json.NewDecoder(res.Body).Decode(&ret); err != nil {
  8918. return nil, err
  8919. }
  8920. return ret, nil
  8921. // {
  8922. // "description": "Retrieves or modifies multiple orders in a single request.",
  8923. // "httpMethod": "POST",
  8924. // "id": "content.orders.custombatch",
  8925. // "path": "orders/batch",
  8926. // "request": {
  8927. // "$ref": "OrdersCustomBatchRequest"
  8928. // },
  8929. // "response": {
  8930. // "$ref": "OrdersCustomBatchResponse"
  8931. // },
  8932. // "scopes": [
  8933. // "https://www.googleapis.com/auth/content"
  8934. // ]
  8935. // }
  8936. }
  8937. // method id "content.orders.get":
  8938. type OrdersGetCall struct {
  8939. s *Service
  8940. merchantId uint64
  8941. orderId string
  8942. urlParams_ gensupport.URLParams
  8943. ifNoneMatch_ string
  8944. ctx_ context.Context
  8945. }
  8946. // Get: Retrieves an order from your Merchant Center account.
  8947. func (r *OrdersService) Get(merchantId uint64, orderId string) *OrdersGetCall {
  8948. c := &OrdersGetCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  8949. c.merchantId = merchantId
  8950. c.orderId = orderId
  8951. return c
  8952. }
  8953. // Fields allows partial responses to be retrieved. See
  8954. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  8955. // for more information.
  8956. func (c *OrdersGetCall) Fields(s ...googleapi.Field) *OrdersGetCall {
  8957. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  8958. return c
  8959. }
  8960. // IfNoneMatch sets the optional parameter which makes the operation
  8961. // fail if the object's ETag matches the given value. This is useful for
  8962. // getting updates only after the object has changed since the last
  8963. // request. Use googleapi.IsNotModified to check whether the response
  8964. // error from Do is the result of In-None-Match.
  8965. func (c *OrdersGetCall) IfNoneMatch(entityTag string) *OrdersGetCall {
  8966. c.ifNoneMatch_ = entityTag
  8967. return c
  8968. }
  8969. // Context sets the context to be used in this call's Do method. Any
  8970. // pending HTTP request will be aborted if the provided context is
  8971. // canceled.
  8972. func (c *OrdersGetCall) Context(ctx context.Context) *OrdersGetCall {
  8973. c.ctx_ = ctx
  8974. return c
  8975. }
  8976. func (c *OrdersGetCall) doRequest(alt string) (*http.Response, error) {
  8977. var body io.Reader = nil
  8978. c.urlParams_.Set("alt", alt)
  8979. urls := googleapi.ResolveRelative(c.s.BasePath, "{merchantId}/orders/{orderId}")
  8980. urls += "?" + c.urlParams_.Encode()
  8981. req, _ := http.NewRequest("GET", urls, body)
  8982. googleapi.Expand(req.URL, map[string]string{
  8983. "merchantId": strconv.FormatUint(c.merchantId, 10),
  8984. "orderId": c.orderId,
  8985. })
  8986. req.Header.Set("User-Agent", c.s.userAgent())
  8987. if c.ifNoneMatch_ != "" {
  8988. req.Header.Set("If-None-Match", c.ifNoneMatch_)
  8989. }
  8990. if c.ctx_ != nil {
  8991. return ctxhttp.Do(c.ctx_, c.s.client, req)
  8992. }
  8993. return c.s.client.Do(req)
  8994. }
  8995. // Do executes the "content.orders.get" call.
  8996. // Exactly one of *Order or error will be non-nil. Any non-2xx status
  8997. // code is an error. Response headers are in either
  8998. // *Order.ServerResponse.Header or (if a response was returned at all)
  8999. // in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to
  9000. // check whether the returned error was because http.StatusNotModified
  9001. // was returned.
  9002. func (c *OrdersGetCall) Do(opts ...googleapi.CallOption) (*Order, error) {
  9003. gensupport.SetOptions(c.urlParams_, opts...)
  9004. res, err := c.doRequest("json")
  9005. if res != nil && res.StatusCode == http.StatusNotModified {
  9006. if res.Body != nil {
  9007. res.Body.Close()
  9008. }
  9009. return nil, &googleapi.Error{
  9010. Code: res.StatusCode,
  9011. Header: res.Header,
  9012. }
  9013. }
  9014. if err != nil {
  9015. return nil, err
  9016. }
  9017. defer googleapi.CloseBody(res)
  9018. if err := googleapi.CheckResponse(res); err != nil {
  9019. return nil, err
  9020. }
  9021. ret := &Order{
  9022. ServerResponse: googleapi.ServerResponse{
  9023. Header: res.Header,
  9024. HTTPStatusCode: res.StatusCode,
  9025. },
  9026. }
  9027. if err := json.NewDecoder(res.Body).Decode(&ret); err != nil {
  9028. return nil, err
  9029. }
  9030. return ret, nil
  9031. // {
  9032. // "description": "Retrieves an order from your Merchant Center account.",
  9033. // "httpMethod": "GET",
  9034. // "id": "content.orders.get",
  9035. // "parameterOrder": [
  9036. // "merchantId",
  9037. // "orderId"
  9038. // ],
  9039. // "parameters": {
  9040. // "merchantId": {
  9041. // "description": "The ID of the managing account.",
  9042. // "format": "uint64",
  9043. // "location": "path",
  9044. // "required": true,
  9045. // "type": "string"
  9046. // },
  9047. // "orderId": {
  9048. // "description": "The ID of the order.",
  9049. // "location": "path",
  9050. // "required": true,
  9051. // "type": "string"
  9052. // }
  9053. // },
  9054. // "path": "{merchantId}/orders/{orderId}",
  9055. // "response": {
  9056. // "$ref": "Order"
  9057. // },
  9058. // "scopes": [
  9059. // "https://www.googleapis.com/auth/content"
  9060. // ]
  9061. // }
  9062. }
  9063. // method id "content.orders.getbymerchantorderid":
  9064. type OrdersGetbymerchantorderidCall struct {
  9065. s *Service
  9066. merchantId uint64
  9067. merchantOrderId string
  9068. urlParams_ gensupport.URLParams
  9069. ifNoneMatch_ string
  9070. ctx_ context.Context
  9071. }
  9072. // Getbymerchantorderid: Retrieves an order using merchant order id.
  9073. func (r *OrdersService) Getbymerchantorderid(merchantId uint64, merchantOrderId string) *OrdersGetbymerchantorderidCall {
  9074. c := &OrdersGetbymerchantorderidCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  9075. c.merchantId = merchantId
  9076. c.merchantOrderId = merchantOrderId
  9077. return c
  9078. }
  9079. // Fields allows partial responses to be retrieved. See
  9080. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  9081. // for more information.
  9082. func (c *OrdersGetbymerchantorderidCall) Fields(s ...googleapi.Field) *OrdersGetbymerchantorderidCall {
  9083. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  9084. return c
  9085. }
  9086. // IfNoneMatch sets the optional parameter which makes the operation
  9087. // fail if the object's ETag matches the given value. This is useful for
  9088. // getting updates only after the object has changed since the last
  9089. // request. Use googleapi.IsNotModified to check whether the response
  9090. // error from Do is the result of In-None-Match.
  9091. func (c *OrdersGetbymerchantorderidCall) IfNoneMatch(entityTag string) *OrdersGetbymerchantorderidCall {
  9092. c.ifNoneMatch_ = entityTag
  9093. return c
  9094. }
  9095. // Context sets the context to be used in this call's Do method. Any
  9096. // pending HTTP request will be aborted if the provided context is
  9097. // canceled.
  9098. func (c *OrdersGetbymerchantorderidCall) Context(ctx context.Context) *OrdersGetbymerchantorderidCall {
  9099. c.ctx_ = ctx
  9100. return c
  9101. }
  9102. func (c *OrdersGetbymerchantorderidCall) doRequest(alt string) (*http.Response, error) {
  9103. var body io.Reader = nil
  9104. c.urlParams_.Set("alt", alt)
  9105. urls := googleapi.ResolveRelative(c.s.BasePath, "{merchantId}/ordersbymerchantid/{merchantOrderId}")
  9106. urls += "?" + c.urlParams_.Encode()
  9107. req, _ := http.NewRequest("GET", urls, body)
  9108. googleapi.Expand(req.URL, map[string]string{
  9109. "merchantId": strconv.FormatUint(c.merchantId, 10),
  9110. "merchantOrderId": c.merchantOrderId,
  9111. })
  9112. req.Header.Set("User-Agent", c.s.userAgent())
  9113. if c.ifNoneMatch_ != "" {
  9114. req.Header.Set("If-None-Match", c.ifNoneMatch_)
  9115. }
  9116. if c.ctx_ != nil {
  9117. return ctxhttp.Do(c.ctx_, c.s.client, req)
  9118. }
  9119. return c.s.client.Do(req)
  9120. }
  9121. // Do executes the "content.orders.getbymerchantorderid" call.
  9122. // Exactly one of *OrdersGetByMerchantOrderIdResponse or error will be
  9123. // non-nil. Any non-2xx status code is an error. Response headers are in
  9124. // either *OrdersGetByMerchantOrderIdResponse.ServerResponse.Header or
  9125. // (if a response was returned at all) in
  9126. // error.(*googleapi.Error).Header. Use googleapi.IsNotModified to check
  9127. // whether the returned error was because http.StatusNotModified was
  9128. // returned.
  9129. func (c *OrdersGetbymerchantorderidCall) Do(opts ...googleapi.CallOption) (*OrdersGetByMerchantOrderIdResponse, error) {
  9130. gensupport.SetOptions(c.urlParams_, opts...)
  9131. res, err := c.doRequest("json")
  9132. if res != nil && res.StatusCode == http.StatusNotModified {
  9133. if res.Body != nil {
  9134. res.Body.Close()
  9135. }
  9136. return nil, &googleapi.Error{
  9137. Code: res.StatusCode,
  9138. Header: res.Header,
  9139. }
  9140. }
  9141. if err != nil {
  9142. return nil, err
  9143. }
  9144. defer googleapi.CloseBody(res)
  9145. if err := googleapi.CheckResponse(res); err != nil {
  9146. return nil, err
  9147. }
  9148. ret := &OrdersGetByMerchantOrderIdResponse{
  9149. ServerResponse: googleapi.ServerResponse{
  9150. Header: res.Header,
  9151. HTTPStatusCode: res.StatusCode,
  9152. },
  9153. }
  9154. if err := json.NewDecoder(res.Body).Decode(&ret); err != nil {
  9155. return nil, err
  9156. }
  9157. return ret, nil
  9158. // {
  9159. // "description": "Retrieves an order using merchant order id.",
  9160. // "httpMethod": "GET",
  9161. // "id": "content.orders.getbymerchantorderid",
  9162. // "parameterOrder": [
  9163. // "merchantId",
  9164. // "merchantOrderId"
  9165. // ],
  9166. // "parameters": {
  9167. // "merchantId": {
  9168. // "description": "The ID of the managing account.",
  9169. // "format": "uint64",
  9170. // "location": "path",
  9171. // "required": true,
  9172. // "type": "string"
  9173. // },
  9174. // "merchantOrderId": {
  9175. // "description": "The merchant order id to be looked for.",
  9176. // "location": "path",
  9177. // "required": true,
  9178. // "type": "string"
  9179. // }
  9180. // },
  9181. // "path": "{merchantId}/ordersbymerchantid/{merchantOrderId}",
  9182. // "response": {
  9183. // "$ref": "OrdersGetByMerchantOrderIdResponse"
  9184. // },
  9185. // "scopes": [
  9186. // "https://www.googleapis.com/auth/content"
  9187. // ]
  9188. // }
  9189. }
  9190. // method id "content.orders.gettestordertemplate":
  9191. type OrdersGettestordertemplateCall struct {
  9192. s *Service
  9193. merchantId uint64
  9194. templateName string
  9195. urlParams_ gensupport.URLParams
  9196. ifNoneMatch_ string
  9197. ctx_ context.Context
  9198. }
  9199. // Gettestordertemplate: Sandbox only. Retrieves an order template that
  9200. // can be used to quickly create a new order in sandbox.
  9201. func (r *OrdersService) Gettestordertemplate(merchantId uint64, templateName string) *OrdersGettestordertemplateCall {
  9202. c := &OrdersGettestordertemplateCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  9203. c.merchantId = merchantId
  9204. c.templateName = templateName
  9205. return c
  9206. }
  9207. // Fields allows partial responses to be retrieved. See
  9208. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  9209. // for more information.
  9210. func (c *OrdersGettestordertemplateCall) Fields(s ...googleapi.Field) *OrdersGettestordertemplateCall {
  9211. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  9212. return c
  9213. }
  9214. // IfNoneMatch sets the optional parameter which makes the operation
  9215. // fail if the object's ETag matches the given value. This is useful for
  9216. // getting updates only after the object has changed since the last
  9217. // request. Use googleapi.IsNotModified to check whether the response
  9218. // error from Do is the result of In-None-Match.
  9219. func (c *OrdersGettestordertemplateCall) IfNoneMatch(entityTag string) *OrdersGettestordertemplateCall {
  9220. c.ifNoneMatch_ = entityTag
  9221. return c
  9222. }
  9223. // Context sets the context to be used in this call's Do method. Any
  9224. // pending HTTP request will be aborted if the provided context is
  9225. // canceled.
  9226. func (c *OrdersGettestordertemplateCall) Context(ctx context.Context) *OrdersGettestordertemplateCall {
  9227. c.ctx_ = ctx
  9228. return c
  9229. }
  9230. func (c *OrdersGettestordertemplateCall) doRequest(alt string) (*http.Response, error) {
  9231. var body io.Reader = nil
  9232. c.urlParams_.Set("alt", alt)
  9233. urls := googleapi.ResolveRelative(c.s.BasePath, "{merchantId}/testordertemplates/{templateName}")
  9234. urls += "?" + c.urlParams_.Encode()
  9235. req, _ := http.NewRequest("GET", urls, body)
  9236. googleapi.Expand(req.URL, map[string]string{
  9237. "merchantId": strconv.FormatUint(c.merchantId, 10),
  9238. "templateName": c.templateName,
  9239. })
  9240. req.Header.Set("User-Agent", c.s.userAgent())
  9241. if c.ifNoneMatch_ != "" {
  9242. req.Header.Set("If-None-Match", c.ifNoneMatch_)
  9243. }
  9244. if c.ctx_ != nil {
  9245. return ctxhttp.Do(c.ctx_, c.s.client, req)
  9246. }
  9247. return c.s.client.Do(req)
  9248. }
  9249. // Do executes the "content.orders.gettestordertemplate" call.
  9250. // Exactly one of *OrdersGetTestOrderTemplateResponse or error will be
  9251. // non-nil. Any non-2xx status code is an error. Response headers are in
  9252. // either *OrdersGetTestOrderTemplateResponse.ServerResponse.Header or
  9253. // (if a response was returned at all) in
  9254. // error.(*googleapi.Error).Header. Use googleapi.IsNotModified to check
  9255. // whether the returned error was because http.StatusNotModified was
  9256. // returned.
  9257. func (c *OrdersGettestordertemplateCall) Do(opts ...googleapi.CallOption) (*OrdersGetTestOrderTemplateResponse, error) {
  9258. gensupport.SetOptions(c.urlParams_, opts...)
  9259. res, err := c.doRequest("json")
  9260. if res != nil && res.StatusCode == http.StatusNotModified {
  9261. if res.Body != nil {
  9262. res.Body.Close()
  9263. }
  9264. return nil, &googleapi.Error{
  9265. Code: res.StatusCode,
  9266. Header: res.Header,
  9267. }
  9268. }
  9269. if err != nil {
  9270. return nil, err
  9271. }
  9272. defer googleapi.CloseBody(res)
  9273. if err := googleapi.CheckResponse(res); err != nil {
  9274. return nil, err
  9275. }
  9276. ret := &OrdersGetTestOrderTemplateResponse{
  9277. ServerResponse: googleapi.ServerResponse{
  9278. Header: res.Header,
  9279. HTTPStatusCode: res.StatusCode,
  9280. },
  9281. }
  9282. if err := json.NewDecoder(res.Body).Decode(&ret); err != nil {
  9283. return nil, err
  9284. }
  9285. return ret, nil
  9286. // {
  9287. // "description": "Sandbox only. Retrieves an order template that can be used to quickly create a new order in sandbox.",
  9288. // "httpMethod": "GET",
  9289. // "id": "content.orders.gettestordertemplate",
  9290. // "parameterOrder": [
  9291. // "merchantId",
  9292. // "templateName"
  9293. // ],
  9294. // "parameters": {
  9295. // "merchantId": {
  9296. // "description": "The ID of the managing account.",
  9297. // "format": "uint64",
  9298. // "location": "path",
  9299. // "required": true,
  9300. // "type": "string"
  9301. // },
  9302. // "templateName": {
  9303. // "description": "The name of the template to retrieve.",
  9304. // "enum": [
  9305. // "template1",
  9306. // "template2"
  9307. // ],
  9308. // "enumDescriptions": [
  9309. // "",
  9310. // ""
  9311. // ],
  9312. // "location": "path",
  9313. // "required": true,
  9314. // "type": "string"
  9315. // }
  9316. // },
  9317. // "path": "{merchantId}/testordertemplates/{templateName}",
  9318. // "response": {
  9319. // "$ref": "OrdersGetTestOrderTemplateResponse"
  9320. // },
  9321. // "scopes": [
  9322. // "https://www.googleapis.com/auth/content"
  9323. // ]
  9324. // }
  9325. }
  9326. // method id "content.orders.list":
  9327. type OrdersListCall struct {
  9328. s *Service
  9329. merchantId uint64
  9330. urlParams_ gensupport.URLParams
  9331. ifNoneMatch_ string
  9332. ctx_ context.Context
  9333. }
  9334. // List: Lists the orders in your Merchant Center account.
  9335. func (r *OrdersService) List(merchantId uint64) *OrdersListCall {
  9336. c := &OrdersListCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  9337. c.merchantId = merchantId
  9338. return c
  9339. }
  9340. // Acknowledged sets the optional parameter "acknowledged": Obtains
  9341. // orders that match the acknowledgement status. When set to true,
  9342. // obtains orders that have been acknowledged. When false, obtains
  9343. // orders that have not been acknowledged.
  9344. // We recommend using this filter set to false, in conjunction with the
  9345. // acknowledge call, such that only un-acknowledged orders are returned.
  9346. func (c *OrdersListCall) Acknowledged(acknowledged bool) *OrdersListCall {
  9347. c.urlParams_.Set("acknowledged", fmt.Sprint(acknowledged))
  9348. return c
  9349. }
  9350. // MaxResults sets the optional parameter "maxResults": The maximum
  9351. // number of orders to return in the response, used for paging. The
  9352. // default value is 25 orders per page, and the maximum allowed value is
  9353. // 250 orders per page.
  9354. // Known issue: All List calls will return all Orders without limit
  9355. // regardless of the value of this field.
  9356. func (c *OrdersListCall) MaxResults(maxResults int64) *OrdersListCall {
  9357. c.urlParams_.Set("maxResults", fmt.Sprint(maxResults))
  9358. return c
  9359. }
  9360. // OrderBy sets the optional parameter "orderBy": The ordering of the
  9361. // returned list. The only supported value are placedDate desc and
  9362. // placedDate asc for now, which returns orders sorted by placement
  9363. // date. "placedDate desc" stands for listing orders by placement date,
  9364. // from oldest to most recent. "placedDate asc" stands for listing
  9365. // orders by placement date, from most recent to oldest. In future
  9366. // releases we'll support other sorting criteria.
  9367. //
  9368. // Possible values:
  9369. // "placedDate asc"
  9370. // "placedDate desc"
  9371. func (c *OrdersListCall) OrderBy(orderBy string) *OrdersListCall {
  9372. c.urlParams_.Set("orderBy", orderBy)
  9373. return c
  9374. }
  9375. // PageToken sets the optional parameter "pageToken": The token returned
  9376. // by the previous request.
  9377. func (c *OrdersListCall) PageToken(pageToken string) *OrdersListCall {
  9378. c.urlParams_.Set("pageToken", pageToken)
  9379. return c
  9380. }
  9381. // PlacedDateEnd sets the optional parameter "placedDateEnd": Obtains
  9382. // orders placed before this date (exclusively), in ISO 8601 format.
  9383. func (c *OrdersListCall) PlacedDateEnd(placedDateEnd string) *OrdersListCall {
  9384. c.urlParams_.Set("placedDateEnd", placedDateEnd)
  9385. return c
  9386. }
  9387. // PlacedDateStart sets the optional parameter "placedDateStart":
  9388. // Obtains orders placed after this date (inclusively), in ISO 8601
  9389. // format.
  9390. func (c *OrdersListCall) PlacedDateStart(placedDateStart string) *OrdersListCall {
  9391. c.urlParams_.Set("placedDateStart", placedDateStart)
  9392. return c
  9393. }
  9394. // Statuses sets the optional parameter "statuses": Obtains orders that
  9395. // match any of the specified statuses. Multiple values can be specified
  9396. // with comma separation. Additionally, please note that active is a
  9397. // shortcut for pendingShipment and partiallyShipped, and completed is a
  9398. // shortcut for shipped , partiallyDelivered, delivered,
  9399. // partiallyReturned, returned, and canceled.
  9400. //
  9401. // Possible values:
  9402. // "active"
  9403. // "canceled"
  9404. // "completed"
  9405. // "delivered"
  9406. // "inProgress"
  9407. // "partiallyDelivered"
  9408. // "partiallyReturned"
  9409. // "partiallyShipped"
  9410. // "pendingShipment"
  9411. // "returned"
  9412. // "shipped"
  9413. func (c *OrdersListCall) Statuses(statuses ...string) *OrdersListCall {
  9414. c.urlParams_.SetMulti("statuses", append([]string{}, statuses...))
  9415. return c
  9416. }
  9417. // Fields allows partial responses to be retrieved. See
  9418. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  9419. // for more information.
  9420. func (c *OrdersListCall) Fields(s ...googleapi.Field) *OrdersListCall {
  9421. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  9422. return c
  9423. }
  9424. // IfNoneMatch sets the optional parameter which makes the operation
  9425. // fail if the object's ETag matches the given value. This is useful for
  9426. // getting updates only after the object has changed since the last
  9427. // request. Use googleapi.IsNotModified to check whether the response
  9428. // error from Do is the result of In-None-Match.
  9429. func (c *OrdersListCall) IfNoneMatch(entityTag string) *OrdersListCall {
  9430. c.ifNoneMatch_ = entityTag
  9431. return c
  9432. }
  9433. // Context sets the context to be used in this call's Do method. Any
  9434. // pending HTTP request will be aborted if the provided context is
  9435. // canceled.
  9436. func (c *OrdersListCall) Context(ctx context.Context) *OrdersListCall {
  9437. c.ctx_ = ctx
  9438. return c
  9439. }
  9440. func (c *OrdersListCall) doRequest(alt string) (*http.Response, error) {
  9441. var body io.Reader = nil
  9442. c.urlParams_.Set("alt", alt)
  9443. urls := googleapi.ResolveRelative(c.s.BasePath, "{merchantId}/orders")
  9444. urls += "?" + c.urlParams_.Encode()
  9445. req, _ := http.NewRequest("GET", urls, body)
  9446. googleapi.Expand(req.URL, map[string]string{
  9447. "merchantId": strconv.FormatUint(c.merchantId, 10),
  9448. })
  9449. req.Header.Set("User-Agent", c.s.userAgent())
  9450. if c.ifNoneMatch_ != "" {
  9451. req.Header.Set("If-None-Match", c.ifNoneMatch_)
  9452. }
  9453. if c.ctx_ != nil {
  9454. return ctxhttp.Do(c.ctx_, c.s.client, req)
  9455. }
  9456. return c.s.client.Do(req)
  9457. }
  9458. // Do executes the "content.orders.list" call.
  9459. // Exactly one of *OrdersListResponse or error will be non-nil. Any
  9460. // non-2xx status code is an error. Response headers are in either
  9461. // *OrdersListResponse.ServerResponse.Header or (if a response was
  9462. // returned at all) in error.(*googleapi.Error).Header. Use
  9463. // googleapi.IsNotModified to check whether the returned error was
  9464. // because http.StatusNotModified was returned.
  9465. func (c *OrdersListCall) Do(opts ...googleapi.CallOption) (*OrdersListResponse, error) {
  9466. gensupport.SetOptions(c.urlParams_, opts...)
  9467. res, err := c.doRequest("json")
  9468. if res != nil && res.StatusCode == http.StatusNotModified {
  9469. if res.Body != nil {
  9470. res.Body.Close()
  9471. }
  9472. return nil, &googleapi.Error{
  9473. Code: res.StatusCode,
  9474. Header: res.Header,
  9475. }
  9476. }
  9477. if err != nil {
  9478. return nil, err
  9479. }
  9480. defer googleapi.CloseBody(res)
  9481. if err := googleapi.CheckResponse(res); err != nil {
  9482. return nil, err
  9483. }
  9484. ret := &OrdersListResponse{
  9485. ServerResponse: googleapi.ServerResponse{
  9486. Header: res.Header,
  9487. HTTPStatusCode: res.StatusCode,
  9488. },
  9489. }
  9490. if err := json.NewDecoder(res.Body).Decode(&ret); err != nil {
  9491. return nil, err
  9492. }
  9493. return ret, nil
  9494. // {
  9495. // "description": "Lists the orders in your Merchant Center account.",
  9496. // "httpMethod": "GET",
  9497. // "id": "content.orders.list",
  9498. // "parameterOrder": [
  9499. // "merchantId"
  9500. // ],
  9501. // "parameters": {
  9502. // "acknowledged": {
  9503. // "description": "Obtains orders that match the acknowledgement status. When set to true, obtains orders that have been acknowledged. When false, obtains orders that have not been acknowledged.\nWe recommend using this filter set to false, in conjunction with the acknowledge call, such that only un-acknowledged orders are returned.",
  9504. // "location": "query",
  9505. // "type": "boolean"
  9506. // },
  9507. // "maxResults": {
  9508. // "description": "The maximum number of orders to return in the response, used for paging. The default value is 25 orders per page, and the maximum allowed value is 250 orders per page.\nKnown issue: All List calls will return all Orders without limit regardless of the value of this field.",
  9509. // "format": "uint32",
  9510. // "location": "query",
  9511. // "type": "integer"
  9512. // },
  9513. // "merchantId": {
  9514. // "description": "The ID of the managing account.",
  9515. // "format": "uint64",
  9516. // "location": "path",
  9517. // "required": true,
  9518. // "type": "string"
  9519. // },
  9520. // "orderBy": {
  9521. // "description": "The ordering of the returned list. The only supported value are placedDate desc and placedDate asc for now, which returns orders sorted by placement date. \"placedDate desc\" stands for listing orders by placement date, from oldest to most recent. \"placedDate asc\" stands for listing orders by placement date, from most recent to oldest. In future releases we'll support other sorting criteria.",
  9522. // "enum": [
  9523. // "placedDate asc",
  9524. // "placedDate desc"
  9525. // ],
  9526. // "enumDescriptions": [
  9527. // "",
  9528. // ""
  9529. // ],
  9530. // "location": "query",
  9531. // "type": "string"
  9532. // },
  9533. // "pageToken": {
  9534. // "description": "The token returned by the previous request.",
  9535. // "location": "query",
  9536. // "type": "string"
  9537. // },
  9538. // "placedDateEnd": {
  9539. // "description": "Obtains orders placed before this date (exclusively), in ISO 8601 format.",
  9540. // "location": "query",
  9541. // "type": "string"
  9542. // },
  9543. // "placedDateStart": {
  9544. // "description": "Obtains orders placed after this date (inclusively), in ISO 8601 format.",
  9545. // "location": "query",
  9546. // "type": "string"
  9547. // },
  9548. // "statuses": {
  9549. // "description": "Obtains orders that match any of the specified statuses. Multiple values can be specified with comma separation. Additionally, please note that active is a shortcut for pendingShipment and partiallyShipped, and completed is a shortcut for shipped , partiallyDelivered, delivered, partiallyReturned, returned, and canceled.",
  9550. // "enum": [
  9551. // "active",
  9552. // "canceled",
  9553. // "completed",
  9554. // "delivered",
  9555. // "inProgress",
  9556. // "partiallyDelivered",
  9557. // "partiallyReturned",
  9558. // "partiallyShipped",
  9559. // "pendingShipment",
  9560. // "returned",
  9561. // "shipped"
  9562. // ],
  9563. // "enumDescriptions": [
  9564. // "",
  9565. // "",
  9566. // "",
  9567. // "",
  9568. // "",
  9569. // "",
  9570. // "",
  9571. // "",
  9572. // "",
  9573. // "",
  9574. // ""
  9575. // ],
  9576. // "location": "query",
  9577. // "repeated": true,
  9578. // "type": "string"
  9579. // }
  9580. // },
  9581. // "path": "{merchantId}/orders",
  9582. // "response": {
  9583. // "$ref": "OrdersListResponse"
  9584. // },
  9585. // "scopes": [
  9586. // "https://www.googleapis.com/auth/content"
  9587. // ]
  9588. // }
  9589. }
  9590. // Pages invokes f for each page of results.
  9591. // A non-nil error returned from f will halt the iteration.
  9592. // The provided context supersedes any context provided to the Context method.
  9593. func (c *OrdersListCall) Pages(ctx context.Context, f func(*OrdersListResponse) error) error {
  9594. c.ctx_ = ctx
  9595. defer c.PageToken(c.urlParams_.Get("pageToken")) // reset paging to original point
  9596. for {
  9597. x, err := c.Do()
  9598. if err != nil {
  9599. return err
  9600. }
  9601. if err := f(x); err != nil {
  9602. return err
  9603. }
  9604. if x.NextPageToken == "" {
  9605. return nil
  9606. }
  9607. c.PageToken(x.NextPageToken)
  9608. }
  9609. }
  9610. // method id "content.orders.refund":
  9611. type OrdersRefundCall struct {
  9612. s *Service
  9613. merchantId uint64
  9614. orderId string
  9615. ordersrefundrequest *OrdersRefundRequest
  9616. urlParams_ gensupport.URLParams
  9617. ctx_ context.Context
  9618. }
  9619. // Refund: Refund a portion of the order, up to the full amount paid.
  9620. func (r *OrdersService) Refund(merchantId uint64, orderId string, ordersrefundrequest *OrdersRefundRequest) *OrdersRefundCall {
  9621. c := &OrdersRefundCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  9622. c.merchantId = merchantId
  9623. c.orderId = orderId
  9624. c.ordersrefundrequest = ordersrefundrequest
  9625. return c
  9626. }
  9627. // Fields allows partial responses to be retrieved. See
  9628. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  9629. // for more information.
  9630. func (c *OrdersRefundCall) Fields(s ...googleapi.Field) *OrdersRefundCall {
  9631. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  9632. return c
  9633. }
  9634. // Context sets the context to be used in this call's Do method. Any
  9635. // pending HTTP request will be aborted if the provided context is
  9636. // canceled.
  9637. func (c *OrdersRefundCall) Context(ctx context.Context) *OrdersRefundCall {
  9638. c.ctx_ = ctx
  9639. return c
  9640. }
  9641. func (c *OrdersRefundCall) doRequest(alt string) (*http.Response, error) {
  9642. var body io.Reader = nil
  9643. body, err := googleapi.WithoutDataWrapper.JSONReader(c.ordersrefundrequest)
  9644. if err != nil {
  9645. return nil, err
  9646. }
  9647. ctype := "application/json"
  9648. c.urlParams_.Set("alt", alt)
  9649. urls := googleapi.ResolveRelative(c.s.BasePath, "{merchantId}/orders/{orderId}/refund")
  9650. urls += "?" + c.urlParams_.Encode()
  9651. req, _ := http.NewRequest("POST", urls, body)
  9652. googleapi.Expand(req.URL, map[string]string{
  9653. "merchantId": strconv.FormatUint(c.merchantId, 10),
  9654. "orderId": c.orderId,
  9655. })
  9656. req.Header.Set("Content-Type", ctype)
  9657. req.Header.Set("User-Agent", c.s.userAgent())
  9658. if c.ctx_ != nil {
  9659. return ctxhttp.Do(c.ctx_, c.s.client, req)
  9660. }
  9661. return c.s.client.Do(req)
  9662. }
  9663. // Do executes the "content.orders.refund" call.
  9664. // Exactly one of *OrdersRefundResponse or error will be non-nil. Any
  9665. // non-2xx status code is an error. Response headers are in either
  9666. // *OrdersRefundResponse.ServerResponse.Header or (if a response was
  9667. // returned at all) in error.(*googleapi.Error).Header. Use
  9668. // googleapi.IsNotModified to check whether the returned error was
  9669. // because http.StatusNotModified was returned.
  9670. func (c *OrdersRefundCall) Do(opts ...googleapi.CallOption) (*OrdersRefundResponse, error) {
  9671. gensupport.SetOptions(c.urlParams_, opts...)
  9672. res, err := c.doRequest("json")
  9673. if res != nil && res.StatusCode == http.StatusNotModified {
  9674. if res.Body != nil {
  9675. res.Body.Close()
  9676. }
  9677. return nil, &googleapi.Error{
  9678. Code: res.StatusCode,
  9679. Header: res.Header,
  9680. }
  9681. }
  9682. if err != nil {
  9683. return nil, err
  9684. }
  9685. defer googleapi.CloseBody(res)
  9686. if err := googleapi.CheckResponse(res); err != nil {
  9687. return nil, err
  9688. }
  9689. ret := &OrdersRefundResponse{
  9690. ServerResponse: googleapi.ServerResponse{
  9691. Header: res.Header,
  9692. HTTPStatusCode: res.StatusCode,
  9693. },
  9694. }
  9695. if err := json.NewDecoder(res.Body).Decode(&ret); err != nil {
  9696. return nil, err
  9697. }
  9698. return ret, nil
  9699. // {
  9700. // "description": "Refund a portion of the order, up to the full amount paid.",
  9701. // "httpMethod": "POST",
  9702. // "id": "content.orders.refund",
  9703. // "parameterOrder": [
  9704. // "merchantId",
  9705. // "orderId"
  9706. // ],
  9707. // "parameters": {
  9708. // "merchantId": {
  9709. // "description": "The ID of the managing account.",
  9710. // "format": "uint64",
  9711. // "location": "path",
  9712. // "required": true,
  9713. // "type": "string"
  9714. // },
  9715. // "orderId": {
  9716. // "description": "The ID of the order to refund.",
  9717. // "location": "path",
  9718. // "required": true,
  9719. // "type": "string"
  9720. // }
  9721. // },
  9722. // "path": "{merchantId}/orders/{orderId}/refund",
  9723. // "request": {
  9724. // "$ref": "OrdersRefundRequest"
  9725. // },
  9726. // "response": {
  9727. // "$ref": "OrdersRefundResponse"
  9728. // },
  9729. // "scopes": [
  9730. // "https://www.googleapis.com/auth/content"
  9731. // ]
  9732. // }
  9733. }
  9734. // method id "content.orders.returnlineitem":
  9735. type OrdersReturnlineitemCall struct {
  9736. s *Service
  9737. merchantId uint64
  9738. orderId string
  9739. ordersreturnlineitemrequest *OrdersReturnLineItemRequest
  9740. urlParams_ gensupport.URLParams
  9741. ctx_ context.Context
  9742. }
  9743. // Returnlineitem: Returns a line item.
  9744. func (r *OrdersService) Returnlineitem(merchantId uint64, orderId string, ordersreturnlineitemrequest *OrdersReturnLineItemRequest) *OrdersReturnlineitemCall {
  9745. c := &OrdersReturnlineitemCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  9746. c.merchantId = merchantId
  9747. c.orderId = orderId
  9748. c.ordersreturnlineitemrequest = ordersreturnlineitemrequest
  9749. return c
  9750. }
  9751. // Fields allows partial responses to be retrieved. See
  9752. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  9753. // for more information.
  9754. func (c *OrdersReturnlineitemCall) Fields(s ...googleapi.Field) *OrdersReturnlineitemCall {
  9755. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  9756. return c
  9757. }
  9758. // Context sets the context to be used in this call's Do method. Any
  9759. // pending HTTP request will be aborted if the provided context is
  9760. // canceled.
  9761. func (c *OrdersReturnlineitemCall) Context(ctx context.Context) *OrdersReturnlineitemCall {
  9762. c.ctx_ = ctx
  9763. return c
  9764. }
  9765. func (c *OrdersReturnlineitemCall) doRequest(alt string) (*http.Response, error) {
  9766. var body io.Reader = nil
  9767. body, err := googleapi.WithoutDataWrapper.JSONReader(c.ordersreturnlineitemrequest)
  9768. if err != nil {
  9769. return nil, err
  9770. }
  9771. ctype := "application/json"
  9772. c.urlParams_.Set("alt", alt)
  9773. urls := googleapi.ResolveRelative(c.s.BasePath, "{merchantId}/orders/{orderId}/returnLineItem")
  9774. urls += "?" + c.urlParams_.Encode()
  9775. req, _ := http.NewRequest("POST", urls, body)
  9776. googleapi.Expand(req.URL, map[string]string{
  9777. "merchantId": strconv.FormatUint(c.merchantId, 10),
  9778. "orderId": c.orderId,
  9779. })
  9780. req.Header.Set("Content-Type", ctype)
  9781. req.Header.Set("User-Agent", c.s.userAgent())
  9782. if c.ctx_ != nil {
  9783. return ctxhttp.Do(c.ctx_, c.s.client, req)
  9784. }
  9785. return c.s.client.Do(req)
  9786. }
  9787. // Do executes the "content.orders.returnlineitem" call.
  9788. // Exactly one of *OrdersReturnLineItemResponse or error will be
  9789. // non-nil. Any non-2xx status code is an error. Response headers are in
  9790. // either *OrdersReturnLineItemResponse.ServerResponse.Header or (if a
  9791. // response was returned at all) in error.(*googleapi.Error).Header. Use
  9792. // googleapi.IsNotModified to check whether the returned error was
  9793. // because http.StatusNotModified was returned.
  9794. func (c *OrdersReturnlineitemCall) Do(opts ...googleapi.CallOption) (*OrdersReturnLineItemResponse, error) {
  9795. gensupport.SetOptions(c.urlParams_, opts...)
  9796. res, err := c.doRequest("json")
  9797. if res != nil && res.StatusCode == http.StatusNotModified {
  9798. if res.Body != nil {
  9799. res.Body.Close()
  9800. }
  9801. return nil, &googleapi.Error{
  9802. Code: res.StatusCode,
  9803. Header: res.Header,
  9804. }
  9805. }
  9806. if err != nil {
  9807. return nil, err
  9808. }
  9809. defer googleapi.CloseBody(res)
  9810. if err := googleapi.CheckResponse(res); err != nil {
  9811. return nil, err
  9812. }
  9813. ret := &OrdersReturnLineItemResponse{
  9814. ServerResponse: googleapi.ServerResponse{
  9815. Header: res.Header,
  9816. HTTPStatusCode: res.StatusCode,
  9817. },
  9818. }
  9819. if err := json.NewDecoder(res.Body).Decode(&ret); err != nil {
  9820. return nil, err
  9821. }
  9822. return ret, nil
  9823. // {
  9824. // "description": "Returns a line item.",
  9825. // "httpMethod": "POST",
  9826. // "id": "content.orders.returnlineitem",
  9827. // "parameterOrder": [
  9828. // "merchantId",
  9829. // "orderId"
  9830. // ],
  9831. // "parameters": {
  9832. // "merchantId": {
  9833. // "description": "The ID of the managing account.",
  9834. // "format": "uint64",
  9835. // "location": "path",
  9836. // "required": true,
  9837. // "type": "string"
  9838. // },
  9839. // "orderId": {
  9840. // "description": "The ID of the order.",
  9841. // "location": "path",
  9842. // "required": true,
  9843. // "type": "string"
  9844. // }
  9845. // },
  9846. // "path": "{merchantId}/orders/{orderId}/returnLineItem",
  9847. // "request": {
  9848. // "$ref": "OrdersReturnLineItemRequest"
  9849. // },
  9850. // "response": {
  9851. // "$ref": "OrdersReturnLineItemResponse"
  9852. // },
  9853. // "scopes": [
  9854. // "https://www.googleapis.com/auth/content"
  9855. // ]
  9856. // }
  9857. }
  9858. // method id "content.orders.shiplineitems":
  9859. type OrdersShiplineitemsCall struct {
  9860. s *Service
  9861. merchantId uint64
  9862. orderId string
  9863. ordersshiplineitemsrequest *OrdersShipLineItemsRequest
  9864. urlParams_ gensupport.URLParams
  9865. ctx_ context.Context
  9866. }
  9867. // Shiplineitems: Marks line item(s) as shipped.
  9868. func (r *OrdersService) Shiplineitems(merchantId uint64, orderId string, ordersshiplineitemsrequest *OrdersShipLineItemsRequest) *OrdersShiplineitemsCall {
  9869. c := &OrdersShiplineitemsCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  9870. c.merchantId = merchantId
  9871. c.orderId = orderId
  9872. c.ordersshiplineitemsrequest = ordersshiplineitemsrequest
  9873. return c
  9874. }
  9875. // Fields allows partial responses to be retrieved. See
  9876. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  9877. // for more information.
  9878. func (c *OrdersShiplineitemsCall) Fields(s ...googleapi.Field) *OrdersShiplineitemsCall {
  9879. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  9880. return c
  9881. }
  9882. // Context sets the context to be used in this call's Do method. Any
  9883. // pending HTTP request will be aborted if the provided context is
  9884. // canceled.
  9885. func (c *OrdersShiplineitemsCall) Context(ctx context.Context) *OrdersShiplineitemsCall {
  9886. c.ctx_ = ctx
  9887. return c
  9888. }
  9889. func (c *OrdersShiplineitemsCall) doRequest(alt string) (*http.Response, error) {
  9890. var body io.Reader = nil
  9891. body, err := googleapi.WithoutDataWrapper.JSONReader(c.ordersshiplineitemsrequest)
  9892. if err != nil {
  9893. return nil, err
  9894. }
  9895. ctype := "application/json"
  9896. c.urlParams_.Set("alt", alt)
  9897. urls := googleapi.ResolveRelative(c.s.BasePath, "{merchantId}/orders/{orderId}/shipLineItems")
  9898. urls += "?" + c.urlParams_.Encode()
  9899. req, _ := http.NewRequest("POST", urls, body)
  9900. googleapi.Expand(req.URL, map[string]string{
  9901. "merchantId": strconv.FormatUint(c.merchantId, 10),
  9902. "orderId": c.orderId,
  9903. })
  9904. req.Header.Set("Content-Type", ctype)
  9905. req.Header.Set("User-Agent", c.s.userAgent())
  9906. if c.ctx_ != nil {
  9907. return ctxhttp.Do(c.ctx_, c.s.client, req)
  9908. }
  9909. return c.s.client.Do(req)
  9910. }
  9911. // Do executes the "content.orders.shiplineitems" call.
  9912. // Exactly one of *OrdersShipLineItemsResponse or error will be non-nil.
  9913. // Any non-2xx status code is an error. Response headers are in either
  9914. // *OrdersShipLineItemsResponse.ServerResponse.Header or (if a response
  9915. // was returned at all) in error.(*googleapi.Error).Header. Use
  9916. // googleapi.IsNotModified to check whether the returned error was
  9917. // because http.StatusNotModified was returned.
  9918. func (c *OrdersShiplineitemsCall) Do(opts ...googleapi.CallOption) (*OrdersShipLineItemsResponse, error) {
  9919. gensupport.SetOptions(c.urlParams_, opts...)
  9920. res, err := c.doRequest("json")
  9921. if res != nil && res.StatusCode == http.StatusNotModified {
  9922. if res.Body != nil {
  9923. res.Body.Close()
  9924. }
  9925. return nil, &googleapi.Error{
  9926. Code: res.StatusCode,
  9927. Header: res.Header,
  9928. }
  9929. }
  9930. if err != nil {
  9931. return nil, err
  9932. }
  9933. defer googleapi.CloseBody(res)
  9934. if err := googleapi.CheckResponse(res); err != nil {
  9935. return nil, err
  9936. }
  9937. ret := &OrdersShipLineItemsResponse{
  9938. ServerResponse: googleapi.ServerResponse{
  9939. Header: res.Header,
  9940. HTTPStatusCode: res.StatusCode,
  9941. },
  9942. }
  9943. if err := json.NewDecoder(res.Body).Decode(&ret); err != nil {
  9944. return nil, err
  9945. }
  9946. return ret, nil
  9947. // {
  9948. // "description": "Marks line item(s) as shipped.",
  9949. // "httpMethod": "POST",
  9950. // "id": "content.orders.shiplineitems",
  9951. // "parameterOrder": [
  9952. // "merchantId",
  9953. // "orderId"
  9954. // ],
  9955. // "parameters": {
  9956. // "merchantId": {
  9957. // "description": "The ID of the managing account.",
  9958. // "format": "uint64",
  9959. // "location": "path",
  9960. // "required": true,
  9961. // "type": "string"
  9962. // },
  9963. // "orderId": {
  9964. // "description": "The ID of the order.",
  9965. // "location": "path",
  9966. // "required": true,
  9967. // "type": "string"
  9968. // }
  9969. // },
  9970. // "path": "{merchantId}/orders/{orderId}/shipLineItems",
  9971. // "request": {
  9972. // "$ref": "OrdersShipLineItemsRequest"
  9973. // },
  9974. // "response": {
  9975. // "$ref": "OrdersShipLineItemsResponse"
  9976. // },
  9977. // "scopes": [
  9978. // "https://www.googleapis.com/auth/content"
  9979. // ]
  9980. // }
  9981. }
  9982. // method id "content.orders.updatemerchantorderid":
  9983. type OrdersUpdatemerchantorderidCall struct {
  9984. s *Service
  9985. merchantId uint64
  9986. orderId string
  9987. ordersupdatemerchantorderidrequest *OrdersUpdateMerchantOrderIdRequest
  9988. urlParams_ gensupport.URLParams
  9989. ctx_ context.Context
  9990. }
  9991. // Updatemerchantorderid: Updates the merchant order ID for a given
  9992. // order.
  9993. func (r *OrdersService) Updatemerchantorderid(merchantId uint64, orderId string, ordersupdatemerchantorderidrequest *OrdersUpdateMerchantOrderIdRequest) *OrdersUpdatemerchantorderidCall {
  9994. c := &OrdersUpdatemerchantorderidCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  9995. c.merchantId = merchantId
  9996. c.orderId = orderId
  9997. c.ordersupdatemerchantorderidrequest = ordersupdatemerchantorderidrequest
  9998. return c
  9999. }
  10000. // Fields allows partial responses to be retrieved. See
  10001. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  10002. // for more information.
  10003. func (c *OrdersUpdatemerchantorderidCall) Fields(s ...googleapi.Field) *OrdersUpdatemerchantorderidCall {
  10004. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  10005. return c
  10006. }
  10007. // Context sets the context to be used in this call's Do method. Any
  10008. // pending HTTP request will be aborted if the provided context is
  10009. // canceled.
  10010. func (c *OrdersUpdatemerchantorderidCall) Context(ctx context.Context) *OrdersUpdatemerchantorderidCall {
  10011. c.ctx_ = ctx
  10012. return c
  10013. }
  10014. func (c *OrdersUpdatemerchantorderidCall) doRequest(alt string) (*http.Response, error) {
  10015. var body io.Reader = nil
  10016. body, err := googleapi.WithoutDataWrapper.JSONReader(c.ordersupdatemerchantorderidrequest)
  10017. if err != nil {
  10018. return nil, err
  10019. }
  10020. ctype := "application/json"
  10021. c.urlParams_.Set("alt", alt)
  10022. urls := googleapi.ResolveRelative(c.s.BasePath, "{merchantId}/orders/{orderId}/updateMerchantOrderId")
  10023. urls += "?" + c.urlParams_.Encode()
  10024. req, _ := http.NewRequest("POST", urls, body)
  10025. googleapi.Expand(req.URL, map[string]string{
  10026. "merchantId": strconv.FormatUint(c.merchantId, 10),
  10027. "orderId": c.orderId,
  10028. })
  10029. req.Header.Set("Content-Type", ctype)
  10030. req.Header.Set("User-Agent", c.s.userAgent())
  10031. if c.ctx_ != nil {
  10032. return ctxhttp.Do(c.ctx_, c.s.client, req)
  10033. }
  10034. return c.s.client.Do(req)
  10035. }
  10036. // Do executes the "content.orders.updatemerchantorderid" call.
  10037. // Exactly one of *OrdersUpdateMerchantOrderIdResponse or error will be
  10038. // non-nil. Any non-2xx status code is an error. Response headers are in
  10039. // either *OrdersUpdateMerchantOrderIdResponse.ServerResponse.Header or
  10040. // (if a response was returned at all) in
  10041. // error.(*googleapi.Error).Header. Use googleapi.IsNotModified to check
  10042. // whether the returned error was because http.StatusNotModified was
  10043. // returned.
  10044. func (c *OrdersUpdatemerchantorderidCall) Do(opts ...googleapi.CallOption) (*OrdersUpdateMerchantOrderIdResponse, error) {
  10045. gensupport.SetOptions(c.urlParams_, opts...)
  10046. res, err := c.doRequest("json")
  10047. if res != nil && res.StatusCode == http.StatusNotModified {
  10048. if res.Body != nil {
  10049. res.Body.Close()
  10050. }
  10051. return nil, &googleapi.Error{
  10052. Code: res.StatusCode,
  10053. Header: res.Header,
  10054. }
  10055. }
  10056. if err != nil {
  10057. return nil, err
  10058. }
  10059. defer googleapi.CloseBody(res)
  10060. if err := googleapi.CheckResponse(res); err != nil {
  10061. return nil, err
  10062. }
  10063. ret := &OrdersUpdateMerchantOrderIdResponse{
  10064. ServerResponse: googleapi.ServerResponse{
  10065. Header: res.Header,
  10066. HTTPStatusCode: res.StatusCode,
  10067. },
  10068. }
  10069. if err := json.NewDecoder(res.Body).Decode(&ret); err != nil {
  10070. return nil, err
  10071. }
  10072. return ret, nil
  10073. // {
  10074. // "description": "Updates the merchant order ID for a given order.",
  10075. // "httpMethod": "POST",
  10076. // "id": "content.orders.updatemerchantorderid",
  10077. // "parameterOrder": [
  10078. // "merchantId",
  10079. // "orderId"
  10080. // ],
  10081. // "parameters": {
  10082. // "merchantId": {
  10083. // "description": "The ID of the managing account.",
  10084. // "format": "uint64",
  10085. // "location": "path",
  10086. // "required": true,
  10087. // "type": "string"
  10088. // },
  10089. // "orderId": {
  10090. // "description": "The ID of the order.",
  10091. // "location": "path",
  10092. // "required": true,
  10093. // "type": "string"
  10094. // }
  10095. // },
  10096. // "path": "{merchantId}/orders/{orderId}/updateMerchantOrderId",
  10097. // "request": {
  10098. // "$ref": "OrdersUpdateMerchantOrderIdRequest"
  10099. // },
  10100. // "response": {
  10101. // "$ref": "OrdersUpdateMerchantOrderIdResponse"
  10102. // },
  10103. // "scopes": [
  10104. // "https://www.googleapis.com/auth/content"
  10105. // ]
  10106. // }
  10107. }
  10108. // method id "content.orders.updateshipment":
  10109. type OrdersUpdateshipmentCall struct {
  10110. s *Service
  10111. merchantId uint64
  10112. orderId string
  10113. ordersupdateshipmentrequest *OrdersUpdateShipmentRequest
  10114. urlParams_ gensupport.URLParams
  10115. ctx_ context.Context
  10116. }
  10117. // Updateshipment: Updates a shipment's status, carrier, and/or tracking
  10118. // ID.
  10119. func (r *OrdersService) Updateshipment(merchantId uint64, orderId string, ordersupdateshipmentrequest *OrdersUpdateShipmentRequest) *OrdersUpdateshipmentCall {
  10120. c := &OrdersUpdateshipmentCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  10121. c.merchantId = merchantId
  10122. c.orderId = orderId
  10123. c.ordersupdateshipmentrequest = ordersupdateshipmentrequest
  10124. return c
  10125. }
  10126. // Fields allows partial responses to be retrieved. See
  10127. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  10128. // for more information.
  10129. func (c *OrdersUpdateshipmentCall) Fields(s ...googleapi.Field) *OrdersUpdateshipmentCall {
  10130. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  10131. return c
  10132. }
  10133. // Context sets the context to be used in this call's Do method. Any
  10134. // pending HTTP request will be aborted if the provided context is
  10135. // canceled.
  10136. func (c *OrdersUpdateshipmentCall) Context(ctx context.Context) *OrdersUpdateshipmentCall {
  10137. c.ctx_ = ctx
  10138. return c
  10139. }
  10140. func (c *OrdersUpdateshipmentCall) doRequest(alt string) (*http.Response, error) {
  10141. var body io.Reader = nil
  10142. body, err := googleapi.WithoutDataWrapper.JSONReader(c.ordersupdateshipmentrequest)
  10143. if err != nil {
  10144. return nil, err
  10145. }
  10146. ctype := "application/json"
  10147. c.urlParams_.Set("alt", alt)
  10148. urls := googleapi.ResolveRelative(c.s.BasePath, "{merchantId}/orders/{orderId}/updateShipment")
  10149. urls += "?" + c.urlParams_.Encode()
  10150. req, _ := http.NewRequest("POST", urls, body)
  10151. googleapi.Expand(req.URL, map[string]string{
  10152. "merchantId": strconv.FormatUint(c.merchantId, 10),
  10153. "orderId": c.orderId,
  10154. })
  10155. req.Header.Set("Content-Type", ctype)
  10156. req.Header.Set("User-Agent", c.s.userAgent())
  10157. if c.ctx_ != nil {
  10158. return ctxhttp.Do(c.ctx_, c.s.client, req)
  10159. }
  10160. return c.s.client.Do(req)
  10161. }
  10162. // Do executes the "content.orders.updateshipment" call.
  10163. // Exactly one of *OrdersUpdateShipmentResponse or error will be
  10164. // non-nil. Any non-2xx status code is an error. Response headers are in
  10165. // either *OrdersUpdateShipmentResponse.ServerResponse.Header or (if a
  10166. // response was returned at all) in error.(*googleapi.Error).Header. Use
  10167. // googleapi.IsNotModified to check whether the returned error was
  10168. // because http.StatusNotModified was returned.
  10169. func (c *OrdersUpdateshipmentCall) Do(opts ...googleapi.CallOption) (*OrdersUpdateShipmentResponse, error) {
  10170. gensupport.SetOptions(c.urlParams_, opts...)
  10171. res, err := c.doRequest("json")
  10172. if res != nil && res.StatusCode == http.StatusNotModified {
  10173. if res.Body != nil {
  10174. res.Body.Close()
  10175. }
  10176. return nil, &googleapi.Error{
  10177. Code: res.StatusCode,
  10178. Header: res.Header,
  10179. }
  10180. }
  10181. if err != nil {
  10182. return nil, err
  10183. }
  10184. defer googleapi.CloseBody(res)
  10185. if err := googleapi.CheckResponse(res); err != nil {
  10186. return nil, err
  10187. }
  10188. ret := &OrdersUpdateShipmentResponse{
  10189. ServerResponse: googleapi.ServerResponse{
  10190. Header: res.Header,
  10191. HTTPStatusCode: res.StatusCode,
  10192. },
  10193. }
  10194. if err := json.NewDecoder(res.Body).Decode(&ret); err != nil {
  10195. return nil, err
  10196. }
  10197. return ret, nil
  10198. // {
  10199. // "description": "Updates a shipment's status, carrier, and/or tracking ID.",
  10200. // "httpMethod": "POST",
  10201. // "id": "content.orders.updateshipment",
  10202. // "parameterOrder": [
  10203. // "merchantId",
  10204. // "orderId"
  10205. // ],
  10206. // "parameters": {
  10207. // "merchantId": {
  10208. // "description": "The ID of the managing account.",
  10209. // "format": "uint64",
  10210. // "location": "path",
  10211. // "required": true,
  10212. // "type": "string"
  10213. // },
  10214. // "orderId": {
  10215. // "description": "The ID of the order.",
  10216. // "location": "path",
  10217. // "required": true,
  10218. // "type": "string"
  10219. // }
  10220. // },
  10221. // "path": "{merchantId}/orders/{orderId}/updateShipment",
  10222. // "request": {
  10223. // "$ref": "OrdersUpdateShipmentRequest"
  10224. // },
  10225. // "response": {
  10226. // "$ref": "OrdersUpdateShipmentResponse"
  10227. // },
  10228. // "scopes": [
  10229. // "https://www.googleapis.com/auth/content"
  10230. // ]
  10231. // }
  10232. }
  10233. // method id "content.products.custombatch":
  10234. type ProductsCustombatchCall struct {
  10235. s *Service
  10236. productscustombatchrequest *ProductsCustomBatchRequest
  10237. urlParams_ gensupport.URLParams
  10238. ctx_ context.Context
  10239. }
  10240. // Custombatch: Retrieves, inserts, and deletes multiple products in a
  10241. // single request.
  10242. func (r *ProductsService) Custombatch(productscustombatchrequest *ProductsCustomBatchRequest) *ProductsCustombatchCall {
  10243. c := &ProductsCustombatchCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  10244. c.productscustombatchrequest = productscustombatchrequest
  10245. return c
  10246. }
  10247. // DryRun sets the optional parameter "dryRun": Flag to run the request
  10248. // in dry-run mode.
  10249. func (c *ProductsCustombatchCall) DryRun(dryRun bool) *ProductsCustombatchCall {
  10250. c.urlParams_.Set("dryRun", fmt.Sprint(dryRun))
  10251. return c
  10252. }
  10253. // Fields allows partial responses to be retrieved. See
  10254. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  10255. // for more information.
  10256. func (c *ProductsCustombatchCall) Fields(s ...googleapi.Field) *ProductsCustombatchCall {
  10257. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  10258. return c
  10259. }
  10260. // Context sets the context to be used in this call's Do method. Any
  10261. // pending HTTP request will be aborted if the provided context is
  10262. // canceled.
  10263. func (c *ProductsCustombatchCall) Context(ctx context.Context) *ProductsCustombatchCall {
  10264. c.ctx_ = ctx
  10265. return c
  10266. }
  10267. func (c *ProductsCustombatchCall) doRequest(alt string) (*http.Response, error) {
  10268. var body io.Reader = nil
  10269. body, err := googleapi.WithoutDataWrapper.JSONReader(c.productscustombatchrequest)
  10270. if err != nil {
  10271. return nil, err
  10272. }
  10273. ctype := "application/json"
  10274. c.urlParams_.Set("alt", alt)
  10275. urls := googleapi.ResolveRelative(c.s.BasePath, "products/batch")
  10276. urls += "?" + c.urlParams_.Encode()
  10277. req, _ := http.NewRequest("POST", urls, body)
  10278. googleapi.SetOpaque(req.URL)
  10279. req.Header.Set("Content-Type", ctype)
  10280. req.Header.Set("User-Agent", c.s.userAgent())
  10281. if c.ctx_ != nil {
  10282. return ctxhttp.Do(c.ctx_, c.s.client, req)
  10283. }
  10284. return c.s.client.Do(req)
  10285. }
  10286. // Do executes the "content.products.custombatch" call.
  10287. // Exactly one of *ProductsCustomBatchResponse or error will be non-nil.
  10288. // Any non-2xx status code is an error. Response headers are in either
  10289. // *ProductsCustomBatchResponse.ServerResponse.Header or (if a response
  10290. // was returned at all) in error.(*googleapi.Error).Header. Use
  10291. // googleapi.IsNotModified to check whether the returned error was
  10292. // because http.StatusNotModified was returned.
  10293. func (c *ProductsCustombatchCall) Do(opts ...googleapi.CallOption) (*ProductsCustomBatchResponse, error) {
  10294. gensupport.SetOptions(c.urlParams_, opts...)
  10295. res, err := c.doRequest("json")
  10296. if res != nil && res.StatusCode == http.StatusNotModified {
  10297. if res.Body != nil {
  10298. res.Body.Close()
  10299. }
  10300. return nil, &googleapi.Error{
  10301. Code: res.StatusCode,
  10302. Header: res.Header,
  10303. }
  10304. }
  10305. if err != nil {
  10306. return nil, err
  10307. }
  10308. defer googleapi.CloseBody(res)
  10309. if err := googleapi.CheckResponse(res); err != nil {
  10310. return nil, err
  10311. }
  10312. ret := &ProductsCustomBatchResponse{
  10313. ServerResponse: googleapi.ServerResponse{
  10314. Header: res.Header,
  10315. HTTPStatusCode: res.StatusCode,
  10316. },
  10317. }
  10318. if err := json.NewDecoder(res.Body).Decode(&ret); err != nil {
  10319. return nil, err
  10320. }
  10321. return ret, nil
  10322. // {
  10323. // "description": "Retrieves, inserts, and deletes multiple products in a single request.",
  10324. // "httpMethod": "POST",
  10325. // "id": "content.products.custombatch",
  10326. // "parameters": {
  10327. // "dryRun": {
  10328. // "description": "Flag to run the request in dry-run mode.",
  10329. // "location": "query",
  10330. // "type": "boolean"
  10331. // }
  10332. // },
  10333. // "path": "products/batch",
  10334. // "request": {
  10335. // "$ref": "ProductsCustomBatchRequest"
  10336. // },
  10337. // "response": {
  10338. // "$ref": "ProductsCustomBatchResponse"
  10339. // },
  10340. // "scopes": [
  10341. // "https://www.googleapis.com/auth/content"
  10342. // ]
  10343. // }
  10344. }
  10345. // method id "content.products.delete":
  10346. type ProductsDeleteCall struct {
  10347. s *Service
  10348. merchantId uint64
  10349. productId string
  10350. urlParams_ gensupport.URLParams
  10351. ctx_ context.Context
  10352. }
  10353. // Delete: Deletes a product from your Merchant Center account.
  10354. func (r *ProductsService) Delete(merchantId uint64, productId string) *ProductsDeleteCall {
  10355. c := &ProductsDeleteCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  10356. c.merchantId = merchantId
  10357. c.productId = productId
  10358. return c
  10359. }
  10360. // DryRun sets the optional parameter "dryRun": Flag to run the request
  10361. // in dry-run mode.
  10362. func (c *ProductsDeleteCall) DryRun(dryRun bool) *ProductsDeleteCall {
  10363. c.urlParams_.Set("dryRun", fmt.Sprint(dryRun))
  10364. return c
  10365. }
  10366. // Fields allows partial responses to be retrieved. See
  10367. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  10368. // for more information.
  10369. func (c *ProductsDeleteCall) Fields(s ...googleapi.Field) *ProductsDeleteCall {
  10370. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  10371. return c
  10372. }
  10373. // Context sets the context to be used in this call's Do method. Any
  10374. // pending HTTP request will be aborted if the provided context is
  10375. // canceled.
  10376. func (c *ProductsDeleteCall) Context(ctx context.Context) *ProductsDeleteCall {
  10377. c.ctx_ = ctx
  10378. return c
  10379. }
  10380. func (c *ProductsDeleteCall) doRequest(alt string) (*http.Response, error) {
  10381. var body io.Reader = nil
  10382. c.urlParams_.Set("alt", alt)
  10383. urls := googleapi.ResolveRelative(c.s.BasePath, "{merchantId}/products/{productId}")
  10384. urls += "?" + c.urlParams_.Encode()
  10385. req, _ := http.NewRequest("DELETE", urls, body)
  10386. googleapi.Expand(req.URL, map[string]string{
  10387. "merchantId": strconv.FormatUint(c.merchantId, 10),
  10388. "productId": c.productId,
  10389. })
  10390. req.Header.Set("User-Agent", c.s.userAgent())
  10391. if c.ctx_ != nil {
  10392. return ctxhttp.Do(c.ctx_, c.s.client, req)
  10393. }
  10394. return c.s.client.Do(req)
  10395. }
  10396. // Do executes the "content.products.delete" call.
  10397. func (c *ProductsDeleteCall) Do(opts ...googleapi.CallOption) error {
  10398. gensupport.SetOptions(c.urlParams_, opts...)
  10399. res, err := c.doRequest("json")
  10400. if err != nil {
  10401. return err
  10402. }
  10403. defer googleapi.CloseBody(res)
  10404. if err := googleapi.CheckResponse(res); err != nil {
  10405. return err
  10406. }
  10407. return nil
  10408. // {
  10409. // "description": "Deletes a product from your Merchant Center account.",
  10410. // "httpMethod": "DELETE",
  10411. // "id": "content.products.delete",
  10412. // "parameterOrder": [
  10413. // "merchantId",
  10414. // "productId"
  10415. // ],
  10416. // "parameters": {
  10417. // "dryRun": {
  10418. // "description": "Flag to run the request in dry-run mode.",
  10419. // "location": "query",
  10420. // "type": "boolean"
  10421. // },
  10422. // "merchantId": {
  10423. // "description": "The ID of the managing account.",
  10424. // "format": "uint64",
  10425. // "location": "path",
  10426. // "required": true,
  10427. // "type": "string"
  10428. // },
  10429. // "productId": {
  10430. // "description": "The ID of the product.",
  10431. // "location": "path",
  10432. // "required": true,
  10433. // "type": "string"
  10434. // }
  10435. // },
  10436. // "path": "{merchantId}/products/{productId}",
  10437. // "scopes": [
  10438. // "https://www.googleapis.com/auth/content"
  10439. // ]
  10440. // }
  10441. }
  10442. // method id "content.products.get":
  10443. type ProductsGetCall struct {
  10444. s *Service
  10445. merchantId uint64
  10446. productId string
  10447. urlParams_ gensupport.URLParams
  10448. ifNoneMatch_ string
  10449. ctx_ context.Context
  10450. }
  10451. // Get: Retrieves a product from your Merchant Center account.
  10452. func (r *ProductsService) Get(merchantId uint64, productId string) *ProductsGetCall {
  10453. c := &ProductsGetCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  10454. c.merchantId = merchantId
  10455. c.productId = productId
  10456. return c
  10457. }
  10458. // Fields allows partial responses to be retrieved. See
  10459. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  10460. // for more information.
  10461. func (c *ProductsGetCall) Fields(s ...googleapi.Field) *ProductsGetCall {
  10462. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  10463. return c
  10464. }
  10465. // IfNoneMatch sets the optional parameter which makes the operation
  10466. // fail if the object's ETag matches the given value. This is useful for
  10467. // getting updates only after the object has changed since the last
  10468. // request. Use googleapi.IsNotModified to check whether the response
  10469. // error from Do is the result of In-None-Match.
  10470. func (c *ProductsGetCall) IfNoneMatch(entityTag string) *ProductsGetCall {
  10471. c.ifNoneMatch_ = entityTag
  10472. return c
  10473. }
  10474. // Context sets the context to be used in this call's Do method. Any
  10475. // pending HTTP request will be aborted if the provided context is
  10476. // canceled.
  10477. func (c *ProductsGetCall) Context(ctx context.Context) *ProductsGetCall {
  10478. c.ctx_ = ctx
  10479. return c
  10480. }
  10481. func (c *ProductsGetCall) doRequest(alt string) (*http.Response, error) {
  10482. var body io.Reader = nil
  10483. c.urlParams_.Set("alt", alt)
  10484. urls := googleapi.ResolveRelative(c.s.BasePath, "{merchantId}/products/{productId}")
  10485. urls += "?" + c.urlParams_.Encode()
  10486. req, _ := http.NewRequest("GET", urls, body)
  10487. googleapi.Expand(req.URL, map[string]string{
  10488. "merchantId": strconv.FormatUint(c.merchantId, 10),
  10489. "productId": c.productId,
  10490. })
  10491. req.Header.Set("User-Agent", c.s.userAgent())
  10492. if c.ifNoneMatch_ != "" {
  10493. req.Header.Set("If-None-Match", c.ifNoneMatch_)
  10494. }
  10495. if c.ctx_ != nil {
  10496. return ctxhttp.Do(c.ctx_, c.s.client, req)
  10497. }
  10498. return c.s.client.Do(req)
  10499. }
  10500. // Do executes the "content.products.get" call.
  10501. // Exactly one of *Product or error will be non-nil. Any non-2xx status
  10502. // code is an error. Response headers are in either
  10503. // *Product.ServerResponse.Header or (if a response was returned at all)
  10504. // in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to
  10505. // check whether the returned error was because http.StatusNotModified
  10506. // was returned.
  10507. func (c *ProductsGetCall) Do(opts ...googleapi.CallOption) (*Product, error) {
  10508. gensupport.SetOptions(c.urlParams_, opts...)
  10509. res, err := c.doRequest("json")
  10510. if res != nil && res.StatusCode == http.StatusNotModified {
  10511. if res.Body != nil {
  10512. res.Body.Close()
  10513. }
  10514. return nil, &googleapi.Error{
  10515. Code: res.StatusCode,
  10516. Header: res.Header,
  10517. }
  10518. }
  10519. if err != nil {
  10520. return nil, err
  10521. }
  10522. defer googleapi.CloseBody(res)
  10523. if err := googleapi.CheckResponse(res); err != nil {
  10524. return nil, err
  10525. }
  10526. ret := &Product{
  10527. ServerResponse: googleapi.ServerResponse{
  10528. Header: res.Header,
  10529. HTTPStatusCode: res.StatusCode,
  10530. },
  10531. }
  10532. if err := json.NewDecoder(res.Body).Decode(&ret); err != nil {
  10533. return nil, err
  10534. }
  10535. return ret, nil
  10536. // {
  10537. // "description": "Retrieves a product from your Merchant Center account.",
  10538. // "httpMethod": "GET",
  10539. // "id": "content.products.get",
  10540. // "parameterOrder": [
  10541. // "merchantId",
  10542. // "productId"
  10543. // ],
  10544. // "parameters": {
  10545. // "merchantId": {
  10546. // "description": "The ID of the managing account.",
  10547. // "format": "uint64",
  10548. // "location": "path",
  10549. // "required": true,
  10550. // "type": "string"
  10551. // },
  10552. // "productId": {
  10553. // "description": "The ID of the product.",
  10554. // "location": "path",
  10555. // "required": true,
  10556. // "type": "string"
  10557. // }
  10558. // },
  10559. // "path": "{merchantId}/products/{productId}",
  10560. // "response": {
  10561. // "$ref": "Product"
  10562. // },
  10563. // "scopes": [
  10564. // "https://www.googleapis.com/auth/content"
  10565. // ]
  10566. // }
  10567. }
  10568. // method id "content.products.insert":
  10569. type ProductsInsertCall struct {
  10570. s *Service
  10571. merchantId uint64
  10572. product *Product
  10573. urlParams_ gensupport.URLParams
  10574. ctx_ context.Context
  10575. }
  10576. // Insert: Uploads a product to your Merchant Center account.
  10577. func (r *ProductsService) Insert(merchantId uint64, product *Product) *ProductsInsertCall {
  10578. c := &ProductsInsertCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  10579. c.merchantId = merchantId
  10580. c.product = product
  10581. return c
  10582. }
  10583. // DryRun sets the optional parameter "dryRun": Flag to run the request
  10584. // in dry-run mode.
  10585. func (c *ProductsInsertCall) DryRun(dryRun bool) *ProductsInsertCall {
  10586. c.urlParams_.Set("dryRun", fmt.Sprint(dryRun))
  10587. return c
  10588. }
  10589. // Fields allows partial responses to be retrieved. See
  10590. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  10591. // for more information.
  10592. func (c *ProductsInsertCall) Fields(s ...googleapi.Field) *ProductsInsertCall {
  10593. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  10594. return c
  10595. }
  10596. // Context sets the context to be used in this call's Do method. Any
  10597. // pending HTTP request will be aborted if the provided context is
  10598. // canceled.
  10599. func (c *ProductsInsertCall) Context(ctx context.Context) *ProductsInsertCall {
  10600. c.ctx_ = ctx
  10601. return c
  10602. }
  10603. func (c *ProductsInsertCall) doRequest(alt string) (*http.Response, error) {
  10604. var body io.Reader = nil
  10605. body, err := googleapi.WithoutDataWrapper.JSONReader(c.product)
  10606. if err != nil {
  10607. return nil, err
  10608. }
  10609. ctype := "application/json"
  10610. c.urlParams_.Set("alt", alt)
  10611. urls := googleapi.ResolveRelative(c.s.BasePath, "{merchantId}/products")
  10612. urls += "?" + c.urlParams_.Encode()
  10613. req, _ := http.NewRequest("POST", urls, body)
  10614. googleapi.Expand(req.URL, map[string]string{
  10615. "merchantId": strconv.FormatUint(c.merchantId, 10),
  10616. })
  10617. req.Header.Set("Content-Type", ctype)
  10618. req.Header.Set("User-Agent", c.s.userAgent())
  10619. if c.ctx_ != nil {
  10620. return ctxhttp.Do(c.ctx_, c.s.client, req)
  10621. }
  10622. return c.s.client.Do(req)
  10623. }
  10624. // Do executes the "content.products.insert" call.
  10625. // Exactly one of *Product or error will be non-nil. Any non-2xx status
  10626. // code is an error. Response headers are in either
  10627. // *Product.ServerResponse.Header or (if a response was returned at all)
  10628. // in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to
  10629. // check whether the returned error was because http.StatusNotModified
  10630. // was returned.
  10631. func (c *ProductsInsertCall) Do(opts ...googleapi.CallOption) (*Product, error) {
  10632. gensupport.SetOptions(c.urlParams_, opts...)
  10633. res, err := c.doRequest("json")
  10634. if res != nil && res.StatusCode == http.StatusNotModified {
  10635. if res.Body != nil {
  10636. res.Body.Close()
  10637. }
  10638. return nil, &googleapi.Error{
  10639. Code: res.StatusCode,
  10640. Header: res.Header,
  10641. }
  10642. }
  10643. if err != nil {
  10644. return nil, err
  10645. }
  10646. defer googleapi.CloseBody(res)
  10647. if err := googleapi.CheckResponse(res); err != nil {
  10648. return nil, err
  10649. }
  10650. ret := &Product{
  10651. ServerResponse: googleapi.ServerResponse{
  10652. Header: res.Header,
  10653. HTTPStatusCode: res.StatusCode,
  10654. },
  10655. }
  10656. if err := json.NewDecoder(res.Body).Decode(&ret); err != nil {
  10657. return nil, err
  10658. }
  10659. return ret, nil
  10660. // {
  10661. // "description": "Uploads a product to your Merchant Center account.",
  10662. // "httpMethod": "POST",
  10663. // "id": "content.products.insert",
  10664. // "parameterOrder": [
  10665. // "merchantId"
  10666. // ],
  10667. // "parameters": {
  10668. // "dryRun": {
  10669. // "description": "Flag to run the request in dry-run mode.",
  10670. // "location": "query",
  10671. // "type": "boolean"
  10672. // },
  10673. // "merchantId": {
  10674. // "description": "The ID of the managing account.",
  10675. // "format": "uint64",
  10676. // "location": "path",
  10677. // "required": true,
  10678. // "type": "string"
  10679. // }
  10680. // },
  10681. // "path": "{merchantId}/products",
  10682. // "request": {
  10683. // "$ref": "Product"
  10684. // },
  10685. // "response": {
  10686. // "$ref": "Product"
  10687. // },
  10688. // "scopes": [
  10689. // "https://www.googleapis.com/auth/content"
  10690. // ]
  10691. // }
  10692. }
  10693. // method id "content.products.list":
  10694. type ProductsListCall struct {
  10695. s *Service
  10696. merchantId uint64
  10697. urlParams_ gensupport.URLParams
  10698. ifNoneMatch_ string
  10699. ctx_ context.Context
  10700. }
  10701. // List: Lists the products in your Merchant Center account.
  10702. func (r *ProductsService) List(merchantId uint64) *ProductsListCall {
  10703. c := &ProductsListCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  10704. c.merchantId = merchantId
  10705. return c
  10706. }
  10707. // IncludeInvalidInsertedItems sets the optional parameter
  10708. // "includeInvalidInsertedItems": Flag to include the invalid inserted
  10709. // items in the result of the list request. By default the invalid items
  10710. // are not shown (the default value is false).
  10711. func (c *ProductsListCall) IncludeInvalidInsertedItems(includeInvalidInsertedItems bool) *ProductsListCall {
  10712. c.urlParams_.Set("includeInvalidInsertedItems", fmt.Sprint(includeInvalidInsertedItems))
  10713. return c
  10714. }
  10715. // MaxResults sets the optional parameter "maxResults": The maximum
  10716. // number of products to return in the response, used for paging.
  10717. func (c *ProductsListCall) MaxResults(maxResults int64) *ProductsListCall {
  10718. c.urlParams_.Set("maxResults", fmt.Sprint(maxResults))
  10719. return c
  10720. }
  10721. // PageToken sets the optional parameter "pageToken": The token returned
  10722. // by the previous request.
  10723. func (c *ProductsListCall) PageToken(pageToken string) *ProductsListCall {
  10724. c.urlParams_.Set("pageToken", pageToken)
  10725. return c
  10726. }
  10727. // Fields allows partial responses to be retrieved. See
  10728. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  10729. // for more information.
  10730. func (c *ProductsListCall) Fields(s ...googleapi.Field) *ProductsListCall {
  10731. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  10732. return c
  10733. }
  10734. // IfNoneMatch sets the optional parameter which makes the operation
  10735. // fail if the object's ETag matches the given value. This is useful for
  10736. // getting updates only after the object has changed since the last
  10737. // request. Use googleapi.IsNotModified to check whether the response
  10738. // error from Do is the result of In-None-Match.
  10739. func (c *ProductsListCall) IfNoneMatch(entityTag string) *ProductsListCall {
  10740. c.ifNoneMatch_ = entityTag
  10741. return c
  10742. }
  10743. // Context sets the context to be used in this call's Do method. Any
  10744. // pending HTTP request will be aborted if the provided context is
  10745. // canceled.
  10746. func (c *ProductsListCall) Context(ctx context.Context) *ProductsListCall {
  10747. c.ctx_ = ctx
  10748. return c
  10749. }
  10750. func (c *ProductsListCall) doRequest(alt string) (*http.Response, error) {
  10751. var body io.Reader = nil
  10752. c.urlParams_.Set("alt", alt)
  10753. urls := googleapi.ResolveRelative(c.s.BasePath, "{merchantId}/products")
  10754. urls += "?" + c.urlParams_.Encode()
  10755. req, _ := http.NewRequest("GET", urls, body)
  10756. googleapi.Expand(req.URL, map[string]string{
  10757. "merchantId": strconv.FormatUint(c.merchantId, 10),
  10758. })
  10759. req.Header.Set("User-Agent", c.s.userAgent())
  10760. if c.ifNoneMatch_ != "" {
  10761. req.Header.Set("If-None-Match", c.ifNoneMatch_)
  10762. }
  10763. if c.ctx_ != nil {
  10764. return ctxhttp.Do(c.ctx_, c.s.client, req)
  10765. }
  10766. return c.s.client.Do(req)
  10767. }
  10768. // Do executes the "content.products.list" call.
  10769. // Exactly one of *ProductsListResponse or error will be non-nil. Any
  10770. // non-2xx status code is an error. Response headers are in either
  10771. // *ProductsListResponse.ServerResponse.Header or (if a response was
  10772. // returned at all) in error.(*googleapi.Error).Header. Use
  10773. // googleapi.IsNotModified to check whether the returned error was
  10774. // because http.StatusNotModified was returned.
  10775. func (c *ProductsListCall) Do(opts ...googleapi.CallOption) (*ProductsListResponse, error) {
  10776. gensupport.SetOptions(c.urlParams_, opts...)
  10777. res, err := c.doRequest("json")
  10778. if res != nil && res.StatusCode == http.StatusNotModified {
  10779. if res.Body != nil {
  10780. res.Body.Close()
  10781. }
  10782. return nil, &googleapi.Error{
  10783. Code: res.StatusCode,
  10784. Header: res.Header,
  10785. }
  10786. }
  10787. if err != nil {
  10788. return nil, err
  10789. }
  10790. defer googleapi.CloseBody(res)
  10791. if err := googleapi.CheckResponse(res); err != nil {
  10792. return nil, err
  10793. }
  10794. ret := &ProductsListResponse{
  10795. ServerResponse: googleapi.ServerResponse{
  10796. Header: res.Header,
  10797. HTTPStatusCode: res.StatusCode,
  10798. },
  10799. }
  10800. if err := json.NewDecoder(res.Body).Decode(&ret); err != nil {
  10801. return nil, err
  10802. }
  10803. return ret, nil
  10804. // {
  10805. // "description": "Lists the products in your Merchant Center account.",
  10806. // "httpMethod": "GET",
  10807. // "id": "content.products.list",
  10808. // "parameterOrder": [
  10809. // "merchantId"
  10810. // ],
  10811. // "parameters": {
  10812. // "includeInvalidInsertedItems": {
  10813. // "description": "Flag to include the invalid inserted items in the result of the list request. By default the invalid items are not shown (the default value is false).",
  10814. // "location": "query",
  10815. // "type": "boolean"
  10816. // },
  10817. // "maxResults": {
  10818. // "description": "The maximum number of products to return in the response, used for paging.",
  10819. // "format": "uint32",
  10820. // "location": "query",
  10821. // "type": "integer"
  10822. // },
  10823. // "merchantId": {
  10824. // "description": "The ID of the managing account.",
  10825. // "format": "uint64",
  10826. // "location": "path",
  10827. // "required": true,
  10828. // "type": "string"
  10829. // },
  10830. // "pageToken": {
  10831. // "description": "The token returned by the previous request.",
  10832. // "location": "query",
  10833. // "type": "string"
  10834. // }
  10835. // },
  10836. // "path": "{merchantId}/products",
  10837. // "response": {
  10838. // "$ref": "ProductsListResponse"
  10839. // },
  10840. // "scopes": [
  10841. // "https://www.googleapis.com/auth/content"
  10842. // ]
  10843. // }
  10844. }
  10845. // Pages invokes f for each page of results.
  10846. // A non-nil error returned from f will halt the iteration.
  10847. // The provided context supersedes any context provided to the Context method.
  10848. func (c *ProductsListCall) Pages(ctx context.Context, f func(*ProductsListResponse) error) error {
  10849. c.ctx_ = ctx
  10850. defer c.PageToken(c.urlParams_.Get("pageToken")) // reset paging to original point
  10851. for {
  10852. x, err := c.Do()
  10853. if err != nil {
  10854. return err
  10855. }
  10856. if err := f(x); err != nil {
  10857. return err
  10858. }
  10859. if x.NextPageToken == "" {
  10860. return nil
  10861. }
  10862. c.PageToken(x.NextPageToken)
  10863. }
  10864. }
  10865. // method id "content.productstatuses.custombatch":
  10866. type ProductstatusesCustombatchCall struct {
  10867. s *Service
  10868. productstatusescustombatchrequest *ProductstatusesCustomBatchRequest
  10869. urlParams_ gensupport.URLParams
  10870. ctx_ context.Context
  10871. }
  10872. // Custombatch: Gets the statuses of multiple products in a single
  10873. // request.
  10874. func (r *ProductstatusesService) Custombatch(productstatusescustombatchrequest *ProductstatusesCustomBatchRequest) *ProductstatusesCustombatchCall {
  10875. c := &ProductstatusesCustombatchCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  10876. c.productstatusescustombatchrequest = productstatusescustombatchrequest
  10877. return c
  10878. }
  10879. // Fields allows partial responses to be retrieved. See
  10880. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  10881. // for more information.
  10882. func (c *ProductstatusesCustombatchCall) Fields(s ...googleapi.Field) *ProductstatusesCustombatchCall {
  10883. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  10884. return c
  10885. }
  10886. // Context sets the context to be used in this call's Do method. Any
  10887. // pending HTTP request will be aborted if the provided context is
  10888. // canceled.
  10889. func (c *ProductstatusesCustombatchCall) Context(ctx context.Context) *ProductstatusesCustombatchCall {
  10890. c.ctx_ = ctx
  10891. return c
  10892. }
  10893. func (c *ProductstatusesCustombatchCall) doRequest(alt string) (*http.Response, error) {
  10894. var body io.Reader = nil
  10895. body, err := googleapi.WithoutDataWrapper.JSONReader(c.productstatusescustombatchrequest)
  10896. if err != nil {
  10897. return nil, err
  10898. }
  10899. ctype := "application/json"
  10900. c.urlParams_.Set("alt", alt)
  10901. urls := googleapi.ResolveRelative(c.s.BasePath, "productstatuses/batch")
  10902. urls += "?" + c.urlParams_.Encode()
  10903. req, _ := http.NewRequest("POST", urls, body)
  10904. googleapi.SetOpaque(req.URL)
  10905. req.Header.Set("Content-Type", ctype)
  10906. req.Header.Set("User-Agent", c.s.userAgent())
  10907. if c.ctx_ != nil {
  10908. return ctxhttp.Do(c.ctx_, c.s.client, req)
  10909. }
  10910. return c.s.client.Do(req)
  10911. }
  10912. // Do executes the "content.productstatuses.custombatch" call.
  10913. // Exactly one of *ProductstatusesCustomBatchResponse or error will be
  10914. // non-nil. Any non-2xx status code is an error. Response headers are in
  10915. // either *ProductstatusesCustomBatchResponse.ServerResponse.Header or
  10916. // (if a response was returned at all) in
  10917. // error.(*googleapi.Error).Header. Use googleapi.IsNotModified to check
  10918. // whether the returned error was because http.StatusNotModified was
  10919. // returned.
  10920. func (c *ProductstatusesCustombatchCall) Do(opts ...googleapi.CallOption) (*ProductstatusesCustomBatchResponse, error) {
  10921. gensupport.SetOptions(c.urlParams_, opts...)
  10922. res, err := c.doRequest("json")
  10923. if res != nil && res.StatusCode == http.StatusNotModified {
  10924. if res.Body != nil {
  10925. res.Body.Close()
  10926. }
  10927. return nil, &googleapi.Error{
  10928. Code: res.StatusCode,
  10929. Header: res.Header,
  10930. }
  10931. }
  10932. if err != nil {
  10933. return nil, err
  10934. }
  10935. defer googleapi.CloseBody(res)
  10936. if err := googleapi.CheckResponse(res); err != nil {
  10937. return nil, err
  10938. }
  10939. ret := &ProductstatusesCustomBatchResponse{
  10940. ServerResponse: googleapi.ServerResponse{
  10941. Header: res.Header,
  10942. HTTPStatusCode: res.StatusCode,
  10943. },
  10944. }
  10945. if err := json.NewDecoder(res.Body).Decode(&ret); err != nil {
  10946. return nil, err
  10947. }
  10948. return ret, nil
  10949. // {
  10950. // "description": "Gets the statuses of multiple products in a single request.",
  10951. // "httpMethod": "POST",
  10952. // "id": "content.productstatuses.custombatch",
  10953. // "path": "productstatuses/batch",
  10954. // "request": {
  10955. // "$ref": "ProductstatusesCustomBatchRequest"
  10956. // },
  10957. // "response": {
  10958. // "$ref": "ProductstatusesCustomBatchResponse"
  10959. // },
  10960. // "scopes": [
  10961. // "https://www.googleapis.com/auth/content"
  10962. // ]
  10963. // }
  10964. }
  10965. // method id "content.productstatuses.get":
  10966. type ProductstatusesGetCall struct {
  10967. s *Service
  10968. merchantId uint64
  10969. productId string
  10970. urlParams_ gensupport.URLParams
  10971. ifNoneMatch_ string
  10972. ctx_ context.Context
  10973. }
  10974. // Get: Gets the status of a product from your Merchant Center account.
  10975. func (r *ProductstatusesService) Get(merchantId uint64, productId string) *ProductstatusesGetCall {
  10976. c := &ProductstatusesGetCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  10977. c.merchantId = merchantId
  10978. c.productId = productId
  10979. return c
  10980. }
  10981. // Fields allows partial responses to be retrieved. See
  10982. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  10983. // for more information.
  10984. func (c *ProductstatusesGetCall) Fields(s ...googleapi.Field) *ProductstatusesGetCall {
  10985. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  10986. return c
  10987. }
  10988. // IfNoneMatch sets the optional parameter which makes the operation
  10989. // fail if the object's ETag matches the given value. This is useful for
  10990. // getting updates only after the object has changed since the last
  10991. // request. Use googleapi.IsNotModified to check whether the response
  10992. // error from Do is the result of In-None-Match.
  10993. func (c *ProductstatusesGetCall) IfNoneMatch(entityTag string) *ProductstatusesGetCall {
  10994. c.ifNoneMatch_ = entityTag
  10995. return c
  10996. }
  10997. // Context sets the context to be used in this call's Do method. Any
  10998. // pending HTTP request will be aborted if the provided context is
  10999. // canceled.
  11000. func (c *ProductstatusesGetCall) Context(ctx context.Context) *ProductstatusesGetCall {
  11001. c.ctx_ = ctx
  11002. return c
  11003. }
  11004. func (c *ProductstatusesGetCall) doRequest(alt string) (*http.Response, error) {
  11005. var body io.Reader = nil
  11006. c.urlParams_.Set("alt", alt)
  11007. urls := googleapi.ResolveRelative(c.s.BasePath, "{merchantId}/productstatuses/{productId}")
  11008. urls += "?" + c.urlParams_.Encode()
  11009. req, _ := http.NewRequest("GET", urls, body)
  11010. googleapi.Expand(req.URL, map[string]string{
  11011. "merchantId": strconv.FormatUint(c.merchantId, 10),
  11012. "productId": c.productId,
  11013. })
  11014. req.Header.Set("User-Agent", c.s.userAgent())
  11015. if c.ifNoneMatch_ != "" {
  11016. req.Header.Set("If-None-Match", c.ifNoneMatch_)
  11017. }
  11018. if c.ctx_ != nil {
  11019. return ctxhttp.Do(c.ctx_, c.s.client, req)
  11020. }
  11021. return c.s.client.Do(req)
  11022. }
  11023. // Do executes the "content.productstatuses.get" call.
  11024. // Exactly one of *ProductStatus or error will be non-nil. Any non-2xx
  11025. // status code is an error. Response headers are in either
  11026. // *ProductStatus.ServerResponse.Header or (if a response was returned
  11027. // at all) in error.(*googleapi.Error).Header. Use
  11028. // googleapi.IsNotModified to check whether the returned error was
  11029. // because http.StatusNotModified was returned.
  11030. func (c *ProductstatusesGetCall) Do(opts ...googleapi.CallOption) (*ProductStatus, error) {
  11031. gensupport.SetOptions(c.urlParams_, opts...)
  11032. res, err := c.doRequest("json")
  11033. if res != nil && res.StatusCode == http.StatusNotModified {
  11034. if res.Body != nil {
  11035. res.Body.Close()
  11036. }
  11037. return nil, &googleapi.Error{
  11038. Code: res.StatusCode,
  11039. Header: res.Header,
  11040. }
  11041. }
  11042. if err != nil {
  11043. return nil, err
  11044. }
  11045. defer googleapi.CloseBody(res)
  11046. if err := googleapi.CheckResponse(res); err != nil {
  11047. return nil, err
  11048. }
  11049. ret := &ProductStatus{
  11050. ServerResponse: googleapi.ServerResponse{
  11051. Header: res.Header,
  11052. HTTPStatusCode: res.StatusCode,
  11053. },
  11054. }
  11055. if err := json.NewDecoder(res.Body).Decode(&ret); err != nil {
  11056. return nil, err
  11057. }
  11058. return ret, nil
  11059. // {
  11060. // "description": "Gets the status of a product from your Merchant Center account.",
  11061. // "httpMethod": "GET",
  11062. // "id": "content.productstatuses.get",
  11063. // "parameterOrder": [
  11064. // "merchantId",
  11065. // "productId"
  11066. // ],
  11067. // "parameters": {
  11068. // "merchantId": {
  11069. // "description": "The ID of the managing account.",
  11070. // "format": "uint64",
  11071. // "location": "path",
  11072. // "required": true,
  11073. // "type": "string"
  11074. // },
  11075. // "productId": {
  11076. // "description": "The ID of the product.",
  11077. // "location": "path",
  11078. // "required": true,
  11079. // "type": "string"
  11080. // }
  11081. // },
  11082. // "path": "{merchantId}/productstatuses/{productId}",
  11083. // "response": {
  11084. // "$ref": "ProductStatus"
  11085. // },
  11086. // "scopes": [
  11087. // "https://www.googleapis.com/auth/content"
  11088. // ]
  11089. // }
  11090. }
  11091. // method id "content.productstatuses.list":
  11092. type ProductstatusesListCall struct {
  11093. s *Service
  11094. merchantId uint64
  11095. urlParams_ gensupport.URLParams
  11096. ifNoneMatch_ string
  11097. ctx_ context.Context
  11098. }
  11099. // List: Lists the statuses of the products in your Merchant Center
  11100. // account.
  11101. func (r *ProductstatusesService) List(merchantId uint64) *ProductstatusesListCall {
  11102. c := &ProductstatusesListCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  11103. c.merchantId = merchantId
  11104. return c
  11105. }
  11106. // IncludeInvalidInsertedItems sets the optional parameter
  11107. // "includeInvalidInsertedItems": Flag to include the invalid inserted
  11108. // items in the result of the list request. By default the invalid items
  11109. // are not shown (the default value is false).
  11110. func (c *ProductstatusesListCall) IncludeInvalidInsertedItems(includeInvalidInsertedItems bool) *ProductstatusesListCall {
  11111. c.urlParams_.Set("includeInvalidInsertedItems", fmt.Sprint(includeInvalidInsertedItems))
  11112. return c
  11113. }
  11114. // MaxResults sets the optional parameter "maxResults": The maximum
  11115. // number of product statuses to return in the response, used for
  11116. // paging.
  11117. func (c *ProductstatusesListCall) MaxResults(maxResults int64) *ProductstatusesListCall {
  11118. c.urlParams_.Set("maxResults", fmt.Sprint(maxResults))
  11119. return c
  11120. }
  11121. // PageToken sets the optional parameter "pageToken": The token returned
  11122. // by the previous request.
  11123. func (c *ProductstatusesListCall) PageToken(pageToken string) *ProductstatusesListCall {
  11124. c.urlParams_.Set("pageToken", pageToken)
  11125. return c
  11126. }
  11127. // Fields allows partial responses to be retrieved. See
  11128. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  11129. // for more information.
  11130. func (c *ProductstatusesListCall) Fields(s ...googleapi.Field) *ProductstatusesListCall {
  11131. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  11132. return c
  11133. }
  11134. // IfNoneMatch sets the optional parameter which makes the operation
  11135. // fail if the object's ETag matches the given value. This is useful for
  11136. // getting updates only after the object has changed since the last
  11137. // request. Use googleapi.IsNotModified to check whether the response
  11138. // error from Do is the result of In-None-Match.
  11139. func (c *ProductstatusesListCall) IfNoneMatch(entityTag string) *ProductstatusesListCall {
  11140. c.ifNoneMatch_ = entityTag
  11141. return c
  11142. }
  11143. // Context sets the context to be used in this call's Do method. Any
  11144. // pending HTTP request will be aborted if the provided context is
  11145. // canceled.
  11146. func (c *ProductstatusesListCall) Context(ctx context.Context) *ProductstatusesListCall {
  11147. c.ctx_ = ctx
  11148. return c
  11149. }
  11150. func (c *ProductstatusesListCall) doRequest(alt string) (*http.Response, error) {
  11151. var body io.Reader = nil
  11152. c.urlParams_.Set("alt", alt)
  11153. urls := googleapi.ResolveRelative(c.s.BasePath, "{merchantId}/productstatuses")
  11154. urls += "?" + c.urlParams_.Encode()
  11155. req, _ := http.NewRequest("GET", urls, body)
  11156. googleapi.Expand(req.URL, map[string]string{
  11157. "merchantId": strconv.FormatUint(c.merchantId, 10),
  11158. })
  11159. req.Header.Set("User-Agent", c.s.userAgent())
  11160. if c.ifNoneMatch_ != "" {
  11161. req.Header.Set("If-None-Match", c.ifNoneMatch_)
  11162. }
  11163. if c.ctx_ != nil {
  11164. return ctxhttp.Do(c.ctx_, c.s.client, req)
  11165. }
  11166. return c.s.client.Do(req)
  11167. }
  11168. // Do executes the "content.productstatuses.list" call.
  11169. // Exactly one of *ProductstatusesListResponse or error will be non-nil.
  11170. // Any non-2xx status code is an error. Response headers are in either
  11171. // *ProductstatusesListResponse.ServerResponse.Header or (if a response
  11172. // was returned at all) in error.(*googleapi.Error).Header. Use
  11173. // googleapi.IsNotModified to check whether the returned error was
  11174. // because http.StatusNotModified was returned.
  11175. func (c *ProductstatusesListCall) Do(opts ...googleapi.CallOption) (*ProductstatusesListResponse, error) {
  11176. gensupport.SetOptions(c.urlParams_, opts...)
  11177. res, err := c.doRequest("json")
  11178. if res != nil && res.StatusCode == http.StatusNotModified {
  11179. if res.Body != nil {
  11180. res.Body.Close()
  11181. }
  11182. return nil, &googleapi.Error{
  11183. Code: res.StatusCode,
  11184. Header: res.Header,
  11185. }
  11186. }
  11187. if err != nil {
  11188. return nil, err
  11189. }
  11190. defer googleapi.CloseBody(res)
  11191. if err := googleapi.CheckResponse(res); err != nil {
  11192. return nil, err
  11193. }
  11194. ret := &ProductstatusesListResponse{
  11195. ServerResponse: googleapi.ServerResponse{
  11196. Header: res.Header,
  11197. HTTPStatusCode: res.StatusCode,
  11198. },
  11199. }
  11200. if err := json.NewDecoder(res.Body).Decode(&ret); err != nil {
  11201. return nil, err
  11202. }
  11203. return ret, nil
  11204. // {
  11205. // "description": "Lists the statuses of the products in your Merchant Center account.",
  11206. // "httpMethod": "GET",
  11207. // "id": "content.productstatuses.list",
  11208. // "parameterOrder": [
  11209. // "merchantId"
  11210. // ],
  11211. // "parameters": {
  11212. // "includeInvalidInsertedItems": {
  11213. // "description": "Flag to include the invalid inserted items in the result of the list request. By default the invalid items are not shown (the default value is false).",
  11214. // "location": "query",
  11215. // "type": "boolean"
  11216. // },
  11217. // "maxResults": {
  11218. // "description": "The maximum number of product statuses to return in the response, used for paging.",
  11219. // "format": "uint32",
  11220. // "location": "query",
  11221. // "type": "integer"
  11222. // },
  11223. // "merchantId": {
  11224. // "description": "The ID of the managing account.",
  11225. // "format": "uint64",
  11226. // "location": "path",
  11227. // "required": true,
  11228. // "type": "string"
  11229. // },
  11230. // "pageToken": {
  11231. // "description": "The token returned by the previous request.",
  11232. // "location": "query",
  11233. // "type": "string"
  11234. // }
  11235. // },
  11236. // "path": "{merchantId}/productstatuses",
  11237. // "response": {
  11238. // "$ref": "ProductstatusesListResponse"
  11239. // },
  11240. // "scopes": [
  11241. // "https://www.googleapis.com/auth/content"
  11242. // ]
  11243. // }
  11244. }
  11245. // Pages invokes f for each page of results.
  11246. // A non-nil error returned from f will halt the iteration.
  11247. // The provided context supersedes any context provided to the Context method.
  11248. func (c *ProductstatusesListCall) Pages(ctx context.Context, f func(*ProductstatusesListResponse) error) error {
  11249. c.ctx_ = ctx
  11250. defer c.PageToken(c.urlParams_.Get("pageToken")) // reset paging to original point
  11251. for {
  11252. x, err := c.Do()
  11253. if err != nil {
  11254. return err
  11255. }
  11256. if err := f(x); err != nil {
  11257. return err
  11258. }
  11259. if x.NextPageToken == "" {
  11260. return nil
  11261. }
  11262. c.PageToken(x.NextPageToken)
  11263. }
  11264. }