books-gen.go 377 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929930931932933934935936937938939940941942943944945946947948949950951952953954955956957958959960961962963964965966967968969970971972973974975976977978979980981982983984985986987988989990991992993994995996997998999100010011002100310041005100610071008100910101011101210131014101510161017101810191020102110221023102410251026102710281029103010311032103310341035103610371038103910401041104210431044104510461047104810491050105110521053105410551056105710581059106010611062106310641065106610671068106910701071107210731074107510761077107810791080108110821083108410851086108710881089109010911092109310941095109610971098109911001101110211031104110511061107110811091110111111121113111411151116111711181119112011211122112311241125112611271128112911301131113211331134113511361137113811391140114111421143114411451146114711481149115011511152115311541155115611571158115911601161116211631164116511661167116811691170117111721173117411751176117711781179118011811182118311841185118611871188118911901191119211931194119511961197119811991200120112021203120412051206120712081209121012111212121312141215121612171218121912201221122212231224122512261227122812291230123112321233123412351236123712381239124012411242124312441245124612471248124912501251125212531254125512561257125812591260126112621263126412651266126712681269127012711272127312741275127612771278127912801281128212831284128512861287128812891290129112921293129412951296129712981299130013011302130313041305130613071308130913101311131213131314131513161317131813191320132113221323132413251326132713281329133013311332133313341335133613371338133913401341134213431344134513461347134813491350135113521353135413551356135713581359136013611362136313641365136613671368136913701371137213731374137513761377137813791380138113821383138413851386138713881389139013911392139313941395139613971398139914001401140214031404140514061407140814091410141114121413141414151416141714181419142014211422142314241425142614271428142914301431143214331434143514361437143814391440144114421443144414451446144714481449145014511452145314541455145614571458145914601461146214631464146514661467146814691470147114721473147414751476147714781479148014811482148314841485148614871488148914901491149214931494149514961497149814991500150115021503150415051506150715081509151015111512151315141515151615171518151915201521152215231524152515261527152815291530153115321533153415351536153715381539154015411542154315441545154615471548154915501551155215531554155515561557155815591560156115621563156415651566156715681569157015711572157315741575157615771578157915801581158215831584158515861587158815891590159115921593159415951596159715981599160016011602160316041605160616071608160916101611161216131614161516161617161816191620162116221623162416251626162716281629163016311632163316341635163616371638163916401641164216431644164516461647164816491650165116521653165416551656165716581659166016611662166316641665166616671668166916701671167216731674167516761677167816791680168116821683168416851686168716881689169016911692169316941695169616971698169917001701170217031704170517061707170817091710171117121713171417151716171717181719172017211722172317241725172617271728172917301731173217331734173517361737173817391740174117421743174417451746174717481749175017511752175317541755175617571758175917601761176217631764176517661767176817691770177117721773177417751776177717781779178017811782178317841785178617871788178917901791179217931794179517961797179817991800180118021803180418051806180718081809181018111812181318141815181618171818181918201821182218231824182518261827182818291830183118321833183418351836183718381839184018411842184318441845184618471848184918501851185218531854185518561857185818591860186118621863186418651866186718681869187018711872187318741875187618771878187918801881188218831884188518861887188818891890189118921893189418951896189718981899190019011902190319041905190619071908190919101911191219131914191519161917191819191920192119221923192419251926192719281929193019311932193319341935193619371938193919401941194219431944194519461947194819491950195119521953195419551956195719581959196019611962196319641965196619671968196919701971197219731974197519761977197819791980198119821983198419851986198719881989199019911992199319941995199619971998199920002001200220032004200520062007200820092010201120122013201420152016201720182019202020212022202320242025202620272028202920302031203220332034203520362037203820392040204120422043204420452046204720482049205020512052205320542055205620572058205920602061206220632064206520662067206820692070207120722073207420752076207720782079208020812082208320842085208620872088208920902091209220932094209520962097209820992100210121022103210421052106210721082109211021112112211321142115211621172118211921202121212221232124212521262127212821292130213121322133213421352136213721382139214021412142214321442145214621472148214921502151215221532154215521562157215821592160216121622163216421652166216721682169217021712172217321742175217621772178217921802181218221832184218521862187218821892190219121922193219421952196219721982199220022012202220322042205220622072208220922102211221222132214221522162217221822192220222122222223222422252226222722282229223022312232223322342235223622372238223922402241224222432244224522462247224822492250225122522253225422552256225722582259226022612262226322642265226622672268226922702271227222732274227522762277227822792280228122822283228422852286228722882289229022912292229322942295229622972298229923002301230223032304230523062307230823092310231123122313231423152316231723182319232023212322232323242325232623272328232923302331233223332334233523362337233823392340234123422343234423452346234723482349235023512352235323542355235623572358235923602361236223632364236523662367236823692370237123722373237423752376237723782379238023812382238323842385238623872388238923902391239223932394239523962397239823992400240124022403240424052406240724082409241024112412241324142415241624172418241924202421242224232424242524262427242824292430243124322433243424352436243724382439244024412442244324442445244624472448244924502451245224532454245524562457245824592460246124622463246424652466246724682469247024712472247324742475247624772478247924802481248224832484248524862487248824892490249124922493249424952496249724982499250025012502250325042505250625072508250925102511251225132514251525162517251825192520252125222523252425252526252725282529253025312532253325342535253625372538253925402541254225432544254525462547254825492550255125522553255425552556255725582559256025612562256325642565256625672568256925702571257225732574257525762577257825792580258125822583258425852586258725882589259025912592259325942595259625972598259926002601260226032604260526062607260826092610261126122613261426152616261726182619262026212622262326242625262626272628262926302631263226332634263526362637263826392640264126422643264426452646264726482649265026512652265326542655265626572658265926602661266226632664266526662667266826692670267126722673267426752676267726782679268026812682268326842685268626872688268926902691269226932694269526962697269826992700270127022703270427052706270727082709271027112712271327142715271627172718271927202721272227232724272527262727272827292730273127322733273427352736273727382739274027412742274327442745274627472748274927502751275227532754275527562757275827592760276127622763276427652766276727682769277027712772277327742775277627772778277927802781278227832784278527862787278827892790279127922793279427952796279727982799280028012802280328042805280628072808280928102811281228132814281528162817281828192820282128222823282428252826282728282829283028312832283328342835283628372838283928402841284228432844284528462847284828492850285128522853285428552856285728582859286028612862286328642865286628672868286928702871287228732874287528762877287828792880288128822883288428852886288728882889289028912892289328942895289628972898289929002901290229032904290529062907290829092910291129122913291429152916291729182919292029212922292329242925292629272928292929302931293229332934293529362937293829392940294129422943294429452946294729482949295029512952295329542955295629572958295929602961296229632964296529662967296829692970297129722973297429752976297729782979298029812982298329842985298629872988298929902991299229932994299529962997299829993000300130023003300430053006300730083009301030113012301330143015301630173018301930203021302230233024302530263027302830293030303130323033303430353036303730383039304030413042304330443045304630473048304930503051305230533054305530563057305830593060306130623063306430653066306730683069307030713072307330743075307630773078307930803081308230833084308530863087308830893090309130923093309430953096309730983099310031013102310331043105310631073108310931103111311231133114311531163117311831193120312131223123312431253126312731283129313031313132313331343135313631373138313931403141314231433144314531463147314831493150315131523153315431553156315731583159316031613162316331643165316631673168316931703171317231733174317531763177317831793180318131823183318431853186318731883189319031913192319331943195319631973198319932003201320232033204320532063207320832093210321132123213321432153216321732183219322032213222322332243225322632273228322932303231323232333234323532363237323832393240324132423243324432453246324732483249325032513252325332543255325632573258325932603261326232633264326532663267326832693270327132723273327432753276327732783279328032813282328332843285328632873288328932903291329232933294329532963297329832993300330133023303330433053306330733083309331033113312331333143315331633173318331933203321332233233324332533263327332833293330333133323333333433353336333733383339334033413342334333443345334633473348334933503351335233533354335533563357335833593360336133623363336433653366336733683369337033713372337333743375337633773378337933803381338233833384338533863387338833893390339133923393339433953396339733983399340034013402340334043405340634073408340934103411341234133414341534163417341834193420342134223423342434253426342734283429343034313432343334343435343634373438343934403441344234433444344534463447344834493450345134523453345434553456345734583459346034613462346334643465346634673468346934703471347234733474347534763477347834793480348134823483348434853486348734883489349034913492349334943495349634973498349935003501350235033504350535063507350835093510351135123513351435153516351735183519352035213522352335243525352635273528352935303531353235333534353535363537353835393540354135423543354435453546354735483549355035513552355335543555355635573558355935603561356235633564356535663567356835693570357135723573357435753576357735783579358035813582358335843585358635873588358935903591359235933594359535963597359835993600360136023603360436053606360736083609361036113612361336143615361636173618361936203621362236233624362536263627362836293630363136323633363436353636363736383639364036413642364336443645364636473648364936503651365236533654365536563657365836593660366136623663366436653666366736683669367036713672367336743675367636773678367936803681368236833684368536863687368836893690369136923693369436953696369736983699370037013702370337043705370637073708370937103711371237133714371537163717371837193720372137223723372437253726372737283729373037313732373337343735373637373738373937403741374237433744374537463747374837493750375137523753375437553756375737583759376037613762376337643765376637673768376937703771377237733774377537763777377837793780378137823783378437853786378737883789379037913792379337943795379637973798379938003801380238033804380538063807380838093810381138123813381438153816381738183819382038213822382338243825382638273828382938303831383238333834383538363837383838393840384138423843384438453846384738483849385038513852385338543855385638573858385938603861386238633864386538663867386838693870387138723873387438753876387738783879388038813882388338843885388638873888388938903891389238933894389538963897389838993900390139023903390439053906390739083909391039113912391339143915391639173918391939203921392239233924392539263927392839293930393139323933393439353936393739383939394039413942394339443945394639473948394939503951395239533954395539563957395839593960396139623963396439653966396739683969397039713972397339743975397639773978397939803981398239833984398539863987398839893990399139923993399439953996399739983999400040014002400340044005400640074008400940104011401240134014401540164017401840194020402140224023402440254026402740284029403040314032403340344035403640374038403940404041404240434044404540464047404840494050405140524053405440554056405740584059406040614062406340644065406640674068406940704071407240734074407540764077407840794080408140824083408440854086408740884089409040914092409340944095409640974098409941004101410241034104410541064107410841094110411141124113411441154116411741184119412041214122412341244125412641274128412941304131413241334134413541364137413841394140414141424143414441454146414741484149415041514152415341544155415641574158415941604161416241634164416541664167416841694170417141724173417441754176417741784179418041814182418341844185418641874188418941904191419241934194419541964197419841994200420142024203420442054206420742084209421042114212421342144215421642174218421942204221422242234224422542264227422842294230423142324233423442354236423742384239424042414242424342444245424642474248424942504251425242534254425542564257425842594260426142624263426442654266426742684269427042714272427342744275427642774278427942804281428242834284428542864287428842894290429142924293429442954296429742984299430043014302430343044305430643074308430943104311431243134314431543164317431843194320432143224323432443254326432743284329433043314332433343344335433643374338433943404341434243434344434543464347434843494350435143524353435443554356435743584359436043614362436343644365436643674368436943704371437243734374437543764377437843794380438143824383438443854386438743884389439043914392439343944395439643974398439944004401440244034404440544064407440844094410441144124413441444154416441744184419442044214422442344244425442644274428442944304431443244334434443544364437443844394440444144424443444444454446444744484449445044514452445344544455445644574458445944604461446244634464446544664467446844694470447144724473447444754476447744784479448044814482448344844485448644874488448944904491449244934494449544964497449844994500450145024503450445054506450745084509451045114512451345144515451645174518451945204521452245234524452545264527452845294530453145324533453445354536453745384539454045414542454345444545454645474548454945504551455245534554455545564557455845594560456145624563456445654566456745684569457045714572457345744575457645774578457945804581458245834584458545864587458845894590459145924593459445954596459745984599460046014602460346044605460646074608460946104611461246134614461546164617461846194620462146224623462446254626462746284629463046314632463346344635463646374638463946404641464246434644464546464647464846494650465146524653465446554656465746584659466046614662466346644665466646674668466946704671467246734674467546764677467846794680468146824683468446854686468746884689469046914692469346944695469646974698469947004701470247034704470547064707470847094710471147124713471447154716471747184719472047214722472347244725472647274728472947304731473247334734473547364737473847394740474147424743474447454746474747484749475047514752475347544755475647574758475947604761476247634764476547664767476847694770477147724773477447754776477747784779478047814782478347844785478647874788478947904791479247934794479547964797479847994800480148024803480448054806480748084809481048114812481348144815481648174818481948204821482248234824482548264827482848294830483148324833483448354836483748384839484048414842484348444845484648474848484948504851485248534854485548564857485848594860486148624863486448654866486748684869487048714872487348744875487648774878487948804881488248834884488548864887488848894890489148924893489448954896489748984899490049014902490349044905490649074908490949104911491249134914491549164917491849194920492149224923492449254926492749284929493049314932493349344935493649374938493949404941494249434944494549464947494849494950495149524953495449554956495749584959496049614962496349644965496649674968496949704971497249734974497549764977497849794980498149824983498449854986498749884989499049914992499349944995499649974998499950005001500250035004500550065007500850095010501150125013501450155016501750185019502050215022502350245025502650275028502950305031503250335034503550365037503850395040504150425043504450455046504750485049505050515052505350545055505650575058505950605061506250635064506550665067506850695070507150725073507450755076507750785079508050815082508350845085508650875088508950905091509250935094509550965097509850995100510151025103510451055106510751085109511051115112511351145115511651175118511951205121512251235124512551265127512851295130513151325133513451355136513751385139514051415142514351445145514651475148514951505151515251535154515551565157515851595160516151625163516451655166516751685169517051715172517351745175517651775178517951805181518251835184518551865187518851895190519151925193519451955196519751985199520052015202520352045205520652075208520952105211521252135214521552165217521852195220522152225223522452255226522752285229523052315232523352345235523652375238523952405241524252435244524552465247524852495250525152525253525452555256525752585259526052615262526352645265526652675268526952705271527252735274527552765277527852795280528152825283528452855286528752885289529052915292529352945295529652975298529953005301530253035304530553065307530853095310531153125313531453155316531753185319532053215322532353245325532653275328532953305331533253335334533553365337533853395340534153425343534453455346534753485349535053515352535353545355535653575358535953605361536253635364536553665367536853695370537153725373537453755376537753785379538053815382538353845385538653875388538953905391539253935394539553965397539853995400540154025403540454055406540754085409541054115412541354145415541654175418541954205421542254235424542554265427542854295430543154325433543454355436543754385439544054415442544354445445544654475448544954505451545254535454545554565457545854595460546154625463546454655466546754685469547054715472547354745475547654775478547954805481548254835484548554865487548854895490549154925493549454955496549754985499550055015502550355045505550655075508550955105511551255135514551555165517551855195520552155225523552455255526552755285529553055315532553355345535553655375538553955405541554255435544554555465547554855495550555155525553555455555556555755585559556055615562556355645565556655675568556955705571557255735574557555765577557855795580558155825583558455855586558755885589559055915592559355945595559655975598559956005601560256035604560556065607560856095610561156125613561456155616561756185619562056215622562356245625562656275628562956305631563256335634563556365637563856395640564156425643564456455646564756485649565056515652565356545655565656575658565956605661566256635664566556665667566856695670567156725673567456755676567756785679568056815682568356845685568656875688568956905691569256935694569556965697569856995700570157025703570457055706570757085709571057115712571357145715571657175718571957205721572257235724572557265727572857295730573157325733573457355736573757385739574057415742574357445745574657475748574957505751575257535754575557565757575857595760576157625763576457655766576757685769577057715772577357745775577657775778577957805781578257835784578557865787578857895790579157925793579457955796579757985799580058015802580358045805580658075808580958105811581258135814581558165817581858195820582158225823582458255826582758285829583058315832583358345835583658375838583958405841584258435844584558465847584858495850585158525853585458555856585758585859586058615862586358645865586658675868586958705871587258735874587558765877587858795880588158825883588458855886588758885889589058915892589358945895589658975898589959005901590259035904590559065907590859095910591159125913591459155916591759185919592059215922592359245925592659275928592959305931593259335934593559365937593859395940594159425943594459455946594759485949595059515952595359545955595659575958595959605961596259635964596559665967596859695970597159725973597459755976597759785979598059815982598359845985598659875988598959905991599259935994599559965997599859996000600160026003600460056006600760086009601060116012601360146015601660176018601960206021602260236024602560266027602860296030603160326033603460356036603760386039604060416042604360446045604660476048604960506051605260536054605560566057605860596060606160626063606460656066606760686069607060716072607360746075607660776078607960806081608260836084608560866087608860896090609160926093609460956096609760986099610061016102610361046105610661076108610961106111611261136114611561166117611861196120612161226123612461256126612761286129613061316132613361346135613661376138613961406141614261436144614561466147614861496150615161526153615461556156615761586159616061616162616361646165616661676168616961706171617261736174617561766177617861796180618161826183618461856186618761886189619061916192619361946195619661976198619962006201620262036204620562066207620862096210621162126213621462156216621762186219622062216222622362246225622662276228622962306231623262336234623562366237623862396240624162426243624462456246624762486249625062516252625362546255625662576258625962606261626262636264626562666267626862696270627162726273627462756276627762786279628062816282628362846285628662876288628962906291629262936294629562966297629862996300630163026303630463056306630763086309631063116312631363146315631663176318631963206321632263236324632563266327632863296330633163326333633463356336633763386339634063416342634363446345634663476348634963506351635263536354635563566357635863596360636163626363636463656366636763686369637063716372637363746375637663776378637963806381638263836384638563866387638863896390639163926393639463956396639763986399640064016402640364046405640664076408640964106411641264136414641564166417641864196420642164226423642464256426642764286429643064316432643364346435643664376438643964406441644264436444644564466447644864496450645164526453645464556456645764586459646064616462646364646465646664676468646964706471647264736474647564766477647864796480648164826483648464856486648764886489649064916492649364946495649664976498649965006501650265036504650565066507650865096510651165126513651465156516651765186519652065216522652365246525652665276528652965306531653265336534653565366537653865396540654165426543654465456546654765486549655065516552655365546555655665576558655965606561656265636564656565666567656865696570657165726573657465756576657765786579658065816582658365846585658665876588658965906591659265936594659565966597659865996600660166026603660466056606660766086609661066116612661366146615661666176618661966206621662266236624662566266627662866296630663166326633663466356636663766386639664066416642664366446645664666476648664966506651665266536654665566566657665866596660666166626663666466656666666766686669667066716672667366746675667666776678667966806681668266836684668566866687668866896690669166926693669466956696669766986699670067016702670367046705670667076708670967106711671267136714671567166717671867196720672167226723672467256726672767286729673067316732673367346735673667376738673967406741674267436744674567466747674867496750675167526753675467556756675767586759676067616762676367646765676667676768676967706771677267736774677567766777677867796780678167826783678467856786678767886789679067916792679367946795679667976798679968006801680268036804680568066807680868096810681168126813681468156816681768186819682068216822682368246825682668276828682968306831683268336834683568366837683868396840684168426843684468456846684768486849685068516852685368546855685668576858685968606861686268636864686568666867686868696870687168726873687468756876687768786879688068816882688368846885688668876888688968906891689268936894689568966897689868996900690169026903690469056906690769086909691069116912691369146915691669176918691969206921692269236924692569266927692869296930693169326933693469356936693769386939694069416942694369446945694669476948694969506951695269536954695569566957695869596960696169626963696469656966696769686969697069716972697369746975697669776978697969806981698269836984698569866987698869896990699169926993699469956996699769986999700070017002700370047005700670077008700970107011701270137014701570167017701870197020702170227023702470257026702770287029703070317032703370347035703670377038703970407041704270437044704570467047704870497050705170527053705470557056705770587059706070617062706370647065706670677068706970707071707270737074707570767077707870797080708170827083708470857086708770887089709070917092709370947095709670977098709971007101710271037104710571067107710871097110711171127113711471157116711771187119712071217122712371247125712671277128712971307131713271337134713571367137713871397140714171427143714471457146714771487149715071517152715371547155715671577158715971607161716271637164716571667167716871697170717171727173717471757176717771787179718071817182718371847185718671877188718971907191719271937194719571967197719871997200720172027203720472057206720772087209721072117212721372147215721672177218721972207221722272237224722572267227722872297230723172327233723472357236723772387239724072417242724372447245724672477248724972507251725272537254725572567257725872597260726172627263726472657266726772687269727072717272727372747275727672777278727972807281728272837284728572867287728872897290729172927293729472957296729772987299730073017302730373047305730673077308730973107311731273137314731573167317731873197320732173227323732473257326732773287329733073317332733373347335733673377338733973407341734273437344734573467347734873497350735173527353735473557356735773587359736073617362736373647365736673677368736973707371737273737374737573767377737873797380738173827383738473857386738773887389739073917392739373947395739673977398739974007401740274037404740574067407740874097410741174127413741474157416741774187419742074217422742374247425742674277428742974307431743274337434743574367437743874397440744174427443744474457446744774487449745074517452745374547455745674577458745974607461746274637464746574667467746874697470747174727473747474757476747774787479748074817482748374847485748674877488748974907491749274937494749574967497749874997500750175027503750475057506750775087509751075117512751375147515751675177518751975207521752275237524752575267527752875297530753175327533753475357536753775387539754075417542754375447545754675477548754975507551755275537554755575567557755875597560756175627563756475657566756775687569757075717572757375747575757675777578757975807581758275837584758575867587758875897590759175927593759475957596759775987599760076017602760376047605760676077608760976107611761276137614761576167617761876197620762176227623762476257626762776287629763076317632763376347635763676377638763976407641764276437644764576467647764876497650765176527653765476557656765776587659766076617662766376647665766676677668766976707671767276737674767576767677767876797680768176827683768476857686768776887689769076917692769376947695769676977698769977007701770277037704770577067707770877097710771177127713771477157716771777187719772077217722772377247725772677277728772977307731773277337734773577367737773877397740774177427743774477457746774777487749775077517752775377547755775677577758775977607761776277637764776577667767776877697770777177727773777477757776777777787779778077817782778377847785778677877788778977907791779277937794779577967797779877997800780178027803780478057806780778087809781078117812781378147815781678177818781978207821782278237824782578267827782878297830783178327833783478357836783778387839784078417842784378447845784678477848784978507851785278537854785578567857785878597860786178627863786478657866786778687869787078717872787378747875787678777878787978807881788278837884788578867887788878897890789178927893789478957896789778987899790079017902790379047905790679077908790979107911791279137914791579167917791879197920792179227923792479257926792779287929793079317932793379347935793679377938793979407941794279437944794579467947794879497950795179527953795479557956795779587959796079617962796379647965796679677968796979707971797279737974797579767977797879797980798179827983798479857986798779887989799079917992799379947995799679977998799980008001800280038004800580068007800880098010801180128013801480158016801780188019802080218022802380248025802680278028802980308031803280338034803580368037803880398040804180428043804480458046804780488049805080518052805380548055805680578058805980608061806280638064806580668067806880698070807180728073807480758076807780788079808080818082808380848085808680878088808980908091809280938094809580968097809880998100810181028103810481058106810781088109811081118112811381148115811681178118811981208121812281238124812581268127812881298130813181328133813481358136813781388139814081418142814381448145814681478148814981508151815281538154815581568157815881598160816181628163816481658166816781688169817081718172817381748175817681778178817981808181818281838184818581868187818881898190819181928193819481958196819781988199820082018202820382048205820682078208820982108211821282138214821582168217821882198220822182228223822482258226822782288229823082318232823382348235823682378238823982408241824282438244824582468247824882498250825182528253825482558256825782588259826082618262826382648265826682678268826982708271827282738274827582768277827882798280828182828283828482858286828782888289829082918292829382948295829682978298829983008301830283038304830583068307830883098310831183128313831483158316831783188319832083218322832383248325832683278328832983308331833283338334833583368337833883398340834183428343834483458346834783488349835083518352835383548355835683578358835983608361836283638364836583668367836883698370837183728373837483758376837783788379838083818382838383848385838683878388838983908391839283938394839583968397839883998400840184028403840484058406840784088409841084118412841384148415841684178418841984208421842284238424842584268427842884298430843184328433843484358436843784388439844084418442844384448445844684478448844984508451845284538454845584568457845884598460846184628463846484658466846784688469847084718472847384748475847684778478847984808481848284838484848584868487848884898490849184928493849484958496849784988499850085018502850385048505850685078508850985108511851285138514851585168517851885198520852185228523852485258526852785288529853085318532853385348535853685378538853985408541854285438544854585468547854885498550855185528553855485558556855785588559856085618562856385648565856685678568856985708571857285738574857585768577857885798580858185828583858485858586858785888589859085918592859385948595859685978598859986008601860286038604860586068607860886098610861186128613861486158616861786188619862086218622862386248625862686278628862986308631863286338634863586368637863886398640864186428643864486458646864786488649865086518652865386548655865686578658865986608661866286638664866586668667866886698670867186728673867486758676867786788679868086818682868386848685868686878688868986908691869286938694869586968697869886998700870187028703870487058706870787088709871087118712871387148715871687178718871987208721872287238724872587268727872887298730873187328733873487358736873787388739874087418742874387448745874687478748874987508751875287538754875587568757875887598760876187628763876487658766876787688769877087718772877387748775877687778778877987808781878287838784878587868787878887898790879187928793879487958796879787988799880088018802880388048805880688078808880988108811881288138814881588168817881888198820882188228823882488258826882788288829883088318832883388348835883688378838883988408841884288438844884588468847884888498850885188528853885488558856885788588859886088618862886388648865886688678868886988708871887288738874887588768877887888798880888188828883888488858886888788888889889088918892889388948895889688978898889989008901890289038904890589068907890889098910891189128913891489158916891789188919892089218922892389248925892689278928892989308931893289338934893589368937893889398940894189428943894489458946894789488949895089518952895389548955895689578958895989608961896289638964896589668967896889698970897189728973897489758976897789788979898089818982898389848985898689878988898989908991899289938994899589968997899889999000900190029003900490059006900790089009901090119012901390149015901690179018901990209021902290239024902590269027902890299030903190329033903490359036903790389039904090419042904390449045904690479048904990509051905290539054905590569057905890599060906190629063906490659066906790689069907090719072907390749075907690779078907990809081908290839084908590869087908890899090909190929093909490959096909790989099910091019102910391049105910691079108910991109111911291139114911591169117911891199120912191229123912491259126912791289129913091319132913391349135913691379138913991409141914291439144914591469147914891499150915191529153915491559156915791589159916091619162916391649165916691679168916991709171917291739174917591769177917891799180918191829183918491859186918791889189919091919192919391949195919691979198919992009201920292039204920592069207920892099210921192129213921492159216921792189219922092219222922392249225922692279228922992309231923292339234923592369237923892399240924192429243924492459246924792489249925092519252925392549255925692579258925992609261926292639264926592669267926892699270927192729273927492759276927792789279928092819282928392849285928692879288928992909291929292939294929592969297929892999300930193029303930493059306930793089309931093119312931393149315931693179318931993209321932293239324932593269327932893299330933193329333933493359336933793389339934093419342934393449345934693479348934993509351935293539354935593569357935893599360936193629363936493659366936793689369937093719372937393749375937693779378937993809381938293839384938593869387938893899390939193929393939493959396939793989399940094019402940394049405940694079408940994109411941294139414941594169417941894199420942194229423942494259426942794289429943094319432943394349435943694379438943994409441944294439444944594469447944894499450945194529453945494559456945794589459946094619462946394649465946694679468946994709471947294739474947594769477947894799480948194829483948494859486948794889489949094919492949394949495949694979498949995009501950295039504950595069507950895099510951195129513951495159516951795189519952095219522952395249525952695279528952995309531953295339534953595369537953895399540954195429543954495459546954795489549955095519552955395549555955695579558955995609561956295639564956595669567956895699570957195729573957495759576957795789579958095819582958395849585958695879588958995909591959295939594959595969597959895999600960196029603960496059606960796089609961096119612961396149615961696179618961996209621962296239624962596269627962896299630963196329633963496359636963796389639964096419642964396449645964696479648964996509651965296539654965596569657965896599660966196629663966496659666966796689669967096719672967396749675967696779678967996809681968296839684968596869687968896899690969196929693969496959696969796989699970097019702970397049705970697079708970997109711971297139714971597169717971897199720972197229723972497259726972797289729973097319732973397349735973697379738973997409741974297439744974597469747974897499750975197529753975497559756975797589759976097619762976397649765976697679768976997709771977297739774977597769777977897799780978197829783978497859786978797889789979097919792979397949795979697979798979998009801980298039804980598069807980898099810981198129813981498159816981798189819982098219822982398249825982698279828982998309831983298339834983598369837983898399840984198429843984498459846984798489849985098519852985398549855985698579858985998609861986298639864986598669867986898699870987198729873987498759876987798789879988098819882988398849885988698879888988998909891989298939894989598969897989898999900990199029903990499059906990799089909991099119912991399149915991699179918991999209921992299239924992599269927992899299930993199329933993499359936993799389939994099419942994399449945994699479948994999509951995299539954995599569957995899599960996199629963996499659966996799689969997099719972997399749975997699779978997999809981998299839984998599869987998899899990999199929993999499959996999799989999100001000110002100031000410005100061000710008100091001010011100121001310014100151001610017100181001910020100211002210023100241002510026100271002810029100301003110032100331003410035100361003710038100391004010041100421004310044100451004610047100481004910050100511005210053100541005510056100571005810059100601006110062100631006410065100661006710068100691007010071100721007310074100751007610077100781007910080100811008210083100841008510086100871008810089100901009110092100931009410095100961009710098100991010010101101021010310104101051010610107101081010910110101111011210113101141011510116101171011810119101201012110122101231012410125101261012710128101291013010131101321013310134101351013610137101381013910140101411014210143101441014510146101471014810149101501015110152101531015410155101561015710158101591016010161101621016310164101651016610167101681016910170101711017210173101741017510176101771017810179101801018110182101831018410185101861018710188101891019010191101921019310194101951019610197101981019910200102011020210203102041020510206102071020810209102101021110212102131021410215102161021710218102191022010221102221022310224102251022610227102281022910230102311023210233102341023510236102371023810239102401024110242102431024410245102461024710248102491025010251102521025310254102551025610257102581025910260102611026210263102641026510266102671026810269102701027110272102731027410275102761027710278102791028010281102821028310284102851028610287102881028910290102911029210293102941029510296102971029810299103001030110302103031030410305103061030710308103091031010311103121031310314103151031610317103181031910320103211032210323103241032510326103271032810329103301033110332103331033410335103361033710338103391034010341103421034310344103451034610347103481034910350103511035210353103541035510356103571035810359103601036110362103631036410365103661036710368103691037010371103721037310374103751037610377103781037910380103811038210383103841038510386103871038810389103901039110392103931039410395103961039710398103991040010401104021040310404104051040610407104081040910410104111041210413104141041510416104171041810419104201042110422104231042410425104261042710428104291043010431104321043310434104351043610437104381043910440104411044210443104441044510446104471044810449104501045110452104531045410455104561045710458104591046010461104621046310464104651046610467104681046910470104711047210473104741047510476104771047810479104801048110482104831048410485104861048710488104891049010491104921049310494104951049610497104981049910500105011050210503105041050510506105071050810509105101051110512105131051410515105161051710518105191052010521105221052310524105251052610527105281052910530105311053210533105341053510536105371053810539105401054110542105431054410545105461054710548105491055010551105521055310554105551055610557105581055910560105611056210563105641056510566105671056810569105701057110572105731057410575105761057710578105791058010581105821058310584105851058610587105881058910590105911059210593105941059510596105971059810599106001060110602106031060410605106061060710608106091061010611106121061310614106151061610617106181061910620106211062210623106241062510626106271062810629106301063110632106331063410635106361063710638106391064010641106421064310644106451064610647106481064910650106511065210653106541065510656106571065810659106601066110662106631066410665106661066710668106691067010671106721067310674106751067610677106781067910680106811068210683106841068510686106871068810689106901069110692106931069410695106961069710698106991070010701107021070310704107051070610707107081070910710107111071210713107141071510716107171071810719107201072110722107231072410725107261072710728107291073010731107321073310734107351073610737107381073910740107411074210743107441074510746107471074810749107501075110752107531075410755107561075710758107591076010761107621076310764107651076610767107681076910770107711077210773107741077510776107771077810779107801078110782107831078410785107861078710788107891079010791107921079310794107951079610797107981079910800108011080210803108041080510806108071080810809108101081110812108131081410815108161081710818108191082010821108221082310824108251082610827108281082910830108311083210833108341083510836108371083810839108401084110842108431084410845108461084710848108491085010851108521085310854108551085610857108581085910860108611086210863108641086510866108671086810869108701087110872108731087410875108761087710878108791088010881108821088310884108851088610887108881088910890108911089210893108941089510896108971089810899109001090110902109031090410905109061090710908109091091010911109121091310914109151091610917109181091910920109211092210923109241092510926109271092810929109301093110932109331093410935109361093710938109391094010941109421094310944109451094610947109481094910950109511095210953109541095510956109571095810959109601096110962109631096410965109661096710968109691097010971109721097310974109751097610977109781097910980109811098210983109841098510986109871098810989109901099110992109931099410995109961099710998109991100011001110021100311004110051100611007110081100911010110111101211013110141101511016110171101811019110201102111022110231102411025110261102711028110291103011031110321103311034110351103611037110381103911040110411104211043110441104511046110471104811049110501105111052110531105411055110561105711058110591106011061110621106311064110651106611067110681106911070110711107211073110741107511076110771107811079110801108111082110831108411085110861108711088110891109011091110921109311094110951109611097110981109911100111011110211103111041110511106111071110811109111101111111112111131111411115111161111711118111191112011121111221112311124111251112611127111281112911130111311113211133111341113511136111371113811139111401114111142111431114411145111461114711148111491115011151111521115311154111551115611157111581115911160111611116211163111641116511166111671116811169111701117111172111731117411175111761117711178111791118011181111821118311184111851118611187111881118911190111911119211193111941119511196111971119811199112001120111202112031120411205112061120711208112091121011211112121121311214112151121611217112181121911220112211122211223112241122511226112271122811229112301123111232112331123411235112361123711238112391124011241112421124311244112451124611247112481124911250112511125211253112541125511256112571125811259112601126111262112631126411265112661126711268112691127011271112721127311274112751127611277112781127911280112811128211283112841128511286112871128811289112901129111292112931129411295112961129711298112991130011301113021130311304113051130611307113081130911310113111131211313113141131511316113171131811319113201132111322113231132411325113261132711328113291133011331113321133311334113351133611337113381133911340113411134211343113441134511346113471134811349113501135111352113531135411355113561135711358
  1. // Package books provides access to the Books API.
  2. //
  3. // See https://developers.google.com/books/docs/v1/getting_started
  4. //
  5. // Usage example:
  6. //
  7. // import "google.golang.org/api/books/v1"
  8. // ...
  9. // booksService, err := books.New(oauthHttpClient)
  10. package books // import "google.golang.org/api/books/v1"
  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 = "books:v1"
  41. const apiName = "books"
  42. const apiVersion = "v1"
  43. const basePath = "https://www.googleapis.com/books/v1/"
  44. // OAuth2 scopes used by this API.
  45. const (
  46. // Manage your books
  47. BooksScope = "https://www.googleapis.com/auth/books"
  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.Bookshelves = NewBookshelvesService(s)
  55. s.Cloudloading = NewCloudloadingService(s)
  56. s.Dictionary = NewDictionaryService(s)
  57. s.Layers = NewLayersService(s)
  58. s.Myconfig = NewMyconfigService(s)
  59. s.Mylibrary = NewMylibraryService(s)
  60. s.Notification = NewNotificationService(s)
  61. s.Onboarding = NewOnboardingService(s)
  62. s.Personalizedstream = NewPersonalizedstreamService(s)
  63. s.Promooffer = NewPromoofferService(s)
  64. s.Series = NewSeriesService(s)
  65. s.Volumes = NewVolumesService(s)
  66. return s, nil
  67. }
  68. type Service struct {
  69. client *http.Client
  70. BasePath string // API endpoint base URL
  71. UserAgent string // optional additional User-Agent fragment
  72. Bookshelves *BookshelvesService
  73. Cloudloading *CloudloadingService
  74. Dictionary *DictionaryService
  75. Layers *LayersService
  76. Myconfig *MyconfigService
  77. Mylibrary *MylibraryService
  78. Notification *NotificationService
  79. Onboarding *OnboardingService
  80. Personalizedstream *PersonalizedstreamService
  81. Promooffer *PromoofferService
  82. Series *SeriesService
  83. Volumes *VolumesService
  84. }
  85. func (s *Service) userAgent() string {
  86. if s.UserAgent == "" {
  87. return googleapi.UserAgent
  88. }
  89. return googleapi.UserAgent + " " + s.UserAgent
  90. }
  91. func NewBookshelvesService(s *Service) *BookshelvesService {
  92. rs := &BookshelvesService{s: s}
  93. rs.Volumes = NewBookshelvesVolumesService(s)
  94. return rs
  95. }
  96. type BookshelvesService struct {
  97. s *Service
  98. Volumes *BookshelvesVolumesService
  99. }
  100. func NewBookshelvesVolumesService(s *Service) *BookshelvesVolumesService {
  101. rs := &BookshelvesVolumesService{s: s}
  102. return rs
  103. }
  104. type BookshelvesVolumesService struct {
  105. s *Service
  106. }
  107. func NewCloudloadingService(s *Service) *CloudloadingService {
  108. rs := &CloudloadingService{s: s}
  109. return rs
  110. }
  111. type CloudloadingService struct {
  112. s *Service
  113. }
  114. func NewDictionaryService(s *Service) *DictionaryService {
  115. rs := &DictionaryService{s: s}
  116. return rs
  117. }
  118. type DictionaryService struct {
  119. s *Service
  120. }
  121. func NewLayersService(s *Service) *LayersService {
  122. rs := &LayersService{s: s}
  123. rs.AnnotationData = NewLayersAnnotationDataService(s)
  124. rs.VolumeAnnotations = NewLayersVolumeAnnotationsService(s)
  125. return rs
  126. }
  127. type LayersService struct {
  128. s *Service
  129. AnnotationData *LayersAnnotationDataService
  130. VolumeAnnotations *LayersVolumeAnnotationsService
  131. }
  132. func NewLayersAnnotationDataService(s *Service) *LayersAnnotationDataService {
  133. rs := &LayersAnnotationDataService{s: s}
  134. return rs
  135. }
  136. type LayersAnnotationDataService struct {
  137. s *Service
  138. }
  139. func NewLayersVolumeAnnotationsService(s *Service) *LayersVolumeAnnotationsService {
  140. rs := &LayersVolumeAnnotationsService{s: s}
  141. return rs
  142. }
  143. type LayersVolumeAnnotationsService struct {
  144. s *Service
  145. }
  146. func NewMyconfigService(s *Service) *MyconfigService {
  147. rs := &MyconfigService{s: s}
  148. return rs
  149. }
  150. type MyconfigService struct {
  151. s *Service
  152. }
  153. func NewMylibraryService(s *Service) *MylibraryService {
  154. rs := &MylibraryService{s: s}
  155. rs.Annotations = NewMylibraryAnnotationsService(s)
  156. rs.Bookshelves = NewMylibraryBookshelvesService(s)
  157. rs.Readingpositions = NewMylibraryReadingpositionsService(s)
  158. return rs
  159. }
  160. type MylibraryService struct {
  161. s *Service
  162. Annotations *MylibraryAnnotationsService
  163. Bookshelves *MylibraryBookshelvesService
  164. Readingpositions *MylibraryReadingpositionsService
  165. }
  166. func NewMylibraryAnnotationsService(s *Service) *MylibraryAnnotationsService {
  167. rs := &MylibraryAnnotationsService{s: s}
  168. return rs
  169. }
  170. type MylibraryAnnotationsService struct {
  171. s *Service
  172. }
  173. func NewMylibraryBookshelvesService(s *Service) *MylibraryBookshelvesService {
  174. rs := &MylibraryBookshelvesService{s: s}
  175. rs.Volumes = NewMylibraryBookshelvesVolumesService(s)
  176. return rs
  177. }
  178. type MylibraryBookshelvesService struct {
  179. s *Service
  180. Volumes *MylibraryBookshelvesVolumesService
  181. }
  182. func NewMylibraryBookshelvesVolumesService(s *Service) *MylibraryBookshelvesVolumesService {
  183. rs := &MylibraryBookshelvesVolumesService{s: s}
  184. return rs
  185. }
  186. type MylibraryBookshelvesVolumesService struct {
  187. s *Service
  188. }
  189. func NewMylibraryReadingpositionsService(s *Service) *MylibraryReadingpositionsService {
  190. rs := &MylibraryReadingpositionsService{s: s}
  191. return rs
  192. }
  193. type MylibraryReadingpositionsService struct {
  194. s *Service
  195. }
  196. func NewNotificationService(s *Service) *NotificationService {
  197. rs := &NotificationService{s: s}
  198. return rs
  199. }
  200. type NotificationService struct {
  201. s *Service
  202. }
  203. func NewOnboardingService(s *Service) *OnboardingService {
  204. rs := &OnboardingService{s: s}
  205. return rs
  206. }
  207. type OnboardingService struct {
  208. s *Service
  209. }
  210. func NewPersonalizedstreamService(s *Service) *PersonalizedstreamService {
  211. rs := &PersonalizedstreamService{s: s}
  212. return rs
  213. }
  214. type PersonalizedstreamService struct {
  215. s *Service
  216. }
  217. func NewPromoofferService(s *Service) *PromoofferService {
  218. rs := &PromoofferService{s: s}
  219. return rs
  220. }
  221. type PromoofferService struct {
  222. s *Service
  223. }
  224. func NewSeriesService(s *Service) *SeriesService {
  225. rs := &SeriesService{s: s}
  226. rs.Membership = NewSeriesMembershipService(s)
  227. return rs
  228. }
  229. type SeriesService struct {
  230. s *Service
  231. Membership *SeriesMembershipService
  232. }
  233. func NewSeriesMembershipService(s *Service) *SeriesMembershipService {
  234. rs := &SeriesMembershipService{s: s}
  235. return rs
  236. }
  237. type SeriesMembershipService struct {
  238. s *Service
  239. }
  240. func NewVolumesService(s *Service) *VolumesService {
  241. rs := &VolumesService{s: s}
  242. rs.Associated = NewVolumesAssociatedService(s)
  243. rs.Mybooks = NewVolumesMybooksService(s)
  244. rs.Recommended = NewVolumesRecommendedService(s)
  245. rs.Useruploaded = NewVolumesUseruploadedService(s)
  246. return rs
  247. }
  248. type VolumesService struct {
  249. s *Service
  250. Associated *VolumesAssociatedService
  251. Mybooks *VolumesMybooksService
  252. Recommended *VolumesRecommendedService
  253. Useruploaded *VolumesUseruploadedService
  254. }
  255. func NewVolumesAssociatedService(s *Service) *VolumesAssociatedService {
  256. rs := &VolumesAssociatedService{s: s}
  257. return rs
  258. }
  259. type VolumesAssociatedService struct {
  260. s *Service
  261. }
  262. func NewVolumesMybooksService(s *Service) *VolumesMybooksService {
  263. rs := &VolumesMybooksService{s: s}
  264. return rs
  265. }
  266. type VolumesMybooksService struct {
  267. s *Service
  268. }
  269. func NewVolumesRecommendedService(s *Service) *VolumesRecommendedService {
  270. rs := &VolumesRecommendedService{s: s}
  271. return rs
  272. }
  273. type VolumesRecommendedService struct {
  274. s *Service
  275. }
  276. func NewVolumesUseruploadedService(s *Service) *VolumesUseruploadedService {
  277. rs := &VolumesUseruploadedService{s: s}
  278. return rs
  279. }
  280. type VolumesUseruploadedService struct {
  281. s *Service
  282. }
  283. type Annotation struct {
  284. // AfterSelectedText: Anchor text after excerpt. For requests, if the
  285. // user bookmarked a screen that has no flowing text on it, then this
  286. // field should be empty.
  287. AfterSelectedText string `json:"afterSelectedText,omitempty"`
  288. // BeforeSelectedText: Anchor text before excerpt. For requests, if the
  289. // user bookmarked a screen that has no flowing text on it, then this
  290. // field should be empty.
  291. BeforeSelectedText string `json:"beforeSelectedText,omitempty"`
  292. // ClientVersionRanges: Selection ranges sent from the client.
  293. ClientVersionRanges *AnnotationClientVersionRanges `json:"clientVersionRanges,omitempty"`
  294. // Created: Timestamp for the created time of this annotation.
  295. Created string `json:"created,omitempty"`
  296. // CurrentVersionRanges: Selection ranges for the most recent content
  297. // version.
  298. CurrentVersionRanges *AnnotationCurrentVersionRanges `json:"currentVersionRanges,omitempty"`
  299. // Data: User-created data for this annotation.
  300. Data string `json:"data,omitempty"`
  301. // Deleted: Indicates that this annotation is deleted.
  302. Deleted bool `json:"deleted,omitempty"`
  303. // HighlightStyle: The highlight style for this annotation.
  304. HighlightStyle string `json:"highlightStyle,omitempty"`
  305. // Id: Id of this annotation, in the form of a GUID.
  306. Id string `json:"id,omitempty"`
  307. // Kind: Resource type.
  308. Kind string `json:"kind,omitempty"`
  309. // LayerId: The layer this annotation is for.
  310. LayerId string `json:"layerId,omitempty"`
  311. LayerSummary *AnnotationLayerSummary `json:"layerSummary,omitempty"`
  312. // PageIds: Pages that this annotation spans.
  313. PageIds []string `json:"pageIds,omitempty"`
  314. // SelectedText: Excerpt from the volume.
  315. SelectedText string `json:"selectedText,omitempty"`
  316. // SelfLink: URL to this resource.
  317. SelfLink string `json:"selfLink,omitempty"`
  318. // Updated: Timestamp for the last time this annotation was modified.
  319. Updated string `json:"updated,omitempty"`
  320. // VolumeId: The volume that this annotation belongs to.
  321. VolumeId string `json:"volumeId,omitempty"`
  322. // ServerResponse contains the HTTP response code and headers from the
  323. // server.
  324. googleapi.ServerResponse `json:"-"`
  325. // ForceSendFields is a list of field names (e.g. "AfterSelectedText")
  326. // to unconditionally include in API requests. By default, fields with
  327. // empty values are omitted from API requests. However, any non-pointer,
  328. // non-interface field appearing in ForceSendFields will be sent to the
  329. // server regardless of whether the field is empty or not. This may be
  330. // used to include empty fields in Patch requests.
  331. ForceSendFields []string `json:"-"`
  332. }
  333. func (s *Annotation) MarshalJSON() ([]byte, error) {
  334. type noMethod Annotation
  335. raw := noMethod(*s)
  336. return gensupport.MarshalJSON(raw, s.ForceSendFields)
  337. }
  338. // AnnotationClientVersionRanges: Selection ranges sent from the client.
  339. type AnnotationClientVersionRanges struct {
  340. // CfiRange: Range in CFI format for this annotation sent by client.
  341. CfiRange *BooksAnnotationsRange `json:"cfiRange,omitempty"`
  342. // ContentVersion: Content version the client sent in.
  343. ContentVersion string `json:"contentVersion,omitempty"`
  344. // GbImageRange: Range in GB image format for this annotation sent by
  345. // client.
  346. GbImageRange *BooksAnnotationsRange `json:"gbImageRange,omitempty"`
  347. // GbTextRange: Range in GB text format for this annotation sent by
  348. // client.
  349. GbTextRange *BooksAnnotationsRange `json:"gbTextRange,omitempty"`
  350. // ImageCfiRange: Range in image CFI format for this annotation sent by
  351. // client.
  352. ImageCfiRange *BooksAnnotationsRange `json:"imageCfiRange,omitempty"`
  353. // ForceSendFields is a list of field names (e.g. "CfiRange") to
  354. // unconditionally include in API requests. By default, fields with
  355. // empty values are omitted from API requests. However, any non-pointer,
  356. // non-interface field appearing in ForceSendFields will be sent to the
  357. // server regardless of whether the field is empty or not. This may be
  358. // used to include empty fields in Patch requests.
  359. ForceSendFields []string `json:"-"`
  360. }
  361. func (s *AnnotationClientVersionRanges) MarshalJSON() ([]byte, error) {
  362. type noMethod AnnotationClientVersionRanges
  363. raw := noMethod(*s)
  364. return gensupport.MarshalJSON(raw, s.ForceSendFields)
  365. }
  366. // AnnotationCurrentVersionRanges: Selection ranges for the most recent
  367. // content version.
  368. type AnnotationCurrentVersionRanges struct {
  369. // CfiRange: Range in CFI format for this annotation for version above.
  370. CfiRange *BooksAnnotationsRange `json:"cfiRange,omitempty"`
  371. // ContentVersion: Content version applicable to ranges below.
  372. ContentVersion string `json:"contentVersion,omitempty"`
  373. // GbImageRange: Range in GB image format for this annotation for
  374. // version above.
  375. GbImageRange *BooksAnnotationsRange `json:"gbImageRange,omitempty"`
  376. // GbTextRange: Range in GB text format for this annotation for version
  377. // above.
  378. GbTextRange *BooksAnnotationsRange `json:"gbTextRange,omitempty"`
  379. // ImageCfiRange: Range in image CFI format for this annotation for
  380. // version above.
  381. ImageCfiRange *BooksAnnotationsRange `json:"imageCfiRange,omitempty"`
  382. // ForceSendFields is a list of field names (e.g. "CfiRange") to
  383. // unconditionally include in API requests. By default, fields with
  384. // empty values are omitted from API requests. However, any non-pointer,
  385. // non-interface field appearing in ForceSendFields will be sent to the
  386. // server regardless of whether the field is empty or not. This may be
  387. // used to include empty fields in Patch requests.
  388. ForceSendFields []string `json:"-"`
  389. }
  390. func (s *AnnotationCurrentVersionRanges) MarshalJSON() ([]byte, error) {
  391. type noMethod AnnotationCurrentVersionRanges
  392. raw := noMethod(*s)
  393. return gensupport.MarshalJSON(raw, s.ForceSendFields)
  394. }
  395. type AnnotationLayerSummary struct {
  396. // AllowedCharacterCount: Maximum allowed characters on this layer,
  397. // especially for the "copy" layer.
  398. AllowedCharacterCount int64 `json:"allowedCharacterCount,omitempty"`
  399. // LimitType: Type of limitation on this layer. "limited" or "unlimited"
  400. // for the "copy" layer.
  401. LimitType string `json:"limitType,omitempty"`
  402. // RemainingCharacterCount: Remaining allowed characters on this layer,
  403. // especially for the "copy" layer.
  404. RemainingCharacterCount int64 `json:"remainingCharacterCount,omitempty"`
  405. // ForceSendFields is a list of field names (e.g.
  406. // "AllowedCharacterCount") to unconditionally include in API requests.
  407. // By default, fields with empty values are omitted from API requests.
  408. // However, any non-pointer, non-interface field appearing in
  409. // ForceSendFields will be sent to the server regardless of whether the
  410. // field is empty or not. This may be used to include empty fields in
  411. // Patch requests.
  412. ForceSendFields []string `json:"-"`
  413. }
  414. func (s *AnnotationLayerSummary) MarshalJSON() ([]byte, error) {
  415. type noMethod AnnotationLayerSummary
  416. raw := noMethod(*s)
  417. return gensupport.MarshalJSON(raw, s.ForceSendFields)
  418. }
  419. type Annotationdata struct {
  420. // AnnotationType: The type of annotation this data is for.
  421. AnnotationType string `json:"annotationType,omitempty"`
  422. Data interface{} `json:"data,omitempty"`
  423. // EncodedData: Base64 encoded data for this annotation data.
  424. EncodedData string `json:"encoded_data,omitempty"`
  425. // Id: Unique id for this annotation data.
  426. Id string `json:"id,omitempty"`
  427. // Kind: Resource Type
  428. Kind string `json:"kind,omitempty"`
  429. // LayerId: The Layer id for this data. *
  430. LayerId string `json:"layerId,omitempty"`
  431. // SelfLink: URL for this resource. *
  432. SelfLink string `json:"selfLink,omitempty"`
  433. // Updated: Timestamp for the last time this data was updated. (RFC 3339
  434. // UTC date-time format).
  435. Updated string `json:"updated,omitempty"`
  436. // VolumeId: The volume id for this data. *
  437. VolumeId string `json:"volumeId,omitempty"`
  438. // ServerResponse contains the HTTP response code and headers from the
  439. // server.
  440. googleapi.ServerResponse `json:"-"`
  441. // ForceSendFields is a list of field names (e.g. "AnnotationType") to
  442. // unconditionally include in API requests. By default, fields with
  443. // empty values are omitted from API requests. However, any non-pointer,
  444. // non-interface field appearing in ForceSendFields will be sent to the
  445. // server regardless of whether the field is empty or not. This may be
  446. // used to include empty fields in Patch requests.
  447. ForceSendFields []string `json:"-"`
  448. }
  449. func (s *Annotationdata) MarshalJSON() ([]byte, error) {
  450. type noMethod Annotationdata
  451. raw := noMethod(*s)
  452. return gensupport.MarshalJSON(raw, s.ForceSendFields)
  453. }
  454. type Annotations struct {
  455. // Items: A list of annotations.
  456. Items []*Annotation `json:"items,omitempty"`
  457. // Kind: Resource type.
  458. Kind string `json:"kind,omitempty"`
  459. // NextPageToken: Token to pass in for pagination for the next page.
  460. // This will not be present if this request does not have more results.
  461. NextPageToken string `json:"nextPageToken,omitempty"`
  462. // TotalItems: Total number of annotations found. This may be greater
  463. // than the number of notes returned in this response if results have
  464. // been paginated.
  465. TotalItems int64 `json:"totalItems,omitempty"`
  466. // ServerResponse contains the HTTP response code and headers from the
  467. // server.
  468. googleapi.ServerResponse `json:"-"`
  469. // ForceSendFields is a list of field names (e.g. "Items") to
  470. // unconditionally include in API requests. By default, fields with
  471. // empty values are omitted from API requests. However, any non-pointer,
  472. // non-interface field appearing in ForceSendFields will be sent to the
  473. // server regardless of whether the field is empty or not. This may be
  474. // used to include empty fields in Patch requests.
  475. ForceSendFields []string `json:"-"`
  476. }
  477. func (s *Annotations) MarshalJSON() ([]byte, error) {
  478. type noMethod Annotations
  479. raw := noMethod(*s)
  480. return gensupport.MarshalJSON(raw, s.ForceSendFields)
  481. }
  482. type AnnotationsSummary struct {
  483. Kind string `json:"kind,omitempty"`
  484. Layers []*AnnotationsSummaryLayers `json:"layers,omitempty"`
  485. // ServerResponse contains the HTTP response code and headers from the
  486. // server.
  487. googleapi.ServerResponse `json:"-"`
  488. // ForceSendFields is a list of field names (e.g. "Kind") to
  489. // unconditionally include in API requests. By default, fields with
  490. // empty values are omitted from API requests. However, any non-pointer,
  491. // non-interface field appearing in ForceSendFields will be sent to the
  492. // server regardless of whether the field is empty or not. This may be
  493. // used to include empty fields in Patch requests.
  494. ForceSendFields []string `json:"-"`
  495. }
  496. func (s *AnnotationsSummary) MarshalJSON() ([]byte, error) {
  497. type noMethod AnnotationsSummary
  498. raw := noMethod(*s)
  499. return gensupport.MarshalJSON(raw, s.ForceSendFields)
  500. }
  501. type AnnotationsSummaryLayers struct {
  502. AllowedCharacterCount int64 `json:"allowedCharacterCount,omitempty"`
  503. LayerId string `json:"layerId,omitempty"`
  504. LimitType string `json:"limitType,omitempty"`
  505. RemainingCharacterCount int64 `json:"remainingCharacterCount,omitempty"`
  506. Updated string `json:"updated,omitempty"`
  507. // ForceSendFields is a list of field names (e.g.
  508. // "AllowedCharacterCount") to unconditionally include in API requests.
  509. // By default, fields with empty values are omitted from API requests.
  510. // However, any non-pointer, non-interface field appearing in
  511. // ForceSendFields will be sent to the server regardless of whether the
  512. // field is empty or not. This may be used to include empty fields in
  513. // Patch requests.
  514. ForceSendFields []string `json:"-"`
  515. }
  516. func (s *AnnotationsSummaryLayers) MarshalJSON() ([]byte, error) {
  517. type noMethod AnnotationsSummaryLayers
  518. raw := noMethod(*s)
  519. return gensupport.MarshalJSON(raw, s.ForceSendFields)
  520. }
  521. type Annotationsdata struct {
  522. // Items: A list of Annotation Data.
  523. Items []*Annotationdata `json:"items,omitempty"`
  524. // Kind: Resource type
  525. Kind string `json:"kind,omitempty"`
  526. // NextPageToken: Token to pass in for pagination for the next page.
  527. // This will not be present if this request does not have more results.
  528. NextPageToken string `json:"nextPageToken,omitempty"`
  529. // TotalItems: The total number of volume annotations found.
  530. TotalItems int64 `json:"totalItems,omitempty"`
  531. // ServerResponse contains the HTTP response code and headers from the
  532. // server.
  533. googleapi.ServerResponse `json:"-"`
  534. // ForceSendFields is a list of field names (e.g. "Items") to
  535. // 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 *Annotationsdata) MarshalJSON() ([]byte, error) {
  543. type noMethod Annotationsdata
  544. raw := noMethod(*s)
  545. return gensupport.MarshalJSON(raw, s.ForceSendFields)
  546. }
  547. type BooksAnnotationsRange struct {
  548. // EndOffset: The offset from the ending position.
  549. EndOffset string `json:"endOffset,omitempty"`
  550. // EndPosition: The ending position for the range.
  551. EndPosition string `json:"endPosition,omitempty"`
  552. // StartOffset: The offset from the starting position.
  553. StartOffset string `json:"startOffset,omitempty"`
  554. // StartPosition: The starting position for the range.
  555. StartPosition string `json:"startPosition,omitempty"`
  556. // ForceSendFields is a list of field names (e.g. "EndOffset") to
  557. // unconditionally include in API requests. By default, fields with
  558. // empty values are omitted from API requests. However, any non-pointer,
  559. // non-interface field appearing in ForceSendFields will be sent to the
  560. // server regardless of whether the field is empty or not. This may be
  561. // used to include empty fields in Patch requests.
  562. ForceSendFields []string `json:"-"`
  563. }
  564. func (s *BooksAnnotationsRange) MarshalJSON() ([]byte, error) {
  565. type noMethod BooksAnnotationsRange
  566. raw := noMethod(*s)
  567. return gensupport.MarshalJSON(raw, s.ForceSendFields)
  568. }
  569. type BooksCloudloadingResource struct {
  570. Author string `json:"author,omitempty"`
  571. ProcessingState string `json:"processingState,omitempty"`
  572. Title string `json:"title,omitempty"`
  573. VolumeId string `json:"volumeId,omitempty"`
  574. // ServerResponse contains the HTTP response code and headers from the
  575. // server.
  576. googleapi.ServerResponse `json:"-"`
  577. // ForceSendFields is a list of field names (e.g. "Author") to
  578. // unconditionally include in API requests. By default, fields with
  579. // empty values are omitted from API requests. However, any non-pointer,
  580. // non-interface field appearing in ForceSendFields will be sent to the
  581. // server regardless of whether the field is empty or not. This may be
  582. // used to include empty fields in Patch requests.
  583. ForceSendFields []string `json:"-"`
  584. }
  585. func (s *BooksCloudloadingResource) MarshalJSON() ([]byte, error) {
  586. type noMethod BooksCloudloadingResource
  587. raw := noMethod(*s)
  588. return gensupport.MarshalJSON(raw, s.ForceSendFields)
  589. }
  590. type BooksVolumesRecommendedRateResponse struct {
  591. ConsistencyToken string `json:"consistency_token,omitempty"`
  592. // ServerResponse contains the HTTP response code and headers from the
  593. // server.
  594. googleapi.ServerResponse `json:"-"`
  595. // ForceSendFields is a list of field names (e.g. "ConsistencyToken") to
  596. // unconditionally include in API requests. By default, fields with
  597. // empty values are omitted from API requests. However, any non-pointer,
  598. // non-interface field appearing in ForceSendFields will be sent to the
  599. // server regardless of whether the field is empty or not. This may be
  600. // used to include empty fields in Patch requests.
  601. ForceSendFields []string `json:"-"`
  602. }
  603. func (s *BooksVolumesRecommendedRateResponse) MarshalJSON() ([]byte, error) {
  604. type noMethod BooksVolumesRecommendedRateResponse
  605. raw := noMethod(*s)
  606. return gensupport.MarshalJSON(raw, s.ForceSendFields)
  607. }
  608. type Bookshelf struct {
  609. // Access: Whether this bookshelf is PUBLIC or PRIVATE.
  610. Access string `json:"access,omitempty"`
  611. // Created: Created time for this bookshelf (formatted UTC timestamp
  612. // with millisecond resolution).
  613. Created string `json:"created,omitempty"`
  614. // Description: Description of this bookshelf.
  615. Description string `json:"description,omitempty"`
  616. // Id: Id of this bookshelf, only unique by user.
  617. Id int64 `json:"id,omitempty"`
  618. // Kind: Resource type for bookshelf metadata.
  619. Kind string `json:"kind,omitempty"`
  620. // SelfLink: URL to this resource.
  621. SelfLink string `json:"selfLink,omitempty"`
  622. // Title: Title of this bookshelf.
  623. Title string `json:"title,omitempty"`
  624. // Updated: Last modified time of this bookshelf (formatted UTC
  625. // timestamp with millisecond resolution).
  626. Updated string `json:"updated,omitempty"`
  627. // VolumeCount: Number of volumes in this bookshelf.
  628. VolumeCount int64 `json:"volumeCount,omitempty"`
  629. // VolumesLastUpdated: Last time a volume was added or removed from this
  630. // bookshelf (formatted UTC timestamp with millisecond resolution).
  631. VolumesLastUpdated string `json:"volumesLastUpdated,omitempty"`
  632. // ServerResponse contains the HTTP response code and headers from the
  633. // server.
  634. googleapi.ServerResponse `json:"-"`
  635. // ForceSendFields is a list of field names (e.g. "Access") to
  636. // unconditionally include in API requests. By default, fields with
  637. // empty values are omitted from API requests. However, any non-pointer,
  638. // non-interface field appearing in ForceSendFields will be sent to the
  639. // server regardless of whether the field is empty or not. This may be
  640. // used to include empty fields in Patch requests.
  641. ForceSendFields []string `json:"-"`
  642. }
  643. func (s *Bookshelf) MarshalJSON() ([]byte, error) {
  644. type noMethod Bookshelf
  645. raw := noMethod(*s)
  646. return gensupport.MarshalJSON(raw, s.ForceSendFields)
  647. }
  648. type Bookshelves struct {
  649. // Items: A list of bookshelves.
  650. Items []*Bookshelf `json:"items,omitempty"`
  651. // Kind: Resource type.
  652. Kind string `json:"kind,omitempty"`
  653. // ServerResponse contains the HTTP response code and headers from the
  654. // server.
  655. googleapi.ServerResponse `json:"-"`
  656. // ForceSendFields is a list of field names (e.g. "Items") to
  657. // unconditionally include in API requests. By default, fields with
  658. // empty values are omitted from API requests. However, any non-pointer,
  659. // non-interface field appearing in ForceSendFields will be sent to the
  660. // server regardless of whether the field is empty or not. This may be
  661. // used to include empty fields in Patch requests.
  662. ForceSendFields []string `json:"-"`
  663. }
  664. func (s *Bookshelves) MarshalJSON() ([]byte, error) {
  665. type noMethod Bookshelves
  666. raw := noMethod(*s)
  667. return gensupport.MarshalJSON(raw, s.ForceSendFields)
  668. }
  669. type Category struct {
  670. // Items: A list of onboarding categories.
  671. Items []*CategoryItems `json:"items,omitempty"`
  672. // Kind: Resource type.
  673. Kind string `json:"kind,omitempty"`
  674. // ServerResponse contains the HTTP response code and headers from the
  675. // server.
  676. googleapi.ServerResponse `json:"-"`
  677. // ForceSendFields is a list of field names (e.g. "Items") to
  678. // unconditionally include in API requests. By default, fields with
  679. // empty values are omitted from API requests. However, any non-pointer,
  680. // non-interface field appearing in ForceSendFields will be sent to the
  681. // server regardless of whether the field is empty or not. This may be
  682. // used to include empty fields in Patch requests.
  683. ForceSendFields []string `json:"-"`
  684. }
  685. func (s *Category) MarshalJSON() ([]byte, error) {
  686. type noMethod Category
  687. raw := noMethod(*s)
  688. return gensupport.MarshalJSON(raw, s.ForceSendFields)
  689. }
  690. type CategoryItems struct {
  691. BadgeUrl string `json:"badgeUrl,omitempty"`
  692. CategoryId string `json:"categoryId,omitempty"`
  693. Name string `json:"name,omitempty"`
  694. // ForceSendFields is a list of field names (e.g. "BadgeUrl") 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 *CategoryItems) MarshalJSON() ([]byte, error) {
  703. type noMethod CategoryItems
  704. raw := noMethod(*s)
  705. return gensupport.MarshalJSON(raw, s.ForceSendFields)
  706. }
  707. type ConcurrentAccessRestriction struct {
  708. // DeviceAllowed: Whether access is granted for this (user, device,
  709. // volume).
  710. DeviceAllowed bool `json:"deviceAllowed,omitempty"`
  711. // Kind: Resource type.
  712. Kind string `json:"kind,omitempty"`
  713. // MaxConcurrentDevices: The maximum number of concurrent access
  714. // licenses for this volume.
  715. MaxConcurrentDevices int64 `json:"maxConcurrentDevices,omitempty"`
  716. // Message: Error/warning message.
  717. Message string `json:"message,omitempty"`
  718. // Nonce: Client nonce for verification. Download access and
  719. // client-validation only.
  720. Nonce string `json:"nonce,omitempty"`
  721. // ReasonCode: Error/warning reason code.
  722. ReasonCode string `json:"reasonCode,omitempty"`
  723. // Restricted: Whether this volume has any concurrent access
  724. // restrictions.
  725. Restricted bool `json:"restricted,omitempty"`
  726. // Signature: Response signature.
  727. Signature string `json:"signature,omitempty"`
  728. // Source: Client app identifier for verification. Download access and
  729. // client-validation only.
  730. Source string `json:"source,omitempty"`
  731. // TimeWindowSeconds: Time in seconds for license auto-expiration.
  732. TimeWindowSeconds int64 `json:"timeWindowSeconds,omitempty"`
  733. // VolumeId: Identifies the volume for which this entry applies.
  734. VolumeId string `json:"volumeId,omitempty"`
  735. // ForceSendFields is a list of field names (e.g. "DeviceAllowed") to
  736. // unconditionally include in API requests. By default, fields with
  737. // empty values are omitted from API requests. However, any non-pointer,
  738. // non-interface field appearing in ForceSendFields will be sent to the
  739. // server regardless of whether the field is empty or not. This may be
  740. // used to include empty fields in Patch requests.
  741. ForceSendFields []string `json:"-"`
  742. }
  743. func (s *ConcurrentAccessRestriction) MarshalJSON() ([]byte, error) {
  744. type noMethod ConcurrentAccessRestriction
  745. raw := noMethod(*s)
  746. return gensupport.MarshalJSON(raw, s.ForceSendFields)
  747. }
  748. type Dictlayerdata struct {
  749. Common *DictlayerdataCommon `json:"common,omitempty"`
  750. Dict *DictlayerdataDict `json:"dict,omitempty"`
  751. Kind string `json:"kind,omitempty"`
  752. // ForceSendFields is a list of field names (e.g. "Common") to
  753. // unconditionally include in API requests. By default, fields with
  754. // empty values are omitted from API requests. However, any non-pointer,
  755. // non-interface field appearing in ForceSendFields will be sent to the
  756. // server regardless of whether the field is empty or not. This may be
  757. // used to include empty fields in Patch requests.
  758. ForceSendFields []string `json:"-"`
  759. }
  760. func (s *Dictlayerdata) MarshalJSON() ([]byte, error) {
  761. type noMethod Dictlayerdata
  762. raw := noMethod(*s)
  763. return gensupport.MarshalJSON(raw, s.ForceSendFields)
  764. }
  765. type DictlayerdataCommon struct {
  766. // Title: The display title and localized canonical name to use when
  767. // searching for this entity on Google search.
  768. Title string `json:"title,omitempty"`
  769. // ForceSendFields is a list of field names (e.g. "Title") to
  770. // unconditionally include in API requests. By default, fields with
  771. // empty values are omitted from API requests. However, any non-pointer,
  772. // non-interface field appearing in ForceSendFields will be sent to the
  773. // server regardless of whether the field is empty or not. This may be
  774. // used to include empty fields in Patch requests.
  775. ForceSendFields []string `json:"-"`
  776. }
  777. func (s *DictlayerdataCommon) MarshalJSON() ([]byte, error) {
  778. type noMethod DictlayerdataCommon
  779. raw := noMethod(*s)
  780. return gensupport.MarshalJSON(raw, s.ForceSendFields)
  781. }
  782. type DictlayerdataDict struct {
  783. // Source: The source, url and attribution for this dictionary data.
  784. Source *DictlayerdataDictSource `json:"source,omitempty"`
  785. Words []*DictlayerdataDictWords `json:"words,omitempty"`
  786. // ForceSendFields is a list of field names (e.g. "Source") 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 *DictlayerdataDict) MarshalJSON() ([]byte, error) {
  795. type noMethod DictlayerdataDict
  796. raw := noMethod(*s)
  797. return gensupport.MarshalJSON(raw, s.ForceSendFields)
  798. }
  799. // DictlayerdataDictSource: The source, url and attribution for this
  800. // dictionary data.
  801. type DictlayerdataDictSource struct {
  802. Attribution string `json:"attribution,omitempty"`
  803. Url string `json:"url,omitempty"`
  804. // ForceSendFields is a list of field names (e.g. "Attribution") to
  805. // unconditionally include in API requests. By default, fields with
  806. // empty values are omitted from API requests. However, any non-pointer,
  807. // non-interface field appearing in ForceSendFields will be sent to the
  808. // server regardless of whether the field is empty or not. This may be
  809. // used to include empty fields in Patch requests.
  810. ForceSendFields []string `json:"-"`
  811. }
  812. func (s *DictlayerdataDictSource) MarshalJSON() ([]byte, error) {
  813. type noMethod DictlayerdataDictSource
  814. raw := noMethod(*s)
  815. return gensupport.MarshalJSON(raw, s.ForceSendFields)
  816. }
  817. type DictlayerdataDictWords struct {
  818. Derivatives []*DictlayerdataDictWordsDerivatives `json:"derivatives,omitempty"`
  819. Examples []*DictlayerdataDictWordsExamples `json:"examples,omitempty"`
  820. Senses []*DictlayerdataDictWordsSenses `json:"senses,omitempty"`
  821. // Source: The words with different meanings but not related words, e.g.
  822. // "go" (game) and "go" (verb).
  823. Source *DictlayerdataDictWordsSource `json:"source,omitempty"`
  824. // ForceSendFields is a list of field names (e.g. "Derivatives") to
  825. // unconditionally include in API requests. By default, fields with
  826. // empty values are omitted from API requests. However, any non-pointer,
  827. // non-interface field appearing in ForceSendFields will be sent to the
  828. // server regardless of whether the field is empty or not. This may be
  829. // used to include empty fields in Patch requests.
  830. ForceSendFields []string `json:"-"`
  831. }
  832. func (s *DictlayerdataDictWords) MarshalJSON() ([]byte, error) {
  833. type noMethod DictlayerdataDictWords
  834. raw := noMethod(*s)
  835. return gensupport.MarshalJSON(raw, s.ForceSendFields)
  836. }
  837. type DictlayerdataDictWordsDerivatives struct {
  838. Source *DictlayerdataDictWordsDerivativesSource `json:"source,omitempty"`
  839. Text string `json:"text,omitempty"`
  840. // ForceSendFields is a list of field names (e.g. "Source") to
  841. // unconditionally include in API requests. By default, fields with
  842. // empty values are omitted from API requests. However, any non-pointer,
  843. // non-interface field appearing in ForceSendFields will be sent to the
  844. // server regardless of whether the field is empty or not. This may be
  845. // used to include empty fields in Patch requests.
  846. ForceSendFields []string `json:"-"`
  847. }
  848. func (s *DictlayerdataDictWordsDerivatives) MarshalJSON() ([]byte, error) {
  849. type noMethod DictlayerdataDictWordsDerivatives
  850. raw := noMethod(*s)
  851. return gensupport.MarshalJSON(raw, s.ForceSendFields)
  852. }
  853. type DictlayerdataDictWordsDerivativesSource struct {
  854. Attribution string `json:"attribution,omitempty"`
  855. Url string `json:"url,omitempty"`
  856. // ForceSendFields is a list of field names (e.g. "Attribution") to
  857. // unconditionally include in API requests. By default, fields with
  858. // empty values are omitted from API requests. However, any non-pointer,
  859. // non-interface field appearing in ForceSendFields will be sent to the
  860. // server regardless of whether the field is empty or not. This may be
  861. // used to include empty fields in Patch requests.
  862. ForceSendFields []string `json:"-"`
  863. }
  864. func (s *DictlayerdataDictWordsDerivativesSource) MarshalJSON() ([]byte, error) {
  865. type noMethod DictlayerdataDictWordsDerivativesSource
  866. raw := noMethod(*s)
  867. return gensupport.MarshalJSON(raw, s.ForceSendFields)
  868. }
  869. type DictlayerdataDictWordsExamples struct {
  870. Source *DictlayerdataDictWordsExamplesSource `json:"source,omitempty"`
  871. Text string `json:"text,omitempty"`
  872. // ForceSendFields is a list of field names (e.g. "Source") to
  873. // unconditionally include in API requests. By default, fields with
  874. // empty values are omitted from API requests. However, any non-pointer,
  875. // non-interface field appearing in ForceSendFields will be sent to the
  876. // server regardless of whether the field is empty or not. This may be
  877. // used to include empty fields in Patch requests.
  878. ForceSendFields []string `json:"-"`
  879. }
  880. func (s *DictlayerdataDictWordsExamples) MarshalJSON() ([]byte, error) {
  881. type noMethod DictlayerdataDictWordsExamples
  882. raw := noMethod(*s)
  883. return gensupport.MarshalJSON(raw, s.ForceSendFields)
  884. }
  885. type DictlayerdataDictWordsExamplesSource struct {
  886. Attribution string `json:"attribution,omitempty"`
  887. Url string `json:"url,omitempty"`
  888. // ForceSendFields is a list of field names (e.g. "Attribution") to
  889. // unconditionally include in API requests. By default, fields with
  890. // empty values are omitted from API requests. However, any non-pointer,
  891. // non-interface field appearing in ForceSendFields will be sent to the
  892. // server regardless of whether the field is empty or not. This may be
  893. // used to include empty fields in Patch requests.
  894. ForceSendFields []string `json:"-"`
  895. }
  896. func (s *DictlayerdataDictWordsExamplesSource) MarshalJSON() ([]byte, error) {
  897. type noMethod DictlayerdataDictWordsExamplesSource
  898. raw := noMethod(*s)
  899. return gensupport.MarshalJSON(raw, s.ForceSendFields)
  900. }
  901. type DictlayerdataDictWordsSenses struct {
  902. Conjugations []*DictlayerdataDictWordsSensesConjugations `json:"conjugations,omitempty"`
  903. Definitions []*DictlayerdataDictWordsSensesDefinitions `json:"definitions,omitempty"`
  904. PartOfSpeech string `json:"partOfSpeech,omitempty"`
  905. Pronunciation string `json:"pronunciation,omitempty"`
  906. PronunciationUrl string `json:"pronunciationUrl,omitempty"`
  907. Source *DictlayerdataDictWordsSensesSource `json:"source,omitempty"`
  908. Syllabification string `json:"syllabification,omitempty"`
  909. Synonyms []*DictlayerdataDictWordsSensesSynonyms `json:"synonyms,omitempty"`
  910. // ForceSendFields is a list of field names (e.g. "Conjugations") to
  911. // unconditionally include in API requests. By default, fields with
  912. // empty values are omitted from API requests. However, any non-pointer,
  913. // non-interface field appearing in ForceSendFields will be sent to the
  914. // server regardless of whether the field is empty or not. This may be
  915. // used to include empty fields in Patch requests.
  916. ForceSendFields []string `json:"-"`
  917. }
  918. func (s *DictlayerdataDictWordsSenses) MarshalJSON() ([]byte, error) {
  919. type noMethod DictlayerdataDictWordsSenses
  920. raw := noMethod(*s)
  921. return gensupport.MarshalJSON(raw, s.ForceSendFields)
  922. }
  923. type DictlayerdataDictWordsSensesConjugations struct {
  924. Type string `json:"type,omitempty"`
  925. Value string `json:"value,omitempty"`
  926. // ForceSendFields is a list of field names (e.g. "Type") 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 *DictlayerdataDictWordsSensesConjugations) MarshalJSON() ([]byte, error) {
  935. type noMethod DictlayerdataDictWordsSensesConjugations
  936. raw := noMethod(*s)
  937. return gensupport.MarshalJSON(raw, s.ForceSendFields)
  938. }
  939. type DictlayerdataDictWordsSensesDefinitions struct {
  940. Definition string `json:"definition,omitempty"`
  941. Examples []*DictlayerdataDictWordsSensesDefinitionsExamples `json:"examples,omitempty"`
  942. // ForceSendFields is a list of field names (e.g. "Definition") to
  943. // unconditionally include in API requests. By default, fields with
  944. // empty values are omitted from API requests. However, any non-pointer,
  945. // non-interface field appearing in ForceSendFields will be sent to the
  946. // server regardless of whether the field is empty or not. This may be
  947. // used to include empty fields in Patch requests.
  948. ForceSendFields []string `json:"-"`
  949. }
  950. func (s *DictlayerdataDictWordsSensesDefinitions) MarshalJSON() ([]byte, error) {
  951. type noMethod DictlayerdataDictWordsSensesDefinitions
  952. raw := noMethod(*s)
  953. return gensupport.MarshalJSON(raw, s.ForceSendFields)
  954. }
  955. type DictlayerdataDictWordsSensesDefinitionsExamples struct {
  956. Source *DictlayerdataDictWordsSensesDefinitionsExamplesSource `json:"source,omitempty"`
  957. Text string `json:"text,omitempty"`
  958. // ForceSendFields is a list of field names (e.g. "Source") to
  959. // unconditionally include in API requests. By default, fields with
  960. // empty values are omitted from API requests. However, any non-pointer,
  961. // non-interface field appearing in ForceSendFields will be sent to the
  962. // server regardless of whether the field is empty or not. This may be
  963. // used to include empty fields in Patch requests.
  964. ForceSendFields []string `json:"-"`
  965. }
  966. func (s *DictlayerdataDictWordsSensesDefinitionsExamples) MarshalJSON() ([]byte, error) {
  967. type noMethod DictlayerdataDictWordsSensesDefinitionsExamples
  968. raw := noMethod(*s)
  969. return gensupport.MarshalJSON(raw, s.ForceSendFields)
  970. }
  971. type DictlayerdataDictWordsSensesDefinitionsExamplesSource struct {
  972. Attribution string `json:"attribution,omitempty"`
  973. Url string `json:"url,omitempty"`
  974. // ForceSendFields is a list of field names (e.g. "Attribution") to
  975. // unconditionally include in API requests. By default, fields with
  976. // empty values are omitted from API requests. However, any non-pointer,
  977. // non-interface field appearing in ForceSendFields will be sent to the
  978. // server regardless of whether the field is empty or not. This may be
  979. // used to include empty fields in Patch requests.
  980. ForceSendFields []string `json:"-"`
  981. }
  982. func (s *DictlayerdataDictWordsSensesDefinitionsExamplesSource) MarshalJSON() ([]byte, error) {
  983. type noMethod DictlayerdataDictWordsSensesDefinitionsExamplesSource
  984. raw := noMethod(*s)
  985. return gensupport.MarshalJSON(raw, s.ForceSendFields)
  986. }
  987. type DictlayerdataDictWordsSensesSource struct {
  988. Attribution string `json:"attribution,omitempty"`
  989. Url string `json:"url,omitempty"`
  990. // ForceSendFields is a list of field names (e.g. "Attribution") 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 *DictlayerdataDictWordsSensesSource) MarshalJSON() ([]byte, error) {
  999. type noMethod DictlayerdataDictWordsSensesSource
  1000. raw := noMethod(*s)
  1001. return gensupport.MarshalJSON(raw, s.ForceSendFields)
  1002. }
  1003. type DictlayerdataDictWordsSensesSynonyms struct {
  1004. Source *DictlayerdataDictWordsSensesSynonymsSource `json:"source,omitempty"`
  1005. Text string `json:"text,omitempty"`
  1006. // ForceSendFields is a list of field names (e.g. "Source") to
  1007. // unconditionally include in API requests. By default, fields with
  1008. // empty values are omitted from API requests. However, any non-pointer,
  1009. // non-interface field appearing in ForceSendFields will be sent to the
  1010. // server regardless of whether the field is empty or not. This may be
  1011. // used to include empty fields in Patch requests.
  1012. ForceSendFields []string `json:"-"`
  1013. }
  1014. func (s *DictlayerdataDictWordsSensesSynonyms) MarshalJSON() ([]byte, error) {
  1015. type noMethod DictlayerdataDictWordsSensesSynonyms
  1016. raw := noMethod(*s)
  1017. return gensupport.MarshalJSON(raw, s.ForceSendFields)
  1018. }
  1019. type DictlayerdataDictWordsSensesSynonymsSource struct {
  1020. Attribution string `json:"attribution,omitempty"`
  1021. Url string `json:"url,omitempty"`
  1022. // ForceSendFields is a list of field names (e.g. "Attribution") to
  1023. // unconditionally include in API requests. By default, fields with
  1024. // empty values are omitted from API requests. However, any non-pointer,
  1025. // non-interface field appearing in ForceSendFields will be sent to the
  1026. // server regardless of whether the field is empty or not. This may be
  1027. // used to include empty fields in Patch requests.
  1028. ForceSendFields []string `json:"-"`
  1029. }
  1030. func (s *DictlayerdataDictWordsSensesSynonymsSource) MarshalJSON() ([]byte, error) {
  1031. type noMethod DictlayerdataDictWordsSensesSynonymsSource
  1032. raw := noMethod(*s)
  1033. return gensupport.MarshalJSON(raw, s.ForceSendFields)
  1034. }
  1035. // DictlayerdataDictWordsSource: The words with different meanings but
  1036. // not related words, e.g. "go" (game) and "go" (verb).
  1037. type DictlayerdataDictWordsSource struct {
  1038. Attribution string `json:"attribution,omitempty"`
  1039. Url string `json:"url,omitempty"`
  1040. // ForceSendFields is a list of field names (e.g. "Attribution") to
  1041. // unconditionally include in API requests. By default, fields with
  1042. // empty values are omitted from API requests. However, any non-pointer,
  1043. // non-interface field appearing in ForceSendFields will be sent to the
  1044. // server regardless of whether the field is empty or not. This may be
  1045. // used to include empty fields in Patch requests.
  1046. ForceSendFields []string `json:"-"`
  1047. }
  1048. func (s *DictlayerdataDictWordsSource) MarshalJSON() ([]byte, error) {
  1049. type noMethod DictlayerdataDictWordsSource
  1050. raw := noMethod(*s)
  1051. return gensupport.MarshalJSON(raw, s.ForceSendFields)
  1052. }
  1053. type Discoveryclusters struct {
  1054. Clusters []*DiscoveryclustersClusters `json:"clusters,omitempty"`
  1055. // Kind: Resorce type.
  1056. Kind string `json:"kind,omitempty"`
  1057. TotalClusters int64 `json:"totalClusters,omitempty"`
  1058. // ServerResponse contains the HTTP response code and headers from the
  1059. // server.
  1060. googleapi.ServerResponse `json:"-"`
  1061. // ForceSendFields is a list of field names (e.g. "Clusters") to
  1062. // unconditionally include in API requests. By default, fields with
  1063. // empty values are omitted from API requests. However, any non-pointer,
  1064. // non-interface field appearing in ForceSendFields will be sent to the
  1065. // server regardless of whether the field is empty or not. This may be
  1066. // used to include empty fields in Patch requests.
  1067. ForceSendFields []string `json:"-"`
  1068. }
  1069. func (s *Discoveryclusters) MarshalJSON() ([]byte, error) {
  1070. type noMethod Discoveryclusters
  1071. raw := noMethod(*s)
  1072. return gensupport.MarshalJSON(raw, s.ForceSendFields)
  1073. }
  1074. type DiscoveryclustersClusters struct {
  1075. BannerWithContentContainer *DiscoveryclustersClustersBannerWithContentContainer `json:"banner_with_content_container,omitempty"`
  1076. SubTitle string `json:"subTitle,omitempty"`
  1077. Title string `json:"title,omitempty"`
  1078. TotalVolumes int64 `json:"totalVolumes,omitempty"`
  1079. Uid string `json:"uid,omitempty"`
  1080. Volumes []*Volume `json:"volumes,omitempty"`
  1081. // ForceSendFields is a list of field names (e.g.
  1082. // "BannerWithContentContainer") to unconditionally include in API
  1083. // requests. By default, fields with empty values are omitted from API
  1084. // requests. However, any non-pointer, non-interface field appearing in
  1085. // ForceSendFields will be sent to the server regardless of whether the
  1086. // field is empty or not. This may be used to include empty fields in
  1087. // Patch requests.
  1088. ForceSendFields []string `json:"-"`
  1089. }
  1090. func (s *DiscoveryclustersClusters) MarshalJSON() ([]byte, error) {
  1091. type noMethod DiscoveryclustersClusters
  1092. raw := noMethod(*s)
  1093. return gensupport.MarshalJSON(raw, s.ForceSendFields)
  1094. }
  1095. type DiscoveryclustersClustersBannerWithContentContainer struct {
  1096. FillColorArgb string `json:"fillColorArgb,omitempty"`
  1097. ImageUrl string `json:"imageUrl,omitempty"`
  1098. MaskColorArgb string `json:"maskColorArgb,omitempty"`
  1099. MoreButtonText string `json:"moreButtonText,omitempty"`
  1100. MoreButtonUrl string `json:"moreButtonUrl,omitempty"`
  1101. TextColorArgb string `json:"textColorArgb,omitempty"`
  1102. // ForceSendFields is a list of field names (e.g. "FillColorArgb") 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 *DiscoveryclustersClustersBannerWithContentContainer) MarshalJSON() ([]byte, error) {
  1111. type noMethod DiscoveryclustersClustersBannerWithContentContainer
  1112. raw := noMethod(*s)
  1113. return gensupport.MarshalJSON(raw, s.ForceSendFields)
  1114. }
  1115. type DownloadAccessRestriction struct {
  1116. // DeviceAllowed: If restricted, whether access is granted for this
  1117. // (user, device, volume).
  1118. DeviceAllowed bool `json:"deviceAllowed,omitempty"`
  1119. // DownloadsAcquired: If restricted, the number of content download
  1120. // licenses already acquired (including the requesting client, if
  1121. // licensed).
  1122. DownloadsAcquired int64 `json:"downloadsAcquired,omitempty"`
  1123. // JustAcquired: If deviceAllowed, whether access was just acquired with
  1124. // this request.
  1125. JustAcquired bool `json:"justAcquired,omitempty"`
  1126. // Kind: Resource type.
  1127. Kind string `json:"kind,omitempty"`
  1128. // MaxDownloadDevices: If restricted, the maximum number of content
  1129. // download licenses for this volume.
  1130. MaxDownloadDevices int64 `json:"maxDownloadDevices,omitempty"`
  1131. // Message: Error/warning message.
  1132. Message string `json:"message,omitempty"`
  1133. // Nonce: Client nonce for verification. Download access and
  1134. // client-validation only.
  1135. Nonce string `json:"nonce,omitempty"`
  1136. // ReasonCode: Error/warning reason code. Additional codes may be added
  1137. // in the future. 0 OK 100 ACCESS_DENIED_PUBLISHER_LIMIT 101
  1138. // ACCESS_DENIED_LIMIT 200 WARNING_USED_LAST_ACCESS
  1139. ReasonCode string `json:"reasonCode,omitempty"`
  1140. // Restricted: Whether this volume has any download access restrictions.
  1141. Restricted bool `json:"restricted,omitempty"`
  1142. // Signature: Response signature.
  1143. Signature string `json:"signature,omitempty"`
  1144. // Source: Client app identifier for verification. Download access and
  1145. // client-validation only.
  1146. Source string `json:"source,omitempty"`
  1147. // VolumeId: Identifies the volume for which this entry applies.
  1148. VolumeId string `json:"volumeId,omitempty"`
  1149. // ForceSendFields is a list of field names (e.g. "DeviceAllowed") 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 *DownloadAccessRestriction) MarshalJSON() ([]byte, error) {
  1158. type noMethod DownloadAccessRestriction
  1159. raw := noMethod(*s)
  1160. return gensupport.MarshalJSON(raw, s.ForceSendFields)
  1161. }
  1162. type DownloadAccesses struct {
  1163. // DownloadAccessList: A list of download access responses.
  1164. DownloadAccessList []*DownloadAccessRestriction `json:"downloadAccessList,omitempty"`
  1165. // Kind: Resource type.
  1166. Kind string `json:"kind,omitempty"`
  1167. // ServerResponse contains the HTTP response code and headers from the
  1168. // server.
  1169. googleapi.ServerResponse `json:"-"`
  1170. // ForceSendFields is a list of field names (e.g. "DownloadAccessList")
  1171. // to unconditionally include in API requests. By default, fields with
  1172. // empty values are omitted from API requests. However, any non-pointer,
  1173. // non-interface field appearing in ForceSendFields will be sent to the
  1174. // server regardless of whether the field is empty or not. This may be
  1175. // used to include empty fields in Patch requests.
  1176. ForceSendFields []string `json:"-"`
  1177. }
  1178. func (s *DownloadAccesses) MarshalJSON() ([]byte, error) {
  1179. type noMethod DownloadAccesses
  1180. raw := noMethod(*s)
  1181. return gensupport.MarshalJSON(raw, s.ForceSendFields)
  1182. }
  1183. type Geolayerdata struct {
  1184. Common *GeolayerdataCommon `json:"common,omitempty"`
  1185. Geo *GeolayerdataGeo `json:"geo,omitempty"`
  1186. Kind string `json:"kind,omitempty"`
  1187. // ForceSendFields is a list of field names (e.g. "Common") to
  1188. // unconditionally include in API requests. By default, fields with
  1189. // empty values are omitted from API requests. However, any non-pointer,
  1190. // non-interface field appearing in ForceSendFields will be sent to the
  1191. // server regardless of whether the field is empty or not. This may be
  1192. // used to include empty fields in Patch requests.
  1193. ForceSendFields []string `json:"-"`
  1194. }
  1195. func (s *Geolayerdata) MarshalJSON() ([]byte, error) {
  1196. type noMethod Geolayerdata
  1197. raw := noMethod(*s)
  1198. return gensupport.MarshalJSON(raw, s.ForceSendFields)
  1199. }
  1200. type GeolayerdataCommon struct {
  1201. // Lang: The language of the information url and description.
  1202. Lang string `json:"lang,omitempty"`
  1203. // PreviewImageUrl: The URL for the preview image information.
  1204. PreviewImageUrl string `json:"previewImageUrl,omitempty"`
  1205. // Snippet: The description for this location.
  1206. Snippet string `json:"snippet,omitempty"`
  1207. // SnippetUrl: The URL for information for this location. Ex: wikipedia
  1208. // link.
  1209. SnippetUrl string `json:"snippetUrl,omitempty"`
  1210. // Title: The display title and localized canonical name to use when
  1211. // searching for this entity on Google search.
  1212. Title string `json:"title,omitempty"`
  1213. // ForceSendFields is a list of field names (e.g. "Lang") to
  1214. // unconditionally include in API requests. By default, fields with
  1215. // empty values are omitted from API requests. However, any non-pointer,
  1216. // non-interface field appearing in ForceSendFields will be sent to the
  1217. // server regardless of whether the field is empty or not. This may be
  1218. // used to include empty fields in Patch requests.
  1219. ForceSendFields []string `json:"-"`
  1220. }
  1221. func (s *GeolayerdataCommon) MarshalJSON() ([]byte, error) {
  1222. type noMethod GeolayerdataCommon
  1223. raw := noMethod(*s)
  1224. return gensupport.MarshalJSON(raw, s.ForceSendFields)
  1225. }
  1226. type GeolayerdataGeo struct {
  1227. // Boundary: The boundary of the location as a set of loops containing
  1228. // pairs of latitude, longitude coordinates.
  1229. Boundary [][]*GeolayerdataGeoBoundaryItem `json:"boundary,omitempty"`
  1230. // CachePolicy: The cache policy active for this data. EX: UNRESTRICTED,
  1231. // RESTRICTED, NEVER
  1232. CachePolicy string `json:"cachePolicy,omitempty"`
  1233. // CountryCode: The country code of the location.
  1234. CountryCode string `json:"countryCode,omitempty"`
  1235. // Latitude: The latitude of the location.
  1236. Latitude float64 `json:"latitude,omitempty"`
  1237. // Longitude: The longitude of the location.
  1238. Longitude float64 `json:"longitude,omitempty"`
  1239. // MapType: The type of map that should be used for this location. EX:
  1240. // HYBRID, ROADMAP, SATELLITE, TERRAIN
  1241. MapType string `json:"mapType,omitempty"`
  1242. // Viewport: The viewport for showing this location. This is a latitude,
  1243. // longitude rectangle.
  1244. Viewport *GeolayerdataGeoViewport `json:"viewport,omitempty"`
  1245. // Zoom: The Zoom level to use for the map. Zoom levels between 0 (the
  1246. // lowest zoom level, in which the entire world can be seen on one map)
  1247. // to 21+ (down to individual buildings). See:
  1248. // https://developers.google.com/maps/documentation/staticmaps/#Zoomlevels
  1249. Zoom int64 `json:"zoom,omitempty"`
  1250. // ForceSendFields is a list of field names (e.g. "Boundary") to
  1251. // unconditionally include in API requests. By default, fields with
  1252. // empty values are omitted from API requests. However, any non-pointer,
  1253. // non-interface field appearing in ForceSendFields will be sent to the
  1254. // server regardless of whether the field is empty or not. This may be
  1255. // used to include empty fields in Patch requests.
  1256. ForceSendFields []string `json:"-"`
  1257. }
  1258. func (s *GeolayerdataGeo) MarshalJSON() ([]byte, error) {
  1259. type noMethod GeolayerdataGeo
  1260. raw := noMethod(*s)
  1261. return gensupport.MarshalJSON(raw, s.ForceSendFields)
  1262. }
  1263. type GeolayerdataGeoBoundaryItem struct {
  1264. Latitude int64 `json:"latitude,omitempty"`
  1265. Longitude int64 `json:"longitude,omitempty"`
  1266. // ForceSendFields is a list of field names (e.g. "Latitude") to
  1267. // unconditionally include in API requests. By default, fields with
  1268. // empty values are omitted from API requests. However, any non-pointer,
  1269. // non-interface field appearing in ForceSendFields will be sent to the
  1270. // server regardless of whether the field is empty or not. This may be
  1271. // used to include empty fields in Patch requests.
  1272. ForceSendFields []string `json:"-"`
  1273. }
  1274. func (s *GeolayerdataGeoBoundaryItem) MarshalJSON() ([]byte, error) {
  1275. type noMethod GeolayerdataGeoBoundaryItem
  1276. raw := noMethod(*s)
  1277. return gensupport.MarshalJSON(raw, s.ForceSendFields)
  1278. }
  1279. // GeolayerdataGeoViewport: The viewport for showing this location. This
  1280. // is a latitude, longitude rectangle.
  1281. type GeolayerdataGeoViewport struct {
  1282. Hi *GeolayerdataGeoViewportHi `json:"hi,omitempty"`
  1283. Lo *GeolayerdataGeoViewportLo `json:"lo,omitempty"`
  1284. // ForceSendFields is a list of field names (e.g. "Hi") to
  1285. // unconditionally include in API requests. By default, fields with
  1286. // empty values are omitted from API requests. However, any non-pointer,
  1287. // non-interface field appearing in ForceSendFields will be sent to the
  1288. // server regardless of whether the field is empty or not. This may be
  1289. // used to include empty fields in Patch requests.
  1290. ForceSendFields []string `json:"-"`
  1291. }
  1292. func (s *GeolayerdataGeoViewport) MarshalJSON() ([]byte, error) {
  1293. type noMethod GeolayerdataGeoViewport
  1294. raw := noMethod(*s)
  1295. return gensupport.MarshalJSON(raw, s.ForceSendFields)
  1296. }
  1297. type GeolayerdataGeoViewportHi struct {
  1298. Latitude float64 `json:"latitude,omitempty"`
  1299. Longitude float64 `json:"longitude,omitempty"`
  1300. // ForceSendFields is a list of field names (e.g. "Latitude") to
  1301. // unconditionally include in API requests. By default, fields with
  1302. // empty values are omitted from API requests. However, any non-pointer,
  1303. // non-interface field appearing in ForceSendFields will be sent to the
  1304. // server regardless of whether the field is empty or not. This may be
  1305. // used to include empty fields in Patch requests.
  1306. ForceSendFields []string `json:"-"`
  1307. }
  1308. func (s *GeolayerdataGeoViewportHi) MarshalJSON() ([]byte, error) {
  1309. type noMethod GeolayerdataGeoViewportHi
  1310. raw := noMethod(*s)
  1311. return gensupport.MarshalJSON(raw, s.ForceSendFields)
  1312. }
  1313. type GeolayerdataGeoViewportLo struct {
  1314. Latitude float64 `json:"latitude,omitempty"`
  1315. Longitude float64 `json:"longitude,omitempty"`
  1316. // ForceSendFields is a list of field names (e.g. "Latitude") to
  1317. // unconditionally include in API requests. By default, fields with
  1318. // empty values are omitted from API requests. However, any non-pointer,
  1319. // non-interface field appearing in ForceSendFields will be sent to the
  1320. // server regardless of whether the field is empty or not. This may be
  1321. // used to include empty fields in Patch requests.
  1322. ForceSendFields []string `json:"-"`
  1323. }
  1324. func (s *GeolayerdataGeoViewportLo) MarshalJSON() ([]byte, error) {
  1325. type noMethod GeolayerdataGeoViewportLo
  1326. raw := noMethod(*s)
  1327. return gensupport.MarshalJSON(raw, s.ForceSendFields)
  1328. }
  1329. type Layersummaries struct {
  1330. // Items: A list of layer summary items.
  1331. Items []*Layersummary `json:"items,omitempty"`
  1332. // Kind: Resource type.
  1333. Kind string `json:"kind,omitempty"`
  1334. // TotalItems: The total number of layer summaries found.
  1335. TotalItems int64 `json:"totalItems,omitempty"`
  1336. // ServerResponse contains the HTTP response code and headers from the
  1337. // server.
  1338. googleapi.ServerResponse `json:"-"`
  1339. // ForceSendFields is a list of field names (e.g. "Items") to
  1340. // unconditionally include in API requests. By default, fields with
  1341. // empty values are omitted from API requests. However, any non-pointer,
  1342. // non-interface field appearing in ForceSendFields will be sent to the
  1343. // server regardless of whether the field is empty or not. This may be
  1344. // used to include empty fields in Patch requests.
  1345. ForceSendFields []string `json:"-"`
  1346. }
  1347. func (s *Layersummaries) MarshalJSON() ([]byte, error) {
  1348. type noMethod Layersummaries
  1349. raw := noMethod(*s)
  1350. return gensupport.MarshalJSON(raw, s.ForceSendFields)
  1351. }
  1352. type Layersummary struct {
  1353. // AnnotationCount: The number of annotations for this layer.
  1354. AnnotationCount int64 `json:"annotationCount,omitempty"`
  1355. // AnnotationTypes: The list of annotation types contained for this
  1356. // layer.
  1357. AnnotationTypes []string `json:"annotationTypes,omitempty"`
  1358. // AnnotationsDataLink: Link to get data for this annotation.
  1359. AnnotationsDataLink string `json:"annotationsDataLink,omitempty"`
  1360. // AnnotationsLink: The link to get the annotations for this layer.
  1361. AnnotationsLink string `json:"annotationsLink,omitempty"`
  1362. // ContentVersion: The content version this resource is for.
  1363. ContentVersion string `json:"contentVersion,omitempty"`
  1364. // DataCount: The number of data items for this layer.
  1365. DataCount int64 `json:"dataCount,omitempty"`
  1366. // Id: Unique id of this layer summary.
  1367. Id string `json:"id,omitempty"`
  1368. // Kind: Resource Type
  1369. Kind string `json:"kind,omitempty"`
  1370. // LayerId: The layer id for this summary.
  1371. LayerId string `json:"layerId,omitempty"`
  1372. // SelfLink: URL to this resource.
  1373. SelfLink string `json:"selfLink,omitempty"`
  1374. // Updated: Timestamp for the last time an item in this layer was
  1375. // updated. (RFC 3339 UTC date-time format).
  1376. Updated string `json:"updated,omitempty"`
  1377. // VolumeAnnotationsVersion: The current version of this layer's volume
  1378. // annotations. Note that this version applies only to the data in the
  1379. // books.layers.volumeAnnotations.* responses. The actual annotation
  1380. // data is versioned separately.
  1381. VolumeAnnotationsVersion string `json:"volumeAnnotationsVersion,omitempty"`
  1382. // VolumeId: The volume id this resource is for.
  1383. VolumeId string `json:"volumeId,omitempty"`
  1384. // ServerResponse contains the HTTP response code and headers from the
  1385. // server.
  1386. googleapi.ServerResponse `json:"-"`
  1387. // ForceSendFields is a list of field names (e.g. "AnnotationCount") to
  1388. // unconditionally include in API requests. By default, fields with
  1389. // empty values are omitted from API requests. However, any non-pointer,
  1390. // non-interface field appearing in ForceSendFields will be sent to the
  1391. // server regardless of whether the field is empty or not. This may be
  1392. // used to include empty fields in Patch requests.
  1393. ForceSendFields []string `json:"-"`
  1394. }
  1395. func (s *Layersummary) MarshalJSON() ([]byte, error) {
  1396. type noMethod Layersummary
  1397. raw := noMethod(*s)
  1398. return gensupport.MarshalJSON(raw, s.ForceSendFields)
  1399. }
  1400. type Metadata struct {
  1401. // Items: A list of offline dictionary metadata.
  1402. Items []*MetadataItems `json:"items,omitempty"`
  1403. // Kind: Resource type.
  1404. Kind string `json:"kind,omitempty"`
  1405. // ServerResponse contains the HTTP response code and headers from the
  1406. // server.
  1407. googleapi.ServerResponse `json:"-"`
  1408. // ForceSendFields is a list of field names (e.g. "Items") to
  1409. // unconditionally include in API requests. By default, fields with
  1410. // empty values are omitted from API requests. However, any non-pointer,
  1411. // non-interface field appearing in ForceSendFields will be sent to the
  1412. // server regardless of whether the field is empty or not. This may be
  1413. // used to include empty fields in Patch requests.
  1414. ForceSendFields []string `json:"-"`
  1415. }
  1416. func (s *Metadata) MarshalJSON() ([]byte, error) {
  1417. type noMethod Metadata
  1418. raw := noMethod(*s)
  1419. return gensupport.MarshalJSON(raw, s.ForceSendFields)
  1420. }
  1421. type MetadataItems struct {
  1422. DownloadUrl string `json:"download_url,omitempty"`
  1423. EncryptedKey string `json:"encrypted_key,omitempty"`
  1424. Language string `json:"language,omitempty"`
  1425. Size int64 `json:"size,omitempty,string"`
  1426. Version int64 `json:"version,omitempty,string"`
  1427. // ForceSendFields is a list of field names (e.g. "DownloadUrl") 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 *MetadataItems) MarshalJSON() ([]byte, error) {
  1436. type noMethod MetadataItems
  1437. raw := noMethod(*s)
  1438. return gensupport.MarshalJSON(raw, s.ForceSendFields)
  1439. }
  1440. type Notification struct {
  1441. Body string `json:"body,omitempty"`
  1442. DontShowNotification bool `json:"dont_show_notification,omitempty"`
  1443. IconUrl string `json:"iconUrl,omitempty"`
  1444. // Kind: Resource type.
  1445. Kind string `json:"kind,omitempty"`
  1446. NotificationType string `json:"notification_type,omitempty"`
  1447. PcampaignId string `json:"pcampaign_id,omitempty"`
  1448. ShowNotificationSettingsAction bool `json:"show_notification_settings_action,omitempty"`
  1449. TargetUrl string `json:"targetUrl,omitempty"`
  1450. Title string `json:"title,omitempty"`
  1451. // ServerResponse contains the HTTP response code and headers from the
  1452. // server.
  1453. googleapi.ServerResponse `json:"-"`
  1454. // ForceSendFields is a list of field names (e.g. "Body") to
  1455. // unconditionally include in API requests. By default, fields with
  1456. // empty values are omitted from API requests. However, any non-pointer,
  1457. // non-interface field appearing in ForceSendFields will be sent to the
  1458. // server regardless of whether the field is empty or not. This may be
  1459. // used to include empty fields in Patch requests.
  1460. ForceSendFields []string `json:"-"`
  1461. }
  1462. func (s *Notification) MarshalJSON() ([]byte, error) {
  1463. type noMethod Notification
  1464. raw := noMethod(*s)
  1465. return gensupport.MarshalJSON(raw, s.ForceSendFields)
  1466. }
  1467. type Offers struct {
  1468. // Items: A list of offers.
  1469. Items []*OffersItems `json:"items,omitempty"`
  1470. // Kind: Resource type.
  1471. Kind string `json:"kind,omitempty"`
  1472. // ServerResponse contains the HTTP response code and headers from the
  1473. // server.
  1474. googleapi.ServerResponse `json:"-"`
  1475. // ForceSendFields is a list of field names (e.g. "Items") to
  1476. // unconditionally include in API requests. By default, fields with
  1477. // empty values are omitted from API requests. However, any non-pointer,
  1478. // non-interface field appearing in ForceSendFields will be sent to the
  1479. // server regardless of whether the field is empty or not. This may be
  1480. // used to include empty fields in Patch requests.
  1481. ForceSendFields []string `json:"-"`
  1482. }
  1483. func (s *Offers) MarshalJSON() ([]byte, error) {
  1484. type noMethod Offers
  1485. raw := noMethod(*s)
  1486. return gensupport.MarshalJSON(raw, s.ForceSendFields)
  1487. }
  1488. type OffersItems struct {
  1489. ArtUrl string `json:"artUrl,omitempty"`
  1490. GservicesKey string `json:"gservicesKey,omitempty"`
  1491. Id string `json:"id,omitempty"`
  1492. Items []*OffersItemsItems `json:"items,omitempty"`
  1493. // ForceSendFields is a list of field names (e.g. "ArtUrl") to
  1494. // unconditionally include in API requests. By default, fields with
  1495. // empty values are omitted from API requests. However, any non-pointer,
  1496. // non-interface field appearing in ForceSendFields will be sent to the
  1497. // server regardless of whether the field is empty or not. This may be
  1498. // used to include empty fields in Patch requests.
  1499. ForceSendFields []string `json:"-"`
  1500. }
  1501. func (s *OffersItems) MarshalJSON() ([]byte, error) {
  1502. type noMethod OffersItems
  1503. raw := noMethod(*s)
  1504. return gensupport.MarshalJSON(raw, s.ForceSendFields)
  1505. }
  1506. type OffersItemsItems struct {
  1507. Author string `json:"author,omitempty"`
  1508. CanonicalVolumeLink string `json:"canonicalVolumeLink,omitempty"`
  1509. CoverUrl string `json:"coverUrl,omitempty"`
  1510. Description string `json:"description,omitempty"`
  1511. Title string `json:"title,omitempty"`
  1512. VolumeId string `json:"volumeId,omitempty"`
  1513. // ForceSendFields is a list of field names (e.g. "Author") 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 *OffersItemsItems) MarshalJSON() ([]byte, error) {
  1522. type noMethod OffersItemsItems
  1523. raw := noMethod(*s)
  1524. return gensupport.MarshalJSON(raw, s.ForceSendFields)
  1525. }
  1526. type ReadingPosition struct {
  1527. // EpubCfiPosition: Position in an EPUB as a CFI.
  1528. EpubCfiPosition string `json:"epubCfiPosition,omitempty"`
  1529. // GbImagePosition: Position in a volume for image-based content.
  1530. GbImagePosition string `json:"gbImagePosition,omitempty"`
  1531. // GbTextPosition: Position in a volume for text-based content.
  1532. GbTextPosition string `json:"gbTextPosition,omitempty"`
  1533. // Kind: Resource type for a reading position.
  1534. Kind string `json:"kind,omitempty"`
  1535. // PdfPosition: Position in a PDF file.
  1536. PdfPosition string `json:"pdfPosition,omitempty"`
  1537. // Updated: Timestamp when this reading position was last updated
  1538. // (formatted UTC timestamp with millisecond resolution).
  1539. Updated string `json:"updated,omitempty"`
  1540. // VolumeId: Volume id associated with this reading position.
  1541. VolumeId string `json:"volumeId,omitempty"`
  1542. // ServerResponse contains the HTTP response code and headers from the
  1543. // server.
  1544. googleapi.ServerResponse `json:"-"`
  1545. // ForceSendFields is a list of field names (e.g. "EpubCfiPosition") to
  1546. // unconditionally include in API requests. By default, fields with
  1547. // empty values are omitted from API requests. However, any non-pointer,
  1548. // non-interface field appearing in ForceSendFields will be sent to the
  1549. // server regardless of whether the field is empty or not. This may be
  1550. // used to include empty fields in Patch requests.
  1551. ForceSendFields []string `json:"-"`
  1552. }
  1553. func (s *ReadingPosition) MarshalJSON() ([]byte, error) {
  1554. type noMethod ReadingPosition
  1555. raw := noMethod(*s)
  1556. return gensupport.MarshalJSON(raw, s.ForceSendFields)
  1557. }
  1558. type RequestAccess struct {
  1559. // ConcurrentAccess: A concurrent access response.
  1560. ConcurrentAccess *ConcurrentAccessRestriction `json:"concurrentAccess,omitempty"`
  1561. // DownloadAccess: A download access response.
  1562. DownloadAccess *DownloadAccessRestriction `json:"downloadAccess,omitempty"`
  1563. // Kind: Resource type.
  1564. Kind string `json:"kind,omitempty"`
  1565. // ServerResponse contains the HTTP response code and headers from the
  1566. // server.
  1567. googleapi.ServerResponse `json:"-"`
  1568. // ForceSendFields is a list of field names (e.g. "ConcurrentAccess") to
  1569. // unconditionally include in API requests. By default, fields with
  1570. // empty values are omitted from API requests. However, any non-pointer,
  1571. // non-interface field appearing in ForceSendFields will be sent to the
  1572. // server regardless of whether the field is empty or not. This may be
  1573. // used to include empty fields in Patch requests.
  1574. ForceSendFields []string `json:"-"`
  1575. }
  1576. func (s *RequestAccess) MarshalJSON() ([]byte, error) {
  1577. type noMethod RequestAccess
  1578. raw := noMethod(*s)
  1579. return gensupport.MarshalJSON(raw, s.ForceSendFields)
  1580. }
  1581. type Review struct {
  1582. // Author: Author of this review.
  1583. Author *ReviewAuthor `json:"author,omitempty"`
  1584. // Content: Review text.
  1585. Content string `json:"content,omitempty"`
  1586. // Date: Date of this review.
  1587. Date string `json:"date,omitempty"`
  1588. // FullTextUrl: URL for the full review text, for reviews gathered from
  1589. // the web.
  1590. FullTextUrl string `json:"fullTextUrl,omitempty"`
  1591. // Kind: Resource type for a review.
  1592. Kind string `json:"kind,omitempty"`
  1593. // Rating: Star rating for this review. Possible values are ONE, TWO,
  1594. // THREE, FOUR, FIVE or NOT_RATED.
  1595. Rating string `json:"rating,omitempty"`
  1596. // Source: Information regarding the source of this review, when the
  1597. // review is not from a Google Books user.
  1598. Source *ReviewSource `json:"source,omitempty"`
  1599. // Title: Title for this review.
  1600. Title string `json:"title,omitempty"`
  1601. // Type: Source type for this review. Possible values are EDITORIAL,
  1602. // WEB_USER or GOOGLE_USER.
  1603. Type string `json:"type,omitempty"`
  1604. // VolumeId: Volume that this review is for.
  1605. VolumeId string `json:"volumeId,omitempty"`
  1606. // ForceSendFields is a list of field names (e.g. "Author") to
  1607. // unconditionally include in API requests. By default, fields with
  1608. // empty values are omitted from API requests. However, any non-pointer,
  1609. // non-interface field appearing in ForceSendFields will be sent to the
  1610. // server regardless of whether the field is empty or not. This may be
  1611. // used to include empty fields in Patch requests.
  1612. ForceSendFields []string `json:"-"`
  1613. }
  1614. func (s *Review) MarshalJSON() ([]byte, error) {
  1615. type noMethod Review
  1616. raw := noMethod(*s)
  1617. return gensupport.MarshalJSON(raw, s.ForceSendFields)
  1618. }
  1619. // ReviewAuthor: Author of this review.
  1620. type ReviewAuthor struct {
  1621. // DisplayName: Name of this person.
  1622. DisplayName string `json:"displayName,omitempty"`
  1623. // ForceSendFields is a list of field names (e.g. "DisplayName") to
  1624. // unconditionally include in API requests. By default, fields with
  1625. // empty values are omitted from API requests. However, any non-pointer,
  1626. // non-interface field appearing in ForceSendFields will be sent to the
  1627. // server regardless of whether the field is empty or not. This may be
  1628. // used to include empty fields in Patch requests.
  1629. ForceSendFields []string `json:"-"`
  1630. }
  1631. func (s *ReviewAuthor) MarshalJSON() ([]byte, error) {
  1632. type noMethod ReviewAuthor
  1633. raw := noMethod(*s)
  1634. return gensupport.MarshalJSON(raw, s.ForceSendFields)
  1635. }
  1636. // ReviewSource: Information regarding the source of this review, when
  1637. // the review is not from a Google Books user.
  1638. type ReviewSource struct {
  1639. // Description: Name of the source.
  1640. Description string `json:"description,omitempty"`
  1641. // ExtraDescription: Extra text about the source of the review.
  1642. ExtraDescription string `json:"extraDescription,omitempty"`
  1643. // Url: URL of the source of the review.
  1644. Url string `json:"url,omitempty"`
  1645. // ForceSendFields is a list of field names (e.g. "Description") to
  1646. // unconditionally include in API requests. By default, fields with
  1647. // empty values are omitted from API requests. However, any non-pointer,
  1648. // non-interface field appearing in ForceSendFields will be sent to the
  1649. // server regardless of whether the field is empty or not. This may be
  1650. // used to include empty fields in Patch requests.
  1651. ForceSendFields []string `json:"-"`
  1652. }
  1653. func (s *ReviewSource) MarshalJSON() ([]byte, error) {
  1654. type noMethod ReviewSource
  1655. raw := noMethod(*s)
  1656. return gensupport.MarshalJSON(raw, s.ForceSendFields)
  1657. }
  1658. type Series struct {
  1659. // Kind: Resource type.
  1660. Kind string `json:"kind,omitempty"`
  1661. Series []*SeriesSeries `json:"series,omitempty"`
  1662. // ServerResponse contains the HTTP response code and headers from the
  1663. // server.
  1664. googleapi.ServerResponse `json:"-"`
  1665. // ForceSendFields is a list of field names (e.g. "Kind") to
  1666. // unconditionally include in API requests. By default, fields with
  1667. // empty values are omitted from API requests. However, any non-pointer,
  1668. // non-interface field appearing in ForceSendFields will be sent to the
  1669. // server regardless of whether the field is empty or not. This may be
  1670. // used to include empty fields in Patch requests.
  1671. ForceSendFields []string `json:"-"`
  1672. }
  1673. func (s *Series) MarshalJSON() ([]byte, error) {
  1674. type noMethod Series
  1675. raw := noMethod(*s)
  1676. return gensupport.MarshalJSON(raw, s.ForceSendFields)
  1677. }
  1678. type SeriesSeries struct {
  1679. BannerImageUrl string `json:"bannerImageUrl,omitempty"`
  1680. ImageUrl string `json:"imageUrl,omitempty"`
  1681. SeriesId string `json:"seriesId,omitempty"`
  1682. SeriesType string `json:"seriesType,omitempty"`
  1683. Title string `json:"title,omitempty"`
  1684. // ForceSendFields is a list of field names (e.g. "BannerImageUrl") to
  1685. // unconditionally include in API requests. By default, fields with
  1686. // empty values are omitted from API requests. However, any non-pointer,
  1687. // non-interface field appearing in ForceSendFields will be sent to the
  1688. // server regardless of whether the field is empty or not. This may be
  1689. // used to include empty fields in Patch requests.
  1690. ForceSendFields []string `json:"-"`
  1691. }
  1692. func (s *SeriesSeries) MarshalJSON() ([]byte, error) {
  1693. type noMethod SeriesSeries
  1694. raw := noMethod(*s)
  1695. return gensupport.MarshalJSON(raw, s.ForceSendFields)
  1696. }
  1697. type Seriesmembership struct {
  1698. // Kind: Resorce type.
  1699. Kind string `json:"kind,omitempty"`
  1700. Member []*Volume `json:"member,omitempty"`
  1701. NextPageToken string `json:"nextPageToken,omitempty"`
  1702. // ServerResponse contains the HTTP response code and headers from the
  1703. // server.
  1704. googleapi.ServerResponse `json:"-"`
  1705. // ForceSendFields is a list of field names (e.g. "Kind") to
  1706. // unconditionally include in API requests. By default, fields with
  1707. // empty values are omitted from API requests. However, any non-pointer,
  1708. // non-interface field appearing in ForceSendFields will be sent to the
  1709. // server regardless of whether the field is empty or not. This may be
  1710. // used to include empty fields in Patch requests.
  1711. ForceSendFields []string `json:"-"`
  1712. }
  1713. func (s *Seriesmembership) MarshalJSON() ([]byte, error) {
  1714. type noMethod Seriesmembership
  1715. raw := noMethod(*s)
  1716. return gensupport.MarshalJSON(raw, s.ForceSendFields)
  1717. }
  1718. type Usersettings struct {
  1719. // Kind: Resource type.
  1720. Kind string `json:"kind,omitempty"`
  1721. // NotesExport: User settings in sub-objects, each for different
  1722. // purposes.
  1723. NotesExport *UsersettingsNotesExport `json:"notesExport,omitempty"`
  1724. Notification *UsersettingsNotification `json:"notification,omitempty"`
  1725. // ServerResponse contains the HTTP response code and headers from the
  1726. // server.
  1727. googleapi.ServerResponse `json:"-"`
  1728. // ForceSendFields is a list of field names (e.g. "Kind") to
  1729. // unconditionally include in API requests. By default, fields with
  1730. // empty values are omitted from API requests. However, any non-pointer,
  1731. // non-interface field appearing in ForceSendFields will be sent to the
  1732. // server regardless of whether the field is empty or not. This may be
  1733. // used to include empty fields in Patch requests.
  1734. ForceSendFields []string `json:"-"`
  1735. }
  1736. func (s *Usersettings) MarshalJSON() ([]byte, error) {
  1737. type noMethod Usersettings
  1738. raw := noMethod(*s)
  1739. return gensupport.MarshalJSON(raw, s.ForceSendFields)
  1740. }
  1741. // UsersettingsNotesExport: User settings in sub-objects, each for
  1742. // different purposes.
  1743. type UsersettingsNotesExport struct {
  1744. FolderName string `json:"folderName,omitempty"`
  1745. IsEnabled bool `json:"isEnabled,omitempty"`
  1746. // ForceSendFields is a list of field names (e.g. "FolderName") to
  1747. // unconditionally include in API requests. By default, fields with
  1748. // empty values are omitted from API requests. However, any non-pointer,
  1749. // non-interface field appearing in ForceSendFields will be sent to the
  1750. // server regardless of whether the field is empty or not. This may be
  1751. // used to include empty fields in Patch requests.
  1752. ForceSendFields []string `json:"-"`
  1753. }
  1754. func (s *UsersettingsNotesExport) MarshalJSON() ([]byte, error) {
  1755. type noMethod UsersettingsNotesExport
  1756. raw := noMethod(*s)
  1757. return gensupport.MarshalJSON(raw, s.ForceSendFields)
  1758. }
  1759. type UsersettingsNotification struct {
  1760. MoreFromAuthors *UsersettingsNotificationMoreFromAuthors `json:"moreFromAuthors,omitempty"`
  1761. // ForceSendFields is a list of field names (e.g. "MoreFromAuthors") to
  1762. // unconditionally include in API requests. By default, fields with
  1763. // empty values are omitted from API requests. However, any non-pointer,
  1764. // non-interface field appearing in ForceSendFields will be sent to the
  1765. // server regardless of whether the field is empty or not. This may be
  1766. // used to include empty fields in Patch requests.
  1767. ForceSendFields []string `json:"-"`
  1768. }
  1769. func (s *UsersettingsNotification) MarshalJSON() ([]byte, error) {
  1770. type noMethod UsersettingsNotification
  1771. raw := noMethod(*s)
  1772. return gensupport.MarshalJSON(raw, s.ForceSendFields)
  1773. }
  1774. type UsersettingsNotificationMoreFromAuthors struct {
  1775. OptedState string `json:"opted_state,omitempty"`
  1776. // ForceSendFields is a list of field names (e.g. "OptedState") to
  1777. // unconditionally include in API requests. By default, fields with
  1778. // empty values are omitted from API requests. However, any non-pointer,
  1779. // non-interface field appearing in ForceSendFields will be sent to the
  1780. // server regardless of whether the field is empty or not. This may be
  1781. // used to include empty fields in Patch requests.
  1782. ForceSendFields []string `json:"-"`
  1783. }
  1784. func (s *UsersettingsNotificationMoreFromAuthors) MarshalJSON() ([]byte, error) {
  1785. type noMethod UsersettingsNotificationMoreFromAuthors
  1786. raw := noMethod(*s)
  1787. return gensupport.MarshalJSON(raw, s.ForceSendFields)
  1788. }
  1789. type Volume struct {
  1790. // AccessInfo: Any information about a volume related to reading or
  1791. // obtaining that volume text. This information can depend on country
  1792. // (books may be public domain in one country but not in another, e.g.).
  1793. AccessInfo *VolumeAccessInfo `json:"accessInfo,omitempty"`
  1794. // Etag: Opaque identifier for a specific version of a volume resource.
  1795. // (In LITE projection)
  1796. Etag string `json:"etag,omitempty"`
  1797. // Id: Unique identifier for a volume. (In LITE projection.)
  1798. Id string `json:"id,omitempty"`
  1799. // Kind: Resource type for a volume. (In LITE projection.)
  1800. Kind string `json:"kind,omitempty"`
  1801. // LayerInfo: What layers exist in this volume and high level
  1802. // information about them.
  1803. LayerInfo *VolumeLayerInfo `json:"layerInfo,omitempty"`
  1804. // RecommendedInfo: Recommendation related information for this volume.
  1805. RecommendedInfo *VolumeRecommendedInfo `json:"recommendedInfo,omitempty"`
  1806. // SaleInfo: Any information about a volume related to the eBookstore
  1807. // and/or purchaseability. This information can depend on the country
  1808. // where the request originates from (i.e. books may not be for sale in
  1809. // certain countries).
  1810. SaleInfo *VolumeSaleInfo `json:"saleInfo,omitempty"`
  1811. // SearchInfo: Search result information related to this volume.
  1812. SearchInfo *VolumeSearchInfo `json:"searchInfo,omitempty"`
  1813. // SelfLink: URL to this resource. (In LITE projection.)
  1814. SelfLink string `json:"selfLink,omitempty"`
  1815. // UserInfo: User specific information related to this volume. (e.g.
  1816. // page this user last read or whether they purchased this book)
  1817. UserInfo *VolumeUserInfo `json:"userInfo,omitempty"`
  1818. // VolumeInfo: General volume information.
  1819. VolumeInfo *VolumeVolumeInfo `json:"volumeInfo,omitempty"`
  1820. // ServerResponse contains the HTTP response code and headers from the
  1821. // server.
  1822. googleapi.ServerResponse `json:"-"`
  1823. // ForceSendFields is a list of field names (e.g. "AccessInfo") to
  1824. // unconditionally include in API requests. By default, fields with
  1825. // empty values are omitted from API requests. However, any non-pointer,
  1826. // non-interface field appearing in ForceSendFields will be sent to the
  1827. // server regardless of whether the field is empty or not. This may be
  1828. // used to include empty fields in Patch requests.
  1829. ForceSendFields []string `json:"-"`
  1830. }
  1831. func (s *Volume) MarshalJSON() ([]byte, error) {
  1832. type noMethod Volume
  1833. raw := noMethod(*s)
  1834. return gensupport.MarshalJSON(raw, s.ForceSendFields)
  1835. }
  1836. // VolumeAccessInfo: Any information about a volume related to reading
  1837. // or obtaining that volume text. This information can depend on country
  1838. // (books may be public domain in one country but not in another, e.g.).
  1839. type VolumeAccessInfo struct {
  1840. // AccessViewStatus: Combines the access and viewability of this volume
  1841. // into a single status field for this user. Values can be
  1842. // FULL_PURCHASED, FULL_PUBLIC_DOMAIN, SAMPLE or NONE. (In LITE
  1843. // projection.)
  1844. AccessViewStatus string `json:"accessViewStatus,omitempty"`
  1845. // Country: The two-letter ISO_3166-1 country code for which this access
  1846. // information is valid. (In LITE projection.)
  1847. Country string `json:"country,omitempty"`
  1848. // DownloadAccess: Information about a volume's download license access
  1849. // restrictions.
  1850. DownloadAccess *DownloadAccessRestriction `json:"downloadAccess,omitempty"`
  1851. // DriveImportedContentLink: URL to the Google Drive viewer if this
  1852. // volume is uploaded by the user by selecting the file from Google
  1853. // Drive.
  1854. DriveImportedContentLink string `json:"driveImportedContentLink,omitempty"`
  1855. // Embeddable: Whether this volume can be embedded in a viewport using
  1856. // the Embedded Viewer API.
  1857. Embeddable bool `json:"embeddable,omitempty"`
  1858. // Epub: Information about epub content. (In LITE projection.)
  1859. Epub *VolumeAccessInfoEpub `json:"epub,omitempty"`
  1860. // ExplicitOfflineLicenseManagement: Whether this volume requires that
  1861. // the client explicitly request offline download license rather than
  1862. // have it done automatically when loading the content, if the client
  1863. // supports it.
  1864. ExplicitOfflineLicenseManagement bool `json:"explicitOfflineLicenseManagement,omitempty"`
  1865. // Pdf: Information about pdf content. (In LITE projection.)
  1866. Pdf *VolumeAccessInfoPdf `json:"pdf,omitempty"`
  1867. // PublicDomain: Whether or not this book is public domain in the
  1868. // country listed above.
  1869. PublicDomain bool `json:"publicDomain,omitempty"`
  1870. // QuoteSharingAllowed: Whether quote sharing is allowed for this
  1871. // volume.
  1872. QuoteSharingAllowed bool `json:"quoteSharingAllowed,omitempty"`
  1873. // TextToSpeechPermission: Whether text-to-speech is permitted for this
  1874. // volume. Values can be ALLOWED, ALLOWED_FOR_ACCESSIBILITY, or
  1875. // NOT_ALLOWED.
  1876. TextToSpeechPermission string `json:"textToSpeechPermission,omitempty"`
  1877. // ViewOrderUrl: For ordered but not yet processed orders, we give a URL
  1878. // that can be used to go to the appropriate Google Wallet page.
  1879. ViewOrderUrl string `json:"viewOrderUrl,omitempty"`
  1880. // Viewability: The read access of a volume. Possible values are
  1881. // PARTIAL, ALL_PAGES, NO_PAGES or UNKNOWN. This value depends on the
  1882. // country listed above. A value of PARTIAL means that the publisher has
  1883. // allowed some portion of the volume to be viewed publicly, without
  1884. // purchase. This can apply to eBooks as well as non-eBooks. Public
  1885. // domain books will always have a value of ALL_PAGES.
  1886. Viewability string `json:"viewability,omitempty"`
  1887. // WebReaderLink: URL to read this volume on the Google Books site. Link
  1888. // will not allow users to read non-viewable volumes.
  1889. WebReaderLink string `json:"webReaderLink,omitempty"`
  1890. // ForceSendFields is a list of field names (e.g. "AccessViewStatus") to
  1891. // unconditionally include in API requests. By default, fields with
  1892. // empty values are omitted from API requests. However, any non-pointer,
  1893. // non-interface field appearing in ForceSendFields will be sent to the
  1894. // server regardless of whether the field is empty or not. This may be
  1895. // used to include empty fields in Patch requests.
  1896. ForceSendFields []string `json:"-"`
  1897. }
  1898. func (s *VolumeAccessInfo) MarshalJSON() ([]byte, error) {
  1899. type noMethod VolumeAccessInfo
  1900. raw := noMethod(*s)
  1901. return gensupport.MarshalJSON(raw, s.ForceSendFields)
  1902. }
  1903. // VolumeAccessInfoEpub: Information about epub content. (In LITE
  1904. // projection.)
  1905. type VolumeAccessInfoEpub struct {
  1906. // AcsTokenLink: URL to retrieve ACS token for epub download. (In LITE
  1907. // projection.)
  1908. AcsTokenLink string `json:"acsTokenLink,omitempty"`
  1909. // DownloadLink: URL to download epub. (In LITE projection.)
  1910. DownloadLink string `json:"downloadLink,omitempty"`
  1911. // IsAvailable: Is a flowing text epub available either as public domain
  1912. // or for purchase. (In LITE projection.)
  1913. IsAvailable bool `json:"isAvailable,omitempty"`
  1914. // ForceSendFields is a list of field names (e.g. "AcsTokenLink") to
  1915. // unconditionally include in API requests. By default, fields with
  1916. // empty values are omitted from API requests. However, any non-pointer,
  1917. // non-interface field appearing in ForceSendFields will be sent to the
  1918. // server regardless of whether the field is empty or not. This may be
  1919. // used to include empty fields in Patch requests.
  1920. ForceSendFields []string `json:"-"`
  1921. }
  1922. func (s *VolumeAccessInfoEpub) MarshalJSON() ([]byte, error) {
  1923. type noMethod VolumeAccessInfoEpub
  1924. raw := noMethod(*s)
  1925. return gensupport.MarshalJSON(raw, s.ForceSendFields)
  1926. }
  1927. // VolumeAccessInfoPdf: Information about pdf content. (In LITE
  1928. // projection.)
  1929. type VolumeAccessInfoPdf struct {
  1930. // AcsTokenLink: URL to retrieve ACS token for pdf download. (In LITE
  1931. // projection.)
  1932. AcsTokenLink string `json:"acsTokenLink,omitempty"`
  1933. // DownloadLink: URL to download pdf. (In LITE projection.)
  1934. DownloadLink string `json:"downloadLink,omitempty"`
  1935. // IsAvailable: Is a scanned image pdf available either as public domain
  1936. // or for purchase. (In LITE projection.)
  1937. IsAvailable bool `json:"isAvailable,omitempty"`
  1938. // ForceSendFields is a list of field names (e.g. "AcsTokenLink") to
  1939. // unconditionally include in API requests. By default, fields with
  1940. // empty values are omitted from API requests. However, any non-pointer,
  1941. // non-interface field appearing in ForceSendFields will be sent to the
  1942. // server regardless of whether the field is empty or not. This may be
  1943. // used to include empty fields in Patch requests.
  1944. ForceSendFields []string `json:"-"`
  1945. }
  1946. func (s *VolumeAccessInfoPdf) MarshalJSON() ([]byte, error) {
  1947. type noMethod VolumeAccessInfoPdf
  1948. raw := noMethod(*s)
  1949. return gensupport.MarshalJSON(raw, s.ForceSendFields)
  1950. }
  1951. // VolumeLayerInfo: What layers exist in this volume and high level
  1952. // information about them.
  1953. type VolumeLayerInfo struct {
  1954. // Layers: A layer should appear here if and only if the layer exists
  1955. // for this book.
  1956. Layers []*VolumeLayerInfoLayers `json:"layers,omitempty"`
  1957. // ForceSendFields is a list of field names (e.g. "Layers") to
  1958. // unconditionally include in API requests. By default, fields with
  1959. // empty values are omitted from API requests. However, any non-pointer,
  1960. // non-interface field appearing in ForceSendFields will be sent to the
  1961. // server regardless of whether the field is empty or not. This may be
  1962. // used to include empty fields in Patch requests.
  1963. ForceSendFields []string `json:"-"`
  1964. }
  1965. func (s *VolumeLayerInfo) MarshalJSON() ([]byte, error) {
  1966. type noMethod VolumeLayerInfo
  1967. raw := noMethod(*s)
  1968. return gensupport.MarshalJSON(raw, s.ForceSendFields)
  1969. }
  1970. type VolumeLayerInfoLayers struct {
  1971. // LayerId: The layer id of this layer (e.g. "geo").
  1972. LayerId string `json:"layerId,omitempty"`
  1973. // VolumeAnnotationsVersion: The current version of this layer's volume
  1974. // annotations. Note that this version applies only to the data in the
  1975. // books.layers.volumeAnnotations.* responses. The actual annotation
  1976. // data is versioned separately.
  1977. VolumeAnnotationsVersion string `json:"volumeAnnotationsVersion,omitempty"`
  1978. // ForceSendFields is a list of field names (e.g. "LayerId") to
  1979. // unconditionally include in API requests. By default, fields with
  1980. // empty values are omitted from API requests. However, any non-pointer,
  1981. // non-interface field appearing in ForceSendFields will be sent to the
  1982. // server regardless of whether the field is empty or not. This may be
  1983. // used to include empty fields in Patch requests.
  1984. ForceSendFields []string `json:"-"`
  1985. }
  1986. func (s *VolumeLayerInfoLayers) MarshalJSON() ([]byte, error) {
  1987. type noMethod VolumeLayerInfoLayers
  1988. raw := noMethod(*s)
  1989. return gensupport.MarshalJSON(raw, s.ForceSendFields)
  1990. }
  1991. // VolumeRecommendedInfo: Recommendation related information for this
  1992. // volume.
  1993. type VolumeRecommendedInfo struct {
  1994. // Explanation: A text explaining why this volume is recommended.
  1995. Explanation string `json:"explanation,omitempty"`
  1996. // ForceSendFields is a list of field names (e.g. "Explanation") to
  1997. // unconditionally include in API requests. By default, fields with
  1998. // empty values are omitted from API requests. However, any non-pointer,
  1999. // non-interface field appearing in ForceSendFields will be sent to the
  2000. // server regardless of whether the field is empty or not. This may be
  2001. // used to include empty fields in Patch requests.
  2002. ForceSendFields []string `json:"-"`
  2003. }
  2004. func (s *VolumeRecommendedInfo) MarshalJSON() ([]byte, error) {
  2005. type noMethod VolumeRecommendedInfo
  2006. raw := noMethod(*s)
  2007. return gensupport.MarshalJSON(raw, s.ForceSendFields)
  2008. }
  2009. // VolumeSaleInfo: Any information about a volume related to the
  2010. // eBookstore and/or purchaseability. This information can depend on the
  2011. // country where the request originates from (i.e. books may not be for
  2012. // sale in certain countries).
  2013. type VolumeSaleInfo struct {
  2014. // BuyLink: URL to purchase this volume on the Google Books site. (In
  2015. // LITE projection)
  2016. BuyLink string `json:"buyLink,omitempty"`
  2017. // Country: The two-letter ISO_3166-1 country code for which this sale
  2018. // information is valid. (In LITE projection.)
  2019. Country string `json:"country,omitempty"`
  2020. // IsEbook: Whether or not this volume is an eBook (can be added to the
  2021. // My eBooks shelf).
  2022. IsEbook bool `json:"isEbook,omitempty"`
  2023. // ListPrice: Suggested retail price. (In LITE projection.)
  2024. ListPrice *VolumeSaleInfoListPrice `json:"listPrice,omitempty"`
  2025. // Offers: Offers available for this volume (sales and rentals).
  2026. Offers []*VolumeSaleInfoOffers `json:"offers,omitempty"`
  2027. // OnSaleDate: The date on which this book is available for sale.
  2028. OnSaleDate string `json:"onSaleDate,omitempty"`
  2029. // RetailPrice: The actual selling price of the book. This is the same
  2030. // as the suggested retail or list price unless there are offers or
  2031. // discounts on this volume. (In LITE projection.)
  2032. RetailPrice *VolumeSaleInfoRetailPrice `json:"retailPrice,omitempty"`
  2033. // Saleability: Whether or not this book is available for sale or
  2034. // offered for free in the Google eBookstore for the country listed
  2035. // above. Possible values are FOR_SALE, FOR_RENTAL_ONLY,
  2036. // FOR_SALE_AND_RENTAL, FREE, NOT_FOR_SALE, or FOR_PREORDER.
  2037. Saleability string `json:"saleability,omitempty"`
  2038. // ForceSendFields is a list of field names (e.g. "BuyLink") to
  2039. // unconditionally include in API requests. By default, fields with
  2040. // empty values are omitted from API requests. However, any non-pointer,
  2041. // non-interface field appearing in ForceSendFields will be sent to the
  2042. // server regardless of whether the field is empty or not. This may be
  2043. // used to include empty fields in Patch requests.
  2044. ForceSendFields []string `json:"-"`
  2045. }
  2046. func (s *VolumeSaleInfo) MarshalJSON() ([]byte, error) {
  2047. type noMethod VolumeSaleInfo
  2048. raw := noMethod(*s)
  2049. return gensupport.MarshalJSON(raw, s.ForceSendFields)
  2050. }
  2051. // VolumeSaleInfoListPrice: Suggested retail price. (In LITE
  2052. // projection.)
  2053. type VolumeSaleInfoListPrice struct {
  2054. // Amount: Amount in the currency listed below. (In LITE projection.)
  2055. Amount float64 `json:"amount,omitempty"`
  2056. // CurrencyCode: An ISO 4217, three-letter currency code. (In LITE
  2057. // projection.)
  2058. CurrencyCode string `json:"currencyCode,omitempty"`
  2059. // ForceSendFields is a list of field names (e.g. "Amount") to
  2060. // unconditionally include in API requests. By default, fields with
  2061. // empty values are omitted from API requests. However, any non-pointer,
  2062. // non-interface field appearing in ForceSendFields will be sent to the
  2063. // server regardless of whether the field is empty or not. This may be
  2064. // used to include empty fields in Patch requests.
  2065. ForceSendFields []string `json:"-"`
  2066. }
  2067. func (s *VolumeSaleInfoListPrice) MarshalJSON() ([]byte, error) {
  2068. type noMethod VolumeSaleInfoListPrice
  2069. raw := noMethod(*s)
  2070. return gensupport.MarshalJSON(raw, s.ForceSendFields)
  2071. }
  2072. type VolumeSaleInfoOffers struct {
  2073. // FinskyOfferType: The finsky offer type (e.g., PURCHASE=0 RENTAL=3)
  2074. FinskyOfferType int64 `json:"finskyOfferType,omitempty"`
  2075. // ListPrice: Offer list (=undiscounted) price in Micros.
  2076. ListPrice *VolumeSaleInfoOffersListPrice `json:"listPrice,omitempty"`
  2077. // RentalDuration: The rental duration (for rental offers only).
  2078. RentalDuration *VolumeSaleInfoOffersRentalDuration `json:"rentalDuration,omitempty"`
  2079. // RetailPrice: Offer retail (=discounted) price in Micros
  2080. RetailPrice *VolumeSaleInfoOffersRetailPrice `json:"retailPrice,omitempty"`
  2081. // ForceSendFields is a list of field names (e.g. "FinskyOfferType") to
  2082. // unconditionally include in API requests. By default, fields with
  2083. // empty values are omitted from API requests. However, any non-pointer,
  2084. // non-interface field appearing in ForceSendFields will be sent to the
  2085. // server regardless of whether the field is empty or not. This may be
  2086. // used to include empty fields in Patch requests.
  2087. ForceSendFields []string `json:"-"`
  2088. }
  2089. func (s *VolumeSaleInfoOffers) MarshalJSON() ([]byte, error) {
  2090. type noMethod VolumeSaleInfoOffers
  2091. raw := noMethod(*s)
  2092. return gensupport.MarshalJSON(raw, s.ForceSendFields)
  2093. }
  2094. // VolumeSaleInfoOffersListPrice: Offer list (=undiscounted) price in
  2095. // Micros.
  2096. type VolumeSaleInfoOffersListPrice struct {
  2097. AmountInMicros float64 `json:"amountInMicros,omitempty"`
  2098. CurrencyCode string `json:"currencyCode,omitempty"`
  2099. // ForceSendFields is a list of field names (e.g. "AmountInMicros") to
  2100. // unconditionally include in API requests. By default, fields with
  2101. // empty values are omitted from API requests. However, any non-pointer,
  2102. // non-interface field appearing in ForceSendFields will be sent to the
  2103. // server regardless of whether the field is empty or not. This may be
  2104. // used to include empty fields in Patch requests.
  2105. ForceSendFields []string `json:"-"`
  2106. }
  2107. func (s *VolumeSaleInfoOffersListPrice) MarshalJSON() ([]byte, error) {
  2108. type noMethod VolumeSaleInfoOffersListPrice
  2109. raw := noMethod(*s)
  2110. return gensupport.MarshalJSON(raw, s.ForceSendFields)
  2111. }
  2112. // VolumeSaleInfoOffersRentalDuration: The rental duration (for rental
  2113. // offers only).
  2114. type VolumeSaleInfoOffersRentalDuration struct {
  2115. Count float64 `json:"count,omitempty"`
  2116. Unit string `json:"unit,omitempty"`
  2117. // ForceSendFields is a list of field names (e.g. "Count") to
  2118. // unconditionally include in API requests. By default, fields with
  2119. // empty values are omitted from API requests. However, any non-pointer,
  2120. // non-interface field appearing in ForceSendFields will be sent to the
  2121. // server regardless of whether the field is empty or not. This may be
  2122. // used to include empty fields in Patch requests.
  2123. ForceSendFields []string `json:"-"`
  2124. }
  2125. func (s *VolumeSaleInfoOffersRentalDuration) MarshalJSON() ([]byte, error) {
  2126. type noMethod VolumeSaleInfoOffersRentalDuration
  2127. raw := noMethod(*s)
  2128. return gensupport.MarshalJSON(raw, s.ForceSendFields)
  2129. }
  2130. // VolumeSaleInfoOffersRetailPrice: Offer retail (=discounted) price in
  2131. // Micros
  2132. type VolumeSaleInfoOffersRetailPrice struct {
  2133. AmountInMicros float64 `json:"amountInMicros,omitempty"`
  2134. CurrencyCode string `json:"currencyCode,omitempty"`
  2135. // ForceSendFields is a list of field names (e.g. "AmountInMicros") to
  2136. // unconditionally include in API requests. By default, fields with
  2137. // empty values are omitted from API requests. However, any non-pointer,
  2138. // non-interface field appearing in ForceSendFields will be sent to the
  2139. // server regardless of whether the field is empty or not. This may be
  2140. // used to include empty fields in Patch requests.
  2141. ForceSendFields []string `json:"-"`
  2142. }
  2143. func (s *VolumeSaleInfoOffersRetailPrice) MarshalJSON() ([]byte, error) {
  2144. type noMethod VolumeSaleInfoOffersRetailPrice
  2145. raw := noMethod(*s)
  2146. return gensupport.MarshalJSON(raw, s.ForceSendFields)
  2147. }
  2148. // VolumeSaleInfoRetailPrice: The actual selling price of the book. This
  2149. // is the same as the suggested retail or list price unless there are
  2150. // offers or discounts on this volume. (In LITE projection.)
  2151. type VolumeSaleInfoRetailPrice struct {
  2152. // Amount: Amount in the currency listed below. (In LITE projection.)
  2153. Amount float64 `json:"amount,omitempty"`
  2154. // CurrencyCode: An ISO 4217, three-letter currency code. (In LITE
  2155. // projection.)
  2156. CurrencyCode string `json:"currencyCode,omitempty"`
  2157. // ForceSendFields is a list of field names (e.g. "Amount") to
  2158. // unconditionally include in API requests. By default, fields with
  2159. // empty values are omitted from API requests. However, any non-pointer,
  2160. // non-interface field appearing in ForceSendFields will be sent to the
  2161. // server regardless of whether the field is empty or not. This may be
  2162. // used to include empty fields in Patch requests.
  2163. ForceSendFields []string `json:"-"`
  2164. }
  2165. func (s *VolumeSaleInfoRetailPrice) MarshalJSON() ([]byte, error) {
  2166. type noMethod VolumeSaleInfoRetailPrice
  2167. raw := noMethod(*s)
  2168. return gensupport.MarshalJSON(raw, s.ForceSendFields)
  2169. }
  2170. // VolumeSearchInfo: Search result information related to this volume.
  2171. type VolumeSearchInfo struct {
  2172. // TextSnippet: A text snippet containing the search query.
  2173. TextSnippet string `json:"textSnippet,omitempty"`
  2174. // ForceSendFields is a list of field names (e.g. "TextSnippet") to
  2175. // unconditionally include in API requests. By default, fields with
  2176. // empty values are omitted from API requests. However, any non-pointer,
  2177. // non-interface field appearing in ForceSendFields will be sent to the
  2178. // server regardless of whether the field is empty or not. This may be
  2179. // used to include empty fields in Patch requests.
  2180. ForceSendFields []string `json:"-"`
  2181. }
  2182. func (s *VolumeSearchInfo) MarshalJSON() ([]byte, error) {
  2183. type noMethod VolumeSearchInfo
  2184. raw := noMethod(*s)
  2185. return gensupport.MarshalJSON(raw, s.ForceSendFields)
  2186. }
  2187. // VolumeUserInfo: User specific information related to this volume.
  2188. // (e.g. page this user last read or whether they purchased this book)
  2189. type VolumeUserInfo struct {
  2190. // AcquiredTime: Timestamp when this volume was acquired by the user.
  2191. // (RFC 3339 UTC date-time format) Acquiring includes purchase, user
  2192. // upload, receiving family sharing, etc.
  2193. AcquiredTime string `json:"acquiredTime,omitempty"`
  2194. // AcquisitionType: How this volume was acquired.
  2195. AcquisitionType int64 `json:"acquisitionType,omitempty"`
  2196. // Copy: Copy/Paste accounting information.
  2197. Copy *VolumeUserInfoCopy `json:"copy,omitempty"`
  2198. // EntitlementType: Whether this volume is purchased, sample, pd
  2199. // download etc.
  2200. EntitlementType int64 `json:"entitlementType,omitempty"`
  2201. // IsFamilySharedFromUser: Whether or not the user shared this volume
  2202. // with the family.
  2203. IsFamilySharedFromUser bool `json:"isFamilySharedFromUser,omitempty"`
  2204. // IsFamilySharedToUser: Whether or not the user received this volume
  2205. // through family sharing.
  2206. IsFamilySharedToUser bool `json:"isFamilySharedToUser,omitempty"`
  2207. // IsFamilySharingAllowed: Whether or not this volume can be shared with
  2208. // the family by the user. This includes sharing eligibility of both the
  2209. // volume and the user. If the value is true, the user can initiate a
  2210. // family sharing action.
  2211. IsFamilySharingAllowed bool `json:"isFamilySharingAllowed,omitempty"`
  2212. // IsInMyBooks: Whether or not this volume is currently in "my books."
  2213. IsInMyBooks bool `json:"isInMyBooks,omitempty"`
  2214. // IsPreordered: Whether or not this volume was pre-ordered by the
  2215. // authenticated user making the request. (In LITE projection.)
  2216. IsPreordered bool `json:"isPreordered,omitempty"`
  2217. // IsPurchased: Whether or not this volume was purchased by the
  2218. // authenticated user making the request. (In LITE projection.)
  2219. IsPurchased bool `json:"isPurchased,omitempty"`
  2220. // IsUploaded: Whether or not this volume was user uploaded.
  2221. IsUploaded bool `json:"isUploaded,omitempty"`
  2222. // ReadingPosition: The user's current reading position in the volume,
  2223. // if one is available. (In LITE projection.)
  2224. ReadingPosition *ReadingPosition `json:"readingPosition,omitempty"`
  2225. // RentalPeriod: Period during this book is/was a valid rental.
  2226. RentalPeriod *VolumeUserInfoRentalPeriod `json:"rentalPeriod,omitempty"`
  2227. // RentalState: Whether this book is an active or an expired rental.
  2228. RentalState string `json:"rentalState,omitempty"`
  2229. // Review: This user's review of this volume, if one exists.
  2230. Review *Review `json:"review,omitempty"`
  2231. // Updated: Timestamp when this volume was last modified by a user
  2232. // action, such as a reading position update, volume purchase or writing
  2233. // a review. (RFC 3339 UTC date-time format).
  2234. Updated string `json:"updated,omitempty"`
  2235. UserUploadedVolumeInfo *VolumeUserInfoUserUploadedVolumeInfo `json:"userUploadedVolumeInfo,omitempty"`
  2236. // ForceSendFields is a list of field names (e.g. "AcquiredTime") to
  2237. // unconditionally include in API requests. By default, fields with
  2238. // empty values are omitted from API requests. However, any non-pointer,
  2239. // non-interface field appearing in ForceSendFields will be sent to the
  2240. // server regardless of whether the field is empty or not. This may be
  2241. // used to include empty fields in Patch requests.
  2242. ForceSendFields []string `json:"-"`
  2243. }
  2244. func (s *VolumeUserInfo) MarshalJSON() ([]byte, error) {
  2245. type noMethod VolumeUserInfo
  2246. raw := noMethod(*s)
  2247. return gensupport.MarshalJSON(raw, s.ForceSendFields)
  2248. }
  2249. // VolumeUserInfoCopy: Copy/Paste accounting information.
  2250. type VolumeUserInfoCopy struct {
  2251. AllowedCharacterCount int64 `json:"allowedCharacterCount,omitempty"`
  2252. LimitType string `json:"limitType,omitempty"`
  2253. RemainingCharacterCount int64 `json:"remainingCharacterCount,omitempty"`
  2254. Updated string `json:"updated,omitempty"`
  2255. // ForceSendFields is a list of field names (e.g.
  2256. // "AllowedCharacterCount") to unconditionally include in API requests.
  2257. // By default, fields with empty values are omitted from API requests.
  2258. // However, any non-pointer, non-interface field appearing in
  2259. // ForceSendFields will be sent to the server regardless of whether the
  2260. // field is empty or not. This may be used to include empty fields in
  2261. // Patch requests.
  2262. ForceSendFields []string `json:"-"`
  2263. }
  2264. func (s *VolumeUserInfoCopy) MarshalJSON() ([]byte, error) {
  2265. type noMethod VolumeUserInfoCopy
  2266. raw := noMethod(*s)
  2267. return gensupport.MarshalJSON(raw, s.ForceSendFields)
  2268. }
  2269. // VolumeUserInfoRentalPeriod: Period during this book is/was a valid
  2270. // rental.
  2271. type VolumeUserInfoRentalPeriod struct {
  2272. EndUtcSec int64 `json:"endUtcSec,omitempty,string"`
  2273. StartUtcSec int64 `json:"startUtcSec,omitempty,string"`
  2274. // ForceSendFields is a list of field names (e.g. "EndUtcSec") to
  2275. // unconditionally include in API requests. By default, fields with
  2276. // empty values are omitted from API requests. However, any non-pointer,
  2277. // non-interface field appearing in ForceSendFields will be sent to the
  2278. // server regardless of whether the field is empty or not. This may be
  2279. // used to include empty fields in Patch requests.
  2280. ForceSendFields []string `json:"-"`
  2281. }
  2282. func (s *VolumeUserInfoRentalPeriod) MarshalJSON() ([]byte, error) {
  2283. type noMethod VolumeUserInfoRentalPeriod
  2284. raw := noMethod(*s)
  2285. return gensupport.MarshalJSON(raw, s.ForceSendFields)
  2286. }
  2287. type VolumeUserInfoUserUploadedVolumeInfo struct {
  2288. ProcessingState string `json:"processingState,omitempty"`
  2289. // ForceSendFields is a list of field names (e.g. "ProcessingState") to
  2290. // unconditionally include in API requests. By default, fields with
  2291. // empty values are omitted from API requests. However, any non-pointer,
  2292. // non-interface field appearing in ForceSendFields will be sent to the
  2293. // server regardless of whether the field is empty or not. This may be
  2294. // used to include empty fields in Patch requests.
  2295. ForceSendFields []string `json:"-"`
  2296. }
  2297. func (s *VolumeUserInfoUserUploadedVolumeInfo) MarshalJSON() ([]byte, error) {
  2298. type noMethod VolumeUserInfoUserUploadedVolumeInfo
  2299. raw := noMethod(*s)
  2300. return gensupport.MarshalJSON(raw, s.ForceSendFields)
  2301. }
  2302. // VolumeVolumeInfo: General volume information.
  2303. type VolumeVolumeInfo struct {
  2304. // AllowAnonLogging: Whether anonymous logging should be allowed.
  2305. AllowAnonLogging bool `json:"allowAnonLogging,omitempty"`
  2306. // Authors: The names of the authors and/or editors for this volume. (In
  2307. // LITE projection)
  2308. Authors []string `json:"authors,omitempty"`
  2309. // AverageRating: The mean review rating for this volume. (min = 1.0,
  2310. // max = 5.0)
  2311. AverageRating float64 `json:"averageRating,omitempty"`
  2312. // CanonicalVolumeLink: Canonical URL for a volume. (In LITE
  2313. // projection.)
  2314. CanonicalVolumeLink string `json:"canonicalVolumeLink,omitempty"`
  2315. // Categories: A list of subject categories, such as "Fiction",
  2316. // "Suspense", etc.
  2317. Categories []string `json:"categories,omitempty"`
  2318. // ContentVersion: An identifier for the version of the volume content
  2319. // (text & images). (In LITE projection)
  2320. ContentVersion string `json:"contentVersion,omitempty"`
  2321. // Description: A synopsis of the volume. The text of the description is
  2322. // formatted in HTML and includes simple formatting elements, such as b,
  2323. // i, and br tags. (In LITE projection.)
  2324. Description string `json:"description,omitempty"`
  2325. // Dimensions: Physical dimensions of this volume.
  2326. Dimensions *VolumeVolumeInfoDimensions `json:"dimensions,omitempty"`
  2327. // ImageLinks: A list of image links for all the sizes that are
  2328. // available. (In LITE projection.)
  2329. ImageLinks *VolumeVolumeInfoImageLinks `json:"imageLinks,omitempty"`
  2330. // IndustryIdentifiers: Industry standard identifiers for this volume.
  2331. IndustryIdentifiers []*VolumeVolumeInfoIndustryIdentifiers `json:"industryIdentifiers,omitempty"`
  2332. // InfoLink: URL to view information about this volume on the Google
  2333. // Books site. (In LITE projection)
  2334. InfoLink string `json:"infoLink,omitempty"`
  2335. // Language: Best language for this volume (based on content). It is the
  2336. // two-letter ISO 639-1 code such as 'fr', 'en', etc.
  2337. Language string `json:"language,omitempty"`
  2338. // MainCategory: The main category to which this volume belongs. It will
  2339. // be the category from the categories list returned below that has the
  2340. // highest weight.
  2341. MainCategory string `json:"mainCategory,omitempty"`
  2342. MaturityRating string `json:"maturityRating,omitempty"`
  2343. // PageCount: Total number of pages as per publisher metadata.
  2344. PageCount int64 `json:"pageCount,omitempty"`
  2345. // PreviewLink: URL to preview this volume on the Google Books site.
  2346. PreviewLink string `json:"previewLink,omitempty"`
  2347. // PrintType: Type of publication of this volume. Possible values are
  2348. // BOOK or MAGAZINE.
  2349. PrintType string `json:"printType,omitempty"`
  2350. // PrintedPageCount: Total number of printed pages in generated pdf
  2351. // representation.
  2352. PrintedPageCount int64 `json:"printedPageCount,omitempty"`
  2353. // PublishedDate: Date of publication. (In LITE projection.)
  2354. PublishedDate string `json:"publishedDate,omitempty"`
  2355. // Publisher: Publisher of this volume. (In LITE projection.)
  2356. Publisher string `json:"publisher,omitempty"`
  2357. // RatingsCount: The number of review ratings for this volume.
  2358. RatingsCount int64 `json:"ratingsCount,omitempty"`
  2359. // ReadingModes: The reading modes available for this volume.
  2360. ReadingModes interface{} `json:"readingModes,omitempty"`
  2361. // SamplePageCount: Total number of sample pages as per publisher
  2362. // metadata.
  2363. SamplePageCount int64 `json:"samplePageCount,omitempty"`
  2364. SeriesInfo *Volumeseriesinfo `json:"seriesInfo,omitempty"`
  2365. // Subtitle: Volume subtitle. (In LITE projection.)
  2366. Subtitle string `json:"subtitle,omitempty"`
  2367. // Title: Volume title. (In LITE projection.)
  2368. Title string `json:"title,omitempty"`
  2369. // ForceSendFields is a list of field names (e.g. "AllowAnonLogging") to
  2370. // unconditionally include in API requests. By default, fields with
  2371. // empty values are omitted from API requests. However, any non-pointer,
  2372. // non-interface field appearing in ForceSendFields will be sent to the
  2373. // server regardless of whether the field is empty or not. This may be
  2374. // used to include empty fields in Patch requests.
  2375. ForceSendFields []string `json:"-"`
  2376. }
  2377. func (s *VolumeVolumeInfo) MarshalJSON() ([]byte, error) {
  2378. type noMethod VolumeVolumeInfo
  2379. raw := noMethod(*s)
  2380. return gensupport.MarshalJSON(raw, s.ForceSendFields)
  2381. }
  2382. // VolumeVolumeInfoDimensions: Physical dimensions of this volume.
  2383. type VolumeVolumeInfoDimensions struct {
  2384. // Height: Height or length of this volume (in cm).
  2385. Height string `json:"height,omitempty"`
  2386. // Thickness: Thickness of this volume (in cm).
  2387. Thickness string `json:"thickness,omitempty"`
  2388. // Width: Width of this volume (in cm).
  2389. Width string `json:"width,omitempty"`
  2390. // ForceSendFields is a list of field names (e.g. "Height") to
  2391. // unconditionally include in API requests. By default, fields with
  2392. // empty values are omitted from API requests. However, any non-pointer,
  2393. // non-interface field appearing in ForceSendFields will be sent to the
  2394. // server regardless of whether the field is empty or not. This may be
  2395. // used to include empty fields in Patch requests.
  2396. ForceSendFields []string `json:"-"`
  2397. }
  2398. func (s *VolumeVolumeInfoDimensions) MarshalJSON() ([]byte, error) {
  2399. type noMethod VolumeVolumeInfoDimensions
  2400. raw := noMethod(*s)
  2401. return gensupport.MarshalJSON(raw, s.ForceSendFields)
  2402. }
  2403. // VolumeVolumeInfoImageLinks: A list of image links for all the sizes
  2404. // that are available. (In LITE projection.)
  2405. type VolumeVolumeInfoImageLinks struct {
  2406. // ExtraLarge: Image link for extra large size (width of ~1280 pixels).
  2407. // (In LITE projection)
  2408. ExtraLarge string `json:"extraLarge,omitempty"`
  2409. // Large: Image link for large size (width of ~800 pixels). (In LITE
  2410. // projection)
  2411. Large string `json:"large,omitempty"`
  2412. // Medium: Image link for medium size (width of ~575 pixels). (In LITE
  2413. // projection)
  2414. Medium string `json:"medium,omitempty"`
  2415. // Small: Image link for small size (width of ~300 pixels). (In LITE
  2416. // projection)
  2417. Small string `json:"small,omitempty"`
  2418. // SmallThumbnail: Image link for small thumbnail size (width of ~80
  2419. // pixels). (In LITE projection)
  2420. SmallThumbnail string `json:"smallThumbnail,omitempty"`
  2421. // Thumbnail: Image link for thumbnail size (width of ~128 pixels). (In
  2422. // LITE projection)
  2423. Thumbnail string `json:"thumbnail,omitempty"`
  2424. // ForceSendFields is a list of field names (e.g. "ExtraLarge") to
  2425. // unconditionally include in API requests. By default, fields with
  2426. // empty values are omitted from API requests. However, any non-pointer,
  2427. // non-interface field appearing in ForceSendFields will be sent to the
  2428. // server regardless of whether the field is empty or not. This may be
  2429. // used to include empty fields in Patch requests.
  2430. ForceSendFields []string `json:"-"`
  2431. }
  2432. func (s *VolumeVolumeInfoImageLinks) MarshalJSON() ([]byte, error) {
  2433. type noMethod VolumeVolumeInfoImageLinks
  2434. raw := noMethod(*s)
  2435. return gensupport.MarshalJSON(raw, s.ForceSendFields)
  2436. }
  2437. type VolumeVolumeInfoIndustryIdentifiers struct {
  2438. // Identifier: Industry specific volume identifier.
  2439. Identifier string `json:"identifier,omitempty"`
  2440. // Type: Identifier type. Possible values are ISBN_10, ISBN_13, ISSN and
  2441. // OTHER.
  2442. Type string `json:"type,omitempty"`
  2443. // ForceSendFields is a list of field names (e.g. "Identifier") 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 *VolumeVolumeInfoIndustryIdentifiers) MarshalJSON() ([]byte, error) {
  2452. type noMethod VolumeVolumeInfoIndustryIdentifiers
  2453. raw := noMethod(*s)
  2454. return gensupport.MarshalJSON(raw, s.ForceSendFields)
  2455. }
  2456. type Volume2 struct {
  2457. // Items: A list of volumes.
  2458. Items []*Volume `json:"items,omitempty"`
  2459. // Kind: Resource type.
  2460. Kind string `json:"kind,omitempty"`
  2461. NextPageToken string `json:"nextPageToken,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. "Items") 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 *Volume2) MarshalJSON() ([]byte, error) {
  2474. type noMethod Volume2
  2475. raw := noMethod(*s)
  2476. return gensupport.MarshalJSON(raw, s.ForceSendFields)
  2477. }
  2478. type Volumeannotation struct {
  2479. // AnnotationDataId: The annotation data id for this volume annotation.
  2480. AnnotationDataId string `json:"annotationDataId,omitempty"`
  2481. // AnnotationDataLink: Link to get data for this annotation.
  2482. AnnotationDataLink string `json:"annotationDataLink,omitempty"`
  2483. // AnnotationType: The type of annotation this is.
  2484. AnnotationType string `json:"annotationType,omitempty"`
  2485. // ContentRanges: The content ranges to identify the selected text.
  2486. ContentRanges *VolumeannotationContentRanges `json:"contentRanges,omitempty"`
  2487. // Data: Data for this annotation.
  2488. Data string `json:"data,omitempty"`
  2489. // Deleted: Indicates that this annotation is deleted.
  2490. Deleted bool `json:"deleted,omitempty"`
  2491. // Id: Unique id of this volume annotation.
  2492. Id string `json:"id,omitempty"`
  2493. // Kind: Resource Type
  2494. Kind string `json:"kind,omitempty"`
  2495. // LayerId: The Layer this annotation is for.
  2496. LayerId string `json:"layerId,omitempty"`
  2497. // PageIds: Pages the annotation spans.
  2498. PageIds []string `json:"pageIds,omitempty"`
  2499. // SelectedText: Excerpt from the volume.
  2500. SelectedText string `json:"selectedText,omitempty"`
  2501. // SelfLink: URL to this resource.
  2502. SelfLink string `json:"selfLink,omitempty"`
  2503. // Updated: Timestamp for the last time this anntoation was updated.
  2504. // (RFC 3339 UTC date-time format).
  2505. Updated string `json:"updated,omitempty"`
  2506. // VolumeId: The Volume this annotation is for.
  2507. VolumeId string `json:"volumeId,omitempty"`
  2508. // ServerResponse contains the HTTP response code and headers from the
  2509. // server.
  2510. googleapi.ServerResponse `json:"-"`
  2511. // ForceSendFields is a list of field names (e.g. "AnnotationDataId") to
  2512. // unconditionally include in API requests. By default, fields with
  2513. // empty values are omitted from API requests. However, any non-pointer,
  2514. // non-interface field appearing in ForceSendFields will be sent to the
  2515. // server regardless of whether the field is empty or not. This may be
  2516. // used to include empty fields in Patch requests.
  2517. ForceSendFields []string `json:"-"`
  2518. }
  2519. func (s *Volumeannotation) MarshalJSON() ([]byte, error) {
  2520. type noMethod Volumeannotation
  2521. raw := noMethod(*s)
  2522. return gensupport.MarshalJSON(raw, s.ForceSendFields)
  2523. }
  2524. // VolumeannotationContentRanges: The content ranges to identify the
  2525. // selected text.
  2526. type VolumeannotationContentRanges struct {
  2527. // CfiRange: Range in CFI format for this annotation for version above.
  2528. CfiRange *BooksAnnotationsRange `json:"cfiRange,omitempty"`
  2529. // ContentVersion: Content version applicable to ranges below.
  2530. ContentVersion string `json:"contentVersion,omitempty"`
  2531. // GbImageRange: Range in GB image format for this annotation for
  2532. // version above.
  2533. GbImageRange *BooksAnnotationsRange `json:"gbImageRange,omitempty"`
  2534. // GbTextRange: Range in GB text format for this annotation for version
  2535. // above.
  2536. GbTextRange *BooksAnnotationsRange `json:"gbTextRange,omitempty"`
  2537. // ForceSendFields is a list of field names (e.g. "CfiRange") to
  2538. // unconditionally include in API requests. By default, fields with
  2539. // empty values are omitted from API requests. However, any non-pointer,
  2540. // non-interface field appearing in ForceSendFields will be sent to the
  2541. // server regardless of whether the field is empty or not. This may be
  2542. // used to include empty fields in Patch requests.
  2543. ForceSendFields []string `json:"-"`
  2544. }
  2545. func (s *VolumeannotationContentRanges) MarshalJSON() ([]byte, error) {
  2546. type noMethod VolumeannotationContentRanges
  2547. raw := noMethod(*s)
  2548. return gensupport.MarshalJSON(raw, s.ForceSendFields)
  2549. }
  2550. type Volumeannotations struct {
  2551. // Items: A list of volume annotations.
  2552. Items []*Volumeannotation `json:"items,omitempty"`
  2553. // Kind: Resource type
  2554. Kind string `json:"kind,omitempty"`
  2555. // NextPageToken: Token to pass in for pagination for the next page.
  2556. // This will not be present if this request does not have more results.
  2557. NextPageToken string `json:"nextPageToken,omitempty"`
  2558. // TotalItems: The total number of volume annotations found.
  2559. TotalItems int64 `json:"totalItems,omitempty"`
  2560. // Version: The version string for all of the volume annotations in this
  2561. // layer (not just the ones in this response). Note: the version string
  2562. // doesn't apply to the annotation data, just the information in this
  2563. // response (e.g. the location of annotations in the book).
  2564. Version string `json:"version,omitempty"`
  2565. // ServerResponse contains the HTTP response code and headers from the
  2566. // server.
  2567. googleapi.ServerResponse `json:"-"`
  2568. // ForceSendFields is a list of field names (e.g. "Items") to
  2569. // unconditionally include in API requests. By default, fields with
  2570. // empty values are omitted from API requests. However, any non-pointer,
  2571. // non-interface field appearing in ForceSendFields will be sent to the
  2572. // server regardless of whether the field is empty or not. This may be
  2573. // used to include empty fields in Patch requests.
  2574. ForceSendFields []string `json:"-"`
  2575. }
  2576. func (s *Volumeannotations) MarshalJSON() ([]byte, error) {
  2577. type noMethod Volumeannotations
  2578. raw := noMethod(*s)
  2579. return gensupport.MarshalJSON(raw, s.ForceSendFields)
  2580. }
  2581. type Volumes struct {
  2582. // Items: A list of volumes.
  2583. Items []*Volume `json:"items,omitempty"`
  2584. // Kind: Resource type.
  2585. Kind string `json:"kind,omitempty"`
  2586. // TotalItems: Total number of volumes found. This might be greater than
  2587. // the number of volumes returned in this response if results have been
  2588. // paginated.
  2589. TotalItems int64 `json:"totalItems,omitempty"`
  2590. // ServerResponse contains the HTTP response code and headers from the
  2591. // server.
  2592. googleapi.ServerResponse `json:"-"`
  2593. // ForceSendFields is a list of field names (e.g. "Items") to
  2594. // unconditionally include in API requests. By default, fields with
  2595. // empty values are omitted from API requests. However, any non-pointer,
  2596. // non-interface field appearing in ForceSendFields will be sent to the
  2597. // server regardless of whether the field is empty or not. This may be
  2598. // used to include empty fields in Patch requests.
  2599. ForceSendFields []string `json:"-"`
  2600. }
  2601. func (s *Volumes) MarshalJSON() ([]byte, error) {
  2602. type noMethod Volumes
  2603. raw := noMethod(*s)
  2604. return gensupport.MarshalJSON(raw, s.ForceSendFields)
  2605. }
  2606. type Volumeseriesinfo struct {
  2607. // BookDisplayNumber: The display number string. This should be used
  2608. // only for display purposes and the actual sequence should be inferred
  2609. // from the below orderNumber.
  2610. BookDisplayNumber string `json:"bookDisplayNumber,omitempty"`
  2611. // Kind: Resource type.
  2612. Kind string `json:"kind,omitempty"`
  2613. // ShortSeriesBookTitle: Short book title in the context of the series.
  2614. ShortSeriesBookTitle string `json:"shortSeriesBookTitle,omitempty"`
  2615. VolumeSeries []*VolumeseriesinfoVolumeSeries `json:"volumeSeries,omitempty"`
  2616. // ForceSendFields is a list of field names (e.g. "BookDisplayNumber")
  2617. // to unconditionally include in API requests. By default, fields with
  2618. // empty values are omitted from API requests. However, any non-pointer,
  2619. // non-interface field appearing in ForceSendFields will be sent to the
  2620. // server regardless of whether the field is empty or not. This may be
  2621. // used to include empty fields in Patch requests.
  2622. ForceSendFields []string `json:"-"`
  2623. }
  2624. func (s *Volumeseriesinfo) MarshalJSON() ([]byte, error) {
  2625. type noMethod Volumeseriesinfo
  2626. raw := noMethod(*s)
  2627. return gensupport.MarshalJSON(raw, s.ForceSendFields)
  2628. }
  2629. type VolumeseriesinfoVolumeSeries struct {
  2630. // Issue: List of issues. Applicable only for Collection Edition and
  2631. // Omnibus.
  2632. Issue []*VolumeseriesinfoVolumeSeriesIssue `json:"issue,omitempty"`
  2633. // OrderNumber: The book order number in the series.
  2634. OrderNumber int64 `json:"orderNumber,omitempty"`
  2635. // SeriesBookType: The book type in the context of series. Examples -
  2636. // Single Issue, Collection Edition, etc.
  2637. SeriesBookType string `json:"seriesBookType,omitempty"`
  2638. // SeriesId: The series id.
  2639. SeriesId string `json:"seriesId,omitempty"`
  2640. // ForceSendFields is a list of field names (e.g. "Issue") to
  2641. // unconditionally include in API requests. By default, fields with
  2642. // empty values are omitted from API requests. However, any non-pointer,
  2643. // non-interface field appearing in ForceSendFields will be sent to the
  2644. // server regardless of whether the field is empty or not. This may be
  2645. // used to include empty fields in Patch requests.
  2646. ForceSendFields []string `json:"-"`
  2647. }
  2648. func (s *VolumeseriesinfoVolumeSeries) MarshalJSON() ([]byte, error) {
  2649. type noMethod VolumeseriesinfoVolumeSeries
  2650. raw := noMethod(*s)
  2651. return gensupport.MarshalJSON(raw, s.ForceSendFields)
  2652. }
  2653. type VolumeseriesinfoVolumeSeriesIssue struct {
  2654. IssueDisplayNumber string `json:"issueDisplayNumber,omitempty"`
  2655. IssueOrderNumber int64 `json:"issueOrderNumber,omitempty"`
  2656. // ForceSendFields is a list of field names (e.g. "IssueDisplayNumber")
  2657. // to unconditionally include in API requests. By default, fields with
  2658. // empty values are omitted from API requests. However, any non-pointer,
  2659. // non-interface field appearing in ForceSendFields will be sent to the
  2660. // server regardless of whether the field is empty or not. This may be
  2661. // used to include empty fields in Patch requests.
  2662. ForceSendFields []string `json:"-"`
  2663. }
  2664. func (s *VolumeseriesinfoVolumeSeriesIssue) MarshalJSON() ([]byte, error) {
  2665. type noMethod VolumeseriesinfoVolumeSeriesIssue
  2666. raw := noMethod(*s)
  2667. return gensupport.MarshalJSON(raw, s.ForceSendFields)
  2668. }
  2669. // method id "books.bookshelves.get":
  2670. type BookshelvesGetCall struct {
  2671. s *Service
  2672. userId string
  2673. shelf string
  2674. urlParams_ gensupport.URLParams
  2675. ifNoneMatch_ string
  2676. ctx_ context.Context
  2677. }
  2678. // Get: Retrieves metadata for a specific bookshelf for the specified
  2679. // user.
  2680. func (r *BookshelvesService) Get(userId string, shelf string) *BookshelvesGetCall {
  2681. c := &BookshelvesGetCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  2682. c.userId = userId
  2683. c.shelf = shelf
  2684. return c
  2685. }
  2686. // Source sets the optional parameter "source": String to identify the
  2687. // originator of this request.
  2688. func (c *BookshelvesGetCall) Source(source string) *BookshelvesGetCall {
  2689. c.urlParams_.Set("source", source)
  2690. return c
  2691. }
  2692. // Fields allows partial responses to be retrieved. See
  2693. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  2694. // for more information.
  2695. func (c *BookshelvesGetCall) Fields(s ...googleapi.Field) *BookshelvesGetCall {
  2696. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  2697. return c
  2698. }
  2699. // IfNoneMatch sets the optional parameter which makes the operation
  2700. // fail if the object's ETag matches the given value. This is useful for
  2701. // getting updates only after the object has changed since the last
  2702. // request. Use googleapi.IsNotModified to check whether the response
  2703. // error from Do is the result of In-None-Match.
  2704. func (c *BookshelvesGetCall) IfNoneMatch(entityTag string) *BookshelvesGetCall {
  2705. c.ifNoneMatch_ = entityTag
  2706. return c
  2707. }
  2708. // Context sets the context to be used in this call's Do method. Any
  2709. // pending HTTP request will be aborted if the provided context is
  2710. // canceled.
  2711. func (c *BookshelvesGetCall) Context(ctx context.Context) *BookshelvesGetCall {
  2712. c.ctx_ = ctx
  2713. return c
  2714. }
  2715. func (c *BookshelvesGetCall) doRequest(alt string) (*http.Response, error) {
  2716. var body io.Reader = nil
  2717. c.urlParams_.Set("alt", alt)
  2718. urls := googleapi.ResolveRelative(c.s.BasePath, "users/{userId}/bookshelves/{shelf}")
  2719. urls += "?" + c.urlParams_.Encode()
  2720. req, _ := http.NewRequest("GET", urls, body)
  2721. googleapi.Expand(req.URL, map[string]string{
  2722. "userId": c.userId,
  2723. "shelf": c.shelf,
  2724. })
  2725. req.Header.Set("User-Agent", c.s.userAgent())
  2726. if c.ifNoneMatch_ != "" {
  2727. req.Header.Set("If-None-Match", c.ifNoneMatch_)
  2728. }
  2729. if c.ctx_ != nil {
  2730. return ctxhttp.Do(c.ctx_, c.s.client, req)
  2731. }
  2732. return c.s.client.Do(req)
  2733. }
  2734. // Do executes the "books.bookshelves.get" call.
  2735. // Exactly one of *Bookshelf or error will be non-nil. Any non-2xx
  2736. // status code is an error. Response headers are in either
  2737. // *Bookshelf.ServerResponse.Header or (if a response was returned at
  2738. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  2739. // to check whether the returned error was because
  2740. // http.StatusNotModified was returned.
  2741. func (c *BookshelvesGetCall) Do(opts ...googleapi.CallOption) (*Bookshelf, error) {
  2742. gensupport.SetOptions(c.urlParams_, opts...)
  2743. res, err := c.doRequest("json")
  2744. if res != nil && res.StatusCode == http.StatusNotModified {
  2745. if res.Body != nil {
  2746. res.Body.Close()
  2747. }
  2748. return nil, &googleapi.Error{
  2749. Code: res.StatusCode,
  2750. Header: res.Header,
  2751. }
  2752. }
  2753. if err != nil {
  2754. return nil, err
  2755. }
  2756. defer googleapi.CloseBody(res)
  2757. if err := googleapi.CheckResponse(res); err != nil {
  2758. return nil, err
  2759. }
  2760. ret := &Bookshelf{
  2761. ServerResponse: googleapi.ServerResponse{
  2762. Header: res.Header,
  2763. HTTPStatusCode: res.StatusCode,
  2764. },
  2765. }
  2766. if err := json.NewDecoder(res.Body).Decode(&ret); err != nil {
  2767. return nil, err
  2768. }
  2769. return ret, nil
  2770. // {
  2771. // "description": "Retrieves metadata for a specific bookshelf for the specified user.",
  2772. // "httpMethod": "GET",
  2773. // "id": "books.bookshelves.get",
  2774. // "parameterOrder": [
  2775. // "userId",
  2776. // "shelf"
  2777. // ],
  2778. // "parameters": {
  2779. // "shelf": {
  2780. // "description": "ID of bookshelf to retrieve.",
  2781. // "location": "path",
  2782. // "required": true,
  2783. // "type": "string"
  2784. // },
  2785. // "source": {
  2786. // "description": "String to identify the originator of this request.",
  2787. // "location": "query",
  2788. // "type": "string"
  2789. // },
  2790. // "userId": {
  2791. // "description": "ID of user for whom to retrieve bookshelves.",
  2792. // "location": "path",
  2793. // "required": true,
  2794. // "type": "string"
  2795. // }
  2796. // },
  2797. // "path": "users/{userId}/bookshelves/{shelf}",
  2798. // "response": {
  2799. // "$ref": "Bookshelf"
  2800. // },
  2801. // "scopes": [
  2802. // "https://www.googleapis.com/auth/books"
  2803. // ]
  2804. // }
  2805. }
  2806. // method id "books.bookshelves.list":
  2807. type BookshelvesListCall struct {
  2808. s *Service
  2809. userId string
  2810. urlParams_ gensupport.URLParams
  2811. ifNoneMatch_ string
  2812. ctx_ context.Context
  2813. }
  2814. // List: Retrieves a list of public bookshelves for the specified user.
  2815. func (r *BookshelvesService) List(userId string) *BookshelvesListCall {
  2816. c := &BookshelvesListCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  2817. c.userId = userId
  2818. return c
  2819. }
  2820. // Source sets the optional parameter "source": String to identify the
  2821. // originator of this request.
  2822. func (c *BookshelvesListCall) Source(source string) *BookshelvesListCall {
  2823. c.urlParams_.Set("source", source)
  2824. return c
  2825. }
  2826. // Fields allows partial responses to be retrieved. See
  2827. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  2828. // for more information.
  2829. func (c *BookshelvesListCall) Fields(s ...googleapi.Field) *BookshelvesListCall {
  2830. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  2831. return c
  2832. }
  2833. // IfNoneMatch sets the optional parameter which makes the operation
  2834. // fail if the object's ETag matches the given value. This is useful for
  2835. // getting updates only after the object has changed since the last
  2836. // request. Use googleapi.IsNotModified to check whether the response
  2837. // error from Do is the result of In-None-Match.
  2838. func (c *BookshelvesListCall) IfNoneMatch(entityTag string) *BookshelvesListCall {
  2839. c.ifNoneMatch_ = entityTag
  2840. return c
  2841. }
  2842. // Context sets the context to be used in this call's Do method. Any
  2843. // pending HTTP request will be aborted if the provided context is
  2844. // canceled.
  2845. func (c *BookshelvesListCall) Context(ctx context.Context) *BookshelvesListCall {
  2846. c.ctx_ = ctx
  2847. return c
  2848. }
  2849. func (c *BookshelvesListCall) doRequest(alt string) (*http.Response, error) {
  2850. var body io.Reader = nil
  2851. c.urlParams_.Set("alt", alt)
  2852. urls := googleapi.ResolveRelative(c.s.BasePath, "users/{userId}/bookshelves")
  2853. urls += "?" + c.urlParams_.Encode()
  2854. req, _ := http.NewRequest("GET", urls, body)
  2855. googleapi.Expand(req.URL, map[string]string{
  2856. "userId": c.userId,
  2857. })
  2858. req.Header.Set("User-Agent", c.s.userAgent())
  2859. if c.ifNoneMatch_ != "" {
  2860. req.Header.Set("If-None-Match", c.ifNoneMatch_)
  2861. }
  2862. if c.ctx_ != nil {
  2863. return ctxhttp.Do(c.ctx_, c.s.client, req)
  2864. }
  2865. return c.s.client.Do(req)
  2866. }
  2867. // Do executes the "books.bookshelves.list" call.
  2868. // Exactly one of *Bookshelves or error will be non-nil. Any non-2xx
  2869. // status code is an error. Response headers are in either
  2870. // *Bookshelves.ServerResponse.Header or (if a response was returned at
  2871. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  2872. // to check whether the returned error was because
  2873. // http.StatusNotModified was returned.
  2874. func (c *BookshelvesListCall) Do(opts ...googleapi.CallOption) (*Bookshelves, error) {
  2875. gensupport.SetOptions(c.urlParams_, opts...)
  2876. res, err := c.doRequest("json")
  2877. if res != nil && res.StatusCode == http.StatusNotModified {
  2878. if res.Body != nil {
  2879. res.Body.Close()
  2880. }
  2881. return nil, &googleapi.Error{
  2882. Code: res.StatusCode,
  2883. Header: res.Header,
  2884. }
  2885. }
  2886. if err != nil {
  2887. return nil, err
  2888. }
  2889. defer googleapi.CloseBody(res)
  2890. if err := googleapi.CheckResponse(res); err != nil {
  2891. return nil, err
  2892. }
  2893. ret := &Bookshelves{
  2894. ServerResponse: googleapi.ServerResponse{
  2895. Header: res.Header,
  2896. HTTPStatusCode: res.StatusCode,
  2897. },
  2898. }
  2899. if err := json.NewDecoder(res.Body).Decode(&ret); err != nil {
  2900. return nil, err
  2901. }
  2902. return ret, nil
  2903. // {
  2904. // "description": "Retrieves a list of public bookshelves for the specified user.",
  2905. // "httpMethod": "GET",
  2906. // "id": "books.bookshelves.list",
  2907. // "parameterOrder": [
  2908. // "userId"
  2909. // ],
  2910. // "parameters": {
  2911. // "source": {
  2912. // "description": "String to identify the originator of this request.",
  2913. // "location": "query",
  2914. // "type": "string"
  2915. // },
  2916. // "userId": {
  2917. // "description": "ID of user for whom to retrieve bookshelves.",
  2918. // "location": "path",
  2919. // "required": true,
  2920. // "type": "string"
  2921. // }
  2922. // },
  2923. // "path": "users/{userId}/bookshelves",
  2924. // "response": {
  2925. // "$ref": "Bookshelves"
  2926. // },
  2927. // "scopes": [
  2928. // "https://www.googleapis.com/auth/books"
  2929. // ]
  2930. // }
  2931. }
  2932. // method id "books.bookshelves.volumes.list":
  2933. type BookshelvesVolumesListCall struct {
  2934. s *Service
  2935. userId string
  2936. shelf string
  2937. urlParams_ gensupport.URLParams
  2938. ifNoneMatch_ string
  2939. ctx_ context.Context
  2940. }
  2941. // List: Retrieves volumes in a specific bookshelf for the specified
  2942. // user.
  2943. func (r *BookshelvesVolumesService) List(userId string, shelf string) *BookshelvesVolumesListCall {
  2944. c := &BookshelvesVolumesListCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  2945. c.userId = userId
  2946. c.shelf = shelf
  2947. return c
  2948. }
  2949. // MaxResults sets the optional parameter "maxResults": Maximum number
  2950. // of results to return
  2951. func (c *BookshelvesVolumesListCall) MaxResults(maxResults int64) *BookshelvesVolumesListCall {
  2952. c.urlParams_.Set("maxResults", fmt.Sprint(maxResults))
  2953. return c
  2954. }
  2955. // ShowPreorders sets the optional parameter "showPreorders": Set to
  2956. // true to show pre-ordered books. Defaults to false.
  2957. func (c *BookshelvesVolumesListCall) ShowPreorders(showPreorders bool) *BookshelvesVolumesListCall {
  2958. c.urlParams_.Set("showPreorders", fmt.Sprint(showPreorders))
  2959. return c
  2960. }
  2961. // Source sets the optional parameter "source": String to identify the
  2962. // originator of this request.
  2963. func (c *BookshelvesVolumesListCall) Source(source string) *BookshelvesVolumesListCall {
  2964. c.urlParams_.Set("source", source)
  2965. return c
  2966. }
  2967. // StartIndex sets the optional parameter "startIndex": Index of the
  2968. // first element to return (starts at 0)
  2969. func (c *BookshelvesVolumesListCall) StartIndex(startIndex int64) *BookshelvesVolumesListCall {
  2970. c.urlParams_.Set("startIndex", fmt.Sprint(startIndex))
  2971. return c
  2972. }
  2973. // Fields allows partial responses to be retrieved. See
  2974. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  2975. // for more information.
  2976. func (c *BookshelvesVolumesListCall) Fields(s ...googleapi.Field) *BookshelvesVolumesListCall {
  2977. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  2978. return c
  2979. }
  2980. // IfNoneMatch sets the optional parameter which makes the operation
  2981. // fail if the object's ETag matches the given value. This is useful for
  2982. // getting updates only after the object has changed since the last
  2983. // request. Use googleapi.IsNotModified to check whether the response
  2984. // error from Do is the result of In-None-Match.
  2985. func (c *BookshelvesVolumesListCall) IfNoneMatch(entityTag string) *BookshelvesVolumesListCall {
  2986. c.ifNoneMatch_ = entityTag
  2987. return c
  2988. }
  2989. // Context sets the context to be used in this call's Do method. Any
  2990. // pending HTTP request will be aborted if the provided context is
  2991. // canceled.
  2992. func (c *BookshelvesVolumesListCall) Context(ctx context.Context) *BookshelvesVolumesListCall {
  2993. c.ctx_ = ctx
  2994. return c
  2995. }
  2996. func (c *BookshelvesVolumesListCall) doRequest(alt string) (*http.Response, error) {
  2997. var body io.Reader = nil
  2998. c.urlParams_.Set("alt", alt)
  2999. urls := googleapi.ResolveRelative(c.s.BasePath, "users/{userId}/bookshelves/{shelf}/volumes")
  3000. urls += "?" + c.urlParams_.Encode()
  3001. req, _ := http.NewRequest("GET", urls, body)
  3002. googleapi.Expand(req.URL, map[string]string{
  3003. "userId": c.userId,
  3004. "shelf": c.shelf,
  3005. })
  3006. req.Header.Set("User-Agent", c.s.userAgent())
  3007. if c.ifNoneMatch_ != "" {
  3008. req.Header.Set("If-None-Match", c.ifNoneMatch_)
  3009. }
  3010. if c.ctx_ != nil {
  3011. return ctxhttp.Do(c.ctx_, c.s.client, req)
  3012. }
  3013. return c.s.client.Do(req)
  3014. }
  3015. // Do executes the "books.bookshelves.volumes.list" call.
  3016. // Exactly one of *Volumes or error will be non-nil. Any non-2xx status
  3017. // code is an error. Response headers are in either
  3018. // *Volumes.ServerResponse.Header or (if a response was returned at all)
  3019. // in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to
  3020. // check whether the returned error was because http.StatusNotModified
  3021. // was returned.
  3022. func (c *BookshelvesVolumesListCall) Do(opts ...googleapi.CallOption) (*Volumes, error) {
  3023. gensupport.SetOptions(c.urlParams_, opts...)
  3024. res, err := c.doRequest("json")
  3025. if res != nil && res.StatusCode == http.StatusNotModified {
  3026. if res.Body != nil {
  3027. res.Body.Close()
  3028. }
  3029. return nil, &googleapi.Error{
  3030. Code: res.StatusCode,
  3031. Header: res.Header,
  3032. }
  3033. }
  3034. if err != nil {
  3035. return nil, err
  3036. }
  3037. defer googleapi.CloseBody(res)
  3038. if err := googleapi.CheckResponse(res); err != nil {
  3039. return nil, err
  3040. }
  3041. ret := &Volumes{
  3042. ServerResponse: googleapi.ServerResponse{
  3043. Header: res.Header,
  3044. HTTPStatusCode: res.StatusCode,
  3045. },
  3046. }
  3047. if err := json.NewDecoder(res.Body).Decode(&ret); err != nil {
  3048. return nil, err
  3049. }
  3050. return ret, nil
  3051. // {
  3052. // "description": "Retrieves volumes in a specific bookshelf for the specified user.",
  3053. // "httpMethod": "GET",
  3054. // "id": "books.bookshelves.volumes.list",
  3055. // "parameterOrder": [
  3056. // "userId",
  3057. // "shelf"
  3058. // ],
  3059. // "parameters": {
  3060. // "maxResults": {
  3061. // "description": "Maximum number of results to return",
  3062. // "format": "uint32",
  3063. // "location": "query",
  3064. // "minimum": "0",
  3065. // "type": "integer"
  3066. // },
  3067. // "shelf": {
  3068. // "description": "ID of bookshelf to retrieve volumes.",
  3069. // "location": "path",
  3070. // "required": true,
  3071. // "type": "string"
  3072. // },
  3073. // "showPreorders": {
  3074. // "description": "Set to true to show pre-ordered books. Defaults to false.",
  3075. // "location": "query",
  3076. // "type": "boolean"
  3077. // },
  3078. // "source": {
  3079. // "description": "String to identify the originator of this request.",
  3080. // "location": "query",
  3081. // "type": "string"
  3082. // },
  3083. // "startIndex": {
  3084. // "description": "Index of the first element to return (starts at 0)",
  3085. // "format": "uint32",
  3086. // "location": "query",
  3087. // "minimum": "0",
  3088. // "type": "integer"
  3089. // },
  3090. // "userId": {
  3091. // "description": "ID of user for whom to retrieve bookshelf volumes.",
  3092. // "location": "path",
  3093. // "required": true,
  3094. // "type": "string"
  3095. // }
  3096. // },
  3097. // "path": "users/{userId}/bookshelves/{shelf}/volumes",
  3098. // "response": {
  3099. // "$ref": "Volumes"
  3100. // },
  3101. // "scopes": [
  3102. // "https://www.googleapis.com/auth/books"
  3103. // ]
  3104. // }
  3105. }
  3106. // method id "books.cloudloading.addBook":
  3107. type CloudloadingAddBookCall struct {
  3108. s *Service
  3109. urlParams_ gensupport.URLParams
  3110. ctx_ context.Context
  3111. }
  3112. // AddBook:
  3113. func (r *CloudloadingService) AddBook() *CloudloadingAddBookCall {
  3114. c := &CloudloadingAddBookCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  3115. return c
  3116. }
  3117. // DriveDocumentId sets the optional parameter "drive_document_id": A
  3118. // drive document id. The upload_client_token must not be set.
  3119. func (c *CloudloadingAddBookCall) DriveDocumentId(driveDocumentId string) *CloudloadingAddBookCall {
  3120. c.urlParams_.Set("drive_document_id", driveDocumentId)
  3121. return c
  3122. }
  3123. // MimeType sets the optional parameter "mime_type": The document MIME
  3124. // type. It can be set only if the drive_document_id is set.
  3125. func (c *CloudloadingAddBookCall) MimeType(mimeType string) *CloudloadingAddBookCall {
  3126. c.urlParams_.Set("mime_type", mimeType)
  3127. return c
  3128. }
  3129. // Name sets the optional parameter "name": The document name. It can be
  3130. // set only if the drive_document_id is set.
  3131. func (c *CloudloadingAddBookCall) Name(name string) *CloudloadingAddBookCall {
  3132. c.urlParams_.Set("name", name)
  3133. return c
  3134. }
  3135. // UploadClientToken sets the optional parameter "upload_client_token":
  3136. func (c *CloudloadingAddBookCall) UploadClientToken(uploadClientToken string) *CloudloadingAddBookCall {
  3137. c.urlParams_.Set("upload_client_token", uploadClientToken)
  3138. return c
  3139. }
  3140. // Fields allows partial responses to be retrieved. See
  3141. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  3142. // for more information.
  3143. func (c *CloudloadingAddBookCall) Fields(s ...googleapi.Field) *CloudloadingAddBookCall {
  3144. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  3145. return c
  3146. }
  3147. // Context sets the context to be used in this call's Do method. Any
  3148. // pending HTTP request will be aborted if the provided context is
  3149. // canceled.
  3150. func (c *CloudloadingAddBookCall) Context(ctx context.Context) *CloudloadingAddBookCall {
  3151. c.ctx_ = ctx
  3152. return c
  3153. }
  3154. func (c *CloudloadingAddBookCall) doRequest(alt string) (*http.Response, error) {
  3155. var body io.Reader = nil
  3156. c.urlParams_.Set("alt", alt)
  3157. urls := googleapi.ResolveRelative(c.s.BasePath, "cloudloading/addBook")
  3158. urls += "?" + c.urlParams_.Encode()
  3159. req, _ := http.NewRequest("POST", urls, body)
  3160. googleapi.SetOpaque(req.URL)
  3161. req.Header.Set("User-Agent", c.s.userAgent())
  3162. if c.ctx_ != nil {
  3163. return ctxhttp.Do(c.ctx_, c.s.client, req)
  3164. }
  3165. return c.s.client.Do(req)
  3166. }
  3167. // Do executes the "books.cloudloading.addBook" call.
  3168. // Exactly one of *BooksCloudloadingResource or error will be non-nil.
  3169. // Any non-2xx status code is an error. Response headers are in either
  3170. // *BooksCloudloadingResource.ServerResponse.Header or (if a response
  3171. // was returned at all) in error.(*googleapi.Error).Header. Use
  3172. // googleapi.IsNotModified to check whether the returned error was
  3173. // because http.StatusNotModified was returned.
  3174. func (c *CloudloadingAddBookCall) Do(opts ...googleapi.CallOption) (*BooksCloudloadingResource, error) {
  3175. gensupport.SetOptions(c.urlParams_, opts...)
  3176. res, err := c.doRequest("json")
  3177. if res != nil && res.StatusCode == http.StatusNotModified {
  3178. if res.Body != nil {
  3179. res.Body.Close()
  3180. }
  3181. return nil, &googleapi.Error{
  3182. Code: res.StatusCode,
  3183. Header: res.Header,
  3184. }
  3185. }
  3186. if err != nil {
  3187. return nil, err
  3188. }
  3189. defer googleapi.CloseBody(res)
  3190. if err := googleapi.CheckResponse(res); err != nil {
  3191. return nil, err
  3192. }
  3193. ret := &BooksCloudloadingResource{
  3194. ServerResponse: googleapi.ServerResponse{
  3195. Header: res.Header,
  3196. HTTPStatusCode: res.StatusCode,
  3197. },
  3198. }
  3199. if err := json.NewDecoder(res.Body).Decode(&ret); err != nil {
  3200. return nil, err
  3201. }
  3202. return ret, nil
  3203. // {
  3204. // "description": "",
  3205. // "httpMethod": "POST",
  3206. // "id": "books.cloudloading.addBook",
  3207. // "parameters": {
  3208. // "drive_document_id": {
  3209. // "description": "A drive document id. The upload_client_token must not be set.",
  3210. // "location": "query",
  3211. // "type": "string"
  3212. // },
  3213. // "mime_type": {
  3214. // "description": "The document MIME type. It can be set only if the drive_document_id is set.",
  3215. // "location": "query",
  3216. // "type": "string"
  3217. // },
  3218. // "name": {
  3219. // "description": "The document name. It can be set only if the drive_document_id is set.",
  3220. // "location": "query",
  3221. // "type": "string"
  3222. // },
  3223. // "upload_client_token": {
  3224. // "location": "query",
  3225. // "type": "string"
  3226. // }
  3227. // },
  3228. // "path": "cloudloading/addBook",
  3229. // "response": {
  3230. // "$ref": "BooksCloudloadingResource"
  3231. // },
  3232. // "scopes": [
  3233. // "https://www.googleapis.com/auth/books"
  3234. // ]
  3235. // }
  3236. }
  3237. // method id "books.cloudloading.deleteBook":
  3238. type CloudloadingDeleteBookCall struct {
  3239. s *Service
  3240. urlParams_ gensupport.URLParams
  3241. ctx_ context.Context
  3242. }
  3243. // DeleteBook: Remove the book and its contents
  3244. func (r *CloudloadingService) DeleteBook(volumeId string) *CloudloadingDeleteBookCall {
  3245. c := &CloudloadingDeleteBookCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  3246. c.urlParams_.Set("volumeId", volumeId)
  3247. return c
  3248. }
  3249. // Fields allows partial responses to be retrieved. See
  3250. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  3251. // for more information.
  3252. func (c *CloudloadingDeleteBookCall) Fields(s ...googleapi.Field) *CloudloadingDeleteBookCall {
  3253. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  3254. return c
  3255. }
  3256. // Context sets the context to be used in this call's Do method. Any
  3257. // pending HTTP request will be aborted if the provided context is
  3258. // canceled.
  3259. func (c *CloudloadingDeleteBookCall) Context(ctx context.Context) *CloudloadingDeleteBookCall {
  3260. c.ctx_ = ctx
  3261. return c
  3262. }
  3263. func (c *CloudloadingDeleteBookCall) doRequest(alt string) (*http.Response, error) {
  3264. var body io.Reader = nil
  3265. c.urlParams_.Set("alt", alt)
  3266. urls := googleapi.ResolveRelative(c.s.BasePath, "cloudloading/deleteBook")
  3267. urls += "?" + c.urlParams_.Encode()
  3268. req, _ := http.NewRequest("POST", urls, body)
  3269. googleapi.SetOpaque(req.URL)
  3270. req.Header.Set("User-Agent", c.s.userAgent())
  3271. if c.ctx_ != nil {
  3272. return ctxhttp.Do(c.ctx_, c.s.client, req)
  3273. }
  3274. return c.s.client.Do(req)
  3275. }
  3276. // Do executes the "books.cloudloading.deleteBook" call.
  3277. func (c *CloudloadingDeleteBookCall) Do(opts ...googleapi.CallOption) error {
  3278. gensupport.SetOptions(c.urlParams_, opts...)
  3279. res, err := c.doRequest("json")
  3280. if err != nil {
  3281. return err
  3282. }
  3283. defer googleapi.CloseBody(res)
  3284. if err := googleapi.CheckResponse(res); err != nil {
  3285. return err
  3286. }
  3287. return nil
  3288. // {
  3289. // "description": "Remove the book and its contents",
  3290. // "httpMethod": "POST",
  3291. // "id": "books.cloudloading.deleteBook",
  3292. // "parameterOrder": [
  3293. // "volumeId"
  3294. // ],
  3295. // "parameters": {
  3296. // "volumeId": {
  3297. // "description": "The id of the book to be removed.",
  3298. // "location": "query",
  3299. // "required": true,
  3300. // "type": "string"
  3301. // }
  3302. // },
  3303. // "path": "cloudloading/deleteBook",
  3304. // "scopes": [
  3305. // "https://www.googleapis.com/auth/books"
  3306. // ]
  3307. // }
  3308. }
  3309. // method id "books.cloudloading.updateBook":
  3310. type CloudloadingUpdateBookCall struct {
  3311. s *Service
  3312. bookscloudloadingresource *BooksCloudloadingResource
  3313. urlParams_ gensupport.URLParams
  3314. ctx_ context.Context
  3315. }
  3316. // UpdateBook:
  3317. func (r *CloudloadingService) UpdateBook(bookscloudloadingresource *BooksCloudloadingResource) *CloudloadingUpdateBookCall {
  3318. c := &CloudloadingUpdateBookCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  3319. c.bookscloudloadingresource = bookscloudloadingresource
  3320. return c
  3321. }
  3322. // Fields allows partial responses to be retrieved. See
  3323. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  3324. // for more information.
  3325. func (c *CloudloadingUpdateBookCall) Fields(s ...googleapi.Field) *CloudloadingUpdateBookCall {
  3326. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  3327. return c
  3328. }
  3329. // Context sets the context to be used in this call's Do method. Any
  3330. // pending HTTP request will be aborted if the provided context is
  3331. // canceled.
  3332. func (c *CloudloadingUpdateBookCall) Context(ctx context.Context) *CloudloadingUpdateBookCall {
  3333. c.ctx_ = ctx
  3334. return c
  3335. }
  3336. func (c *CloudloadingUpdateBookCall) doRequest(alt string) (*http.Response, error) {
  3337. var body io.Reader = nil
  3338. body, err := googleapi.WithoutDataWrapper.JSONReader(c.bookscloudloadingresource)
  3339. if err != nil {
  3340. return nil, err
  3341. }
  3342. ctype := "application/json"
  3343. c.urlParams_.Set("alt", alt)
  3344. urls := googleapi.ResolveRelative(c.s.BasePath, "cloudloading/updateBook")
  3345. urls += "?" + c.urlParams_.Encode()
  3346. req, _ := http.NewRequest("POST", urls, body)
  3347. googleapi.SetOpaque(req.URL)
  3348. req.Header.Set("Content-Type", ctype)
  3349. req.Header.Set("User-Agent", c.s.userAgent())
  3350. if c.ctx_ != nil {
  3351. return ctxhttp.Do(c.ctx_, c.s.client, req)
  3352. }
  3353. return c.s.client.Do(req)
  3354. }
  3355. // Do executes the "books.cloudloading.updateBook" call.
  3356. // Exactly one of *BooksCloudloadingResource or error will be non-nil.
  3357. // Any non-2xx status code is an error. Response headers are in either
  3358. // *BooksCloudloadingResource.ServerResponse.Header or (if a response
  3359. // was returned at all) in error.(*googleapi.Error).Header. Use
  3360. // googleapi.IsNotModified to check whether the returned error was
  3361. // because http.StatusNotModified was returned.
  3362. func (c *CloudloadingUpdateBookCall) Do(opts ...googleapi.CallOption) (*BooksCloudloadingResource, error) {
  3363. gensupport.SetOptions(c.urlParams_, opts...)
  3364. res, err := c.doRequest("json")
  3365. if res != nil && res.StatusCode == http.StatusNotModified {
  3366. if res.Body != nil {
  3367. res.Body.Close()
  3368. }
  3369. return nil, &googleapi.Error{
  3370. Code: res.StatusCode,
  3371. Header: res.Header,
  3372. }
  3373. }
  3374. if err != nil {
  3375. return nil, err
  3376. }
  3377. defer googleapi.CloseBody(res)
  3378. if err := googleapi.CheckResponse(res); err != nil {
  3379. return nil, err
  3380. }
  3381. ret := &BooksCloudloadingResource{
  3382. ServerResponse: googleapi.ServerResponse{
  3383. Header: res.Header,
  3384. HTTPStatusCode: res.StatusCode,
  3385. },
  3386. }
  3387. if err := json.NewDecoder(res.Body).Decode(&ret); err != nil {
  3388. return nil, err
  3389. }
  3390. return ret, nil
  3391. // {
  3392. // "description": "",
  3393. // "httpMethod": "POST",
  3394. // "id": "books.cloudloading.updateBook",
  3395. // "path": "cloudloading/updateBook",
  3396. // "request": {
  3397. // "$ref": "BooksCloudloadingResource"
  3398. // },
  3399. // "response": {
  3400. // "$ref": "BooksCloudloadingResource"
  3401. // },
  3402. // "scopes": [
  3403. // "https://www.googleapis.com/auth/books"
  3404. // ]
  3405. // }
  3406. }
  3407. // method id "books.dictionary.listOfflineMetadata":
  3408. type DictionaryListOfflineMetadataCall struct {
  3409. s *Service
  3410. urlParams_ gensupport.URLParams
  3411. ifNoneMatch_ string
  3412. ctx_ context.Context
  3413. }
  3414. // ListOfflineMetadata: Returns a list of offline dictionary metadata
  3415. // available
  3416. func (r *DictionaryService) ListOfflineMetadata(cpksver string) *DictionaryListOfflineMetadataCall {
  3417. c := &DictionaryListOfflineMetadataCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  3418. c.urlParams_.Set("cpksver", cpksver)
  3419. return c
  3420. }
  3421. // Fields allows partial responses to be retrieved. See
  3422. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  3423. // for more information.
  3424. func (c *DictionaryListOfflineMetadataCall) Fields(s ...googleapi.Field) *DictionaryListOfflineMetadataCall {
  3425. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  3426. return c
  3427. }
  3428. // IfNoneMatch sets the optional parameter which makes the operation
  3429. // fail if the object's ETag matches the given value. This is useful for
  3430. // getting updates only after the object has changed since the last
  3431. // request. Use googleapi.IsNotModified to check whether the response
  3432. // error from Do is the result of In-None-Match.
  3433. func (c *DictionaryListOfflineMetadataCall) IfNoneMatch(entityTag string) *DictionaryListOfflineMetadataCall {
  3434. c.ifNoneMatch_ = entityTag
  3435. return c
  3436. }
  3437. // Context sets the context to be used in this call's Do method. Any
  3438. // pending HTTP request will be aborted if the provided context is
  3439. // canceled.
  3440. func (c *DictionaryListOfflineMetadataCall) Context(ctx context.Context) *DictionaryListOfflineMetadataCall {
  3441. c.ctx_ = ctx
  3442. return c
  3443. }
  3444. func (c *DictionaryListOfflineMetadataCall) doRequest(alt string) (*http.Response, error) {
  3445. var body io.Reader = nil
  3446. c.urlParams_.Set("alt", alt)
  3447. urls := googleapi.ResolveRelative(c.s.BasePath, "dictionary/listOfflineMetadata")
  3448. urls += "?" + c.urlParams_.Encode()
  3449. req, _ := http.NewRequest("GET", urls, body)
  3450. googleapi.SetOpaque(req.URL)
  3451. req.Header.Set("User-Agent", c.s.userAgent())
  3452. if c.ifNoneMatch_ != "" {
  3453. req.Header.Set("If-None-Match", c.ifNoneMatch_)
  3454. }
  3455. if c.ctx_ != nil {
  3456. return ctxhttp.Do(c.ctx_, c.s.client, req)
  3457. }
  3458. return c.s.client.Do(req)
  3459. }
  3460. // Do executes the "books.dictionary.listOfflineMetadata" call.
  3461. // Exactly one of *Metadata or error will be non-nil. Any non-2xx status
  3462. // code is an error. Response headers are in either
  3463. // *Metadata.ServerResponse.Header or (if a response was returned at
  3464. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  3465. // to check whether the returned error was because
  3466. // http.StatusNotModified was returned.
  3467. func (c *DictionaryListOfflineMetadataCall) Do(opts ...googleapi.CallOption) (*Metadata, error) {
  3468. gensupport.SetOptions(c.urlParams_, opts...)
  3469. res, err := c.doRequest("json")
  3470. if res != nil && res.StatusCode == http.StatusNotModified {
  3471. if res.Body != nil {
  3472. res.Body.Close()
  3473. }
  3474. return nil, &googleapi.Error{
  3475. Code: res.StatusCode,
  3476. Header: res.Header,
  3477. }
  3478. }
  3479. if err != nil {
  3480. return nil, err
  3481. }
  3482. defer googleapi.CloseBody(res)
  3483. if err := googleapi.CheckResponse(res); err != nil {
  3484. return nil, err
  3485. }
  3486. ret := &Metadata{
  3487. ServerResponse: googleapi.ServerResponse{
  3488. Header: res.Header,
  3489. HTTPStatusCode: res.StatusCode,
  3490. },
  3491. }
  3492. if err := json.NewDecoder(res.Body).Decode(&ret); err != nil {
  3493. return nil, err
  3494. }
  3495. return ret, nil
  3496. // {
  3497. // "description": "Returns a list of offline dictionary metadata available",
  3498. // "httpMethod": "GET",
  3499. // "id": "books.dictionary.listOfflineMetadata",
  3500. // "parameterOrder": [
  3501. // "cpksver"
  3502. // ],
  3503. // "parameters": {
  3504. // "cpksver": {
  3505. // "description": "The device/version ID from which to request the data.",
  3506. // "location": "query",
  3507. // "required": true,
  3508. // "type": "string"
  3509. // }
  3510. // },
  3511. // "path": "dictionary/listOfflineMetadata",
  3512. // "response": {
  3513. // "$ref": "Metadata"
  3514. // },
  3515. // "scopes": [
  3516. // "https://www.googleapis.com/auth/books"
  3517. // ]
  3518. // }
  3519. }
  3520. // method id "books.layers.get":
  3521. type LayersGetCall struct {
  3522. s *Service
  3523. volumeId string
  3524. summaryId string
  3525. urlParams_ gensupport.URLParams
  3526. ifNoneMatch_ string
  3527. ctx_ context.Context
  3528. }
  3529. // Get: Gets the layer summary for a volume.
  3530. func (r *LayersService) Get(volumeId string, summaryId string) *LayersGetCall {
  3531. c := &LayersGetCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  3532. c.volumeId = volumeId
  3533. c.summaryId = summaryId
  3534. return c
  3535. }
  3536. // ContentVersion sets the optional parameter "contentVersion": The
  3537. // content version for the requested volume.
  3538. func (c *LayersGetCall) ContentVersion(contentVersion string) *LayersGetCall {
  3539. c.urlParams_.Set("contentVersion", contentVersion)
  3540. return c
  3541. }
  3542. // Source sets the optional parameter "source": String to identify the
  3543. // originator of this request.
  3544. func (c *LayersGetCall) Source(source string) *LayersGetCall {
  3545. c.urlParams_.Set("source", source)
  3546. return c
  3547. }
  3548. // Fields allows partial responses to be retrieved. See
  3549. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  3550. // for more information.
  3551. func (c *LayersGetCall) Fields(s ...googleapi.Field) *LayersGetCall {
  3552. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  3553. return c
  3554. }
  3555. // IfNoneMatch sets the optional parameter which makes the operation
  3556. // fail if the object's ETag matches the given value. This is useful for
  3557. // getting updates only after the object has changed since the last
  3558. // request. Use googleapi.IsNotModified to check whether the response
  3559. // error from Do is the result of In-None-Match.
  3560. func (c *LayersGetCall) IfNoneMatch(entityTag string) *LayersGetCall {
  3561. c.ifNoneMatch_ = entityTag
  3562. return c
  3563. }
  3564. // Context sets the context to be used in this call's Do method. Any
  3565. // pending HTTP request will be aborted if the provided context is
  3566. // canceled.
  3567. func (c *LayersGetCall) Context(ctx context.Context) *LayersGetCall {
  3568. c.ctx_ = ctx
  3569. return c
  3570. }
  3571. func (c *LayersGetCall) doRequest(alt string) (*http.Response, error) {
  3572. var body io.Reader = nil
  3573. c.urlParams_.Set("alt", alt)
  3574. urls := googleapi.ResolveRelative(c.s.BasePath, "volumes/{volumeId}/layersummary/{summaryId}")
  3575. urls += "?" + c.urlParams_.Encode()
  3576. req, _ := http.NewRequest("GET", urls, body)
  3577. googleapi.Expand(req.URL, map[string]string{
  3578. "volumeId": c.volumeId,
  3579. "summaryId": c.summaryId,
  3580. })
  3581. req.Header.Set("User-Agent", c.s.userAgent())
  3582. if c.ifNoneMatch_ != "" {
  3583. req.Header.Set("If-None-Match", c.ifNoneMatch_)
  3584. }
  3585. if c.ctx_ != nil {
  3586. return ctxhttp.Do(c.ctx_, c.s.client, req)
  3587. }
  3588. return c.s.client.Do(req)
  3589. }
  3590. // Do executes the "books.layers.get" call.
  3591. // Exactly one of *Layersummary or error will be non-nil. Any non-2xx
  3592. // status code is an error. Response headers are in either
  3593. // *Layersummary.ServerResponse.Header or (if a response was returned at
  3594. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  3595. // to check whether the returned error was because
  3596. // http.StatusNotModified was returned.
  3597. func (c *LayersGetCall) Do(opts ...googleapi.CallOption) (*Layersummary, error) {
  3598. gensupport.SetOptions(c.urlParams_, opts...)
  3599. res, err := c.doRequest("json")
  3600. if res != nil && res.StatusCode == http.StatusNotModified {
  3601. if res.Body != nil {
  3602. res.Body.Close()
  3603. }
  3604. return nil, &googleapi.Error{
  3605. Code: res.StatusCode,
  3606. Header: res.Header,
  3607. }
  3608. }
  3609. if err != nil {
  3610. return nil, err
  3611. }
  3612. defer googleapi.CloseBody(res)
  3613. if err := googleapi.CheckResponse(res); err != nil {
  3614. return nil, err
  3615. }
  3616. ret := &Layersummary{
  3617. ServerResponse: googleapi.ServerResponse{
  3618. Header: res.Header,
  3619. HTTPStatusCode: res.StatusCode,
  3620. },
  3621. }
  3622. if err := json.NewDecoder(res.Body).Decode(&ret); err != nil {
  3623. return nil, err
  3624. }
  3625. return ret, nil
  3626. // {
  3627. // "description": "Gets the layer summary for a volume.",
  3628. // "httpMethod": "GET",
  3629. // "id": "books.layers.get",
  3630. // "parameterOrder": [
  3631. // "volumeId",
  3632. // "summaryId"
  3633. // ],
  3634. // "parameters": {
  3635. // "contentVersion": {
  3636. // "description": "The content version for the requested volume.",
  3637. // "location": "query",
  3638. // "type": "string"
  3639. // },
  3640. // "source": {
  3641. // "description": "String to identify the originator of this request.",
  3642. // "location": "query",
  3643. // "type": "string"
  3644. // },
  3645. // "summaryId": {
  3646. // "description": "The ID for the layer to get the summary for.",
  3647. // "location": "path",
  3648. // "required": true,
  3649. // "type": "string"
  3650. // },
  3651. // "volumeId": {
  3652. // "description": "The volume to retrieve layers for.",
  3653. // "location": "path",
  3654. // "required": true,
  3655. // "type": "string"
  3656. // }
  3657. // },
  3658. // "path": "volumes/{volumeId}/layersummary/{summaryId}",
  3659. // "response": {
  3660. // "$ref": "Layersummary"
  3661. // },
  3662. // "scopes": [
  3663. // "https://www.googleapis.com/auth/books"
  3664. // ]
  3665. // }
  3666. }
  3667. // method id "books.layers.list":
  3668. type LayersListCall struct {
  3669. s *Service
  3670. volumeId string
  3671. urlParams_ gensupport.URLParams
  3672. ifNoneMatch_ string
  3673. ctx_ context.Context
  3674. }
  3675. // List: List the layer summaries for a volume.
  3676. func (r *LayersService) List(volumeId string) *LayersListCall {
  3677. c := &LayersListCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  3678. c.volumeId = volumeId
  3679. return c
  3680. }
  3681. // ContentVersion sets the optional parameter "contentVersion": The
  3682. // content version for the requested volume.
  3683. func (c *LayersListCall) ContentVersion(contentVersion string) *LayersListCall {
  3684. c.urlParams_.Set("contentVersion", contentVersion)
  3685. return c
  3686. }
  3687. // MaxResults sets the optional parameter "maxResults": Maximum number
  3688. // of results to return
  3689. func (c *LayersListCall) MaxResults(maxResults int64) *LayersListCall {
  3690. c.urlParams_.Set("maxResults", fmt.Sprint(maxResults))
  3691. return c
  3692. }
  3693. // PageToken sets the optional parameter "pageToken": The value of the
  3694. // nextToken from the previous page.
  3695. func (c *LayersListCall) PageToken(pageToken string) *LayersListCall {
  3696. c.urlParams_.Set("pageToken", pageToken)
  3697. return c
  3698. }
  3699. // Source sets the optional parameter "source": String to identify the
  3700. // originator of this request.
  3701. func (c *LayersListCall) Source(source string) *LayersListCall {
  3702. c.urlParams_.Set("source", source)
  3703. return c
  3704. }
  3705. // Fields allows partial responses to be retrieved. See
  3706. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  3707. // for more information.
  3708. func (c *LayersListCall) Fields(s ...googleapi.Field) *LayersListCall {
  3709. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  3710. return c
  3711. }
  3712. // IfNoneMatch sets the optional parameter which makes the operation
  3713. // fail if the object's ETag matches the given value. This is useful for
  3714. // getting updates only after the object has changed since the last
  3715. // request. Use googleapi.IsNotModified to check whether the response
  3716. // error from Do is the result of In-None-Match.
  3717. func (c *LayersListCall) IfNoneMatch(entityTag string) *LayersListCall {
  3718. c.ifNoneMatch_ = entityTag
  3719. return c
  3720. }
  3721. // Context sets the context to be used in this call's Do method. Any
  3722. // pending HTTP request will be aborted if the provided context is
  3723. // canceled.
  3724. func (c *LayersListCall) Context(ctx context.Context) *LayersListCall {
  3725. c.ctx_ = ctx
  3726. return c
  3727. }
  3728. func (c *LayersListCall) doRequest(alt string) (*http.Response, error) {
  3729. var body io.Reader = nil
  3730. c.urlParams_.Set("alt", alt)
  3731. urls := googleapi.ResolveRelative(c.s.BasePath, "volumes/{volumeId}/layersummary")
  3732. urls += "?" + c.urlParams_.Encode()
  3733. req, _ := http.NewRequest("GET", urls, body)
  3734. googleapi.Expand(req.URL, map[string]string{
  3735. "volumeId": c.volumeId,
  3736. })
  3737. req.Header.Set("User-Agent", c.s.userAgent())
  3738. if c.ifNoneMatch_ != "" {
  3739. req.Header.Set("If-None-Match", c.ifNoneMatch_)
  3740. }
  3741. if c.ctx_ != nil {
  3742. return ctxhttp.Do(c.ctx_, c.s.client, req)
  3743. }
  3744. return c.s.client.Do(req)
  3745. }
  3746. // Do executes the "books.layers.list" call.
  3747. // Exactly one of *Layersummaries or error will be non-nil. Any non-2xx
  3748. // status code is an error. Response headers are in either
  3749. // *Layersummaries.ServerResponse.Header or (if a response was returned
  3750. // at all) in error.(*googleapi.Error).Header. Use
  3751. // googleapi.IsNotModified to check whether the returned error was
  3752. // because http.StatusNotModified was returned.
  3753. func (c *LayersListCall) Do(opts ...googleapi.CallOption) (*Layersummaries, error) {
  3754. gensupport.SetOptions(c.urlParams_, opts...)
  3755. res, err := c.doRequest("json")
  3756. if res != nil && res.StatusCode == http.StatusNotModified {
  3757. if res.Body != nil {
  3758. res.Body.Close()
  3759. }
  3760. return nil, &googleapi.Error{
  3761. Code: res.StatusCode,
  3762. Header: res.Header,
  3763. }
  3764. }
  3765. if err != nil {
  3766. return nil, err
  3767. }
  3768. defer googleapi.CloseBody(res)
  3769. if err := googleapi.CheckResponse(res); err != nil {
  3770. return nil, err
  3771. }
  3772. ret := &Layersummaries{
  3773. ServerResponse: googleapi.ServerResponse{
  3774. Header: res.Header,
  3775. HTTPStatusCode: res.StatusCode,
  3776. },
  3777. }
  3778. if err := json.NewDecoder(res.Body).Decode(&ret); err != nil {
  3779. return nil, err
  3780. }
  3781. return ret, nil
  3782. // {
  3783. // "description": "List the layer summaries for a volume.",
  3784. // "httpMethod": "GET",
  3785. // "id": "books.layers.list",
  3786. // "parameterOrder": [
  3787. // "volumeId"
  3788. // ],
  3789. // "parameters": {
  3790. // "contentVersion": {
  3791. // "description": "The content version for the requested volume.",
  3792. // "location": "query",
  3793. // "type": "string"
  3794. // },
  3795. // "maxResults": {
  3796. // "description": "Maximum number of results to return",
  3797. // "format": "uint32",
  3798. // "location": "query",
  3799. // "maximum": "200",
  3800. // "minimum": "0",
  3801. // "type": "integer"
  3802. // },
  3803. // "pageToken": {
  3804. // "description": "The value of the nextToken from the previous page.",
  3805. // "location": "query",
  3806. // "type": "string"
  3807. // },
  3808. // "source": {
  3809. // "description": "String to identify the originator of this request.",
  3810. // "location": "query",
  3811. // "type": "string"
  3812. // },
  3813. // "volumeId": {
  3814. // "description": "The volume to retrieve layers for.",
  3815. // "location": "path",
  3816. // "required": true,
  3817. // "type": "string"
  3818. // }
  3819. // },
  3820. // "path": "volumes/{volumeId}/layersummary",
  3821. // "response": {
  3822. // "$ref": "Layersummaries"
  3823. // },
  3824. // "scopes": [
  3825. // "https://www.googleapis.com/auth/books"
  3826. // ]
  3827. // }
  3828. }
  3829. // method id "books.layers.annotationData.get":
  3830. type LayersAnnotationDataGetCall struct {
  3831. s *Service
  3832. volumeId string
  3833. layerId string
  3834. annotationDataId string
  3835. urlParams_ gensupport.URLParams
  3836. ifNoneMatch_ string
  3837. ctx_ context.Context
  3838. }
  3839. // Get: Gets the annotation data.
  3840. func (r *LayersAnnotationDataService) Get(volumeId string, layerId string, annotationDataId string, contentVersion string) *LayersAnnotationDataGetCall {
  3841. c := &LayersAnnotationDataGetCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  3842. c.volumeId = volumeId
  3843. c.layerId = layerId
  3844. c.annotationDataId = annotationDataId
  3845. c.urlParams_.Set("contentVersion", contentVersion)
  3846. return c
  3847. }
  3848. // AllowWebDefinitions sets the optional parameter
  3849. // "allowWebDefinitions": For the dictionary layer. Whether or not to
  3850. // allow web definitions.
  3851. func (c *LayersAnnotationDataGetCall) AllowWebDefinitions(allowWebDefinitions bool) *LayersAnnotationDataGetCall {
  3852. c.urlParams_.Set("allowWebDefinitions", fmt.Sprint(allowWebDefinitions))
  3853. return c
  3854. }
  3855. // H sets the optional parameter "h": The requested pixel height for any
  3856. // images. If height is provided width must also be provided.
  3857. func (c *LayersAnnotationDataGetCall) H(h int64) *LayersAnnotationDataGetCall {
  3858. c.urlParams_.Set("h", fmt.Sprint(h))
  3859. return c
  3860. }
  3861. // Locale sets the optional parameter "locale": The locale information
  3862. // for the data. ISO-639-1 language and ISO-3166-1 country code. Ex:
  3863. // 'en_US'.
  3864. func (c *LayersAnnotationDataGetCall) Locale(locale string) *LayersAnnotationDataGetCall {
  3865. c.urlParams_.Set("locale", locale)
  3866. return c
  3867. }
  3868. // Scale sets the optional parameter "scale": The requested scale for
  3869. // the image.
  3870. func (c *LayersAnnotationDataGetCall) Scale(scale int64) *LayersAnnotationDataGetCall {
  3871. c.urlParams_.Set("scale", fmt.Sprint(scale))
  3872. return c
  3873. }
  3874. // Source sets the optional parameter "source": String to identify the
  3875. // originator of this request.
  3876. func (c *LayersAnnotationDataGetCall) Source(source string) *LayersAnnotationDataGetCall {
  3877. c.urlParams_.Set("source", source)
  3878. return c
  3879. }
  3880. // W sets the optional parameter "w": The requested pixel width for any
  3881. // images. If width is provided height must also be provided.
  3882. func (c *LayersAnnotationDataGetCall) W(w int64) *LayersAnnotationDataGetCall {
  3883. c.urlParams_.Set("w", fmt.Sprint(w))
  3884. return c
  3885. }
  3886. // Fields allows partial responses to be retrieved. See
  3887. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  3888. // for more information.
  3889. func (c *LayersAnnotationDataGetCall) Fields(s ...googleapi.Field) *LayersAnnotationDataGetCall {
  3890. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  3891. return c
  3892. }
  3893. // IfNoneMatch sets the optional parameter which makes the operation
  3894. // fail if the object's ETag matches the given value. This is useful for
  3895. // getting updates only after the object has changed since the last
  3896. // request. Use googleapi.IsNotModified to check whether the response
  3897. // error from Do is the result of In-None-Match.
  3898. func (c *LayersAnnotationDataGetCall) IfNoneMatch(entityTag string) *LayersAnnotationDataGetCall {
  3899. c.ifNoneMatch_ = entityTag
  3900. return c
  3901. }
  3902. // Context sets the context to be used in this call's Do method. Any
  3903. // pending HTTP request will be aborted if the provided context is
  3904. // canceled.
  3905. func (c *LayersAnnotationDataGetCall) Context(ctx context.Context) *LayersAnnotationDataGetCall {
  3906. c.ctx_ = ctx
  3907. return c
  3908. }
  3909. func (c *LayersAnnotationDataGetCall) doRequest(alt string) (*http.Response, error) {
  3910. var body io.Reader = nil
  3911. c.urlParams_.Set("alt", alt)
  3912. urls := googleapi.ResolveRelative(c.s.BasePath, "volumes/{volumeId}/layers/{layerId}/data/{annotationDataId}")
  3913. urls += "?" + c.urlParams_.Encode()
  3914. req, _ := http.NewRequest("GET", urls, body)
  3915. googleapi.Expand(req.URL, map[string]string{
  3916. "volumeId": c.volumeId,
  3917. "layerId": c.layerId,
  3918. "annotationDataId": c.annotationDataId,
  3919. })
  3920. req.Header.Set("User-Agent", c.s.userAgent())
  3921. if c.ifNoneMatch_ != "" {
  3922. req.Header.Set("If-None-Match", c.ifNoneMatch_)
  3923. }
  3924. if c.ctx_ != nil {
  3925. return ctxhttp.Do(c.ctx_, c.s.client, req)
  3926. }
  3927. return c.s.client.Do(req)
  3928. }
  3929. // Do executes the "books.layers.annotationData.get" call.
  3930. // Exactly one of *Annotationdata or error will be non-nil. Any non-2xx
  3931. // status code is an error. Response headers are in either
  3932. // *Annotationdata.ServerResponse.Header or (if a response was returned
  3933. // at all) in error.(*googleapi.Error).Header. Use
  3934. // googleapi.IsNotModified to check whether the returned error was
  3935. // because http.StatusNotModified was returned.
  3936. func (c *LayersAnnotationDataGetCall) Do(opts ...googleapi.CallOption) (*Annotationdata, error) {
  3937. gensupport.SetOptions(c.urlParams_, opts...)
  3938. res, err := c.doRequest("json")
  3939. if res != nil && res.StatusCode == http.StatusNotModified {
  3940. if res.Body != nil {
  3941. res.Body.Close()
  3942. }
  3943. return nil, &googleapi.Error{
  3944. Code: res.StatusCode,
  3945. Header: res.Header,
  3946. }
  3947. }
  3948. if err != nil {
  3949. return nil, err
  3950. }
  3951. defer googleapi.CloseBody(res)
  3952. if err := googleapi.CheckResponse(res); err != nil {
  3953. return nil, err
  3954. }
  3955. ret := &Annotationdata{
  3956. ServerResponse: googleapi.ServerResponse{
  3957. Header: res.Header,
  3958. HTTPStatusCode: res.StatusCode,
  3959. },
  3960. }
  3961. if err := json.NewDecoder(res.Body).Decode(&ret); err != nil {
  3962. return nil, err
  3963. }
  3964. return ret, nil
  3965. // {
  3966. // "description": "Gets the annotation data.",
  3967. // "httpMethod": "GET",
  3968. // "id": "books.layers.annotationData.get",
  3969. // "parameterOrder": [
  3970. // "volumeId",
  3971. // "layerId",
  3972. // "annotationDataId",
  3973. // "contentVersion"
  3974. // ],
  3975. // "parameters": {
  3976. // "allowWebDefinitions": {
  3977. // "description": "For the dictionary layer. Whether or not to allow web definitions.",
  3978. // "location": "query",
  3979. // "type": "boolean"
  3980. // },
  3981. // "annotationDataId": {
  3982. // "description": "The ID of the annotation data to retrieve.",
  3983. // "location": "path",
  3984. // "required": true,
  3985. // "type": "string"
  3986. // },
  3987. // "contentVersion": {
  3988. // "description": "The content version for the volume you are trying to retrieve.",
  3989. // "location": "query",
  3990. // "required": true,
  3991. // "type": "string"
  3992. // },
  3993. // "h": {
  3994. // "description": "The requested pixel height for any images. If height is provided width must also be provided.",
  3995. // "format": "int32",
  3996. // "location": "query",
  3997. // "type": "integer"
  3998. // },
  3999. // "layerId": {
  4000. // "description": "The ID for the layer to get the annotations.",
  4001. // "location": "path",
  4002. // "required": true,
  4003. // "type": "string"
  4004. // },
  4005. // "locale": {
  4006. // "description": "The locale information for the data. ISO-639-1 language and ISO-3166-1 country code. Ex: 'en_US'.",
  4007. // "location": "query",
  4008. // "type": "string"
  4009. // },
  4010. // "scale": {
  4011. // "description": "The requested scale for the image.",
  4012. // "format": "int32",
  4013. // "location": "query",
  4014. // "minimum": "0",
  4015. // "type": "integer"
  4016. // },
  4017. // "source": {
  4018. // "description": "String to identify the originator of this request.",
  4019. // "location": "query",
  4020. // "type": "string"
  4021. // },
  4022. // "volumeId": {
  4023. // "description": "The volume to retrieve annotations for.",
  4024. // "location": "path",
  4025. // "required": true,
  4026. // "type": "string"
  4027. // },
  4028. // "w": {
  4029. // "description": "The requested pixel width for any images. If width is provided height must also be provided.",
  4030. // "format": "int32",
  4031. // "location": "query",
  4032. // "type": "integer"
  4033. // }
  4034. // },
  4035. // "path": "volumes/{volumeId}/layers/{layerId}/data/{annotationDataId}",
  4036. // "response": {
  4037. // "$ref": "Annotationdata"
  4038. // },
  4039. // "scopes": [
  4040. // "https://www.googleapis.com/auth/books"
  4041. // ]
  4042. // }
  4043. }
  4044. // method id "books.layers.annotationData.list":
  4045. type LayersAnnotationDataListCall struct {
  4046. s *Service
  4047. volumeId string
  4048. layerId string
  4049. urlParams_ gensupport.URLParams
  4050. ifNoneMatch_ string
  4051. ctx_ context.Context
  4052. }
  4053. // List: Gets the annotation data for a volume and layer.
  4054. func (r *LayersAnnotationDataService) List(volumeId string, layerId string, contentVersion string) *LayersAnnotationDataListCall {
  4055. c := &LayersAnnotationDataListCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  4056. c.volumeId = volumeId
  4057. c.layerId = layerId
  4058. c.urlParams_.Set("contentVersion", contentVersion)
  4059. return c
  4060. }
  4061. // AnnotationDataId sets the optional parameter "annotationDataId": The
  4062. // list of Annotation Data Ids to retrieve. Pagination is ignored if
  4063. // this is set.
  4064. func (c *LayersAnnotationDataListCall) AnnotationDataId(annotationDataId ...string) *LayersAnnotationDataListCall {
  4065. c.urlParams_.SetMulti("annotationDataId", append([]string{}, annotationDataId...))
  4066. return c
  4067. }
  4068. // H sets the optional parameter "h": The requested pixel height for any
  4069. // images. If height is provided width must also be provided.
  4070. func (c *LayersAnnotationDataListCall) H(h int64) *LayersAnnotationDataListCall {
  4071. c.urlParams_.Set("h", fmt.Sprint(h))
  4072. return c
  4073. }
  4074. // Locale sets the optional parameter "locale": The locale information
  4075. // for the data. ISO-639-1 language and ISO-3166-1 country code. Ex:
  4076. // 'en_US'.
  4077. func (c *LayersAnnotationDataListCall) Locale(locale string) *LayersAnnotationDataListCall {
  4078. c.urlParams_.Set("locale", locale)
  4079. return c
  4080. }
  4081. // MaxResults sets the optional parameter "maxResults": Maximum number
  4082. // of results to return
  4083. func (c *LayersAnnotationDataListCall) MaxResults(maxResults int64) *LayersAnnotationDataListCall {
  4084. c.urlParams_.Set("maxResults", fmt.Sprint(maxResults))
  4085. return c
  4086. }
  4087. // PageToken sets the optional parameter "pageToken": The value of the
  4088. // nextToken from the previous page.
  4089. func (c *LayersAnnotationDataListCall) PageToken(pageToken string) *LayersAnnotationDataListCall {
  4090. c.urlParams_.Set("pageToken", pageToken)
  4091. return c
  4092. }
  4093. // Scale sets the optional parameter "scale": The requested scale for
  4094. // the image.
  4095. func (c *LayersAnnotationDataListCall) Scale(scale int64) *LayersAnnotationDataListCall {
  4096. c.urlParams_.Set("scale", fmt.Sprint(scale))
  4097. return c
  4098. }
  4099. // Source sets the optional parameter "source": String to identify the
  4100. // originator of this request.
  4101. func (c *LayersAnnotationDataListCall) Source(source string) *LayersAnnotationDataListCall {
  4102. c.urlParams_.Set("source", source)
  4103. return c
  4104. }
  4105. // UpdatedMax sets the optional parameter "updatedMax": RFC 3339
  4106. // timestamp to restrict to items updated prior to this timestamp
  4107. // (exclusive).
  4108. func (c *LayersAnnotationDataListCall) UpdatedMax(updatedMax string) *LayersAnnotationDataListCall {
  4109. c.urlParams_.Set("updatedMax", updatedMax)
  4110. return c
  4111. }
  4112. // UpdatedMin sets the optional parameter "updatedMin": RFC 3339
  4113. // timestamp to restrict to items updated since this timestamp
  4114. // (inclusive).
  4115. func (c *LayersAnnotationDataListCall) UpdatedMin(updatedMin string) *LayersAnnotationDataListCall {
  4116. c.urlParams_.Set("updatedMin", updatedMin)
  4117. return c
  4118. }
  4119. // W sets the optional parameter "w": The requested pixel width for any
  4120. // images. If width is provided height must also be provided.
  4121. func (c *LayersAnnotationDataListCall) W(w int64) *LayersAnnotationDataListCall {
  4122. c.urlParams_.Set("w", fmt.Sprint(w))
  4123. return c
  4124. }
  4125. // Fields allows partial responses to be retrieved. See
  4126. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  4127. // for more information.
  4128. func (c *LayersAnnotationDataListCall) Fields(s ...googleapi.Field) *LayersAnnotationDataListCall {
  4129. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  4130. return c
  4131. }
  4132. // IfNoneMatch sets the optional parameter which makes the operation
  4133. // fail if the object's ETag matches the given value. This is useful for
  4134. // getting updates only after the object has changed since the last
  4135. // request. Use googleapi.IsNotModified to check whether the response
  4136. // error from Do is the result of In-None-Match.
  4137. func (c *LayersAnnotationDataListCall) IfNoneMatch(entityTag string) *LayersAnnotationDataListCall {
  4138. c.ifNoneMatch_ = entityTag
  4139. return c
  4140. }
  4141. // Context sets the context to be used in this call's Do method. Any
  4142. // pending HTTP request will be aborted if the provided context is
  4143. // canceled.
  4144. func (c *LayersAnnotationDataListCall) Context(ctx context.Context) *LayersAnnotationDataListCall {
  4145. c.ctx_ = ctx
  4146. return c
  4147. }
  4148. func (c *LayersAnnotationDataListCall) doRequest(alt string) (*http.Response, error) {
  4149. var body io.Reader = nil
  4150. c.urlParams_.Set("alt", alt)
  4151. urls := googleapi.ResolveRelative(c.s.BasePath, "volumes/{volumeId}/layers/{layerId}/data")
  4152. urls += "?" + c.urlParams_.Encode()
  4153. req, _ := http.NewRequest("GET", urls, body)
  4154. googleapi.Expand(req.URL, map[string]string{
  4155. "volumeId": c.volumeId,
  4156. "layerId": c.layerId,
  4157. })
  4158. req.Header.Set("User-Agent", c.s.userAgent())
  4159. if c.ifNoneMatch_ != "" {
  4160. req.Header.Set("If-None-Match", c.ifNoneMatch_)
  4161. }
  4162. if c.ctx_ != nil {
  4163. return ctxhttp.Do(c.ctx_, c.s.client, req)
  4164. }
  4165. return c.s.client.Do(req)
  4166. }
  4167. // Do executes the "books.layers.annotationData.list" call.
  4168. // Exactly one of *Annotationsdata or error will be non-nil. Any non-2xx
  4169. // status code is an error. Response headers are in either
  4170. // *Annotationsdata.ServerResponse.Header or (if a response was returned
  4171. // at all) in error.(*googleapi.Error).Header. Use
  4172. // googleapi.IsNotModified to check whether the returned error was
  4173. // because http.StatusNotModified was returned.
  4174. func (c *LayersAnnotationDataListCall) Do(opts ...googleapi.CallOption) (*Annotationsdata, error) {
  4175. gensupport.SetOptions(c.urlParams_, opts...)
  4176. res, err := c.doRequest("json")
  4177. if res != nil && res.StatusCode == http.StatusNotModified {
  4178. if res.Body != nil {
  4179. res.Body.Close()
  4180. }
  4181. return nil, &googleapi.Error{
  4182. Code: res.StatusCode,
  4183. Header: res.Header,
  4184. }
  4185. }
  4186. if err != nil {
  4187. return nil, err
  4188. }
  4189. defer googleapi.CloseBody(res)
  4190. if err := googleapi.CheckResponse(res); err != nil {
  4191. return nil, err
  4192. }
  4193. ret := &Annotationsdata{
  4194. ServerResponse: googleapi.ServerResponse{
  4195. Header: res.Header,
  4196. HTTPStatusCode: res.StatusCode,
  4197. },
  4198. }
  4199. if err := json.NewDecoder(res.Body).Decode(&ret); err != nil {
  4200. return nil, err
  4201. }
  4202. return ret, nil
  4203. // {
  4204. // "description": "Gets the annotation data for a volume and layer.",
  4205. // "httpMethod": "GET",
  4206. // "id": "books.layers.annotationData.list",
  4207. // "parameterOrder": [
  4208. // "volumeId",
  4209. // "layerId",
  4210. // "contentVersion"
  4211. // ],
  4212. // "parameters": {
  4213. // "annotationDataId": {
  4214. // "description": "The list of Annotation Data Ids to retrieve. Pagination is ignored if this is set.",
  4215. // "location": "query",
  4216. // "repeated": true,
  4217. // "type": "string"
  4218. // },
  4219. // "contentVersion": {
  4220. // "description": "The content version for the requested volume.",
  4221. // "location": "query",
  4222. // "required": true,
  4223. // "type": "string"
  4224. // },
  4225. // "h": {
  4226. // "description": "The requested pixel height for any images. If height is provided width must also be provided.",
  4227. // "format": "int32",
  4228. // "location": "query",
  4229. // "type": "integer"
  4230. // },
  4231. // "layerId": {
  4232. // "description": "The ID for the layer to get the annotation data.",
  4233. // "location": "path",
  4234. // "required": true,
  4235. // "type": "string"
  4236. // },
  4237. // "locale": {
  4238. // "description": "The locale information for the data. ISO-639-1 language and ISO-3166-1 country code. Ex: 'en_US'.",
  4239. // "location": "query",
  4240. // "type": "string"
  4241. // },
  4242. // "maxResults": {
  4243. // "description": "Maximum number of results to return",
  4244. // "format": "uint32",
  4245. // "location": "query",
  4246. // "maximum": "200",
  4247. // "minimum": "0",
  4248. // "type": "integer"
  4249. // },
  4250. // "pageToken": {
  4251. // "description": "The value of the nextToken from the previous page.",
  4252. // "location": "query",
  4253. // "type": "string"
  4254. // },
  4255. // "scale": {
  4256. // "description": "The requested scale for the image.",
  4257. // "format": "int32",
  4258. // "location": "query",
  4259. // "minimum": "0",
  4260. // "type": "integer"
  4261. // },
  4262. // "source": {
  4263. // "description": "String to identify the originator of this request.",
  4264. // "location": "query",
  4265. // "type": "string"
  4266. // },
  4267. // "updatedMax": {
  4268. // "description": "RFC 3339 timestamp to restrict to items updated prior to this timestamp (exclusive).",
  4269. // "location": "query",
  4270. // "type": "string"
  4271. // },
  4272. // "updatedMin": {
  4273. // "description": "RFC 3339 timestamp to restrict to items updated since this timestamp (inclusive).",
  4274. // "location": "query",
  4275. // "type": "string"
  4276. // },
  4277. // "volumeId": {
  4278. // "description": "The volume to retrieve annotation data for.",
  4279. // "location": "path",
  4280. // "required": true,
  4281. // "type": "string"
  4282. // },
  4283. // "w": {
  4284. // "description": "The requested pixel width for any images. If width is provided height must also be provided.",
  4285. // "format": "int32",
  4286. // "location": "query",
  4287. // "type": "integer"
  4288. // }
  4289. // },
  4290. // "path": "volumes/{volumeId}/layers/{layerId}/data",
  4291. // "response": {
  4292. // "$ref": "Annotationsdata"
  4293. // },
  4294. // "scopes": [
  4295. // "https://www.googleapis.com/auth/books"
  4296. // ]
  4297. // }
  4298. }
  4299. // Pages invokes f for each page of results.
  4300. // A non-nil error returned from f will halt the iteration.
  4301. // The provided context supersedes any context provided to the Context method.
  4302. func (c *LayersAnnotationDataListCall) Pages(ctx context.Context, f func(*Annotationsdata) error) error {
  4303. c.ctx_ = ctx
  4304. defer c.PageToken(c.urlParams_.Get("pageToken")) // reset paging to original point
  4305. for {
  4306. x, err := c.Do()
  4307. if err != nil {
  4308. return err
  4309. }
  4310. if err := f(x); err != nil {
  4311. return err
  4312. }
  4313. if x.NextPageToken == "" {
  4314. return nil
  4315. }
  4316. c.PageToken(x.NextPageToken)
  4317. }
  4318. }
  4319. // method id "books.layers.volumeAnnotations.get":
  4320. type LayersVolumeAnnotationsGetCall struct {
  4321. s *Service
  4322. volumeId string
  4323. layerId string
  4324. annotationId string
  4325. urlParams_ gensupport.URLParams
  4326. ifNoneMatch_ string
  4327. ctx_ context.Context
  4328. }
  4329. // Get: Gets the volume annotation.
  4330. func (r *LayersVolumeAnnotationsService) Get(volumeId string, layerId string, annotationId string) *LayersVolumeAnnotationsGetCall {
  4331. c := &LayersVolumeAnnotationsGetCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  4332. c.volumeId = volumeId
  4333. c.layerId = layerId
  4334. c.annotationId = annotationId
  4335. return c
  4336. }
  4337. // Locale sets the optional parameter "locale": The locale information
  4338. // for the data. ISO-639-1 language and ISO-3166-1 country code. Ex:
  4339. // 'en_US'.
  4340. func (c *LayersVolumeAnnotationsGetCall) Locale(locale string) *LayersVolumeAnnotationsGetCall {
  4341. c.urlParams_.Set("locale", locale)
  4342. return c
  4343. }
  4344. // Source sets the optional parameter "source": String to identify the
  4345. // originator of this request.
  4346. func (c *LayersVolumeAnnotationsGetCall) Source(source string) *LayersVolumeAnnotationsGetCall {
  4347. c.urlParams_.Set("source", source)
  4348. return c
  4349. }
  4350. // Fields allows partial responses to be retrieved. See
  4351. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  4352. // for more information.
  4353. func (c *LayersVolumeAnnotationsGetCall) Fields(s ...googleapi.Field) *LayersVolumeAnnotationsGetCall {
  4354. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  4355. return c
  4356. }
  4357. // IfNoneMatch sets the optional parameter which makes the operation
  4358. // fail if the object's ETag matches the given value. This is useful for
  4359. // getting updates only after the object has changed since the last
  4360. // request. Use googleapi.IsNotModified to check whether the response
  4361. // error from Do is the result of In-None-Match.
  4362. func (c *LayersVolumeAnnotationsGetCall) IfNoneMatch(entityTag string) *LayersVolumeAnnotationsGetCall {
  4363. c.ifNoneMatch_ = entityTag
  4364. return c
  4365. }
  4366. // Context sets the context to be used in this call's Do method. Any
  4367. // pending HTTP request will be aborted if the provided context is
  4368. // canceled.
  4369. func (c *LayersVolumeAnnotationsGetCall) Context(ctx context.Context) *LayersVolumeAnnotationsGetCall {
  4370. c.ctx_ = ctx
  4371. return c
  4372. }
  4373. func (c *LayersVolumeAnnotationsGetCall) doRequest(alt string) (*http.Response, error) {
  4374. var body io.Reader = nil
  4375. c.urlParams_.Set("alt", alt)
  4376. urls := googleapi.ResolveRelative(c.s.BasePath, "volumes/{volumeId}/layers/{layerId}/annotations/{annotationId}")
  4377. urls += "?" + c.urlParams_.Encode()
  4378. req, _ := http.NewRequest("GET", urls, body)
  4379. googleapi.Expand(req.URL, map[string]string{
  4380. "volumeId": c.volumeId,
  4381. "layerId": c.layerId,
  4382. "annotationId": c.annotationId,
  4383. })
  4384. req.Header.Set("User-Agent", c.s.userAgent())
  4385. if c.ifNoneMatch_ != "" {
  4386. req.Header.Set("If-None-Match", c.ifNoneMatch_)
  4387. }
  4388. if c.ctx_ != nil {
  4389. return ctxhttp.Do(c.ctx_, c.s.client, req)
  4390. }
  4391. return c.s.client.Do(req)
  4392. }
  4393. // Do executes the "books.layers.volumeAnnotations.get" call.
  4394. // Exactly one of *Volumeannotation or error will be non-nil. Any
  4395. // non-2xx status code is an error. Response headers are in either
  4396. // *Volumeannotation.ServerResponse.Header or (if a response was
  4397. // returned at all) in error.(*googleapi.Error).Header. Use
  4398. // googleapi.IsNotModified to check whether the returned error was
  4399. // because http.StatusNotModified was returned.
  4400. func (c *LayersVolumeAnnotationsGetCall) Do(opts ...googleapi.CallOption) (*Volumeannotation, error) {
  4401. gensupport.SetOptions(c.urlParams_, opts...)
  4402. res, err := c.doRequest("json")
  4403. if res != nil && res.StatusCode == http.StatusNotModified {
  4404. if res.Body != nil {
  4405. res.Body.Close()
  4406. }
  4407. return nil, &googleapi.Error{
  4408. Code: res.StatusCode,
  4409. Header: res.Header,
  4410. }
  4411. }
  4412. if err != nil {
  4413. return nil, err
  4414. }
  4415. defer googleapi.CloseBody(res)
  4416. if err := googleapi.CheckResponse(res); err != nil {
  4417. return nil, err
  4418. }
  4419. ret := &Volumeannotation{
  4420. ServerResponse: googleapi.ServerResponse{
  4421. Header: res.Header,
  4422. HTTPStatusCode: res.StatusCode,
  4423. },
  4424. }
  4425. if err := json.NewDecoder(res.Body).Decode(&ret); err != nil {
  4426. return nil, err
  4427. }
  4428. return ret, nil
  4429. // {
  4430. // "description": "Gets the volume annotation.",
  4431. // "httpMethod": "GET",
  4432. // "id": "books.layers.volumeAnnotations.get",
  4433. // "parameterOrder": [
  4434. // "volumeId",
  4435. // "layerId",
  4436. // "annotationId"
  4437. // ],
  4438. // "parameters": {
  4439. // "annotationId": {
  4440. // "description": "The ID of the volume annotation to retrieve.",
  4441. // "location": "path",
  4442. // "required": true,
  4443. // "type": "string"
  4444. // },
  4445. // "layerId": {
  4446. // "description": "The ID for the layer to get the annotations.",
  4447. // "location": "path",
  4448. // "required": true,
  4449. // "type": "string"
  4450. // },
  4451. // "locale": {
  4452. // "description": "The locale information for the data. ISO-639-1 language and ISO-3166-1 country code. Ex: 'en_US'.",
  4453. // "location": "query",
  4454. // "type": "string"
  4455. // },
  4456. // "source": {
  4457. // "description": "String to identify the originator of this request.",
  4458. // "location": "query",
  4459. // "type": "string"
  4460. // },
  4461. // "volumeId": {
  4462. // "description": "The volume to retrieve annotations for.",
  4463. // "location": "path",
  4464. // "required": true,
  4465. // "type": "string"
  4466. // }
  4467. // },
  4468. // "path": "volumes/{volumeId}/layers/{layerId}/annotations/{annotationId}",
  4469. // "response": {
  4470. // "$ref": "Volumeannotation"
  4471. // },
  4472. // "scopes": [
  4473. // "https://www.googleapis.com/auth/books"
  4474. // ]
  4475. // }
  4476. }
  4477. // method id "books.layers.volumeAnnotations.list":
  4478. type LayersVolumeAnnotationsListCall struct {
  4479. s *Service
  4480. volumeId string
  4481. layerId string
  4482. urlParams_ gensupport.URLParams
  4483. ifNoneMatch_ string
  4484. ctx_ context.Context
  4485. }
  4486. // List: Gets the volume annotations for a volume and layer.
  4487. func (r *LayersVolumeAnnotationsService) List(volumeId string, layerId string, contentVersion string) *LayersVolumeAnnotationsListCall {
  4488. c := &LayersVolumeAnnotationsListCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  4489. c.volumeId = volumeId
  4490. c.layerId = layerId
  4491. c.urlParams_.Set("contentVersion", contentVersion)
  4492. return c
  4493. }
  4494. // EndOffset sets the optional parameter "endOffset": The end offset to
  4495. // end retrieving data from.
  4496. func (c *LayersVolumeAnnotationsListCall) EndOffset(endOffset string) *LayersVolumeAnnotationsListCall {
  4497. c.urlParams_.Set("endOffset", endOffset)
  4498. return c
  4499. }
  4500. // EndPosition sets the optional parameter "endPosition": The end
  4501. // position to end retrieving data from.
  4502. func (c *LayersVolumeAnnotationsListCall) EndPosition(endPosition string) *LayersVolumeAnnotationsListCall {
  4503. c.urlParams_.Set("endPosition", endPosition)
  4504. return c
  4505. }
  4506. // Locale sets the optional parameter "locale": The locale information
  4507. // for the data. ISO-639-1 language and ISO-3166-1 country code. Ex:
  4508. // 'en_US'.
  4509. func (c *LayersVolumeAnnotationsListCall) Locale(locale string) *LayersVolumeAnnotationsListCall {
  4510. c.urlParams_.Set("locale", locale)
  4511. return c
  4512. }
  4513. // MaxResults sets the optional parameter "maxResults": Maximum number
  4514. // of results to return
  4515. func (c *LayersVolumeAnnotationsListCall) MaxResults(maxResults int64) *LayersVolumeAnnotationsListCall {
  4516. c.urlParams_.Set("maxResults", fmt.Sprint(maxResults))
  4517. return c
  4518. }
  4519. // PageToken sets the optional parameter "pageToken": The value of the
  4520. // nextToken from the previous page.
  4521. func (c *LayersVolumeAnnotationsListCall) PageToken(pageToken string) *LayersVolumeAnnotationsListCall {
  4522. c.urlParams_.Set("pageToken", pageToken)
  4523. return c
  4524. }
  4525. // ShowDeleted sets the optional parameter "showDeleted": Set to true to
  4526. // return deleted annotations. updatedMin must be in the request to use
  4527. // this. Defaults to false.
  4528. func (c *LayersVolumeAnnotationsListCall) ShowDeleted(showDeleted bool) *LayersVolumeAnnotationsListCall {
  4529. c.urlParams_.Set("showDeleted", fmt.Sprint(showDeleted))
  4530. return c
  4531. }
  4532. // Source sets the optional parameter "source": String to identify the
  4533. // originator of this request.
  4534. func (c *LayersVolumeAnnotationsListCall) Source(source string) *LayersVolumeAnnotationsListCall {
  4535. c.urlParams_.Set("source", source)
  4536. return c
  4537. }
  4538. // StartOffset sets the optional parameter "startOffset": The start
  4539. // offset to start retrieving data from.
  4540. func (c *LayersVolumeAnnotationsListCall) StartOffset(startOffset string) *LayersVolumeAnnotationsListCall {
  4541. c.urlParams_.Set("startOffset", startOffset)
  4542. return c
  4543. }
  4544. // StartPosition sets the optional parameter "startPosition": The start
  4545. // position to start retrieving data from.
  4546. func (c *LayersVolumeAnnotationsListCall) StartPosition(startPosition string) *LayersVolumeAnnotationsListCall {
  4547. c.urlParams_.Set("startPosition", startPosition)
  4548. return c
  4549. }
  4550. // UpdatedMax sets the optional parameter "updatedMax": RFC 3339
  4551. // timestamp to restrict to items updated prior to this timestamp
  4552. // (exclusive).
  4553. func (c *LayersVolumeAnnotationsListCall) UpdatedMax(updatedMax string) *LayersVolumeAnnotationsListCall {
  4554. c.urlParams_.Set("updatedMax", updatedMax)
  4555. return c
  4556. }
  4557. // UpdatedMin sets the optional parameter "updatedMin": RFC 3339
  4558. // timestamp to restrict to items updated since this timestamp
  4559. // (inclusive).
  4560. func (c *LayersVolumeAnnotationsListCall) UpdatedMin(updatedMin string) *LayersVolumeAnnotationsListCall {
  4561. c.urlParams_.Set("updatedMin", updatedMin)
  4562. return c
  4563. }
  4564. // VolumeAnnotationsVersion sets the optional parameter
  4565. // "volumeAnnotationsVersion": The version of the volume annotations
  4566. // that you are requesting.
  4567. func (c *LayersVolumeAnnotationsListCall) VolumeAnnotationsVersion(volumeAnnotationsVersion string) *LayersVolumeAnnotationsListCall {
  4568. c.urlParams_.Set("volumeAnnotationsVersion", volumeAnnotationsVersion)
  4569. return c
  4570. }
  4571. // Fields allows partial responses to be retrieved. See
  4572. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  4573. // for more information.
  4574. func (c *LayersVolumeAnnotationsListCall) Fields(s ...googleapi.Field) *LayersVolumeAnnotationsListCall {
  4575. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  4576. return c
  4577. }
  4578. // IfNoneMatch sets the optional parameter which makes the operation
  4579. // fail if the object's ETag matches the given value. This is useful for
  4580. // getting updates only after the object has changed since the last
  4581. // request. Use googleapi.IsNotModified to check whether the response
  4582. // error from Do is the result of In-None-Match.
  4583. func (c *LayersVolumeAnnotationsListCall) IfNoneMatch(entityTag string) *LayersVolumeAnnotationsListCall {
  4584. c.ifNoneMatch_ = entityTag
  4585. return c
  4586. }
  4587. // Context sets the context to be used in this call's Do method. Any
  4588. // pending HTTP request will be aborted if the provided context is
  4589. // canceled.
  4590. func (c *LayersVolumeAnnotationsListCall) Context(ctx context.Context) *LayersVolumeAnnotationsListCall {
  4591. c.ctx_ = ctx
  4592. return c
  4593. }
  4594. func (c *LayersVolumeAnnotationsListCall) doRequest(alt string) (*http.Response, error) {
  4595. var body io.Reader = nil
  4596. c.urlParams_.Set("alt", alt)
  4597. urls := googleapi.ResolveRelative(c.s.BasePath, "volumes/{volumeId}/layers/{layerId}")
  4598. urls += "?" + c.urlParams_.Encode()
  4599. req, _ := http.NewRequest("GET", urls, body)
  4600. googleapi.Expand(req.URL, map[string]string{
  4601. "volumeId": c.volumeId,
  4602. "layerId": c.layerId,
  4603. })
  4604. req.Header.Set("User-Agent", c.s.userAgent())
  4605. if c.ifNoneMatch_ != "" {
  4606. req.Header.Set("If-None-Match", c.ifNoneMatch_)
  4607. }
  4608. if c.ctx_ != nil {
  4609. return ctxhttp.Do(c.ctx_, c.s.client, req)
  4610. }
  4611. return c.s.client.Do(req)
  4612. }
  4613. // Do executes the "books.layers.volumeAnnotations.list" call.
  4614. // Exactly one of *Volumeannotations or error will be non-nil. Any
  4615. // non-2xx status code is an error. Response headers are in either
  4616. // *Volumeannotations.ServerResponse.Header or (if a response was
  4617. // returned at all) in error.(*googleapi.Error).Header. Use
  4618. // googleapi.IsNotModified to check whether the returned error was
  4619. // because http.StatusNotModified was returned.
  4620. func (c *LayersVolumeAnnotationsListCall) Do(opts ...googleapi.CallOption) (*Volumeannotations, error) {
  4621. gensupport.SetOptions(c.urlParams_, opts...)
  4622. res, err := c.doRequest("json")
  4623. if res != nil && res.StatusCode == http.StatusNotModified {
  4624. if res.Body != nil {
  4625. res.Body.Close()
  4626. }
  4627. return nil, &googleapi.Error{
  4628. Code: res.StatusCode,
  4629. Header: res.Header,
  4630. }
  4631. }
  4632. if err != nil {
  4633. return nil, err
  4634. }
  4635. defer googleapi.CloseBody(res)
  4636. if err := googleapi.CheckResponse(res); err != nil {
  4637. return nil, err
  4638. }
  4639. ret := &Volumeannotations{
  4640. ServerResponse: googleapi.ServerResponse{
  4641. Header: res.Header,
  4642. HTTPStatusCode: res.StatusCode,
  4643. },
  4644. }
  4645. if err := json.NewDecoder(res.Body).Decode(&ret); err != nil {
  4646. return nil, err
  4647. }
  4648. return ret, nil
  4649. // {
  4650. // "description": "Gets the volume annotations for a volume and layer.",
  4651. // "httpMethod": "GET",
  4652. // "id": "books.layers.volumeAnnotations.list",
  4653. // "parameterOrder": [
  4654. // "volumeId",
  4655. // "layerId",
  4656. // "contentVersion"
  4657. // ],
  4658. // "parameters": {
  4659. // "contentVersion": {
  4660. // "description": "The content version for the requested volume.",
  4661. // "location": "query",
  4662. // "required": true,
  4663. // "type": "string"
  4664. // },
  4665. // "endOffset": {
  4666. // "description": "The end offset to end retrieving data from.",
  4667. // "location": "query",
  4668. // "type": "string"
  4669. // },
  4670. // "endPosition": {
  4671. // "description": "The end position to end retrieving data from.",
  4672. // "location": "query",
  4673. // "type": "string"
  4674. // },
  4675. // "layerId": {
  4676. // "description": "The ID for the layer to get the annotations.",
  4677. // "location": "path",
  4678. // "required": true,
  4679. // "type": "string"
  4680. // },
  4681. // "locale": {
  4682. // "description": "The locale information for the data. ISO-639-1 language and ISO-3166-1 country code. Ex: 'en_US'.",
  4683. // "location": "query",
  4684. // "type": "string"
  4685. // },
  4686. // "maxResults": {
  4687. // "description": "Maximum number of results to return",
  4688. // "format": "uint32",
  4689. // "location": "query",
  4690. // "maximum": "200",
  4691. // "minimum": "0",
  4692. // "type": "integer"
  4693. // },
  4694. // "pageToken": {
  4695. // "description": "The value of the nextToken from the previous page.",
  4696. // "location": "query",
  4697. // "type": "string"
  4698. // },
  4699. // "showDeleted": {
  4700. // "description": "Set to true to return deleted annotations. updatedMin must be in the request to use this. Defaults to false.",
  4701. // "location": "query",
  4702. // "type": "boolean"
  4703. // },
  4704. // "source": {
  4705. // "description": "String to identify the originator of this request.",
  4706. // "location": "query",
  4707. // "type": "string"
  4708. // },
  4709. // "startOffset": {
  4710. // "description": "The start offset to start retrieving data from.",
  4711. // "location": "query",
  4712. // "type": "string"
  4713. // },
  4714. // "startPosition": {
  4715. // "description": "The start position to start retrieving data from.",
  4716. // "location": "query",
  4717. // "type": "string"
  4718. // },
  4719. // "updatedMax": {
  4720. // "description": "RFC 3339 timestamp to restrict to items updated prior to this timestamp (exclusive).",
  4721. // "location": "query",
  4722. // "type": "string"
  4723. // },
  4724. // "updatedMin": {
  4725. // "description": "RFC 3339 timestamp to restrict to items updated since this timestamp (inclusive).",
  4726. // "location": "query",
  4727. // "type": "string"
  4728. // },
  4729. // "volumeAnnotationsVersion": {
  4730. // "description": "The version of the volume annotations that you are requesting.",
  4731. // "location": "query",
  4732. // "type": "string"
  4733. // },
  4734. // "volumeId": {
  4735. // "description": "The volume to retrieve annotations for.",
  4736. // "location": "path",
  4737. // "required": true,
  4738. // "type": "string"
  4739. // }
  4740. // },
  4741. // "path": "volumes/{volumeId}/layers/{layerId}",
  4742. // "response": {
  4743. // "$ref": "Volumeannotations"
  4744. // },
  4745. // "scopes": [
  4746. // "https://www.googleapis.com/auth/books"
  4747. // ]
  4748. // }
  4749. }
  4750. // Pages invokes f for each page of results.
  4751. // A non-nil error returned from f will halt the iteration.
  4752. // The provided context supersedes any context provided to the Context method.
  4753. func (c *LayersVolumeAnnotationsListCall) Pages(ctx context.Context, f func(*Volumeannotations) error) error {
  4754. c.ctx_ = ctx
  4755. defer c.PageToken(c.urlParams_.Get("pageToken")) // reset paging to original point
  4756. for {
  4757. x, err := c.Do()
  4758. if err != nil {
  4759. return err
  4760. }
  4761. if err := f(x); err != nil {
  4762. return err
  4763. }
  4764. if x.NextPageToken == "" {
  4765. return nil
  4766. }
  4767. c.PageToken(x.NextPageToken)
  4768. }
  4769. }
  4770. // method id "books.myconfig.getUserSettings":
  4771. type MyconfigGetUserSettingsCall struct {
  4772. s *Service
  4773. urlParams_ gensupport.URLParams
  4774. ifNoneMatch_ string
  4775. ctx_ context.Context
  4776. }
  4777. // GetUserSettings: Gets the current settings for the user.
  4778. func (r *MyconfigService) GetUserSettings() *MyconfigGetUserSettingsCall {
  4779. c := &MyconfigGetUserSettingsCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  4780. return c
  4781. }
  4782. // Fields allows partial responses to be retrieved. See
  4783. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  4784. // for more information.
  4785. func (c *MyconfigGetUserSettingsCall) Fields(s ...googleapi.Field) *MyconfigGetUserSettingsCall {
  4786. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  4787. return c
  4788. }
  4789. // IfNoneMatch sets the optional parameter which makes the operation
  4790. // fail if the object's ETag matches the given value. This is useful for
  4791. // getting updates only after the object has changed since the last
  4792. // request. Use googleapi.IsNotModified to check whether the response
  4793. // error from Do is the result of In-None-Match.
  4794. func (c *MyconfigGetUserSettingsCall) IfNoneMatch(entityTag string) *MyconfigGetUserSettingsCall {
  4795. c.ifNoneMatch_ = entityTag
  4796. return c
  4797. }
  4798. // Context sets the context to be used in this call's Do method. Any
  4799. // pending HTTP request will be aborted if the provided context is
  4800. // canceled.
  4801. func (c *MyconfigGetUserSettingsCall) Context(ctx context.Context) *MyconfigGetUserSettingsCall {
  4802. c.ctx_ = ctx
  4803. return c
  4804. }
  4805. func (c *MyconfigGetUserSettingsCall) doRequest(alt string) (*http.Response, error) {
  4806. var body io.Reader = nil
  4807. c.urlParams_.Set("alt", alt)
  4808. urls := googleapi.ResolveRelative(c.s.BasePath, "myconfig/getUserSettings")
  4809. urls += "?" + c.urlParams_.Encode()
  4810. req, _ := http.NewRequest("GET", urls, body)
  4811. googleapi.SetOpaque(req.URL)
  4812. req.Header.Set("User-Agent", c.s.userAgent())
  4813. if c.ifNoneMatch_ != "" {
  4814. req.Header.Set("If-None-Match", c.ifNoneMatch_)
  4815. }
  4816. if c.ctx_ != nil {
  4817. return ctxhttp.Do(c.ctx_, c.s.client, req)
  4818. }
  4819. return c.s.client.Do(req)
  4820. }
  4821. // Do executes the "books.myconfig.getUserSettings" call.
  4822. // Exactly one of *Usersettings or error will be non-nil. Any non-2xx
  4823. // status code is an error. Response headers are in either
  4824. // *Usersettings.ServerResponse.Header or (if a response was returned at
  4825. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  4826. // to check whether the returned error was because
  4827. // http.StatusNotModified was returned.
  4828. func (c *MyconfigGetUserSettingsCall) Do(opts ...googleapi.CallOption) (*Usersettings, error) {
  4829. gensupport.SetOptions(c.urlParams_, opts...)
  4830. res, err := c.doRequest("json")
  4831. if res != nil && res.StatusCode == http.StatusNotModified {
  4832. if res.Body != nil {
  4833. res.Body.Close()
  4834. }
  4835. return nil, &googleapi.Error{
  4836. Code: res.StatusCode,
  4837. Header: res.Header,
  4838. }
  4839. }
  4840. if err != nil {
  4841. return nil, err
  4842. }
  4843. defer googleapi.CloseBody(res)
  4844. if err := googleapi.CheckResponse(res); err != nil {
  4845. return nil, err
  4846. }
  4847. ret := &Usersettings{
  4848. ServerResponse: googleapi.ServerResponse{
  4849. Header: res.Header,
  4850. HTTPStatusCode: res.StatusCode,
  4851. },
  4852. }
  4853. if err := json.NewDecoder(res.Body).Decode(&ret); err != nil {
  4854. return nil, err
  4855. }
  4856. return ret, nil
  4857. // {
  4858. // "description": "Gets the current settings for the user.",
  4859. // "httpMethod": "GET",
  4860. // "id": "books.myconfig.getUserSettings",
  4861. // "path": "myconfig/getUserSettings",
  4862. // "response": {
  4863. // "$ref": "Usersettings"
  4864. // },
  4865. // "scopes": [
  4866. // "https://www.googleapis.com/auth/books"
  4867. // ]
  4868. // }
  4869. }
  4870. // method id "books.myconfig.releaseDownloadAccess":
  4871. type MyconfigReleaseDownloadAccessCall struct {
  4872. s *Service
  4873. urlParams_ gensupport.URLParams
  4874. ctx_ context.Context
  4875. }
  4876. // ReleaseDownloadAccess: Release downloaded content access restriction.
  4877. func (r *MyconfigService) ReleaseDownloadAccess(volumeIds []string, cpksver string) *MyconfigReleaseDownloadAccessCall {
  4878. c := &MyconfigReleaseDownloadAccessCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  4879. c.urlParams_.SetMulti("volumeIds", append([]string{}, volumeIds...))
  4880. c.urlParams_.Set("cpksver", cpksver)
  4881. return c
  4882. }
  4883. // Locale sets the optional parameter "locale": ISO-639-1, ISO-3166-1
  4884. // codes for message localization, i.e. en_US.
  4885. func (c *MyconfigReleaseDownloadAccessCall) Locale(locale string) *MyconfigReleaseDownloadAccessCall {
  4886. c.urlParams_.Set("locale", locale)
  4887. return c
  4888. }
  4889. // Source sets the optional parameter "source": String to identify the
  4890. // originator of this request.
  4891. func (c *MyconfigReleaseDownloadAccessCall) Source(source string) *MyconfigReleaseDownloadAccessCall {
  4892. c.urlParams_.Set("source", source)
  4893. return c
  4894. }
  4895. // Fields allows partial responses to be retrieved. See
  4896. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  4897. // for more information.
  4898. func (c *MyconfigReleaseDownloadAccessCall) Fields(s ...googleapi.Field) *MyconfigReleaseDownloadAccessCall {
  4899. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  4900. return c
  4901. }
  4902. // Context sets the context to be used in this call's Do method. Any
  4903. // pending HTTP request will be aborted if the provided context is
  4904. // canceled.
  4905. func (c *MyconfigReleaseDownloadAccessCall) Context(ctx context.Context) *MyconfigReleaseDownloadAccessCall {
  4906. c.ctx_ = ctx
  4907. return c
  4908. }
  4909. func (c *MyconfigReleaseDownloadAccessCall) doRequest(alt string) (*http.Response, error) {
  4910. var body io.Reader = nil
  4911. c.urlParams_.Set("alt", alt)
  4912. urls := googleapi.ResolveRelative(c.s.BasePath, "myconfig/releaseDownloadAccess")
  4913. urls += "?" + c.urlParams_.Encode()
  4914. req, _ := http.NewRequest("POST", urls, body)
  4915. googleapi.SetOpaque(req.URL)
  4916. req.Header.Set("User-Agent", c.s.userAgent())
  4917. if c.ctx_ != nil {
  4918. return ctxhttp.Do(c.ctx_, c.s.client, req)
  4919. }
  4920. return c.s.client.Do(req)
  4921. }
  4922. // Do executes the "books.myconfig.releaseDownloadAccess" call.
  4923. // Exactly one of *DownloadAccesses or error will be non-nil. Any
  4924. // non-2xx status code is an error. Response headers are in either
  4925. // *DownloadAccesses.ServerResponse.Header or (if a response was
  4926. // returned at all) in error.(*googleapi.Error).Header. Use
  4927. // googleapi.IsNotModified to check whether the returned error was
  4928. // because http.StatusNotModified was returned.
  4929. func (c *MyconfigReleaseDownloadAccessCall) Do(opts ...googleapi.CallOption) (*DownloadAccesses, error) {
  4930. gensupport.SetOptions(c.urlParams_, opts...)
  4931. res, err := c.doRequest("json")
  4932. if res != nil && res.StatusCode == http.StatusNotModified {
  4933. if res.Body != nil {
  4934. res.Body.Close()
  4935. }
  4936. return nil, &googleapi.Error{
  4937. Code: res.StatusCode,
  4938. Header: res.Header,
  4939. }
  4940. }
  4941. if err != nil {
  4942. return nil, err
  4943. }
  4944. defer googleapi.CloseBody(res)
  4945. if err := googleapi.CheckResponse(res); err != nil {
  4946. return nil, err
  4947. }
  4948. ret := &DownloadAccesses{
  4949. ServerResponse: googleapi.ServerResponse{
  4950. Header: res.Header,
  4951. HTTPStatusCode: res.StatusCode,
  4952. },
  4953. }
  4954. if err := json.NewDecoder(res.Body).Decode(&ret); err != nil {
  4955. return nil, err
  4956. }
  4957. return ret, nil
  4958. // {
  4959. // "description": "Release downloaded content access restriction.",
  4960. // "httpMethod": "POST",
  4961. // "id": "books.myconfig.releaseDownloadAccess",
  4962. // "parameterOrder": [
  4963. // "volumeIds",
  4964. // "cpksver"
  4965. // ],
  4966. // "parameters": {
  4967. // "cpksver": {
  4968. // "description": "The device/version ID from which to release the restriction.",
  4969. // "location": "query",
  4970. // "required": true,
  4971. // "type": "string"
  4972. // },
  4973. // "locale": {
  4974. // "description": "ISO-639-1, ISO-3166-1 codes for message localization, i.e. en_US.",
  4975. // "location": "query",
  4976. // "type": "string"
  4977. // },
  4978. // "source": {
  4979. // "description": "String to identify the originator of this request.",
  4980. // "location": "query",
  4981. // "type": "string"
  4982. // },
  4983. // "volumeIds": {
  4984. // "description": "The volume(s) to release restrictions for.",
  4985. // "location": "query",
  4986. // "repeated": true,
  4987. // "required": true,
  4988. // "type": "string"
  4989. // }
  4990. // },
  4991. // "path": "myconfig/releaseDownloadAccess",
  4992. // "response": {
  4993. // "$ref": "DownloadAccesses"
  4994. // },
  4995. // "scopes": [
  4996. // "https://www.googleapis.com/auth/books"
  4997. // ]
  4998. // }
  4999. }
  5000. // method id "books.myconfig.requestAccess":
  5001. type MyconfigRequestAccessCall struct {
  5002. s *Service
  5003. urlParams_ gensupport.URLParams
  5004. ctx_ context.Context
  5005. }
  5006. // RequestAccess: Request concurrent and download access restrictions.
  5007. func (r *MyconfigService) RequestAccess(source string, volumeId string, nonce string, cpksver string) *MyconfigRequestAccessCall {
  5008. c := &MyconfigRequestAccessCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  5009. c.urlParams_.Set("source", source)
  5010. c.urlParams_.Set("volumeId", volumeId)
  5011. c.urlParams_.Set("nonce", nonce)
  5012. c.urlParams_.Set("cpksver", cpksver)
  5013. return c
  5014. }
  5015. // LicenseTypes sets the optional parameter "licenseTypes": The type of
  5016. // access license to request. If not specified, the default is BOTH.
  5017. //
  5018. // Possible values:
  5019. // "BOTH" - Both concurrent and download licenses.
  5020. // "CONCURRENT" - Concurrent access license.
  5021. // "DOWNLOAD" - Offline download access license.
  5022. func (c *MyconfigRequestAccessCall) LicenseTypes(licenseTypes string) *MyconfigRequestAccessCall {
  5023. c.urlParams_.Set("licenseTypes", licenseTypes)
  5024. return c
  5025. }
  5026. // Locale sets the optional parameter "locale": ISO-639-1, ISO-3166-1
  5027. // codes for message localization, i.e. en_US.
  5028. func (c *MyconfigRequestAccessCall) Locale(locale string) *MyconfigRequestAccessCall {
  5029. c.urlParams_.Set("locale", locale)
  5030. return c
  5031. }
  5032. // Fields allows partial responses to be retrieved. See
  5033. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  5034. // for more information.
  5035. func (c *MyconfigRequestAccessCall) Fields(s ...googleapi.Field) *MyconfigRequestAccessCall {
  5036. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  5037. return c
  5038. }
  5039. // Context sets the context to be used in this call's Do method. Any
  5040. // pending HTTP request will be aborted if the provided context is
  5041. // canceled.
  5042. func (c *MyconfigRequestAccessCall) Context(ctx context.Context) *MyconfigRequestAccessCall {
  5043. c.ctx_ = ctx
  5044. return c
  5045. }
  5046. func (c *MyconfigRequestAccessCall) doRequest(alt string) (*http.Response, error) {
  5047. var body io.Reader = nil
  5048. c.urlParams_.Set("alt", alt)
  5049. urls := googleapi.ResolveRelative(c.s.BasePath, "myconfig/requestAccess")
  5050. urls += "?" + c.urlParams_.Encode()
  5051. req, _ := http.NewRequest("POST", urls, body)
  5052. googleapi.SetOpaque(req.URL)
  5053. req.Header.Set("User-Agent", c.s.userAgent())
  5054. if c.ctx_ != nil {
  5055. return ctxhttp.Do(c.ctx_, c.s.client, req)
  5056. }
  5057. return c.s.client.Do(req)
  5058. }
  5059. // Do executes the "books.myconfig.requestAccess" call.
  5060. // Exactly one of *RequestAccess or error will be non-nil. Any non-2xx
  5061. // status code is an error. Response headers are in either
  5062. // *RequestAccess.ServerResponse.Header or (if a response was returned
  5063. // at all) in error.(*googleapi.Error).Header. Use
  5064. // googleapi.IsNotModified to check whether the returned error was
  5065. // because http.StatusNotModified was returned.
  5066. func (c *MyconfigRequestAccessCall) Do(opts ...googleapi.CallOption) (*RequestAccess, error) {
  5067. gensupport.SetOptions(c.urlParams_, opts...)
  5068. res, err := c.doRequest("json")
  5069. if res != nil && res.StatusCode == http.StatusNotModified {
  5070. if res.Body != nil {
  5071. res.Body.Close()
  5072. }
  5073. return nil, &googleapi.Error{
  5074. Code: res.StatusCode,
  5075. Header: res.Header,
  5076. }
  5077. }
  5078. if err != nil {
  5079. return nil, err
  5080. }
  5081. defer googleapi.CloseBody(res)
  5082. if err := googleapi.CheckResponse(res); err != nil {
  5083. return nil, err
  5084. }
  5085. ret := &RequestAccess{
  5086. ServerResponse: googleapi.ServerResponse{
  5087. Header: res.Header,
  5088. HTTPStatusCode: res.StatusCode,
  5089. },
  5090. }
  5091. if err := json.NewDecoder(res.Body).Decode(&ret); err != nil {
  5092. return nil, err
  5093. }
  5094. return ret, nil
  5095. // {
  5096. // "description": "Request concurrent and download access restrictions.",
  5097. // "httpMethod": "POST",
  5098. // "id": "books.myconfig.requestAccess",
  5099. // "parameterOrder": [
  5100. // "source",
  5101. // "volumeId",
  5102. // "nonce",
  5103. // "cpksver"
  5104. // ],
  5105. // "parameters": {
  5106. // "cpksver": {
  5107. // "description": "The device/version ID from which to request the restrictions.",
  5108. // "location": "query",
  5109. // "required": true,
  5110. // "type": "string"
  5111. // },
  5112. // "licenseTypes": {
  5113. // "description": "The type of access license to request. If not specified, the default is BOTH.",
  5114. // "enum": [
  5115. // "BOTH",
  5116. // "CONCURRENT",
  5117. // "DOWNLOAD"
  5118. // ],
  5119. // "enumDescriptions": [
  5120. // "Both concurrent and download licenses.",
  5121. // "Concurrent access license.",
  5122. // "Offline download access license."
  5123. // ],
  5124. // "location": "query",
  5125. // "type": "string"
  5126. // },
  5127. // "locale": {
  5128. // "description": "ISO-639-1, ISO-3166-1 codes for message localization, i.e. en_US.",
  5129. // "location": "query",
  5130. // "type": "string"
  5131. // },
  5132. // "nonce": {
  5133. // "description": "The client nonce value.",
  5134. // "location": "query",
  5135. // "required": true,
  5136. // "type": "string"
  5137. // },
  5138. // "source": {
  5139. // "description": "String to identify the originator of this request.",
  5140. // "location": "query",
  5141. // "required": true,
  5142. // "type": "string"
  5143. // },
  5144. // "volumeId": {
  5145. // "description": "The volume to request concurrent/download restrictions for.",
  5146. // "location": "query",
  5147. // "required": true,
  5148. // "type": "string"
  5149. // }
  5150. // },
  5151. // "path": "myconfig/requestAccess",
  5152. // "response": {
  5153. // "$ref": "RequestAccess"
  5154. // },
  5155. // "scopes": [
  5156. // "https://www.googleapis.com/auth/books"
  5157. // ]
  5158. // }
  5159. }
  5160. // method id "books.myconfig.syncVolumeLicenses":
  5161. type MyconfigSyncVolumeLicensesCall struct {
  5162. s *Service
  5163. urlParams_ gensupport.URLParams
  5164. ctx_ context.Context
  5165. }
  5166. // SyncVolumeLicenses: Request downloaded content access for specified
  5167. // volumes on the My eBooks shelf.
  5168. func (r *MyconfigService) SyncVolumeLicenses(source string, nonce string, cpksver string) *MyconfigSyncVolumeLicensesCall {
  5169. c := &MyconfigSyncVolumeLicensesCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  5170. c.urlParams_.Set("source", source)
  5171. c.urlParams_.Set("nonce", nonce)
  5172. c.urlParams_.Set("cpksver", cpksver)
  5173. return c
  5174. }
  5175. // Features sets the optional parameter "features": List of features
  5176. // supported by the client, i.e., 'RENTALS'
  5177. //
  5178. // Possible values:
  5179. // "RENTALS" - Client supports rentals.
  5180. func (c *MyconfigSyncVolumeLicensesCall) Features(features ...string) *MyconfigSyncVolumeLicensesCall {
  5181. c.urlParams_.SetMulti("features", append([]string{}, features...))
  5182. return c
  5183. }
  5184. // IncludeNonComicsSeries sets the optional parameter
  5185. // "includeNonComicsSeries": Set to true to include non-comics series.
  5186. // Defaults to false.
  5187. func (c *MyconfigSyncVolumeLicensesCall) IncludeNonComicsSeries(includeNonComicsSeries bool) *MyconfigSyncVolumeLicensesCall {
  5188. c.urlParams_.Set("includeNonComicsSeries", fmt.Sprint(includeNonComicsSeries))
  5189. return c
  5190. }
  5191. // Locale sets the optional parameter "locale": ISO-639-1, ISO-3166-1
  5192. // codes for message localization, i.e. en_US.
  5193. func (c *MyconfigSyncVolumeLicensesCall) Locale(locale string) *MyconfigSyncVolumeLicensesCall {
  5194. c.urlParams_.Set("locale", locale)
  5195. return c
  5196. }
  5197. // ShowPreorders sets the optional parameter "showPreorders": Set to
  5198. // true to show pre-ordered books. Defaults to false.
  5199. func (c *MyconfigSyncVolumeLicensesCall) ShowPreorders(showPreorders bool) *MyconfigSyncVolumeLicensesCall {
  5200. c.urlParams_.Set("showPreorders", fmt.Sprint(showPreorders))
  5201. return c
  5202. }
  5203. // VolumeIds sets the optional parameter "volumeIds": The volume(s) to
  5204. // request download restrictions for.
  5205. func (c *MyconfigSyncVolumeLicensesCall) VolumeIds(volumeIds ...string) *MyconfigSyncVolumeLicensesCall {
  5206. c.urlParams_.SetMulti("volumeIds", append([]string{}, volumeIds...))
  5207. return c
  5208. }
  5209. // Fields allows partial responses to be retrieved. See
  5210. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  5211. // for more information.
  5212. func (c *MyconfigSyncVolumeLicensesCall) Fields(s ...googleapi.Field) *MyconfigSyncVolumeLicensesCall {
  5213. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  5214. return c
  5215. }
  5216. // Context sets the context to be used in this call's Do method. Any
  5217. // pending HTTP request will be aborted if the provided context is
  5218. // canceled.
  5219. func (c *MyconfigSyncVolumeLicensesCall) Context(ctx context.Context) *MyconfigSyncVolumeLicensesCall {
  5220. c.ctx_ = ctx
  5221. return c
  5222. }
  5223. func (c *MyconfigSyncVolumeLicensesCall) doRequest(alt string) (*http.Response, error) {
  5224. var body io.Reader = nil
  5225. c.urlParams_.Set("alt", alt)
  5226. urls := googleapi.ResolveRelative(c.s.BasePath, "myconfig/syncVolumeLicenses")
  5227. urls += "?" + c.urlParams_.Encode()
  5228. req, _ := http.NewRequest("POST", urls, body)
  5229. googleapi.SetOpaque(req.URL)
  5230. req.Header.Set("User-Agent", c.s.userAgent())
  5231. if c.ctx_ != nil {
  5232. return ctxhttp.Do(c.ctx_, c.s.client, req)
  5233. }
  5234. return c.s.client.Do(req)
  5235. }
  5236. // Do executes the "books.myconfig.syncVolumeLicenses" call.
  5237. // Exactly one of *Volumes or error will be non-nil. Any non-2xx status
  5238. // code is an error. Response headers are in either
  5239. // *Volumes.ServerResponse.Header or (if a response was returned at all)
  5240. // in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to
  5241. // check whether the returned error was because http.StatusNotModified
  5242. // was returned.
  5243. func (c *MyconfigSyncVolumeLicensesCall) Do(opts ...googleapi.CallOption) (*Volumes, error) {
  5244. gensupport.SetOptions(c.urlParams_, opts...)
  5245. res, err := c.doRequest("json")
  5246. if res != nil && res.StatusCode == http.StatusNotModified {
  5247. if res.Body != nil {
  5248. res.Body.Close()
  5249. }
  5250. return nil, &googleapi.Error{
  5251. Code: res.StatusCode,
  5252. Header: res.Header,
  5253. }
  5254. }
  5255. if err != nil {
  5256. return nil, err
  5257. }
  5258. defer googleapi.CloseBody(res)
  5259. if err := googleapi.CheckResponse(res); err != nil {
  5260. return nil, err
  5261. }
  5262. ret := &Volumes{
  5263. ServerResponse: googleapi.ServerResponse{
  5264. Header: res.Header,
  5265. HTTPStatusCode: res.StatusCode,
  5266. },
  5267. }
  5268. if err := json.NewDecoder(res.Body).Decode(&ret); err != nil {
  5269. return nil, err
  5270. }
  5271. return ret, nil
  5272. // {
  5273. // "description": "Request downloaded content access for specified volumes on the My eBooks shelf.",
  5274. // "httpMethod": "POST",
  5275. // "id": "books.myconfig.syncVolumeLicenses",
  5276. // "parameterOrder": [
  5277. // "source",
  5278. // "nonce",
  5279. // "cpksver"
  5280. // ],
  5281. // "parameters": {
  5282. // "cpksver": {
  5283. // "description": "The device/version ID from which to release the restriction.",
  5284. // "location": "query",
  5285. // "required": true,
  5286. // "type": "string"
  5287. // },
  5288. // "features": {
  5289. // "description": "List of features supported by the client, i.e., 'RENTALS'",
  5290. // "enum": [
  5291. // "RENTALS"
  5292. // ],
  5293. // "enumDescriptions": [
  5294. // "Client supports rentals."
  5295. // ],
  5296. // "location": "query",
  5297. // "repeated": true,
  5298. // "type": "string"
  5299. // },
  5300. // "includeNonComicsSeries": {
  5301. // "description": "Set to true to include non-comics series. Defaults to false.",
  5302. // "location": "query",
  5303. // "type": "boolean"
  5304. // },
  5305. // "locale": {
  5306. // "description": "ISO-639-1, ISO-3166-1 codes for message localization, i.e. en_US.",
  5307. // "location": "query",
  5308. // "type": "string"
  5309. // },
  5310. // "nonce": {
  5311. // "description": "The client nonce value.",
  5312. // "location": "query",
  5313. // "required": true,
  5314. // "type": "string"
  5315. // },
  5316. // "showPreorders": {
  5317. // "description": "Set to true to show pre-ordered books. Defaults to false.",
  5318. // "location": "query",
  5319. // "type": "boolean"
  5320. // },
  5321. // "source": {
  5322. // "description": "String to identify the originator of this request.",
  5323. // "location": "query",
  5324. // "required": true,
  5325. // "type": "string"
  5326. // },
  5327. // "volumeIds": {
  5328. // "description": "The volume(s) to request download restrictions for.",
  5329. // "location": "query",
  5330. // "repeated": true,
  5331. // "type": "string"
  5332. // }
  5333. // },
  5334. // "path": "myconfig/syncVolumeLicenses",
  5335. // "response": {
  5336. // "$ref": "Volumes"
  5337. // },
  5338. // "scopes": [
  5339. // "https://www.googleapis.com/auth/books"
  5340. // ]
  5341. // }
  5342. }
  5343. // method id "books.myconfig.updateUserSettings":
  5344. type MyconfigUpdateUserSettingsCall struct {
  5345. s *Service
  5346. usersettings *Usersettings
  5347. urlParams_ gensupport.URLParams
  5348. ctx_ context.Context
  5349. }
  5350. // UpdateUserSettings: Sets the settings for the user. If a sub-object
  5351. // is specified, it will overwrite the existing sub-object stored in the
  5352. // server. Unspecified sub-objects will retain the existing value.
  5353. func (r *MyconfigService) UpdateUserSettings(usersettings *Usersettings) *MyconfigUpdateUserSettingsCall {
  5354. c := &MyconfigUpdateUserSettingsCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  5355. c.usersettings = usersettings
  5356. return c
  5357. }
  5358. // Fields allows partial responses to be retrieved. See
  5359. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  5360. // for more information.
  5361. func (c *MyconfigUpdateUserSettingsCall) Fields(s ...googleapi.Field) *MyconfigUpdateUserSettingsCall {
  5362. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  5363. return c
  5364. }
  5365. // Context sets the context to be used in this call's Do method. Any
  5366. // pending HTTP request will be aborted if the provided context is
  5367. // canceled.
  5368. func (c *MyconfigUpdateUserSettingsCall) Context(ctx context.Context) *MyconfigUpdateUserSettingsCall {
  5369. c.ctx_ = ctx
  5370. return c
  5371. }
  5372. func (c *MyconfigUpdateUserSettingsCall) doRequest(alt string) (*http.Response, error) {
  5373. var body io.Reader = nil
  5374. body, err := googleapi.WithoutDataWrapper.JSONReader(c.usersettings)
  5375. if err != nil {
  5376. return nil, err
  5377. }
  5378. ctype := "application/json"
  5379. c.urlParams_.Set("alt", alt)
  5380. urls := googleapi.ResolveRelative(c.s.BasePath, "myconfig/updateUserSettings")
  5381. urls += "?" + c.urlParams_.Encode()
  5382. req, _ := http.NewRequest("POST", urls, body)
  5383. googleapi.SetOpaque(req.URL)
  5384. req.Header.Set("Content-Type", ctype)
  5385. req.Header.Set("User-Agent", c.s.userAgent())
  5386. if c.ctx_ != nil {
  5387. return ctxhttp.Do(c.ctx_, c.s.client, req)
  5388. }
  5389. return c.s.client.Do(req)
  5390. }
  5391. // Do executes the "books.myconfig.updateUserSettings" call.
  5392. // Exactly one of *Usersettings or error will be non-nil. Any non-2xx
  5393. // status code is an error. Response headers are in either
  5394. // *Usersettings.ServerResponse.Header or (if a response was returned at
  5395. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  5396. // to check whether the returned error was because
  5397. // http.StatusNotModified was returned.
  5398. func (c *MyconfigUpdateUserSettingsCall) Do(opts ...googleapi.CallOption) (*Usersettings, error) {
  5399. gensupport.SetOptions(c.urlParams_, opts...)
  5400. res, err := c.doRequest("json")
  5401. if res != nil && res.StatusCode == http.StatusNotModified {
  5402. if res.Body != nil {
  5403. res.Body.Close()
  5404. }
  5405. return nil, &googleapi.Error{
  5406. Code: res.StatusCode,
  5407. Header: res.Header,
  5408. }
  5409. }
  5410. if err != nil {
  5411. return nil, err
  5412. }
  5413. defer googleapi.CloseBody(res)
  5414. if err := googleapi.CheckResponse(res); err != nil {
  5415. return nil, err
  5416. }
  5417. ret := &Usersettings{
  5418. ServerResponse: googleapi.ServerResponse{
  5419. Header: res.Header,
  5420. HTTPStatusCode: res.StatusCode,
  5421. },
  5422. }
  5423. if err := json.NewDecoder(res.Body).Decode(&ret); err != nil {
  5424. return nil, err
  5425. }
  5426. return ret, nil
  5427. // {
  5428. // "description": "Sets the settings for the user. If a sub-object is specified, it will overwrite the existing sub-object stored in the server. Unspecified sub-objects will retain the existing value.",
  5429. // "httpMethod": "POST",
  5430. // "id": "books.myconfig.updateUserSettings",
  5431. // "path": "myconfig/updateUserSettings",
  5432. // "request": {
  5433. // "$ref": "Usersettings"
  5434. // },
  5435. // "response": {
  5436. // "$ref": "Usersettings"
  5437. // },
  5438. // "scopes": [
  5439. // "https://www.googleapis.com/auth/books"
  5440. // ]
  5441. // }
  5442. }
  5443. // method id "books.mylibrary.annotations.delete":
  5444. type MylibraryAnnotationsDeleteCall struct {
  5445. s *Service
  5446. annotationId string
  5447. urlParams_ gensupport.URLParams
  5448. ctx_ context.Context
  5449. }
  5450. // Delete: Deletes an annotation.
  5451. func (r *MylibraryAnnotationsService) Delete(annotationId string) *MylibraryAnnotationsDeleteCall {
  5452. c := &MylibraryAnnotationsDeleteCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  5453. c.annotationId = annotationId
  5454. return c
  5455. }
  5456. // Source sets the optional parameter "source": String to identify the
  5457. // originator of this request.
  5458. func (c *MylibraryAnnotationsDeleteCall) Source(source string) *MylibraryAnnotationsDeleteCall {
  5459. c.urlParams_.Set("source", source)
  5460. return c
  5461. }
  5462. // Fields allows partial responses to be retrieved. See
  5463. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  5464. // for more information.
  5465. func (c *MylibraryAnnotationsDeleteCall) Fields(s ...googleapi.Field) *MylibraryAnnotationsDeleteCall {
  5466. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  5467. return c
  5468. }
  5469. // Context sets the context to be used in this call's Do method. Any
  5470. // pending HTTP request will be aborted if the provided context is
  5471. // canceled.
  5472. func (c *MylibraryAnnotationsDeleteCall) Context(ctx context.Context) *MylibraryAnnotationsDeleteCall {
  5473. c.ctx_ = ctx
  5474. return c
  5475. }
  5476. func (c *MylibraryAnnotationsDeleteCall) doRequest(alt string) (*http.Response, error) {
  5477. var body io.Reader = nil
  5478. c.urlParams_.Set("alt", alt)
  5479. urls := googleapi.ResolveRelative(c.s.BasePath, "mylibrary/annotations/{annotationId}")
  5480. urls += "?" + c.urlParams_.Encode()
  5481. req, _ := http.NewRequest("DELETE", urls, body)
  5482. googleapi.Expand(req.URL, map[string]string{
  5483. "annotationId": c.annotationId,
  5484. })
  5485. req.Header.Set("User-Agent", c.s.userAgent())
  5486. if c.ctx_ != nil {
  5487. return ctxhttp.Do(c.ctx_, c.s.client, req)
  5488. }
  5489. return c.s.client.Do(req)
  5490. }
  5491. // Do executes the "books.mylibrary.annotations.delete" call.
  5492. func (c *MylibraryAnnotationsDeleteCall) Do(opts ...googleapi.CallOption) error {
  5493. gensupport.SetOptions(c.urlParams_, opts...)
  5494. res, err := c.doRequest("json")
  5495. if err != nil {
  5496. return err
  5497. }
  5498. defer googleapi.CloseBody(res)
  5499. if err := googleapi.CheckResponse(res); err != nil {
  5500. return err
  5501. }
  5502. return nil
  5503. // {
  5504. // "description": "Deletes an annotation.",
  5505. // "httpMethod": "DELETE",
  5506. // "id": "books.mylibrary.annotations.delete",
  5507. // "parameterOrder": [
  5508. // "annotationId"
  5509. // ],
  5510. // "parameters": {
  5511. // "annotationId": {
  5512. // "description": "The ID for the annotation to delete.",
  5513. // "location": "path",
  5514. // "required": true,
  5515. // "type": "string"
  5516. // },
  5517. // "source": {
  5518. // "description": "String to identify the originator of this request.",
  5519. // "location": "query",
  5520. // "type": "string"
  5521. // }
  5522. // },
  5523. // "path": "mylibrary/annotations/{annotationId}",
  5524. // "scopes": [
  5525. // "https://www.googleapis.com/auth/books"
  5526. // ]
  5527. // }
  5528. }
  5529. // method id "books.mylibrary.annotations.insert":
  5530. type MylibraryAnnotationsInsertCall struct {
  5531. s *Service
  5532. annotation *Annotation
  5533. urlParams_ gensupport.URLParams
  5534. ctx_ context.Context
  5535. }
  5536. // Insert: Inserts a new annotation.
  5537. func (r *MylibraryAnnotationsService) Insert(annotation *Annotation) *MylibraryAnnotationsInsertCall {
  5538. c := &MylibraryAnnotationsInsertCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  5539. c.annotation = annotation
  5540. return c
  5541. }
  5542. // Country sets the optional parameter "country": ISO-3166-1 code to
  5543. // override the IP-based location.
  5544. func (c *MylibraryAnnotationsInsertCall) Country(country string) *MylibraryAnnotationsInsertCall {
  5545. c.urlParams_.Set("country", country)
  5546. return c
  5547. }
  5548. // ShowOnlySummaryInResponse sets the optional parameter
  5549. // "showOnlySummaryInResponse": Requests that only the summary of the
  5550. // specified layer be provided in the response.
  5551. func (c *MylibraryAnnotationsInsertCall) ShowOnlySummaryInResponse(showOnlySummaryInResponse bool) *MylibraryAnnotationsInsertCall {
  5552. c.urlParams_.Set("showOnlySummaryInResponse", fmt.Sprint(showOnlySummaryInResponse))
  5553. return c
  5554. }
  5555. // Source sets the optional parameter "source": String to identify the
  5556. // originator of this request.
  5557. func (c *MylibraryAnnotationsInsertCall) Source(source string) *MylibraryAnnotationsInsertCall {
  5558. c.urlParams_.Set("source", source)
  5559. return c
  5560. }
  5561. // Fields allows partial responses to be retrieved. See
  5562. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  5563. // for more information.
  5564. func (c *MylibraryAnnotationsInsertCall) Fields(s ...googleapi.Field) *MylibraryAnnotationsInsertCall {
  5565. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  5566. return c
  5567. }
  5568. // Context sets the context to be used in this call's Do method. Any
  5569. // pending HTTP request will be aborted if the provided context is
  5570. // canceled.
  5571. func (c *MylibraryAnnotationsInsertCall) Context(ctx context.Context) *MylibraryAnnotationsInsertCall {
  5572. c.ctx_ = ctx
  5573. return c
  5574. }
  5575. func (c *MylibraryAnnotationsInsertCall) doRequest(alt string) (*http.Response, error) {
  5576. var body io.Reader = nil
  5577. body, err := googleapi.WithoutDataWrapper.JSONReader(c.annotation)
  5578. if err != nil {
  5579. return nil, err
  5580. }
  5581. ctype := "application/json"
  5582. c.urlParams_.Set("alt", alt)
  5583. urls := googleapi.ResolveRelative(c.s.BasePath, "mylibrary/annotations")
  5584. urls += "?" + c.urlParams_.Encode()
  5585. req, _ := http.NewRequest("POST", urls, body)
  5586. googleapi.SetOpaque(req.URL)
  5587. req.Header.Set("Content-Type", ctype)
  5588. req.Header.Set("User-Agent", c.s.userAgent())
  5589. if c.ctx_ != nil {
  5590. return ctxhttp.Do(c.ctx_, c.s.client, req)
  5591. }
  5592. return c.s.client.Do(req)
  5593. }
  5594. // Do executes the "books.mylibrary.annotations.insert" call.
  5595. // Exactly one of *Annotation or error will be non-nil. Any non-2xx
  5596. // status code is an error. Response headers are in either
  5597. // *Annotation.ServerResponse.Header or (if a response was returned at
  5598. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  5599. // to check whether the returned error was because
  5600. // http.StatusNotModified was returned.
  5601. func (c *MylibraryAnnotationsInsertCall) Do(opts ...googleapi.CallOption) (*Annotation, error) {
  5602. gensupport.SetOptions(c.urlParams_, opts...)
  5603. res, err := c.doRequest("json")
  5604. if res != nil && res.StatusCode == http.StatusNotModified {
  5605. if res.Body != nil {
  5606. res.Body.Close()
  5607. }
  5608. return nil, &googleapi.Error{
  5609. Code: res.StatusCode,
  5610. Header: res.Header,
  5611. }
  5612. }
  5613. if err != nil {
  5614. return nil, err
  5615. }
  5616. defer googleapi.CloseBody(res)
  5617. if err := googleapi.CheckResponse(res); err != nil {
  5618. return nil, err
  5619. }
  5620. ret := &Annotation{
  5621. ServerResponse: googleapi.ServerResponse{
  5622. Header: res.Header,
  5623. HTTPStatusCode: res.StatusCode,
  5624. },
  5625. }
  5626. if err := json.NewDecoder(res.Body).Decode(&ret); err != nil {
  5627. return nil, err
  5628. }
  5629. return ret, nil
  5630. // {
  5631. // "description": "Inserts a new annotation.",
  5632. // "httpMethod": "POST",
  5633. // "id": "books.mylibrary.annotations.insert",
  5634. // "parameters": {
  5635. // "country": {
  5636. // "description": "ISO-3166-1 code to override the IP-based location.",
  5637. // "location": "query",
  5638. // "type": "string"
  5639. // },
  5640. // "showOnlySummaryInResponse": {
  5641. // "description": "Requests that only the summary of the specified layer be provided in the response.",
  5642. // "location": "query",
  5643. // "type": "boolean"
  5644. // },
  5645. // "source": {
  5646. // "description": "String to identify the originator of this request.",
  5647. // "location": "query",
  5648. // "type": "string"
  5649. // }
  5650. // },
  5651. // "path": "mylibrary/annotations",
  5652. // "request": {
  5653. // "$ref": "Annotation"
  5654. // },
  5655. // "response": {
  5656. // "$ref": "Annotation"
  5657. // },
  5658. // "scopes": [
  5659. // "https://www.googleapis.com/auth/books"
  5660. // ]
  5661. // }
  5662. }
  5663. // method id "books.mylibrary.annotations.list":
  5664. type MylibraryAnnotationsListCall struct {
  5665. s *Service
  5666. urlParams_ gensupport.URLParams
  5667. ifNoneMatch_ string
  5668. ctx_ context.Context
  5669. }
  5670. // List: Retrieves a list of annotations, possibly filtered.
  5671. func (r *MylibraryAnnotationsService) List() *MylibraryAnnotationsListCall {
  5672. c := &MylibraryAnnotationsListCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  5673. return c
  5674. }
  5675. // ContentVersion sets the optional parameter "contentVersion": The
  5676. // content version for the requested volume.
  5677. func (c *MylibraryAnnotationsListCall) ContentVersion(contentVersion string) *MylibraryAnnotationsListCall {
  5678. c.urlParams_.Set("contentVersion", contentVersion)
  5679. return c
  5680. }
  5681. // LayerId sets the optional parameter "layerId": The layer ID to limit
  5682. // annotation by.
  5683. func (c *MylibraryAnnotationsListCall) LayerId(layerId string) *MylibraryAnnotationsListCall {
  5684. c.urlParams_.Set("layerId", layerId)
  5685. return c
  5686. }
  5687. // LayerIds sets the optional parameter "layerIds": The layer ID(s) to
  5688. // limit annotation by.
  5689. func (c *MylibraryAnnotationsListCall) LayerIds(layerIds ...string) *MylibraryAnnotationsListCall {
  5690. c.urlParams_.SetMulti("layerIds", append([]string{}, layerIds...))
  5691. return c
  5692. }
  5693. // MaxResults sets the optional parameter "maxResults": Maximum number
  5694. // of results to return
  5695. func (c *MylibraryAnnotationsListCall) MaxResults(maxResults int64) *MylibraryAnnotationsListCall {
  5696. c.urlParams_.Set("maxResults", fmt.Sprint(maxResults))
  5697. return c
  5698. }
  5699. // PageToken sets the optional parameter "pageToken": The value of the
  5700. // nextToken from the previous page.
  5701. func (c *MylibraryAnnotationsListCall) PageToken(pageToken string) *MylibraryAnnotationsListCall {
  5702. c.urlParams_.Set("pageToken", pageToken)
  5703. return c
  5704. }
  5705. // ShowDeleted sets the optional parameter "showDeleted": Set to true to
  5706. // return deleted annotations. updatedMin must be in the request to use
  5707. // this. Defaults to false.
  5708. func (c *MylibraryAnnotationsListCall) ShowDeleted(showDeleted bool) *MylibraryAnnotationsListCall {
  5709. c.urlParams_.Set("showDeleted", fmt.Sprint(showDeleted))
  5710. return c
  5711. }
  5712. // Source sets the optional parameter "source": String to identify the
  5713. // originator of this request.
  5714. func (c *MylibraryAnnotationsListCall) Source(source string) *MylibraryAnnotationsListCall {
  5715. c.urlParams_.Set("source", source)
  5716. return c
  5717. }
  5718. // UpdatedMax sets the optional parameter "updatedMax": RFC 3339
  5719. // timestamp to restrict to items updated prior to this timestamp
  5720. // (exclusive).
  5721. func (c *MylibraryAnnotationsListCall) UpdatedMax(updatedMax string) *MylibraryAnnotationsListCall {
  5722. c.urlParams_.Set("updatedMax", updatedMax)
  5723. return c
  5724. }
  5725. // UpdatedMin sets the optional parameter "updatedMin": RFC 3339
  5726. // timestamp to restrict to items updated since this timestamp
  5727. // (inclusive).
  5728. func (c *MylibraryAnnotationsListCall) UpdatedMin(updatedMin string) *MylibraryAnnotationsListCall {
  5729. c.urlParams_.Set("updatedMin", updatedMin)
  5730. return c
  5731. }
  5732. // VolumeId sets the optional parameter "volumeId": The volume to
  5733. // restrict annotations to.
  5734. func (c *MylibraryAnnotationsListCall) VolumeId(volumeId string) *MylibraryAnnotationsListCall {
  5735. c.urlParams_.Set("volumeId", volumeId)
  5736. return c
  5737. }
  5738. // Fields allows partial responses to be retrieved. See
  5739. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  5740. // for more information.
  5741. func (c *MylibraryAnnotationsListCall) Fields(s ...googleapi.Field) *MylibraryAnnotationsListCall {
  5742. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  5743. return c
  5744. }
  5745. // IfNoneMatch sets the optional parameter which makes the operation
  5746. // fail if the object's ETag matches the given value. This is useful for
  5747. // getting updates only after the object has changed since the last
  5748. // request. Use googleapi.IsNotModified to check whether the response
  5749. // error from Do is the result of In-None-Match.
  5750. func (c *MylibraryAnnotationsListCall) IfNoneMatch(entityTag string) *MylibraryAnnotationsListCall {
  5751. c.ifNoneMatch_ = entityTag
  5752. return c
  5753. }
  5754. // Context sets the context to be used in this call's Do method. Any
  5755. // pending HTTP request will be aborted if the provided context is
  5756. // canceled.
  5757. func (c *MylibraryAnnotationsListCall) Context(ctx context.Context) *MylibraryAnnotationsListCall {
  5758. c.ctx_ = ctx
  5759. return c
  5760. }
  5761. func (c *MylibraryAnnotationsListCall) doRequest(alt string) (*http.Response, error) {
  5762. var body io.Reader = nil
  5763. c.urlParams_.Set("alt", alt)
  5764. urls := googleapi.ResolveRelative(c.s.BasePath, "mylibrary/annotations")
  5765. urls += "?" + c.urlParams_.Encode()
  5766. req, _ := http.NewRequest("GET", urls, body)
  5767. googleapi.SetOpaque(req.URL)
  5768. req.Header.Set("User-Agent", c.s.userAgent())
  5769. if c.ifNoneMatch_ != "" {
  5770. req.Header.Set("If-None-Match", c.ifNoneMatch_)
  5771. }
  5772. if c.ctx_ != nil {
  5773. return ctxhttp.Do(c.ctx_, c.s.client, req)
  5774. }
  5775. return c.s.client.Do(req)
  5776. }
  5777. // Do executes the "books.mylibrary.annotations.list" call.
  5778. // Exactly one of *Annotations or error will be non-nil. Any non-2xx
  5779. // status code is an error. Response headers are in either
  5780. // *Annotations.ServerResponse.Header or (if a response was returned at
  5781. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  5782. // to check whether the returned error was because
  5783. // http.StatusNotModified was returned.
  5784. func (c *MylibraryAnnotationsListCall) Do(opts ...googleapi.CallOption) (*Annotations, error) {
  5785. gensupport.SetOptions(c.urlParams_, opts...)
  5786. res, err := c.doRequest("json")
  5787. if res != nil && res.StatusCode == http.StatusNotModified {
  5788. if res.Body != nil {
  5789. res.Body.Close()
  5790. }
  5791. return nil, &googleapi.Error{
  5792. Code: res.StatusCode,
  5793. Header: res.Header,
  5794. }
  5795. }
  5796. if err != nil {
  5797. return nil, err
  5798. }
  5799. defer googleapi.CloseBody(res)
  5800. if err := googleapi.CheckResponse(res); err != nil {
  5801. return nil, err
  5802. }
  5803. ret := &Annotations{
  5804. ServerResponse: googleapi.ServerResponse{
  5805. Header: res.Header,
  5806. HTTPStatusCode: res.StatusCode,
  5807. },
  5808. }
  5809. if err := json.NewDecoder(res.Body).Decode(&ret); err != nil {
  5810. return nil, err
  5811. }
  5812. return ret, nil
  5813. // {
  5814. // "description": "Retrieves a list of annotations, possibly filtered.",
  5815. // "httpMethod": "GET",
  5816. // "id": "books.mylibrary.annotations.list",
  5817. // "parameters": {
  5818. // "contentVersion": {
  5819. // "description": "The content version for the requested volume.",
  5820. // "location": "query",
  5821. // "type": "string"
  5822. // },
  5823. // "layerId": {
  5824. // "description": "The layer ID to limit annotation by.",
  5825. // "location": "query",
  5826. // "type": "string"
  5827. // },
  5828. // "layerIds": {
  5829. // "description": "The layer ID(s) to limit annotation by.",
  5830. // "location": "query",
  5831. // "repeated": true,
  5832. // "type": "string"
  5833. // },
  5834. // "maxResults": {
  5835. // "description": "Maximum number of results to return",
  5836. // "format": "uint32",
  5837. // "location": "query",
  5838. // "maximum": "40",
  5839. // "minimum": "0",
  5840. // "type": "integer"
  5841. // },
  5842. // "pageToken": {
  5843. // "description": "The value of the nextToken from the previous page.",
  5844. // "location": "query",
  5845. // "type": "string"
  5846. // },
  5847. // "showDeleted": {
  5848. // "description": "Set to true to return deleted annotations. updatedMin must be in the request to use this. Defaults to false.",
  5849. // "location": "query",
  5850. // "type": "boolean"
  5851. // },
  5852. // "source": {
  5853. // "description": "String to identify the originator of this request.",
  5854. // "location": "query",
  5855. // "type": "string"
  5856. // },
  5857. // "updatedMax": {
  5858. // "description": "RFC 3339 timestamp to restrict to items updated prior to this timestamp (exclusive).",
  5859. // "location": "query",
  5860. // "type": "string"
  5861. // },
  5862. // "updatedMin": {
  5863. // "description": "RFC 3339 timestamp to restrict to items updated since this timestamp (inclusive).",
  5864. // "location": "query",
  5865. // "type": "string"
  5866. // },
  5867. // "volumeId": {
  5868. // "description": "The volume to restrict annotations to.",
  5869. // "location": "query",
  5870. // "type": "string"
  5871. // }
  5872. // },
  5873. // "path": "mylibrary/annotations",
  5874. // "response": {
  5875. // "$ref": "Annotations"
  5876. // },
  5877. // "scopes": [
  5878. // "https://www.googleapis.com/auth/books"
  5879. // ]
  5880. // }
  5881. }
  5882. // Pages invokes f for each page of results.
  5883. // A non-nil error returned from f will halt the iteration.
  5884. // The provided context supersedes any context provided to the Context method.
  5885. func (c *MylibraryAnnotationsListCall) Pages(ctx context.Context, f func(*Annotations) error) error {
  5886. c.ctx_ = ctx
  5887. defer c.PageToken(c.urlParams_.Get("pageToken")) // reset paging to original point
  5888. for {
  5889. x, err := c.Do()
  5890. if err != nil {
  5891. return err
  5892. }
  5893. if err := f(x); err != nil {
  5894. return err
  5895. }
  5896. if x.NextPageToken == "" {
  5897. return nil
  5898. }
  5899. c.PageToken(x.NextPageToken)
  5900. }
  5901. }
  5902. // method id "books.mylibrary.annotations.summary":
  5903. type MylibraryAnnotationsSummaryCall struct {
  5904. s *Service
  5905. urlParams_ gensupport.URLParams
  5906. ctx_ context.Context
  5907. }
  5908. // Summary: Gets the summary of specified layers.
  5909. func (r *MylibraryAnnotationsService) Summary(layerIds []string, volumeId string) *MylibraryAnnotationsSummaryCall {
  5910. c := &MylibraryAnnotationsSummaryCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  5911. c.urlParams_.SetMulti("layerIds", append([]string{}, layerIds...))
  5912. c.urlParams_.Set("volumeId", volumeId)
  5913. return c
  5914. }
  5915. // Fields allows partial responses to be retrieved. See
  5916. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  5917. // for more information.
  5918. func (c *MylibraryAnnotationsSummaryCall) Fields(s ...googleapi.Field) *MylibraryAnnotationsSummaryCall {
  5919. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  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 *MylibraryAnnotationsSummaryCall) Context(ctx context.Context) *MylibraryAnnotationsSummaryCall {
  5926. c.ctx_ = ctx
  5927. return c
  5928. }
  5929. func (c *MylibraryAnnotationsSummaryCall) 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, "mylibrary/annotations/summary")
  5933. urls += "?" + c.urlParams_.Encode()
  5934. req, _ := http.NewRequest("POST", urls, body)
  5935. googleapi.SetOpaque(req.URL)
  5936. req.Header.Set("User-Agent", c.s.userAgent())
  5937. if c.ctx_ != nil {
  5938. return ctxhttp.Do(c.ctx_, c.s.client, req)
  5939. }
  5940. return c.s.client.Do(req)
  5941. }
  5942. // Do executes the "books.mylibrary.annotations.summary" call.
  5943. // Exactly one of *AnnotationsSummary or error will be non-nil. Any
  5944. // non-2xx status code is an error. Response headers are in either
  5945. // *AnnotationsSummary.ServerResponse.Header or (if a response was
  5946. // returned at all) in error.(*googleapi.Error).Header. Use
  5947. // googleapi.IsNotModified to check whether the returned error was
  5948. // because http.StatusNotModified was returned.
  5949. func (c *MylibraryAnnotationsSummaryCall) Do(opts ...googleapi.CallOption) (*AnnotationsSummary, error) {
  5950. gensupport.SetOptions(c.urlParams_, opts...)
  5951. res, err := c.doRequest("json")
  5952. if res != nil && res.StatusCode == http.StatusNotModified {
  5953. if res.Body != nil {
  5954. res.Body.Close()
  5955. }
  5956. return nil, &googleapi.Error{
  5957. Code: res.StatusCode,
  5958. Header: res.Header,
  5959. }
  5960. }
  5961. if err != nil {
  5962. return nil, err
  5963. }
  5964. defer googleapi.CloseBody(res)
  5965. if err := googleapi.CheckResponse(res); err != nil {
  5966. return nil, err
  5967. }
  5968. ret := &AnnotationsSummary{
  5969. ServerResponse: googleapi.ServerResponse{
  5970. Header: res.Header,
  5971. HTTPStatusCode: res.StatusCode,
  5972. },
  5973. }
  5974. if err := json.NewDecoder(res.Body).Decode(&ret); err != nil {
  5975. return nil, err
  5976. }
  5977. return ret, nil
  5978. // {
  5979. // "description": "Gets the summary of specified layers.",
  5980. // "httpMethod": "POST",
  5981. // "id": "books.mylibrary.annotations.summary",
  5982. // "parameterOrder": [
  5983. // "layerIds",
  5984. // "volumeId"
  5985. // ],
  5986. // "parameters": {
  5987. // "layerIds": {
  5988. // "description": "Array of layer IDs to get the summary for.",
  5989. // "location": "query",
  5990. // "repeated": true,
  5991. // "required": true,
  5992. // "type": "string"
  5993. // },
  5994. // "volumeId": {
  5995. // "description": "Volume id to get the summary for.",
  5996. // "location": "query",
  5997. // "required": true,
  5998. // "type": "string"
  5999. // }
  6000. // },
  6001. // "path": "mylibrary/annotations/summary",
  6002. // "response": {
  6003. // "$ref": "AnnotationsSummary"
  6004. // },
  6005. // "scopes": [
  6006. // "https://www.googleapis.com/auth/books"
  6007. // ]
  6008. // }
  6009. }
  6010. // method id "books.mylibrary.annotations.update":
  6011. type MylibraryAnnotationsUpdateCall struct {
  6012. s *Service
  6013. annotationId string
  6014. annotation *Annotation
  6015. urlParams_ gensupport.URLParams
  6016. ctx_ context.Context
  6017. }
  6018. // Update: Updates an existing annotation.
  6019. func (r *MylibraryAnnotationsService) Update(annotationId string, annotation *Annotation) *MylibraryAnnotationsUpdateCall {
  6020. c := &MylibraryAnnotationsUpdateCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  6021. c.annotationId = annotationId
  6022. c.annotation = annotation
  6023. return c
  6024. }
  6025. // Source sets the optional parameter "source": String to identify the
  6026. // originator of this request.
  6027. func (c *MylibraryAnnotationsUpdateCall) Source(source string) *MylibraryAnnotationsUpdateCall {
  6028. c.urlParams_.Set("source", source)
  6029. return c
  6030. }
  6031. // Fields allows partial responses to be retrieved. See
  6032. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  6033. // for more information.
  6034. func (c *MylibraryAnnotationsUpdateCall) Fields(s ...googleapi.Field) *MylibraryAnnotationsUpdateCall {
  6035. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  6036. return c
  6037. }
  6038. // Context sets the context to be used in this call's Do method. Any
  6039. // pending HTTP request will be aborted if the provided context is
  6040. // canceled.
  6041. func (c *MylibraryAnnotationsUpdateCall) Context(ctx context.Context) *MylibraryAnnotationsUpdateCall {
  6042. c.ctx_ = ctx
  6043. return c
  6044. }
  6045. func (c *MylibraryAnnotationsUpdateCall) doRequest(alt string) (*http.Response, error) {
  6046. var body io.Reader = nil
  6047. body, err := googleapi.WithoutDataWrapper.JSONReader(c.annotation)
  6048. if err != nil {
  6049. return nil, err
  6050. }
  6051. ctype := "application/json"
  6052. c.urlParams_.Set("alt", alt)
  6053. urls := googleapi.ResolveRelative(c.s.BasePath, "mylibrary/annotations/{annotationId}")
  6054. urls += "?" + c.urlParams_.Encode()
  6055. req, _ := http.NewRequest("PUT", urls, body)
  6056. googleapi.Expand(req.URL, map[string]string{
  6057. "annotationId": c.annotationId,
  6058. })
  6059. req.Header.Set("Content-Type", ctype)
  6060. req.Header.Set("User-Agent", c.s.userAgent())
  6061. if c.ctx_ != nil {
  6062. return ctxhttp.Do(c.ctx_, c.s.client, req)
  6063. }
  6064. return c.s.client.Do(req)
  6065. }
  6066. // Do executes the "books.mylibrary.annotations.update" call.
  6067. // Exactly one of *Annotation or error will be non-nil. Any non-2xx
  6068. // status code is an error. Response headers are in either
  6069. // *Annotation.ServerResponse.Header or (if a response was returned at
  6070. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  6071. // to check whether the returned error was because
  6072. // http.StatusNotModified was returned.
  6073. func (c *MylibraryAnnotationsUpdateCall) Do(opts ...googleapi.CallOption) (*Annotation, error) {
  6074. gensupport.SetOptions(c.urlParams_, opts...)
  6075. res, err := c.doRequest("json")
  6076. if res != nil && res.StatusCode == http.StatusNotModified {
  6077. if res.Body != nil {
  6078. res.Body.Close()
  6079. }
  6080. return nil, &googleapi.Error{
  6081. Code: res.StatusCode,
  6082. Header: res.Header,
  6083. }
  6084. }
  6085. if err != nil {
  6086. return nil, err
  6087. }
  6088. defer googleapi.CloseBody(res)
  6089. if err := googleapi.CheckResponse(res); err != nil {
  6090. return nil, err
  6091. }
  6092. ret := &Annotation{
  6093. ServerResponse: googleapi.ServerResponse{
  6094. Header: res.Header,
  6095. HTTPStatusCode: res.StatusCode,
  6096. },
  6097. }
  6098. if err := json.NewDecoder(res.Body).Decode(&ret); err != nil {
  6099. return nil, err
  6100. }
  6101. return ret, nil
  6102. // {
  6103. // "description": "Updates an existing annotation.",
  6104. // "httpMethod": "PUT",
  6105. // "id": "books.mylibrary.annotations.update",
  6106. // "parameterOrder": [
  6107. // "annotationId"
  6108. // ],
  6109. // "parameters": {
  6110. // "annotationId": {
  6111. // "description": "The ID for the annotation to update.",
  6112. // "location": "path",
  6113. // "required": true,
  6114. // "type": "string"
  6115. // },
  6116. // "source": {
  6117. // "description": "String to identify the originator of this request.",
  6118. // "location": "query",
  6119. // "type": "string"
  6120. // }
  6121. // },
  6122. // "path": "mylibrary/annotations/{annotationId}",
  6123. // "request": {
  6124. // "$ref": "Annotation"
  6125. // },
  6126. // "response": {
  6127. // "$ref": "Annotation"
  6128. // },
  6129. // "scopes": [
  6130. // "https://www.googleapis.com/auth/books"
  6131. // ]
  6132. // }
  6133. }
  6134. // method id "books.mylibrary.bookshelves.addVolume":
  6135. type MylibraryBookshelvesAddVolumeCall struct {
  6136. s *Service
  6137. shelf string
  6138. urlParams_ gensupport.URLParams
  6139. ctx_ context.Context
  6140. }
  6141. // AddVolume: Adds a volume to a bookshelf.
  6142. func (r *MylibraryBookshelvesService) AddVolume(shelf string, volumeId string) *MylibraryBookshelvesAddVolumeCall {
  6143. c := &MylibraryBookshelvesAddVolumeCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  6144. c.shelf = shelf
  6145. c.urlParams_.Set("volumeId", volumeId)
  6146. return c
  6147. }
  6148. // Reason sets the optional parameter "reason": The reason for which the
  6149. // book is added to the library.
  6150. //
  6151. // Possible values:
  6152. // "IOS_PREX" - Volumes added from the PREX flow on iOS.
  6153. // "IOS_SEARCH" - Volumes added from the Search flow on iOS.
  6154. // "ONBOARDING" - Volumes added from the Onboarding flow.
  6155. func (c *MylibraryBookshelvesAddVolumeCall) Reason(reason string) *MylibraryBookshelvesAddVolumeCall {
  6156. c.urlParams_.Set("reason", reason)
  6157. return c
  6158. }
  6159. // Source sets the optional parameter "source": String to identify the
  6160. // originator of this request.
  6161. func (c *MylibraryBookshelvesAddVolumeCall) Source(source string) *MylibraryBookshelvesAddVolumeCall {
  6162. c.urlParams_.Set("source", source)
  6163. return c
  6164. }
  6165. // Fields allows partial responses to be retrieved. See
  6166. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  6167. // for more information.
  6168. func (c *MylibraryBookshelvesAddVolumeCall) Fields(s ...googleapi.Field) *MylibraryBookshelvesAddVolumeCall {
  6169. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  6170. return c
  6171. }
  6172. // Context sets the context to be used in this call's Do method. Any
  6173. // pending HTTP request will be aborted if the provided context is
  6174. // canceled.
  6175. func (c *MylibraryBookshelvesAddVolumeCall) Context(ctx context.Context) *MylibraryBookshelvesAddVolumeCall {
  6176. c.ctx_ = ctx
  6177. return c
  6178. }
  6179. func (c *MylibraryBookshelvesAddVolumeCall) doRequest(alt string) (*http.Response, error) {
  6180. var body io.Reader = nil
  6181. c.urlParams_.Set("alt", alt)
  6182. urls := googleapi.ResolveRelative(c.s.BasePath, "mylibrary/bookshelves/{shelf}/addVolume")
  6183. urls += "?" + c.urlParams_.Encode()
  6184. req, _ := http.NewRequest("POST", urls, body)
  6185. googleapi.Expand(req.URL, map[string]string{
  6186. "shelf": c.shelf,
  6187. })
  6188. req.Header.Set("User-Agent", c.s.userAgent())
  6189. if c.ctx_ != nil {
  6190. return ctxhttp.Do(c.ctx_, c.s.client, req)
  6191. }
  6192. return c.s.client.Do(req)
  6193. }
  6194. // Do executes the "books.mylibrary.bookshelves.addVolume" call.
  6195. func (c *MylibraryBookshelvesAddVolumeCall) Do(opts ...googleapi.CallOption) error {
  6196. gensupport.SetOptions(c.urlParams_, opts...)
  6197. res, err := c.doRequest("json")
  6198. if err != nil {
  6199. return err
  6200. }
  6201. defer googleapi.CloseBody(res)
  6202. if err := googleapi.CheckResponse(res); err != nil {
  6203. return err
  6204. }
  6205. return nil
  6206. // {
  6207. // "description": "Adds a volume to a bookshelf.",
  6208. // "httpMethod": "POST",
  6209. // "id": "books.mylibrary.bookshelves.addVolume",
  6210. // "parameterOrder": [
  6211. // "shelf",
  6212. // "volumeId"
  6213. // ],
  6214. // "parameters": {
  6215. // "reason": {
  6216. // "description": "The reason for which the book is added to the library.",
  6217. // "enum": [
  6218. // "IOS_PREX",
  6219. // "IOS_SEARCH",
  6220. // "ONBOARDING"
  6221. // ],
  6222. // "enumDescriptions": [
  6223. // "Volumes added from the PREX flow on iOS.",
  6224. // "Volumes added from the Search flow on iOS.",
  6225. // "Volumes added from the Onboarding flow."
  6226. // ],
  6227. // "location": "query",
  6228. // "type": "string"
  6229. // },
  6230. // "shelf": {
  6231. // "description": "ID of bookshelf to which to add a volume.",
  6232. // "location": "path",
  6233. // "required": true,
  6234. // "type": "string"
  6235. // },
  6236. // "source": {
  6237. // "description": "String to identify the originator of this request.",
  6238. // "location": "query",
  6239. // "type": "string"
  6240. // },
  6241. // "volumeId": {
  6242. // "description": "ID of volume to add.",
  6243. // "location": "query",
  6244. // "required": true,
  6245. // "type": "string"
  6246. // }
  6247. // },
  6248. // "path": "mylibrary/bookshelves/{shelf}/addVolume",
  6249. // "scopes": [
  6250. // "https://www.googleapis.com/auth/books"
  6251. // ]
  6252. // }
  6253. }
  6254. // method id "books.mylibrary.bookshelves.clearVolumes":
  6255. type MylibraryBookshelvesClearVolumesCall struct {
  6256. s *Service
  6257. shelf string
  6258. urlParams_ gensupport.URLParams
  6259. ctx_ context.Context
  6260. }
  6261. // ClearVolumes: Clears all volumes from a bookshelf.
  6262. func (r *MylibraryBookshelvesService) ClearVolumes(shelf string) *MylibraryBookshelvesClearVolumesCall {
  6263. c := &MylibraryBookshelvesClearVolumesCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  6264. c.shelf = shelf
  6265. return c
  6266. }
  6267. // Source sets the optional parameter "source": String to identify the
  6268. // originator of this request.
  6269. func (c *MylibraryBookshelvesClearVolumesCall) Source(source string) *MylibraryBookshelvesClearVolumesCall {
  6270. c.urlParams_.Set("source", source)
  6271. return c
  6272. }
  6273. // Fields allows partial responses to be retrieved. See
  6274. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  6275. // for more information.
  6276. func (c *MylibraryBookshelvesClearVolumesCall) Fields(s ...googleapi.Field) *MylibraryBookshelvesClearVolumesCall {
  6277. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  6278. return c
  6279. }
  6280. // Context sets the context to be used in this call's Do method. Any
  6281. // pending HTTP request will be aborted if the provided context is
  6282. // canceled.
  6283. func (c *MylibraryBookshelvesClearVolumesCall) Context(ctx context.Context) *MylibraryBookshelvesClearVolumesCall {
  6284. c.ctx_ = ctx
  6285. return c
  6286. }
  6287. func (c *MylibraryBookshelvesClearVolumesCall) doRequest(alt string) (*http.Response, error) {
  6288. var body io.Reader = nil
  6289. c.urlParams_.Set("alt", alt)
  6290. urls := googleapi.ResolveRelative(c.s.BasePath, "mylibrary/bookshelves/{shelf}/clearVolumes")
  6291. urls += "?" + c.urlParams_.Encode()
  6292. req, _ := http.NewRequest("POST", urls, body)
  6293. googleapi.Expand(req.URL, map[string]string{
  6294. "shelf": c.shelf,
  6295. })
  6296. req.Header.Set("User-Agent", c.s.userAgent())
  6297. if c.ctx_ != nil {
  6298. return ctxhttp.Do(c.ctx_, c.s.client, req)
  6299. }
  6300. return c.s.client.Do(req)
  6301. }
  6302. // Do executes the "books.mylibrary.bookshelves.clearVolumes" call.
  6303. func (c *MylibraryBookshelvesClearVolumesCall) Do(opts ...googleapi.CallOption) error {
  6304. gensupport.SetOptions(c.urlParams_, opts...)
  6305. res, err := c.doRequest("json")
  6306. if err != nil {
  6307. return err
  6308. }
  6309. defer googleapi.CloseBody(res)
  6310. if err := googleapi.CheckResponse(res); err != nil {
  6311. return err
  6312. }
  6313. return nil
  6314. // {
  6315. // "description": "Clears all volumes from a bookshelf.",
  6316. // "httpMethod": "POST",
  6317. // "id": "books.mylibrary.bookshelves.clearVolumes",
  6318. // "parameterOrder": [
  6319. // "shelf"
  6320. // ],
  6321. // "parameters": {
  6322. // "shelf": {
  6323. // "description": "ID of bookshelf from which to remove a volume.",
  6324. // "location": "path",
  6325. // "required": true,
  6326. // "type": "string"
  6327. // },
  6328. // "source": {
  6329. // "description": "String to identify the originator of this request.",
  6330. // "location": "query",
  6331. // "type": "string"
  6332. // }
  6333. // },
  6334. // "path": "mylibrary/bookshelves/{shelf}/clearVolumes",
  6335. // "scopes": [
  6336. // "https://www.googleapis.com/auth/books"
  6337. // ]
  6338. // }
  6339. }
  6340. // method id "books.mylibrary.bookshelves.get":
  6341. type MylibraryBookshelvesGetCall struct {
  6342. s *Service
  6343. shelf string
  6344. urlParams_ gensupport.URLParams
  6345. ifNoneMatch_ string
  6346. ctx_ context.Context
  6347. }
  6348. // Get: Retrieves metadata for a specific bookshelf belonging to the
  6349. // authenticated user.
  6350. func (r *MylibraryBookshelvesService) Get(shelf string) *MylibraryBookshelvesGetCall {
  6351. c := &MylibraryBookshelvesGetCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  6352. c.shelf = shelf
  6353. return c
  6354. }
  6355. // Source sets the optional parameter "source": String to identify the
  6356. // originator of this request.
  6357. func (c *MylibraryBookshelvesGetCall) Source(source string) *MylibraryBookshelvesGetCall {
  6358. c.urlParams_.Set("source", source)
  6359. return c
  6360. }
  6361. // Fields allows partial responses to be retrieved. See
  6362. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  6363. // for more information.
  6364. func (c *MylibraryBookshelvesGetCall) Fields(s ...googleapi.Field) *MylibraryBookshelvesGetCall {
  6365. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  6366. return c
  6367. }
  6368. // IfNoneMatch sets the optional parameter which makes the operation
  6369. // fail if the object's ETag matches the given value. This is useful for
  6370. // getting updates only after the object has changed since the last
  6371. // request. Use googleapi.IsNotModified to check whether the response
  6372. // error from Do is the result of In-None-Match.
  6373. func (c *MylibraryBookshelvesGetCall) IfNoneMatch(entityTag string) *MylibraryBookshelvesGetCall {
  6374. c.ifNoneMatch_ = entityTag
  6375. return c
  6376. }
  6377. // Context sets the context to be used in this call's Do method. Any
  6378. // pending HTTP request will be aborted if the provided context is
  6379. // canceled.
  6380. func (c *MylibraryBookshelvesGetCall) Context(ctx context.Context) *MylibraryBookshelvesGetCall {
  6381. c.ctx_ = ctx
  6382. return c
  6383. }
  6384. func (c *MylibraryBookshelvesGetCall) doRequest(alt string) (*http.Response, error) {
  6385. var body io.Reader = nil
  6386. c.urlParams_.Set("alt", alt)
  6387. urls := googleapi.ResolveRelative(c.s.BasePath, "mylibrary/bookshelves/{shelf}")
  6388. urls += "?" + c.urlParams_.Encode()
  6389. req, _ := http.NewRequest("GET", urls, body)
  6390. googleapi.Expand(req.URL, map[string]string{
  6391. "shelf": c.shelf,
  6392. })
  6393. req.Header.Set("User-Agent", c.s.userAgent())
  6394. if c.ifNoneMatch_ != "" {
  6395. req.Header.Set("If-None-Match", c.ifNoneMatch_)
  6396. }
  6397. if c.ctx_ != nil {
  6398. return ctxhttp.Do(c.ctx_, c.s.client, req)
  6399. }
  6400. return c.s.client.Do(req)
  6401. }
  6402. // Do executes the "books.mylibrary.bookshelves.get" call.
  6403. // Exactly one of *Bookshelf or error will be non-nil. Any non-2xx
  6404. // status code is an error. Response headers are in either
  6405. // *Bookshelf.ServerResponse.Header or (if a response was returned at
  6406. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  6407. // to check whether the returned error was because
  6408. // http.StatusNotModified was returned.
  6409. func (c *MylibraryBookshelvesGetCall) Do(opts ...googleapi.CallOption) (*Bookshelf, error) {
  6410. gensupport.SetOptions(c.urlParams_, opts...)
  6411. res, err := c.doRequest("json")
  6412. if res != nil && res.StatusCode == http.StatusNotModified {
  6413. if res.Body != nil {
  6414. res.Body.Close()
  6415. }
  6416. return nil, &googleapi.Error{
  6417. Code: res.StatusCode,
  6418. Header: res.Header,
  6419. }
  6420. }
  6421. if err != nil {
  6422. return nil, err
  6423. }
  6424. defer googleapi.CloseBody(res)
  6425. if err := googleapi.CheckResponse(res); err != nil {
  6426. return nil, err
  6427. }
  6428. ret := &Bookshelf{
  6429. ServerResponse: googleapi.ServerResponse{
  6430. Header: res.Header,
  6431. HTTPStatusCode: res.StatusCode,
  6432. },
  6433. }
  6434. if err := json.NewDecoder(res.Body).Decode(&ret); err != nil {
  6435. return nil, err
  6436. }
  6437. return ret, nil
  6438. // {
  6439. // "description": "Retrieves metadata for a specific bookshelf belonging to the authenticated user.",
  6440. // "httpMethod": "GET",
  6441. // "id": "books.mylibrary.bookshelves.get",
  6442. // "parameterOrder": [
  6443. // "shelf"
  6444. // ],
  6445. // "parameters": {
  6446. // "shelf": {
  6447. // "description": "ID of bookshelf to retrieve.",
  6448. // "location": "path",
  6449. // "required": true,
  6450. // "type": "string"
  6451. // },
  6452. // "source": {
  6453. // "description": "String to identify the originator of this request.",
  6454. // "location": "query",
  6455. // "type": "string"
  6456. // }
  6457. // },
  6458. // "path": "mylibrary/bookshelves/{shelf}",
  6459. // "response": {
  6460. // "$ref": "Bookshelf"
  6461. // },
  6462. // "scopes": [
  6463. // "https://www.googleapis.com/auth/books"
  6464. // ]
  6465. // }
  6466. }
  6467. // method id "books.mylibrary.bookshelves.list":
  6468. type MylibraryBookshelvesListCall struct {
  6469. s *Service
  6470. urlParams_ gensupport.URLParams
  6471. ifNoneMatch_ string
  6472. ctx_ context.Context
  6473. }
  6474. // List: Retrieves a list of bookshelves belonging to the authenticated
  6475. // user.
  6476. func (r *MylibraryBookshelvesService) List() *MylibraryBookshelvesListCall {
  6477. c := &MylibraryBookshelvesListCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  6478. return c
  6479. }
  6480. // Source sets the optional parameter "source": String to identify the
  6481. // originator of this request.
  6482. func (c *MylibraryBookshelvesListCall) Source(source string) *MylibraryBookshelvesListCall {
  6483. c.urlParams_.Set("source", source)
  6484. return c
  6485. }
  6486. // Fields allows partial responses to be retrieved. See
  6487. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  6488. // for more information.
  6489. func (c *MylibraryBookshelvesListCall) Fields(s ...googleapi.Field) *MylibraryBookshelvesListCall {
  6490. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  6491. return c
  6492. }
  6493. // IfNoneMatch sets the optional parameter which makes the operation
  6494. // fail if the object's ETag matches the given value. This is useful for
  6495. // getting updates only after the object has changed since the last
  6496. // request. Use googleapi.IsNotModified to check whether the response
  6497. // error from Do is the result of In-None-Match.
  6498. func (c *MylibraryBookshelvesListCall) IfNoneMatch(entityTag string) *MylibraryBookshelvesListCall {
  6499. c.ifNoneMatch_ = entityTag
  6500. return c
  6501. }
  6502. // Context sets the context to be used in this call's Do method. Any
  6503. // pending HTTP request will be aborted if the provided context is
  6504. // canceled.
  6505. func (c *MylibraryBookshelvesListCall) Context(ctx context.Context) *MylibraryBookshelvesListCall {
  6506. c.ctx_ = ctx
  6507. return c
  6508. }
  6509. func (c *MylibraryBookshelvesListCall) doRequest(alt string) (*http.Response, error) {
  6510. var body io.Reader = nil
  6511. c.urlParams_.Set("alt", alt)
  6512. urls := googleapi.ResolveRelative(c.s.BasePath, "mylibrary/bookshelves")
  6513. urls += "?" + c.urlParams_.Encode()
  6514. req, _ := http.NewRequest("GET", urls, body)
  6515. googleapi.SetOpaque(req.URL)
  6516. req.Header.Set("User-Agent", c.s.userAgent())
  6517. if c.ifNoneMatch_ != "" {
  6518. req.Header.Set("If-None-Match", c.ifNoneMatch_)
  6519. }
  6520. if c.ctx_ != nil {
  6521. return ctxhttp.Do(c.ctx_, c.s.client, req)
  6522. }
  6523. return c.s.client.Do(req)
  6524. }
  6525. // Do executes the "books.mylibrary.bookshelves.list" call.
  6526. // Exactly one of *Bookshelves or error will be non-nil. Any non-2xx
  6527. // status code is an error. Response headers are in either
  6528. // *Bookshelves.ServerResponse.Header or (if a response was returned at
  6529. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  6530. // to check whether the returned error was because
  6531. // http.StatusNotModified was returned.
  6532. func (c *MylibraryBookshelvesListCall) Do(opts ...googleapi.CallOption) (*Bookshelves, error) {
  6533. gensupport.SetOptions(c.urlParams_, opts...)
  6534. res, err := c.doRequest("json")
  6535. if res != nil && res.StatusCode == http.StatusNotModified {
  6536. if res.Body != nil {
  6537. res.Body.Close()
  6538. }
  6539. return nil, &googleapi.Error{
  6540. Code: res.StatusCode,
  6541. Header: res.Header,
  6542. }
  6543. }
  6544. if err != nil {
  6545. return nil, err
  6546. }
  6547. defer googleapi.CloseBody(res)
  6548. if err := googleapi.CheckResponse(res); err != nil {
  6549. return nil, err
  6550. }
  6551. ret := &Bookshelves{
  6552. ServerResponse: googleapi.ServerResponse{
  6553. Header: res.Header,
  6554. HTTPStatusCode: res.StatusCode,
  6555. },
  6556. }
  6557. if err := json.NewDecoder(res.Body).Decode(&ret); err != nil {
  6558. return nil, err
  6559. }
  6560. return ret, nil
  6561. // {
  6562. // "description": "Retrieves a list of bookshelves belonging to the authenticated user.",
  6563. // "httpMethod": "GET",
  6564. // "id": "books.mylibrary.bookshelves.list",
  6565. // "parameters": {
  6566. // "source": {
  6567. // "description": "String to identify the originator of this request.",
  6568. // "location": "query",
  6569. // "type": "string"
  6570. // }
  6571. // },
  6572. // "path": "mylibrary/bookshelves",
  6573. // "response": {
  6574. // "$ref": "Bookshelves"
  6575. // },
  6576. // "scopes": [
  6577. // "https://www.googleapis.com/auth/books"
  6578. // ]
  6579. // }
  6580. }
  6581. // method id "books.mylibrary.bookshelves.moveVolume":
  6582. type MylibraryBookshelvesMoveVolumeCall struct {
  6583. s *Service
  6584. shelf string
  6585. urlParams_ gensupport.URLParams
  6586. ctx_ context.Context
  6587. }
  6588. // MoveVolume: Moves a volume within a bookshelf.
  6589. func (r *MylibraryBookshelvesService) MoveVolume(shelf string, volumeId string, volumePosition int64) *MylibraryBookshelvesMoveVolumeCall {
  6590. c := &MylibraryBookshelvesMoveVolumeCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  6591. c.shelf = shelf
  6592. c.urlParams_.Set("volumeId", volumeId)
  6593. c.urlParams_.Set("volumePosition", fmt.Sprint(volumePosition))
  6594. return c
  6595. }
  6596. // Source sets the optional parameter "source": String to identify the
  6597. // originator of this request.
  6598. func (c *MylibraryBookshelvesMoveVolumeCall) Source(source string) *MylibraryBookshelvesMoveVolumeCall {
  6599. c.urlParams_.Set("source", source)
  6600. return c
  6601. }
  6602. // Fields allows partial responses to be retrieved. See
  6603. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  6604. // for more information.
  6605. func (c *MylibraryBookshelvesMoveVolumeCall) Fields(s ...googleapi.Field) *MylibraryBookshelvesMoveVolumeCall {
  6606. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  6607. return c
  6608. }
  6609. // Context sets the context to be used in this call's Do method. Any
  6610. // pending HTTP request will be aborted if the provided context is
  6611. // canceled.
  6612. func (c *MylibraryBookshelvesMoveVolumeCall) Context(ctx context.Context) *MylibraryBookshelvesMoveVolumeCall {
  6613. c.ctx_ = ctx
  6614. return c
  6615. }
  6616. func (c *MylibraryBookshelvesMoveVolumeCall) doRequest(alt string) (*http.Response, error) {
  6617. var body io.Reader = nil
  6618. c.urlParams_.Set("alt", alt)
  6619. urls := googleapi.ResolveRelative(c.s.BasePath, "mylibrary/bookshelves/{shelf}/moveVolume")
  6620. urls += "?" + c.urlParams_.Encode()
  6621. req, _ := http.NewRequest("POST", urls, body)
  6622. googleapi.Expand(req.URL, map[string]string{
  6623. "shelf": c.shelf,
  6624. })
  6625. req.Header.Set("User-Agent", c.s.userAgent())
  6626. if c.ctx_ != nil {
  6627. return ctxhttp.Do(c.ctx_, c.s.client, req)
  6628. }
  6629. return c.s.client.Do(req)
  6630. }
  6631. // Do executes the "books.mylibrary.bookshelves.moveVolume" call.
  6632. func (c *MylibraryBookshelvesMoveVolumeCall) Do(opts ...googleapi.CallOption) error {
  6633. gensupport.SetOptions(c.urlParams_, opts...)
  6634. res, err := c.doRequest("json")
  6635. if err != nil {
  6636. return err
  6637. }
  6638. defer googleapi.CloseBody(res)
  6639. if err := googleapi.CheckResponse(res); err != nil {
  6640. return err
  6641. }
  6642. return nil
  6643. // {
  6644. // "description": "Moves a volume within a bookshelf.",
  6645. // "httpMethod": "POST",
  6646. // "id": "books.mylibrary.bookshelves.moveVolume",
  6647. // "parameterOrder": [
  6648. // "shelf",
  6649. // "volumeId",
  6650. // "volumePosition"
  6651. // ],
  6652. // "parameters": {
  6653. // "shelf": {
  6654. // "description": "ID of bookshelf with the volume.",
  6655. // "location": "path",
  6656. // "required": true,
  6657. // "type": "string"
  6658. // },
  6659. // "source": {
  6660. // "description": "String to identify the originator of this request.",
  6661. // "location": "query",
  6662. // "type": "string"
  6663. // },
  6664. // "volumeId": {
  6665. // "description": "ID of volume to move.",
  6666. // "location": "query",
  6667. // "required": true,
  6668. // "type": "string"
  6669. // },
  6670. // "volumePosition": {
  6671. // "description": "Position on shelf to move the item (0 puts the item before the current first item, 1 puts it between the first and the second and so on.)",
  6672. // "format": "int32",
  6673. // "location": "query",
  6674. // "required": true,
  6675. // "type": "integer"
  6676. // }
  6677. // },
  6678. // "path": "mylibrary/bookshelves/{shelf}/moveVolume",
  6679. // "scopes": [
  6680. // "https://www.googleapis.com/auth/books"
  6681. // ]
  6682. // }
  6683. }
  6684. // method id "books.mylibrary.bookshelves.removeVolume":
  6685. type MylibraryBookshelvesRemoveVolumeCall struct {
  6686. s *Service
  6687. shelf string
  6688. urlParams_ gensupport.URLParams
  6689. ctx_ context.Context
  6690. }
  6691. // RemoveVolume: Removes a volume from a bookshelf.
  6692. func (r *MylibraryBookshelvesService) RemoveVolume(shelf string, volumeId string) *MylibraryBookshelvesRemoveVolumeCall {
  6693. c := &MylibraryBookshelvesRemoveVolumeCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  6694. c.shelf = shelf
  6695. c.urlParams_.Set("volumeId", volumeId)
  6696. return c
  6697. }
  6698. // Reason sets the optional parameter "reason": The reason for which the
  6699. // book is removed from the library.
  6700. //
  6701. // Possible values:
  6702. // "ONBOARDING" - Samples removed from the Onboarding flow.
  6703. func (c *MylibraryBookshelvesRemoveVolumeCall) Reason(reason string) *MylibraryBookshelvesRemoveVolumeCall {
  6704. c.urlParams_.Set("reason", reason)
  6705. return c
  6706. }
  6707. // Source sets the optional parameter "source": String to identify the
  6708. // originator of this request.
  6709. func (c *MylibraryBookshelvesRemoveVolumeCall) Source(source string) *MylibraryBookshelvesRemoveVolumeCall {
  6710. c.urlParams_.Set("source", source)
  6711. return c
  6712. }
  6713. // Fields allows partial responses to be retrieved. See
  6714. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  6715. // for more information.
  6716. func (c *MylibraryBookshelvesRemoveVolumeCall) Fields(s ...googleapi.Field) *MylibraryBookshelvesRemoveVolumeCall {
  6717. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  6718. return c
  6719. }
  6720. // Context sets the context to be used in this call's Do method. Any
  6721. // pending HTTP request will be aborted if the provided context is
  6722. // canceled.
  6723. func (c *MylibraryBookshelvesRemoveVolumeCall) Context(ctx context.Context) *MylibraryBookshelvesRemoveVolumeCall {
  6724. c.ctx_ = ctx
  6725. return c
  6726. }
  6727. func (c *MylibraryBookshelvesRemoveVolumeCall) doRequest(alt string) (*http.Response, error) {
  6728. var body io.Reader = nil
  6729. c.urlParams_.Set("alt", alt)
  6730. urls := googleapi.ResolveRelative(c.s.BasePath, "mylibrary/bookshelves/{shelf}/removeVolume")
  6731. urls += "?" + c.urlParams_.Encode()
  6732. req, _ := http.NewRequest("POST", urls, body)
  6733. googleapi.Expand(req.URL, map[string]string{
  6734. "shelf": c.shelf,
  6735. })
  6736. req.Header.Set("User-Agent", c.s.userAgent())
  6737. if c.ctx_ != nil {
  6738. return ctxhttp.Do(c.ctx_, c.s.client, req)
  6739. }
  6740. return c.s.client.Do(req)
  6741. }
  6742. // Do executes the "books.mylibrary.bookshelves.removeVolume" call.
  6743. func (c *MylibraryBookshelvesRemoveVolumeCall) Do(opts ...googleapi.CallOption) error {
  6744. gensupport.SetOptions(c.urlParams_, opts...)
  6745. res, err := c.doRequest("json")
  6746. if err != nil {
  6747. return err
  6748. }
  6749. defer googleapi.CloseBody(res)
  6750. if err := googleapi.CheckResponse(res); err != nil {
  6751. return err
  6752. }
  6753. return nil
  6754. // {
  6755. // "description": "Removes a volume from a bookshelf.",
  6756. // "httpMethod": "POST",
  6757. // "id": "books.mylibrary.bookshelves.removeVolume",
  6758. // "parameterOrder": [
  6759. // "shelf",
  6760. // "volumeId"
  6761. // ],
  6762. // "parameters": {
  6763. // "reason": {
  6764. // "description": "The reason for which the book is removed from the library.",
  6765. // "enum": [
  6766. // "ONBOARDING"
  6767. // ],
  6768. // "enumDescriptions": [
  6769. // "Samples removed from the Onboarding flow."
  6770. // ],
  6771. // "location": "query",
  6772. // "type": "string"
  6773. // },
  6774. // "shelf": {
  6775. // "description": "ID of bookshelf from which to remove a volume.",
  6776. // "location": "path",
  6777. // "required": true,
  6778. // "type": "string"
  6779. // },
  6780. // "source": {
  6781. // "description": "String to identify the originator of this request.",
  6782. // "location": "query",
  6783. // "type": "string"
  6784. // },
  6785. // "volumeId": {
  6786. // "description": "ID of volume to remove.",
  6787. // "location": "query",
  6788. // "required": true,
  6789. // "type": "string"
  6790. // }
  6791. // },
  6792. // "path": "mylibrary/bookshelves/{shelf}/removeVolume",
  6793. // "scopes": [
  6794. // "https://www.googleapis.com/auth/books"
  6795. // ]
  6796. // }
  6797. }
  6798. // method id "books.mylibrary.bookshelves.volumes.list":
  6799. type MylibraryBookshelvesVolumesListCall struct {
  6800. s *Service
  6801. shelf string
  6802. urlParams_ gensupport.URLParams
  6803. ifNoneMatch_ string
  6804. ctx_ context.Context
  6805. }
  6806. // List: Gets volume information for volumes on a bookshelf.
  6807. func (r *MylibraryBookshelvesVolumesService) List(shelf string) *MylibraryBookshelvesVolumesListCall {
  6808. c := &MylibraryBookshelvesVolumesListCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  6809. c.shelf = shelf
  6810. return c
  6811. }
  6812. // Country sets the optional parameter "country": ISO-3166-1 code to
  6813. // override the IP-based location.
  6814. func (c *MylibraryBookshelvesVolumesListCall) Country(country string) *MylibraryBookshelvesVolumesListCall {
  6815. c.urlParams_.Set("country", country)
  6816. return c
  6817. }
  6818. // MaxResults sets the optional parameter "maxResults": Maximum number
  6819. // of results to return
  6820. func (c *MylibraryBookshelvesVolumesListCall) MaxResults(maxResults int64) *MylibraryBookshelvesVolumesListCall {
  6821. c.urlParams_.Set("maxResults", fmt.Sprint(maxResults))
  6822. return c
  6823. }
  6824. // Projection sets the optional parameter "projection": Restrict
  6825. // information returned to a set of selected fields.
  6826. //
  6827. // Possible values:
  6828. // "full" - Includes all volume data.
  6829. // "lite" - Includes a subset of fields in volumeInfo and accessInfo.
  6830. func (c *MylibraryBookshelvesVolumesListCall) Projection(projection string) *MylibraryBookshelvesVolumesListCall {
  6831. c.urlParams_.Set("projection", projection)
  6832. return c
  6833. }
  6834. // Q sets the optional parameter "q": Full-text search query string in
  6835. // this bookshelf.
  6836. func (c *MylibraryBookshelvesVolumesListCall) Q(q string) *MylibraryBookshelvesVolumesListCall {
  6837. c.urlParams_.Set("q", q)
  6838. return c
  6839. }
  6840. // ShowPreorders sets the optional parameter "showPreorders": Set to
  6841. // true to show pre-ordered books. Defaults to false.
  6842. func (c *MylibraryBookshelvesVolumesListCall) ShowPreorders(showPreorders bool) *MylibraryBookshelvesVolumesListCall {
  6843. c.urlParams_.Set("showPreorders", fmt.Sprint(showPreorders))
  6844. return c
  6845. }
  6846. // Source sets the optional parameter "source": String to identify the
  6847. // originator of this request.
  6848. func (c *MylibraryBookshelvesVolumesListCall) Source(source string) *MylibraryBookshelvesVolumesListCall {
  6849. c.urlParams_.Set("source", source)
  6850. return c
  6851. }
  6852. // StartIndex sets the optional parameter "startIndex": Index of the
  6853. // first element to return (starts at 0)
  6854. func (c *MylibraryBookshelvesVolumesListCall) StartIndex(startIndex int64) *MylibraryBookshelvesVolumesListCall {
  6855. c.urlParams_.Set("startIndex", fmt.Sprint(startIndex))
  6856. return c
  6857. }
  6858. // Fields allows partial responses to be retrieved. See
  6859. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  6860. // for more information.
  6861. func (c *MylibraryBookshelvesVolumesListCall) Fields(s ...googleapi.Field) *MylibraryBookshelvesVolumesListCall {
  6862. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  6863. return c
  6864. }
  6865. // IfNoneMatch sets the optional parameter which makes the operation
  6866. // fail if the object's ETag matches the given value. This is useful for
  6867. // getting updates only after the object has changed since the last
  6868. // request. Use googleapi.IsNotModified to check whether the response
  6869. // error from Do is the result of In-None-Match.
  6870. func (c *MylibraryBookshelvesVolumesListCall) IfNoneMatch(entityTag string) *MylibraryBookshelvesVolumesListCall {
  6871. c.ifNoneMatch_ = entityTag
  6872. return c
  6873. }
  6874. // Context sets the context to be used in this call's Do method. Any
  6875. // pending HTTP request will be aborted if the provided context is
  6876. // canceled.
  6877. func (c *MylibraryBookshelvesVolumesListCall) Context(ctx context.Context) *MylibraryBookshelvesVolumesListCall {
  6878. c.ctx_ = ctx
  6879. return c
  6880. }
  6881. func (c *MylibraryBookshelvesVolumesListCall) doRequest(alt string) (*http.Response, error) {
  6882. var body io.Reader = nil
  6883. c.urlParams_.Set("alt", alt)
  6884. urls := googleapi.ResolveRelative(c.s.BasePath, "mylibrary/bookshelves/{shelf}/volumes")
  6885. urls += "?" + c.urlParams_.Encode()
  6886. req, _ := http.NewRequest("GET", urls, body)
  6887. googleapi.Expand(req.URL, map[string]string{
  6888. "shelf": c.shelf,
  6889. })
  6890. req.Header.Set("User-Agent", c.s.userAgent())
  6891. if c.ifNoneMatch_ != "" {
  6892. req.Header.Set("If-None-Match", c.ifNoneMatch_)
  6893. }
  6894. if c.ctx_ != nil {
  6895. return ctxhttp.Do(c.ctx_, c.s.client, req)
  6896. }
  6897. return c.s.client.Do(req)
  6898. }
  6899. // Do executes the "books.mylibrary.bookshelves.volumes.list" call.
  6900. // Exactly one of *Volumes or error will be non-nil. Any non-2xx status
  6901. // code is an error. Response headers are in either
  6902. // *Volumes.ServerResponse.Header or (if a response was returned at all)
  6903. // in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to
  6904. // check whether the returned error was because http.StatusNotModified
  6905. // was returned.
  6906. func (c *MylibraryBookshelvesVolumesListCall) Do(opts ...googleapi.CallOption) (*Volumes, error) {
  6907. gensupport.SetOptions(c.urlParams_, opts...)
  6908. res, err := c.doRequest("json")
  6909. if res != nil && res.StatusCode == http.StatusNotModified {
  6910. if res.Body != nil {
  6911. res.Body.Close()
  6912. }
  6913. return nil, &googleapi.Error{
  6914. Code: res.StatusCode,
  6915. Header: res.Header,
  6916. }
  6917. }
  6918. if err != nil {
  6919. return nil, err
  6920. }
  6921. defer googleapi.CloseBody(res)
  6922. if err := googleapi.CheckResponse(res); err != nil {
  6923. return nil, err
  6924. }
  6925. ret := &Volumes{
  6926. ServerResponse: googleapi.ServerResponse{
  6927. Header: res.Header,
  6928. HTTPStatusCode: res.StatusCode,
  6929. },
  6930. }
  6931. if err := json.NewDecoder(res.Body).Decode(&ret); err != nil {
  6932. return nil, err
  6933. }
  6934. return ret, nil
  6935. // {
  6936. // "description": "Gets volume information for volumes on a bookshelf.",
  6937. // "httpMethod": "GET",
  6938. // "id": "books.mylibrary.bookshelves.volumes.list",
  6939. // "parameterOrder": [
  6940. // "shelf"
  6941. // ],
  6942. // "parameters": {
  6943. // "country": {
  6944. // "description": "ISO-3166-1 code to override the IP-based location.",
  6945. // "location": "query",
  6946. // "type": "string"
  6947. // },
  6948. // "maxResults": {
  6949. // "description": "Maximum number of results to return",
  6950. // "format": "uint32",
  6951. // "location": "query",
  6952. // "minimum": "0",
  6953. // "type": "integer"
  6954. // },
  6955. // "projection": {
  6956. // "description": "Restrict information returned to a set of selected fields.",
  6957. // "enum": [
  6958. // "full",
  6959. // "lite"
  6960. // ],
  6961. // "enumDescriptions": [
  6962. // "Includes all volume data.",
  6963. // "Includes a subset of fields in volumeInfo and accessInfo."
  6964. // ],
  6965. // "location": "query",
  6966. // "type": "string"
  6967. // },
  6968. // "q": {
  6969. // "description": "Full-text search query string in this bookshelf.",
  6970. // "location": "query",
  6971. // "type": "string"
  6972. // },
  6973. // "shelf": {
  6974. // "description": "The bookshelf ID or name retrieve volumes for.",
  6975. // "location": "path",
  6976. // "required": true,
  6977. // "type": "string"
  6978. // },
  6979. // "showPreorders": {
  6980. // "description": "Set to true to show pre-ordered books. Defaults to false.",
  6981. // "location": "query",
  6982. // "type": "boolean"
  6983. // },
  6984. // "source": {
  6985. // "description": "String to identify the originator of this request.",
  6986. // "location": "query",
  6987. // "type": "string"
  6988. // },
  6989. // "startIndex": {
  6990. // "description": "Index of the first element to return (starts at 0)",
  6991. // "format": "uint32",
  6992. // "location": "query",
  6993. // "minimum": "0",
  6994. // "type": "integer"
  6995. // }
  6996. // },
  6997. // "path": "mylibrary/bookshelves/{shelf}/volumes",
  6998. // "response": {
  6999. // "$ref": "Volumes"
  7000. // },
  7001. // "scopes": [
  7002. // "https://www.googleapis.com/auth/books"
  7003. // ]
  7004. // }
  7005. }
  7006. // method id "books.mylibrary.readingpositions.get":
  7007. type MylibraryReadingpositionsGetCall struct {
  7008. s *Service
  7009. volumeId string
  7010. urlParams_ gensupport.URLParams
  7011. ifNoneMatch_ string
  7012. ctx_ context.Context
  7013. }
  7014. // Get: Retrieves my reading position information for a volume.
  7015. func (r *MylibraryReadingpositionsService) Get(volumeId string) *MylibraryReadingpositionsGetCall {
  7016. c := &MylibraryReadingpositionsGetCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  7017. c.volumeId = volumeId
  7018. return c
  7019. }
  7020. // ContentVersion sets the optional parameter "contentVersion": Volume
  7021. // content version for which this reading position is requested.
  7022. func (c *MylibraryReadingpositionsGetCall) ContentVersion(contentVersion string) *MylibraryReadingpositionsGetCall {
  7023. c.urlParams_.Set("contentVersion", contentVersion)
  7024. return c
  7025. }
  7026. // Source sets the optional parameter "source": String to identify the
  7027. // originator of this request.
  7028. func (c *MylibraryReadingpositionsGetCall) Source(source string) *MylibraryReadingpositionsGetCall {
  7029. c.urlParams_.Set("source", source)
  7030. return c
  7031. }
  7032. // Fields allows partial responses to be retrieved. See
  7033. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  7034. // for more information.
  7035. func (c *MylibraryReadingpositionsGetCall) Fields(s ...googleapi.Field) *MylibraryReadingpositionsGetCall {
  7036. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  7037. return c
  7038. }
  7039. // IfNoneMatch sets the optional parameter which makes the operation
  7040. // fail if the object's ETag matches the given value. This is useful for
  7041. // getting updates only after the object has changed since the last
  7042. // request. Use googleapi.IsNotModified to check whether the response
  7043. // error from Do is the result of In-None-Match.
  7044. func (c *MylibraryReadingpositionsGetCall) IfNoneMatch(entityTag string) *MylibraryReadingpositionsGetCall {
  7045. c.ifNoneMatch_ = entityTag
  7046. return c
  7047. }
  7048. // Context sets the context to be used in this call's Do method. Any
  7049. // pending HTTP request will be aborted if the provided context is
  7050. // canceled.
  7051. func (c *MylibraryReadingpositionsGetCall) Context(ctx context.Context) *MylibraryReadingpositionsGetCall {
  7052. c.ctx_ = ctx
  7053. return c
  7054. }
  7055. func (c *MylibraryReadingpositionsGetCall) doRequest(alt string) (*http.Response, error) {
  7056. var body io.Reader = nil
  7057. c.urlParams_.Set("alt", alt)
  7058. urls := googleapi.ResolveRelative(c.s.BasePath, "mylibrary/readingpositions/{volumeId}")
  7059. urls += "?" + c.urlParams_.Encode()
  7060. req, _ := http.NewRequest("GET", urls, body)
  7061. googleapi.Expand(req.URL, map[string]string{
  7062. "volumeId": c.volumeId,
  7063. })
  7064. req.Header.Set("User-Agent", c.s.userAgent())
  7065. if c.ifNoneMatch_ != "" {
  7066. req.Header.Set("If-None-Match", c.ifNoneMatch_)
  7067. }
  7068. if c.ctx_ != nil {
  7069. return ctxhttp.Do(c.ctx_, c.s.client, req)
  7070. }
  7071. return c.s.client.Do(req)
  7072. }
  7073. // Do executes the "books.mylibrary.readingpositions.get" call.
  7074. // Exactly one of *ReadingPosition or error will be non-nil. Any non-2xx
  7075. // status code is an error. Response headers are in either
  7076. // *ReadingPosition.ServerResponse.Header or (if a response was returned
  7077. // at all) in error.(*googleapi.Error).Header. Use
  7078. // googleapi.IsNotModified to check whether the returned error was
  7079. // because http.StatusNotModified was returned.
  7080. func (c *MylibraryReadingpositionsGetCall) Do(opts ...googleapi.CallOption) (*ReadingPosition, error) {
  7081. gensupport.SetOptions(c.urlParams_, opts...)
  7082. res, err := c.doRequest("json")
  7083. if res != nil && res.StatusCode == http.StatusNotModified {
  7084. if res.Body != nil {
  7085. res.Body.Close()
  7086. }
  7087. return nil, &googleapi.Error{
  7088. Code: res.StatusCode,
  7089. Header: res.Header,
  7090. }
  7091. }
  7092. if err != nil {
  7093. return nil, err
  7094. }
  7095. defer googleapi.CloseBody(res)
  7096. if err := googleapi.CheckResponse(res); err != nil {
  7097. return nil, err
  7098. }
  7099. ret := &ReadingPosition{
  7100. ServerResponse: googleapi.ServerResponse{
  7101. Header: res.Header,
  7102. HTTPStatusCode: res.StatusCode,
  7103. },
  7104. }
  7105. if err := json.NewDecoder(res.Body).Decode(&ret); err != nil {
  7106. return nil, err
  7107. }
  7108. return ret, nil
  7109. // {
  7110. // "description": "Retrieves my reading position information for a volume.",
  7111. // "httpMethod": "GET",
  7112. // "id": "books.mylibrary.readingpositions.get",
  7113. // "parameterOrder": [
  7114. // "volumeId"
  7115. // ],
  7116. // "parameters": {
  7117. // "contentVersion": {
  7118. // "description": "Volume content version for which this reading position is requested.",
  7119. // "location": "query",
  7120. // "type": "string"
  7121. // },
  7122. // "source": {
  7123. // "description": "String to identify the originator of this request.",
  7124. // "location": "query",
  7125. // "type": "string"
  7126. // },
  7127. // "volumeId": {
  7128. // "description": "ID of volume for which to retrieve a reading position.",
  7129. // "location": "path",
  7130. // "required": true,
  7131. // "type": "string"
  7132. // }
  7133. // },
  7134. // "path": "mylibrary/readingpositions/{volumeId}",
  7135. // "response": {
  7136. // "$ref": "ReadingPosition"
  7137. // },
  7138. // "scopes": [
  7139. // "https://www.googleapis.com/auth/books"
  7140. // ]
  7141. // }
  7142. }
  7143. // method id "books.mylibrary.readingpositions.setPosition":
  7144. type MylibraryReadingpositionsSetPositionCall struct {
  7145. s *Service
  7146. volumeId string
  7147. urlParams_ gensupport.URLParams
  7148. ctx_ context.Context
  7149. }
  7150. // SetPosition: Sets my reading position information for a volume.
  7151. func (r *MylibraryReadingpositionsService) SetPosition(volumeId string, timestamp string, position string) *MylibraryReadingpositionsSetPositionCall {
  7152. c := &MylibraryReadingpositionsSetPositionCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  7153. c.volumeId = volumeId
  7154. c.urlParams_.Set("timestamp", timestamp)
  7155. c.urlParams_.Set("position", position)
  7156. return c
  7157. }
  7158. // Action sets the optional parameter "action": Action that caused this
  7159. // reading position to be set.
  7160. //
  7161. // Possible values:
  7162. // "bookmark" - User chose bookmark within volume.
  7163. // "chapter" - User selected chapter from list.
  7164. // "next-page" - Next page event.
  7165. // "prev-page" - Previous page event.
  7166. // "scroll" - User navigated to page.
  7167. // "search" - User chose search results within volume.
  7168. func (c *MylibraryReadingpositionsSetPositionCall) Action(action string) *MylibraryReadingpositionsSetPositionCall {
  7169. c.urlParams_.Set("action", action)
  7170. return c
  7171. }
  7172. // ContentVersion sets the optional parameter "contentVersion": Volume
  7173. // content version for which this reading position applies.
  7174. func (c *MylibraryReadingpositionsSetPositionCall) ContentVersion(contentVersion string) *MylibraryReadingpositionsSetPositionCall {
  7175. c.urlParams_.Set("contentVersion", contentVersion)
  7176. return c
  7177. }
  7178. // DeviceCookie sets the optional parameter "deviceCookie": Random
  7179. // persistent device cookie optional on set position.
  7180. func (c *MylibraryReadingpositionsSetPositionCall) DeviceCookie(deviceCookie string) *MylibraryReadingpositionsSetPositionCall {
  7181. c.urlParams_.Set("deviceCookie", deviceCookie)
  7182. return c
  7183. }
  7184. // Source sets the optional parameter "source": String to identify the
  7185. // originator of this request.
  7186. func (c *MylibraryReadingpositionsSetPositionCall) Source(source string) *MylibraryReadingpositionsSetPositionCall {
  7187. c.urlParams_.Set("source", source)
  7188. return c
  7189. }
  7190. // Fields allows partial responses to be retrieved. See
  7191. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  7192. // for more information.
  7193. func (c *MylibraryReadingpositionsSetPositionCall) Fields(s ...googleapi.Field) *MylibraryReadingpositionsSetPositionCall {
  7194. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  7195. return c
  7196. }
  7197. // Context sets the context to be used in this call's Do method. Any
  7198. // pending HTTP request will be aborted if the provided context is
  7199. // canceled.
  7200. func (c *MylibraryReadingpositionsSetPositionCall) Context(ctx context.Context) *MylibraryReadingpositionsSetPositionCall {
  7201. c.ctx_ = ctx
  7202. return c
  7203. }
  7204. func (c *MylibraryReadingpositionsSetPositionCall) doRequest(alt string) (*http.Response, error) {
  7205. var body io.Reader = nil
  7206. c.urlParams_.Set("alt", alt)
  7207. urls := googleapi.ResolveRelative(c.s.BasePath, "mylibrary/readingpositions/{volumeId}/setPosition")
  7208. urls += "?" + c.urlParams_.Encode()
  7209. req, _ := http.NewRequest("POST", urls, body)
  7210. googleapi.Expand(req.URL, map[string]string{
  7211. "volumeId": c.volumeId,
  7212. })
  7213. req.Header.Set("User-Agent", c.s.userAgent())
  7214. if c.ctx_ != nil {
  7215. return ctxhttp.Do(c.ctx_, c.s.client, req)
  7216. }
  7217. return c.s.client.Do(req)
  7218. }
  7219. // Do executes the "books.mylibrary.readingpositions.setPosition" call.
  7220. func (c *MylibraryReadingpositionsSetPositionCall) Do(opts ...googleapi.CallOption) error {
  7221. gensupport.SetOptions(c.urlParams_, opts...)
  7222. res, err := c.doRequest("json")
  7223. if err != nil {
  7224. return err
  7225. }
  7226. defer googleapi.CloseBody(res)
  7227. if err := googleapi.CheckResponse(res); err != nil {
  7228. return err
  7229. }
  7230. return nil
  7231. // {
  7232. // "description": "Sets my reading position information for a volume.",
  7233. // "httpMethod": "POST",
  7234. // "id": "books.mylibrary.readingpositions.setPosition",
  7235. // "parameterOrder": [
  7236. // "volumeId",
  7237. // "timestamp",
  7238. // "position"
  7239. // ],
  7240. // "parameters": {
  7241. // "action": {
  7242. // "description": "Action that caused this reading position to be set.",
  7243. // "enum": [
  7244. // "bookmark",
  7245. // "chapter",
  7246. // "next-page",
  7247. // "prev-page",
  7248. // "scroll",
  7249. // "search"
  7250. // ],
  7251. // "enumDescriptions": [
  7252. // "User chose bookmark within volume.",
  7253. // "User selected chapter from list.",
  7254. // "Next page event.",
  7255. // "Previous page event.",
  7256. // "User navigated to page.",
  7257. // "User chose search results within volume."
  7258. // ],
  7259. // "location": "query",
  7260. // "type": "string"
  7261. // },
  7262. // "contentVersion": {
  7263. // "description": "Volume content version for which this reading position applies.",
  7264. // "location": "query",
  7265. // "type": "string"
  7266. // },
  7267. // "deviceCookie": {
  7268. // "description": "Random persistent device cookie optional on set position.",
  7269. // "location": "query",
  7270. // "type": "string"
  7271. // },
  7272. // "position": {
  7273. // "description": "Position string for the new volume reading position.",
  7274. // "location": "query",
  7275. // "required": true,
  7276. // "type": "string"
  7277. // },
  7278. // "source": {
  7279. // "description": "String to identify the originator of this request.",
  7280. // "location": "query",
  7281. // "type": "string"
  7282. // },
  7283. // "timestamp": {
  7284. // "description": "RFC 3339 UTC format timestamp associated with this reading position.",
  7285. // "location": "query",
  7286. // "required": true,
  7287. // "type": "string"
  7288. // },
  7289. // "volumeId": {
  7290. // "description": "ID of volume for which to update the reading position.",
  7291. // "location": "path",
  7292. // "required": true,
  7293. // "type": "string"
  7294. // }
  7295. // },
  7296. // "path": "mylibrary/readingpositions/{volumeId}/setPosition",
  7297. // "scopes": [
  7298. // "https://www.googleapis.com/auth/books"
  7299. // ]
  7300. // }
  7301. }
  7302. // method id "books.notification.get":
  7303. type NotificationGetCall struct {
  7304. s *Service
  7305. urlParams_ gensupport.URLParams
  7306. ifNoneMatch_ string
  7307. ctx_ context.Context
  7308. }
  7309. // Get: Returns notification details for a given notification id.
  7310. func (r *NotificationService) Get(notificationId string) *NotificationGetCall {
  7311. c := &NotificationGetCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  7312. c.urlParams_.Set("notification_id", notificationId)
  7313. return c
  7314. }
  7315. // Locale sets the optional parameter "locale": ISO-639-1 language and
  7316. // ISO-3166-1 country code. Ex: 'en_US'. Used for generating
  7317. // notification title and body.
  7318. func (c *NotificationGetCall) Locale(locale string) *NotificationGetCall {
  7319. c.urlParams_.Set("locale", locale)
  7320. return c
  7321. }
  7322. // Source sets the optional parameter "source": String to identify the
  7323. // originator of this request.
  7324. func (c *NotificationGetCall) Source(source string) *NotificationGetCall {
  7325. c.urlParams_.Set("source", source)
  7326. return c
  7327. }
  7328. // TargetIds sets the optional parameter "targetIds": List of target ids
  7329. // used for experiments or user segments
  7330. func (c *NotificationGetCall) TargetIds(targetIds ...int64) *NotificationGetCall {
  7331. var targetIds_ []string
  7332. for _, v := range targetIds {
  7333. targetIds_ = append(targetIds_, fmt.Sprint(v))
  7334. }
  7335. c.urlParams_.SetMulti("targetIds", targetIds_)
  7336. return c
  7337. }
  7338. // Fields allows partial responses to be retrieved. See
  7339. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  7340. // for more information.
  7341. func (c *NotificationGetCall) Fields(s ...googleapi.Field) *NotificationGetCall {
  7342. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  7343. return c
  7344. }
  7345. // IfNoneMatch sets the optional parameter which makes the operation
  7346. // fail if the object's ETag matches the given value. This is useful for
  7347. // getting updates only after the object has changed since the last
  7348. // request. Use googleapi.IsNotModified to check whether the response
  7349. // error from Do is the result of In-None-Match.
  7350. func (c *NotificationGetCall) IfNoneMatch(entityTag string) *NotificationGetCall {
  7351. c.ifNoneMatch_ = entityTag
  7352. return c
  7353. }
  7354. // Context sets the context to be used in this call's Do method. Any
  7355. // pending HTTP request will be aborted if the provided context is
  7356. // canceled.
  7357. func (c *NotificationGetCall) Context(ctx context.Context) *NotificationGetCall {
  7358. c.ctx_ = ctx
  7359. return c
  7360. }
  7361. func (c *NotificationGetCall) doRequest(alt string) (*http.Response, error) {
  7362. var body io.Reader = nil
  7363. c.urlParams_.Set("alt", alt)
  7364. urls := googleapi.ResolveRelative(c.s.BasePath, "notification/get")
  7365. urls += "?" + c.urlParams_.Encode()
  7366. req, _ := http.NewRequest("GET", urls, body)
  7367. googleapi.SetOpaque(req.URL)
  7368. req.Header.Set("User-Agent", c.s.userAgent())
  7369. if c.ifNoneMatch_ != "" {
  7370. req.Header.Set("If-None-Match", c.ifNoneMatch_)
  7371. }
  7372. if c.ctx_ != nil {
  7373. return ctxhttp.Do(c.ctx_, c.s.client, req)
  7374. }
  7375. return c.s.client.Do(req)
  7376. }
  7377. // Do executes the "books.notification.get" call.
  7378. // Exactly one of *Notification or error will be non-nil. Any non-2xx
  7379. // status code is an error. Response headers are in either
  7380. // *Notification.ServerResponse.Header or (if a response was returned at
  7381. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  7382. // to check whether the returned error was because
  7383. // http.StatusNotModified was returned.
  7384. func (c *NotificationGetCall) Do(opts ...googleapi.CallOption) (*Notification, error) {
  7385. gensupport.SetOptions(c.urlParams_, opts...)
  7386. res, err := c.doRequest("json")
  7387. if res != nil && res.StatusCode == http.StatusNotModified {
  7388. if res.Body != nil {
  7389. res.Body.Close()
  7390. }
  7391. return nil, &googleapi.Error{
  7392. Code: res.StatusCode,
  7393. Header: res.Header,
  7394. }
  7395. }
  7396. if err != nil {
  7397. return nil, err
  7398. }
  7399. defer googleapi.CloseBody(res)
  7400. if err := googleapi.CheckResponse(res); err != nil {
  7401. return nil, err
  7402. }
  7403. ret := &Notification{
  7404. ServerResponse: googleapi.ServerResponse{
  7405. Header: res.Header,
  7406. HTTPStatusCode: res.StatusCode,
  7407. },
  7408. }
  7409. if err := json.NewDecoder(res.Body).Decode(&ret); err != nil {
  7410. return nil, err
  7411. }
  7412. return ret, nil
  7413. // {
  7414. // "description": "Returns notification details for a given notification id.",
  7415. // "httpMethod": "GET",
  7416. // "id": "books.notification.get",
  7417. // "parameterOrder": [
  7418. // "notification_id"
  7419. // ],
  7420. // "parameters": {
  7421. // "locale": {
  7422. // "description": "ISO-639-1 language and ISO-3166-1 country code. Ex: 'en_US'. Used for generating notification title and body.",
  7423. // "location": "query",
  7424. // "type": "string"
  7425. // },
  7426. // "notification_id": {
  7427. // "description": "String to identify the notification.",
  7428. // "location": "query",
  7429. // "required": true,
  7430. // "type": "string"
  7431. // },
  7432. // "source": {
  7433. // "description": "String to identify the originator of this request.",
  7434. // "location": "query",
  7435. // "type": "string"
  7436. // },
  7437. // "targetIds": {
  7438. // "description": "List of target ids used for experiments or user segments",
  7439. // "format": "int64",
  7440. // "location": "query",
  7441. // "repeated": true,
  7442. // "type": "string"
  7443. // }
  7444. // },
  7445. // "path": "notification/get",
  7446. // "response": {
  7447. // "$ref": "Notification"
  7448. // },
  7449. // "scopes": [
  7450. // "https://www.googleapis.com/auth/books"
  7451. // ]
  7452. // }
  7453. }
  7454. // method id "books.onboarding.listCategories":
  7455. type OnboardingListCategoriesCall struct {
  7456. s *Service
  7457. urlParams_ gensupport.URLParams
  7458. ifNoneMatch_ string
  7459. ctx_ context.Context
  7460. }
  7461. // ListCategories: List categories for onboarding experience.
  7462. func (r *OnboardingService) ListCategories() *OnboardingListCategoriesCall {
  7463. c := &OnboardingListCategoriesCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  7464. return c
  7465. }
  7466. // Locale sets the optional parameter "locale": ISO-639-1 language and
  7467. // ISO-3166-1 country code. Default is en-US if unset.
  7468. func (c *OnboardingListCategoriesCall) Locale(locale string) *OnboardingListCategoriesCall {
  7469. c.urlParams_.Set("locale", locale)
  7470. return c
  7471. }
  7472. // Fields allows partial responses to be retrieved. See
  7473. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  7474. // for more information.
  7475. func (c *OnboardingListCategoriesCall) Fields(s ...googleapi.Field) *OnboardingListCategoriesCall {
  7476. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  7477. return c
  7478. }
  7479. // IfNoneMatch sets the optional parameter which makes the operation
  7480. // fail if the object's ETag matches the given value. This is useful for
  7481. // getting updates only after the object has changed since the last
  7482. // request. Use googleapi.IsNotModified to check whether the response
  7483. // error from Do is the result of In-None-Match.
  7484. func (c *OnboardingListCategoriesCall) IfNoneMatch(entityTag string) *OnboardingListCategoriesCall {
  7485. c.ifNoneMatch_ = entityTag
  7486. return c
  7487. }
  7488. // Context sets the context to be used in this call's Do method. Any
  7489. // pending HTTP request will be aborted if the provided context is
  7490. // canceled.
  7491. func (c *OnboardingListCategoriesCall) Context(ctx context.Context) *OnboardingListCategoriesCall {
  7492. c.ctx_ = ctx
  7493. return c
  7494. }
  7495. func (c *OnboardingListCategoriesCall) doRequest(alt string) (*http.Response, error) {
  7496. var body io.Reader = nil
  7497. c.urlParams_.Set("alt", alt)
  7498. urls := googleapi.ResolveRelative(c.s.BasePath, "onboarding/listCategories")
  7499. urls += "?" + c.urlParams_.Encode()
  7500. req, _ := http.NewRequest("GET", urls, body)
  7501. googleapi.SetOpaque(req.URL)
  7502. req.Header.Set("User-Agent", c.s.userAgent())
  7503. if c.ifNoneMatch_ != "" {
  7504. req.Header.Set("If-None-Match", c.ifNoneMatch_)
  7505. }
  7506. if c.ctx_ != nil {
  7507. return ctxhttp.Do(c.ctx_, c.s.client, req)
  7508. }
  7509. return c.s.client.Do(req)
  7510. }
  7511. // Do executes the "books.onboarding.listCategories" call.
  7512. // Exactly one of *Category or error will be non-nil. Any non-2xx status
  7513. // code is an error. Response headers are in either
  7514. // *Category.ServerResponse.Header or (if a response was returned at
  7515. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  7516. // to check whether the returned error was because
  7517. // http.StatusNotModified was returned.
  7518. func (c *OnboardingListCategoriesCall) Do(opts ...googleapi.CallOption) (*Category, error) {
  7519. gensupport.SetOptions(c.urlParams_, opts...)
  7520. res, err := c.doRequest("json")
  7521. if res != nil && res.StatusCode == http.StatusNotModified {
  7522. if res.Body != nil {
  7523. res.Body.Close()
  7524. }
  7525. return nil, &googleapi.Error{
  7526. Code: res.StatusCode,
  7527. Header: res.Header,
  7528. }
  7529. }
  7530. if err != nil {
  7531. return nil, err
  7532. }
  7533. defer googleapi.CloseBody(res)
  7534. if err := googleapi.CheckResponse(res); err != nil {
  7535. return nil, err
  7536. }
  7537. ret := &Category{
  7538. ServerResponse: googleapi.ServerResponse{
  7539. Header: res.Header,
  7540. HTTPStatusCode: res.StatusCode,
  7541. },
  7542. }
  7543. if err := json.NewDecoder(res.Body).Decode(&ret); err != nil {
  7544. return nil, err
  7545. }
  7546. return ret, nil
  7547. // {
  7548. // "description": "List categories for onboarding experience.",
  7549. // "httpMethod": "GET",
  7550. // "id": "books.onboarding.listCategories",
  7551. // "parameters": {
  7552. // "locale": {
  7553. // "description": "ISO-639-1 language and ISO-3166-1 country code. Default is en-US if unset.",
  7554. // "location": "query",
  7555. // "type": "string"
  7556. // }
  7557. // },
  7558. // "path": "onboarding/listCategories",
  7559. // "response": {
  7560. // "$ref": "Category"
  7561. // },
  7562. // "scopes": [
  7563. // "https://www.googleapis.com/auth/books"
  7564. // ]
  7565. // }
  7566. }
  7567. // method id "books.onboarding.listCategoryVolumes":
  7568. type OnboardingListCategoryVolumesCall struct {
  7569. s *Service
  7570. urlParams_ gensupport.URLParams
  7571. ifNoneMatch_ string
  7572. ctx_ context.Context
  7573. }
  7574. // ListCategoryVolumes: List available volumes under categories for
  7575. // onboarding experience.
  7576. func (r *OnboardingService) ListCategoryVolumes() *OnboardingListCategoryVolumesCall {
  7577. c := &OnboardingListCategoryVolumesCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  7578. return c
  7579. }
  7580. // CategoryId sets the optional parameter "categoryId": List of category
  7581. // ids requested.
  7582. func (c *OnboardingListCategoryVolumesCall) CategoryId(categoryId ...string) *OnboardingListCategoryVolumesCall {
  7583. c.urlParams_.SetMulti("categoryId", append([]string{}, categoryId...))
  7584. return c
  7585. }
  7586. // Locale sets the optional parameter "locale": ISO-639-1 language and
  7587. // ISO-3166-1 country code. Default is en-US if unset.
  7588. func (c *OnboardingListCategoryVolumesCall) Locale(locale string) *OnboardingListCategoryVolumesCall {
  7589. c.urlParams_.Set("locale", locale)
  7590. return c
  7591. }
  7592. // MaxAllowedMaturityRating sets the optional parameter
  7593. // "maxAllowedMaturityRating": The maximum allowed maturity rating of
  7594. // returned volumes. Books with a higher maturity rating are filtered
  7595. // out.
  7596. //
  7597. // Possible values:
  7598. // "mature" - Show books which are rated mature or lower.
  7599. // "not-mature" - Show books which are rated not mature.
  7600. func (c *OnboardingListCategoryVolumesCall) MaxAllowedMaturityRating(maxAllowedMaturityRating string) *OnboardingListCategoryVolumesCall {
  7601. c.urlParams_.Set("maxAllowedMaturityRating", maxAllowedMaturityRating)
  7602. return c
  7603. }
  7604. // PageSize sets the optional parameter "pageSize": Number of maximum
  7605. // results per page to be included in the response.
  7606. func (c *OnboardingListCategoryVolumesCall) PageSize(pageSize int64) *OnboardingListCategoryVolumesCall {
  7607. c.urlParams_.Set("pageSize", fmt.Sprint(pageSize))
  7608. return c
  7609. }
  7610. // PageToken sets the optional parameter "pageToken": The value of the
  7611. // nextToken from the previous page.
  7612. func (c *OnboardingListCategoryVolumesCall) PageToken(pageToken string) *OnboardingListCategoryVolumesCall {
  7613. c.urlParams_.Set("pageToken", pageToken)
  7614. return c
  7615. }
  7616. // Fields allows partial responses to be retrieved. See
  7617. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  7618. // for more information.
  7619. func (c *OnboardingListCategoryVolumesCall) Fields(s ...googleapi.Field) *OnboardingListCategoryVolumesCall {
  7620. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  7621. return c
  7622. }
  7623. // IfNoneMatch sets the optional parameter which makes the operation
  7624. // fail if the object's ETag matches the given value. This is useful for
  7625. // getting updates only after the object has changed since the last
  7626. // request. Use googleapi.IsNotModified to check whether the response
  7627. // error from Do is the result of In-None-Match.
  7628. func (c *OnboardingListCategoryVolumesCall) IfNoneMatch(entityTag string) *OnboardingListCategoryVolumesCall {
  7629. c.ifNoneMatch_ = entityTag
  7630. return c
  7631. }
  7632. // Context sets the context to be used in this call's Do method. Any
  7633. // pending HTTP request will be aborted if the provided context is
  7634. // canceled.
  7635. func (c *OnboardingListCategoryVolumesCall) Context(ctx context.Context) *OnboardingListCategoryVolumesCall {
  7636. c.ctx_ = ctx
  7637. return c
  7638. }
  7639. func (c *OnboardingListCategoryVolumesCall) doRequest(alt string) (*http.Response, error) {
  7640. var body io.Reader = nil
  7641. c.urlParams_.Set("alt", alt)
  7642. urls := googleapi.ResolveRelative(c.s.BasePath, "onboarding/listCategoryVolumes")
  7643. urls += "?" + c.urlParams_.Encode()
  7644. req, _ := http.NewRequest("GET", urls, body)
  7645. googleapi.SetOpaque(req.URL)
  7646. req.Header.Set("User-Agent", c.s.userAgent())
  7647. if c.ifNoneMatch_ != "" {
  7648. req.Header.Set("If-None-Match", c.ifNoneMatch_)
  7649. }
  7650. if c.ctx_ != nil {
  7651. return ctxhttp.Do(c.ctx_, c.s.client, req)
  7652. }
  7653. return c.s.client.Do(req)
  7654. }
  7655. // Do executes the "books.onboarding.listCategoryVolumes" call.
  7656. // Exactly one of *Volume2 or error will be non-nil. Any non-2xx status
  7657. // code is an error. Response headers are in either
  7658. // *Volume2.ServerResponse.Header or (if a response was returned at all)
  7659. // in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to
  7660. // check whether the returned error was because http.StatusNotModified
  7661. // was returned.
  7662. func (c *OnboardingListCategoryVolumesCall) Do(opts ...googleapi.CallOption) (*Volume2, error) {
  7663. gensupport.SetOptions(c.urlParams_, opts...)
  7664. res, err := c.doRequest("json")
  7665. if res != nil && res.StatusCode == http.StatusNotModified {
  7666. if res.Body != nil {
  7667. res.Body.Close()
  7668. }
  7669. return nil, &googleapi.Error{
  7670. Code: res.StatusCode,
  7671. Header: res.Header,
  7672. }
  7673. }
  7674. if err != nil {
  7675. return nil, err
  7676. }
  7677. defer googleapi.CloseBody(res)
  7678. if err := googleapi.CheckResponse(res); err != nil {
  7679. return nil, err
  7680. }
  7681. ret := &Volume2{
  7682. ServerResponse: googleapi.ServerResponse{
  7683. Header: res.Header,
  7684. HTTPStatusCode: res.StatusCode,
  7685. },
  7686. }
  7687. if err := json.NewDecoder(res.Body).Decode(&ret); err != nil {
  7688. return nil, err
  7689. }
  7690. return ret, nil
  7691. // {
  7692. // "description": "List available volumes under categories for onboarding experience.",
  7693. // "httpMethod": "GET",
  7694. // "id": "books.onboarding.listCategoryVolumes",
  7695. // "parameters": {
  7696. // "categoryId": {
  7697. // "description": "List of category ids requested.",
  7698. // "location": "query",
  7699. // "repeated": true,
  7700. // "type": "string"
  7701. // },
  7702. // "locale": {
  7703. // "description": "ISO-639-1 language and ISO-3166-1 country code. Default is en-US if unset.",
  7704. // "location": "query",
  7705. // "type": "string"
  7706. // },
  7707. // "maxAllowedMaturityRating": {
  7708. // "description": "The maximum allowed maturity rating of returned volumes. Books with a higher maturity rating are filtered out.",
  7709. // "enum": [
  7710. // "mature",
  7711. // "not-mature"
  7712. // ],
  7713. // "enumDescriptions": [
  7714. // "Show books which are rated mature or lower.",
  7715. // "Show books which are rated not mature."
  7716. // ],
  7717. // "location": "query",
  7718. // "type": "string"
  7719. // },
  7720. // "pageSize": {
  7721. // "description": "Number of maximum results per page to be included in the response.",
  7722. // "format": "uint32",
  7723. // "location": "query",
  7724. // "type": "integer"
  7725. // },
  7726. // "pageToken": {
  7727. // "description": "The value of the nextToken from the previous page.",
  7728. // "location": "query",
  7729. // "type": "string"
  7730. // }
  7731. // },
  7732. // "path": "onboarding/listCategoryVolumes",
  7733. // "response": {
  7734. // "$ref": "Volume2"
  7735. // },
  7736. // "scopes": [
  7737. // "https://www.googleapis.com/auth/books"
  7738. // ]
  7739. // }
  7740. }
  7741. // Pages invokes f for each page of results.
  7742. // A non-nil error returned from f will halt the iteration.
  7743. // The provided context supersedes any context provided to the Context method.
  7744. func (c *OnboardingListCategoryVolumesCall) Pages(ctx context.Context, f func(*Volume2) error) error {
  7745. c.ctx_ = ctx
  7746. defer c.PageToken(c.urlParams_.Get("pageToken")) // reset paging to original point
  7747. for {
  7748. x, err := c.Do()
  7749. if err != nil {
  7750. return err
  7751. }
  7752. if err := f(x); err != nil {
  7753. return err
  7754. }
  7755. if x.NextPageToken == "" {
  7756. return nil
  7757. }
  7758. c.PageToken(x.NextPageToken)
  7759. }
  7760. }
  7761. // method id "books.personalizedstream.get":
  7762. type PersonalizedstreamGetCall struct {
  7763. s *Service
  7764. urlParams_ gensupport.URLParams
  7765. ifNoneMatch_ string
  7766. ctx_ context.Context
  7767. }
  7768. // Get: Returns a stream of personalized book clusters
  7769. func (r *PersonalizedstreamService) Get() *PersonalizedstreamGetCall {
  7770. c := &PersonalizedstreamGetCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  7771. return c
  7772. }
  7773. // Locale sets the optional parameter "locale": ISO-639-1 language and
  7774. // ISO-3166-1 country code. Ex: 'en_US'. Used for generating
  7775. // recommendations.
  7776. func (c *PersonalizedstreamGetCall) Locale(locale string) *PersonalizedstreamGetCall {
  7777. c.urlParams_.Set("locale", locale)
  7778. return c
  7779. }
  7780. // MaxAllowedMaturityRating sets the optional parameter
  7781. // "maxAllowedMaturityRating": The maximum allowed maturity rating of
  7782. // returned recommendations. Books with a higher maturity rating are
  7783. // filtered out.
  7784. //
  7785. // Possible values:
  7786. // "mature" - Show books which are rated mature or lower.
  7787. // "not-mature" - Show books which are rated not mature.
  7788. func (c *PersonalizedstreamGetCall) MaxAllowedMaturityRating(maxAllowedMaturityRating string) *PersonalizedstreamGetCall {
  7789. c.urlParams_.Set("maxAllowedMaturityRating", maxAllowedMaturityRating)
  7790. return c
  7791. }
  7792. // Source sets the optional parameter "source": String to identify the
  7793. // originator of this request.
  7794. func (c *PersonalizedstreamGetCall) Source(source string) *PersonalizedstreamGetCall {
  7795. c.urlParams_.Set("source", source)
  7796. return c
  7797. }
  7798. // TargetIds sets the optional parameter "targetIds": List of target ids
  7799. // used for experiments or user segments
  7800. func (c *PersonalizedstreamGetCall) TargetIds(targetIds ...int64) *PersonalizedstreamGetCall {
  7801. var targetIds_ []string
  7802. for _, v := range targetIds {
  7803. targetIds_ = append(targetIds_, fmt.Sprint(v))
  7804. }
  7805. c.urlParams_.SetMulti("targetIds", targetIds_)
  7806. return c
  7807. }
  7808. // Fields allows partial responses to be retrieved. See
  7809. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  7810. // for more information.
  7811. func (c *PersonalizedstreamGetCall) Fields(s ...googleapi.Field) *PersonalizedstreamGetCall {
  7812. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  7813. return c
  7814. }
  7815. // IfNoneMatch sets the optional parameter which makes the operation
  7816. // fail if the object's ETag matches the given value. This is useful for
  7817. // getting updates only after the object has changed since the last
  7818. // request. Use googleapi.IsNotModified to check whether the response
  7819. // error from Do is the result of In-None-Match.
  7820. func (c *PersonalizedstreamGetCall) IfNoneMatch(entityTag string) *PersonalizedstreamGetCall {
  7821. c.ifNoneMatch_ = entityTag
  7822. return c
  7823. }
  7824. // Context sets the context to be used in this call's Do method. Any
  7825. // pending HTTP request will be aborted if the provided context is
  7826. // canceled.
  7827. func (c *PersonalizedstreamGetCall) Context(ctx context.Context) *PersonalizedstreamGetCall {
  7828. c.ctx_ = ctx
  7829. return c
  7830. }
  7831. func (c *PersonalizedstreamGetCall) doRequest(alt string) (*http.Response, error) {
  7832. var body io.Reader = nil
  7833. c.urlParams_.Set("alt", alt)
  7834. urls := googleapi.ResolveRelative(c.s.BasePath, "personalizedstream/get")
  7835. urls += "?" + c.urlParams_.Encode()
  7836. req, _ := http.NewRequest("GET", urls, body)
  7837. googleapi.SetOpaque(req.URL)
  7838. req.Header.Set("User-Agent", c.s.userAgent())
  7839. if c.ifNoneMatch_ != "" {
  7840. req.Header.Set("If-None-Match", c.ifNoneMatch_)
  7841. }
  7842. if c.ctx_ != nil {
  7843. return ctxhttp.Do(c.ctx_, c.s.client, req)
  7844. }
  7845. return c.s.client.Do(req)
  7846. }
  7847. // Do executes the "books.personalizedstream.get" call.
  7848. // Exactly one of *Discoveryclusters or error will be non-nil. Any
  7849. // non-2xx status code is an error. Response headers are in either
  7850. // *Discoveryclusters.ServerResponse.Header or (if a response was
  7851. // returned at all) in error.(*googleapi.Error).Header. Use
  7852. // googleapi.IsNotModified to check whether the returned error was
  7853. // because http.StatusNotModified was returned.
  7854. func (c *PersonalizedstreamGetCall) Do(opts ...googleapi.CallOption) (*Discoveryclusters, error) {
  7855. gensupport.SetOptions(c.urlParams_, opts...)
  7856. res, err := c.doRequest("json")
  7857. if res != nil && res.StatusCode == http.StatusNotModified {
  7858. if res.Body != nil {
  7859. res.Body.Close()
  7860. }
  7861. return nil, &googleapi.Error{
  7862. Code: res.StatusCode,
  7863. Header: res.Header,
  7864. }
  7865. }
  7866. if err != nil {
  7867. return nil, err
  7868. }
  7869. defer googleapi.CloseBody(res)
  7870. if err := googleapi.CheckResponse(res); err != nil {
  7871. return nil, err
  7872. }
  7873. ret := &Discoveryclusters{
  7874. ServerResponse: googleapi.ServerResponse{
  7875. Header: res.Header,
  7876. HTTPStatusCode: res.StatusCode,
  7877. },
  7878. }
  7879. if err := json.NewDecoder(res.Body).Decode(&ret); err != nil {
  7880. return nil, err
  7881. }
  7882. return ret, nil
  7883. // {
  7884. // "description": "Returns a stream of personalized book clusters",
  7885. // "httpMethod": "GET",
  7886. // "id": "books.personalizedstream.get",
  7887. // "parameters": {
  7888. // "locale": {
  7889. // "description": "ISO-639-1 language and ISO-3166-1 country code. Ex: 'en_US'. Used for generating recommendations.",
  7890. // "location": "query",
  7891. // "type": "string"
  7892. // },
  7893. // "maxAllowedMaturityRating": {
  7894. // "description": "The maximum allowed maturity rating of returned recommendations. Books with a higher maturity rating are filtered out.",
  7895. // "enum": [
  7896. // "mature",
  7897. // "not-mature"
  7898. // ],
  7899. // "enumDescriptions": [
  7900. // "Show books which are rated mature or lower.",
  7901. // "Show books which are rated not mature."
  7902. // ],
  7903. // "location": "query",
  7904. // "type": "string"
  7905. // },
  7906. // "source": {
  7907. // "description": "String to identify the originator of this request.",
  7908. // "location": "query",
  7909. // "type": "string"
  7910. // },
  7911. // "targetIds": {
  7912. // "description": "List of target ids used for experiments or user segments",
  7913. // "format": "int64",
  7914. // "location": "query",
  7915. // "repeated": true,
  7916. // "type": "string"
  7917. // }
  7918. // },
  7919. // "path": "personalizedstream/get",
  7920. // "response": {
  7921. // "$ref": "Discoveryclusters"
  7922. // },
  7923. // "scopes": [
  7924. // "https://www.googleapis.com/auth/books"
  7925. // ]
  7926. // }
  7927. }
  7928. // method id "books.promooffer.accept":
  7929. type PromoofferAcceptCall struct {
  7930. s *Service
  7931. urlParams_ gensupport.URLParams
  7932. ctx_ context.Context
  7933. }
  7934. // Accept:
  7935. func (r *PromoofferService) Accept() *PromoofferAcceptCall {
  7936. c := &PromoofferAcceptCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  7937. return c
  7938. }
  7939. // AndroidId sets the optional parameter "androidId": device android_id
  7940. func (c *PromoofferAcceptCall) AndroidId(androidId string) *PromoofferAcceptCall {
  7941. c.urlParams_.Set("androidId", androidId)
  7942. return c
  7943. }
  7944. // Device sets the optional parameter "device": device device
  7945. func (c *PromoofferAcceptCall) Device(device string) *PromoofferAcceptCall {
  7946. c.urlParams_.Set("device", device)
  7947. return c
  7948. }
  7949. // Manufacturer sets the optional parameter "manufacturer": device
  7950. // manufacturer
  7951. func (c *PromoofferAcceptCall) Manufacturer(manufacturer string) *PromoofferAcceptCall {
  7952. c.urlParams_.Set("manufacturer", manufacturer)
  7953. return c
  7954. }
  7955. // Model sets the optional parameter "model": device model
  7956. func (c *PromoofferAcceptCall) Model(model string) *PromoofferAcceptCall {
  7957. c.urlParams_.Set("model", model)
  7958. return c
  7959. }
  7960. // OfferId sets the optional parameter "offerId":
  7961. func (c *PromoofferAcceptCall) OfferId(offerId string) *PromoofferAcceptCall {
  7962. c.urlParams_.Set("offerId", offerId)
  7963. return c
  7964. }
  7965. // Product sets the optional parameter "product": device product
  7966. func (c *PromoofferAcceptCall) Product(product string) *PromoofferAcceptCall {
  7967. c.urlParams_.Set("product", product)
  7968. return c
  7969. }
  7970. // Serial sets the optional parameter "serial": device serial
  7971. func (c *PromoofferAcceptCall) Serial(serial string) *PromoofferAcceptCall {
  7972. c.urlParams_.Set("serial", serial)
  7973. return c
  7974. }
  7975. // VolumeId sets the optional parameter "volumeId": Volume id to
  7976. // exercise the offer
  7977. func (c *PromoofferAcceptCall) VolumeId(volumeId string) *PromoofferAcceptCall {
  7978. c.urlParams_.Set("volumeId", volumeId)
  7979. return c
  7980. }
  7981. // Fields allows partial responses to be retrieved. See
  7982. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  7983. // for more information.
  7984. func (c *PromoofferAcceptCall) Fields(s ...googleapi.Field) *PromoofferAcceptCall {
  7985. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  7986. return c
  7987. }
  7988. // Context sets the context to be used in this call's Do method. Any
  7989. // pending HTTP request will be aborted if the provided context is
  7990. // canceled.
  7991. func (c *PromoofferAcceptCall) Context(ctx context.Context) *PromoofferAcceptCall {
  7992. c.ctx_ = ctx
  7993. return c
  7994. }
  7995. func (c *PromoofferAcceptCall) doRequest(alt string) (*http.Response, error) {
  7996. var body io.Reader = nil
  7997. c.urlParams_.Set("alt", alt)
  7998. urls := googleapi.ResolveRelative(c.s.BasePath, "promooffer/accept")
  7999. urls += "?" + c.urlParams_.Encode()
  8000. req, _ := http.NewRequest("POST", urls, body)
  8001. googleapi.SetOpaque(req.URL)
  8002. req.Header.Set("User-Agent", c.s.userAgent())
  8003. if c.ctx_ != nil {
  8004. return ctxhttp.Do(c.ctx_, c.s.client, req)
  8005. }
  8006. return c.s.client.Do(req)
  8007. }
  8008. // Do executes the "books.promooffer.accept" call.
  8009. func (c *PromoofferAcceptCall) Do(opts ...googleapi.CallOption) error {
  8010. gensupport.SetOptions(c.urlParams_, opts...)
  8011. res, err := c.doRequest("json")
  8012. if err != nil {
  8013. return err
  8014. }
  8015. defer googleapi.CloseBody(res)
  8016. if err := googleapi.CheckResponse(res); err != nil {
  8017. return err
  8018. }
  8019. return nil
  8020. // {
  8021. // "description": "",
  8022. // "httpMethod": "POST",
  8023. // "id": "books.promooffer.accept",
  8024. // "parameters": {
  8025. // "androidId": {
  8026. // "description": "device android_id",
  8027. // "location": "query",
  8028. // "type": "string"
  8029. // },
  8030. // "device": {
  8031. // "description": "device device",
  8032. // "location": "query",
  8033. // "type": "string"
  8034. // },
  8035. // "manufacturer": {
  8036. // "description": "device manufacturer",
  8037. // "location": "query",
  8038. // "type": "string"
  8039. // },
  8040. // "model": {
  8041. // "description": "device model",
  8042. // "location": "query",
  8043. // "type": "string"
  8044. // },
  8045. // "offerId": {
  8046. // "location": "query",
  8047. // "type": "string"
  8048. // },
  8049. // "product": {
  8050. // "description": "device product",
  8051. // "location": "query",
  8052. // "type": "string"
  8053. // },
  8054. // "serial": {
  8055. // "description": "device serial",
  8056. // "location": "query",
  8057. // "type": "string"
  8058. // },
  8059. // "volumeId": {
  8060. // "description": "Volume id to exercise the offer",
  8061. // "location": "query",
  8062. // "type": "string"
  8063. // }
  8064. // },
  8065. // "path": "promooffer/accept",
  8066. // "scopes": [
  8067. // "https://www.googleapis.com/auth/books"
  8068. // ]
  8069. // }
  8070. }
  8071. // method id "books.promooffer.dismiss":
  8072. type PromoofferDismissCall struct {
  8073. s *Service
  8074. urlParams_ gensupport.URLParams
  8075. ctx_ context.Context
  8076. }
  8077. // Dismiss:
  8078. func (r *PromoofferService) Dismiss() *PromoofferDismissCall {
  8079. c := &PromoofferDismissCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  8080. return c
  8081. }
  8082. // AndroidId sets the optional parameter "androidId": device android_id
  8083. func (c *PromoofferDismissCall) AndroidId(androidId string) *PromoofferDismissCall {
  8084. c.urlParams_.Set("androidId", androidId)
  8085. return c
  8086. }
  8087. // Device sets the optional parameter "device": device device
  8088. func (c *PromoofferDismissCall) Device(device string) *PromoofferDismissCall {
  8089. c.urlParams_.Set("device", device)
  8090. return c
  8091. }
  8092. // Manufacturer sets the optional parameter "manufacturer": device
  8093. // manufacturer
  8094. func (c *PromoofferDismissCall) Manufacturer(manufacturer string) *PromoofferDismissCall {
  8095. c.urlParams_.Set("manufacturer", manufacturer)
  8096. return c
  8097. }
  8098. // Model sets the optional parameter "model": device model
  8099. func (c *PromoofferDismissCall) Model(model string) *PromoofferDismissCall {
  8100. c.urlParams_.Set("model", model)
  8101. return c
  8102. }
  8103. // OfferId sets the optional parameter "offerId": Offer to dimiss
  8104. func (c *PromoofferDismissCall) OfferId(offerId string) *PromoofferDismissCall {
  8105. c.urlParams_.Set("offerId", offerId)
  8106. return c
  8107. }
  8108. // Product sets the optional parameter "product": device product
  8109. func (c *PromoofferDismissCall) Product(product string) *PromoofferDismissCall {
  8110. c.urlParams_.Set("product", product)
  8111. return c
  8112. }
  8113. // Serial sets the optional parameter "serial": device serial
  8114. func (c *PromoofferDismissCall) Serial(serial string) *PromoofferDismissCall {
  8115. c.urlParams_.Set("serial", serial)
  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 *PromoofferDismissCall) Fields(s ...googleapi.Field) *PromoofferDismissCall {
  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 *PromoofferDismissCall) Context(ctx context.Context) *PromoofferDismissCall {
  8129. c.ctx_ = ctx
  8130. return c
  8131. }
  8132. func (c *PromoofferDismissCall) doRequest(alt string) (*http.Response, error) {
  8133. var body io.Reader = nil
  8134. c.urlParams_.Set("alt", alt)
  8135. urls := googleapi.ResolveRelative(c.s.BasePath, "promooffer/dismiss")
  8136. urls += "?" + c.urlParams_.Encode()
  8137. req, _ := http.NewRequest("POST", urls, body)
  8138. googleapi.SetOpaque(req.URL)
  8139. req.Header.Set("User-Agent", c.s.userAgent())
  8140. if c.ctx_ != nil {
  8141. return ctxhttp.Do(c.ctx_, c.s.client, req)
  8142. }
  8143. return c.s.client.Do(req)
  8144. }
  8145. // Do executes the "books.promooffer.dismiss" call.
  8146. func (c *PromoofferDismissCall) Do(opts ...googleapi.CallOption) error {
  8147. gensupport.SetOptions(c.urlParams_, opts...)
  8148. res, err := c.doRequest("json")
  8149. if err != nil {
  8150. return err
  8151. }
  8152. defer googleapi.CloseBody(res)
  8153. if err := googleapi.CheckResponse(res); err != nil {
  8154. return err
  8155. }
  8156. return nil
  8157. // {
  8158. // "description": "",
  8159. // "httpMethod": "POST",
  8160. // "id": "books.promooffer.dismiss",
  8161. // "parameters": {
  8162. // "androidId": {
  8163. // "description": "device android_id",
  8164. // "location": "query",
  8165. // "type": "string"
  8166. // },
  8167. // "device": {
  8168. // "description": "device device",
  8169. // "location": "query",
  8170. // "type": "string"
  8171. // },
  8172. // "manufacturer": {
  8173. // "description": "device manufacturer",
  8174. // "location": "query",
  8175. // "type": "string"
  8176. // },
  8177. // "model": {
  8178. // "description": "device model",
  8179. // "location": "query",
  8180. // "type": "string"
  8181. // },
  8182. // "offerId": {
  8183. // "description": "Offer to dimiss",
  8184. // "location": "query",
  8185. // "type": "string"
  8186. // },
  8187. // "product": {
  8188. // "description": "device product",
  8189. // "location": "query",
  8190. // "type": "string"
  8191. // },
  8192. // "serial": {
  8193. // "description": "device serial",
  8194. // "location": "query",
  8195. // "type": "string"
  8196. // }
  8197. // },
  8198. // "path": "promooffer/dismiss",
  8199. // "scopes": [
  8200. // "https://www.googleapis.com/auth/books"
  8201. // ]
  8202. // }
  8203. }
  8204. // method id "books.promooffer.get":
  8205. type PromoofferGetCall struct {
  8206. s *Service
  8207. urlParams_ gensupport.URLParams
  8208. ifNoneMatch_ string
  8209. ctx_ context.Context
  8210. }
  8211. // Get: Returns a list of promo offers available to the user
  8212. func (r *PromoofferService) Get() *PromoofferGetCall {
  8213. c := &PromoofferGetCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  8214. return c
  8215. }
  8216. // AndroidId sets the optional parameter "androidId": device android_id
  8217. func (c *PromoofferGetCall) AndroidId(androidId string) *PromoofferGetCall {
  8218. c.urlParams_.Set("androidId", androidId)
  8219. return c
  8220. }
  8221. // Device sets the optional parameter "device": device device
  8222. func (c *PromoofferGetCall) Device(device string) *PromoofferGetCall {
  8223. c.urlParams_.Set("device", device)
  8224. return c
  8225. }
  8226. // Manufacturer sets the optional parameter "manufacturer": device
  8227. // manufacturer
  8228. func (c *PromoofferGetCall) Manufacturer(manufacturer string) *PromoofferGetCall {
  8229. c.urlParams_.Set("manufacturer", manufacturer)
  8230. return c
  8231. }
  8232. // Model sets the optional parameter "model": device model
  8233. func (c *PromoofferGetCall) Model(model string) *PromoofferGetCall {
  8234. c.urlParams_.Set("model", model)
  8235. return c
  8236. }
  8237. // Product sets the optional parameter "product": device product
  8238. func (c *PromoofferGetCall) Product(product string) *PromoofferGetCall {
  8239. c.urlParams_.Set("product", product)
  8240. return c
  8241. }
  8242. // Serial sets the optional parameter "serial": device serial
  8243. func (c *PromoofferGetCall) Serial(serial string) *PromoofferGetCall {
  8244. c.urlParams_.Set("serial", serial)
  8245. return c
  8246. }
  8247. // Fields allows partial responses to be retrieved. See
  8248. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  8249. // for more information.
  8250. func (c *PromoofferGetCall) Fields(s ...googleapi.Field) *PromoofferGetCall {
  8251. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  8252. return c
  8253. }
  8254. // IfNoneMatch sets the optional parameter which makes the operation
  8255. // fail if the object's ETag matches the given value. This is useful for
  8256. // getting updates only after the object has changed since the last
  8257. // request. Use googleapi.IsNotModified to check whether the response
  8258. // error from Do is the result of In-None-Match.
  8259. func (c *PromoofferGetCall) IfNoneMatch(entityTag string) *PromoofferGetCall {
  8260. c.ifNoneMatch_ = entityTag
  8261. return c
  8262. }
  8263. // Context sets the context to be used in this call's Do method. Any
  8264. // pending HTTP request will be aborted if the provided context is
  8265. // canceled.
  8266. func (c *PromoofferGetCall) Context(ctx context.Context) *PromoofferGetCall {
  8267. c.ctx_ = ctx
  8268. return c
  8269. }
  8270. func (c *PromoofferGetCall) doRequest(alt string) (*http.Response, error) {
  8271. var body io.Reader = nil
  8272. c.urlParams_.Set("alt", alt)
  8273. urls := googleapi.ResolveRelative(c.s.BasePath, "promooffer/get")
  8274. urls += "?" + c.urlParams_.Encode()
  8275. req, _ := http.NewRequest("GET", urls, body)
  8276. googleapi.SetOpaque(req.URL)
  8277. req.Header.Set("User-Agent", c.s.userAgent())
  8278. if c.ifNoneMatch_ != "" {
  8279. req.Header.Set("If-None-Match", c.ifNoneMatch_)
  8280. }
  8281. if c.ctx_ != nil {
  8282. return ctxhttp.Do(c.ctx_, c.s.client, req)
  8283. }
  8284. return c.s.client.Do(req)
  8285. }
  8286. // Do executes the "books.promooffer.get" call.
  8287. // Exactly one of *Offers or error will be non-nil. Any non-2xx status
  8288. // code is an error. Response headers are in either
  8289. // *Offers.ServerResponse.Header or (if a response was returned at all)
  8290. // in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to
  8291. // check whether the returned error was because http.StatusNotModified
  8292. // was returned.
  8293. func (c *PromoofferGetCall) Do(opts ...googleapi.CallOption) (*Offers, error) {
  8294. gensupport.SetOptions(c.urlParams_, opts...)
  8295. res, err := c.doRequest("json")
  8296. if res != nil && res.StatusCode == http.StatusNotModified {
  8297. if res.Body != nil {
  8298. res.Body.Close()
  8299. }
  8300. return nil, &googleapi.Error{
  8301. Code: res.StatusCode,
  8302. Header: res.Header,
  8303. }
  8304. }
  8305. if err != nil {
  8306. return nil, err
  8307. }
  8308. defer googleapi.CloseBody(res)
  8309. if err := googleapi.CheckResponse(res); err != nil {
  8310. return nil, err
  8311. }
  8312. ret := &Offers{
  8313. ServerResponse: googleapi.ServerResponse{
  8314. Header: res.Header,
  8315. HTTPStatusCode: res.StatusCode,
  8316. },
  8317. }
  8318. if err := json.NewDecoder(res.Body).Decode(&ret); err != nil {
  8319. return nil, err
  8320. }
  8321. return ret, nil
  8322. // {
  8323. // "description": "Returns a list of promo offers available to the user",
  8324. // "httpMethod": "GET",
  8325. // "id": "books.promooffer.get",
  8326. // "parameters": {
  8327. // "androidId": {
  8328. // "description": "device android_id",
  8329. // "location": "query",
  8330. // "type": "string"
  8331. // },
  8332. // "device": {
  8333. // "description": "device device",
  8334. // "location": "query",
  8335. // "type": "string"
  8336. // },
  8337. // "manufacturer": {
  8338. // "description": "device manufacturer",
  8339. // "location": "query",
  8340. // "type": "string"
  8341. // },
  8342. // "model": {
  8343. // "description": "device model",
  8344. // "location": "query",
  8345. // "type": "string"
  8346. // },
  8347. // "product": {
  8348. // "description": "device product",
  8349. // "location": "query",
  8350. // "type": "string"
  8351. // },
  8352. // "serial": {
  8353. // "description": "device serial",
  8354. // "location": "query",
  8355. // "type": "string"
  8356. // }
  8357. // },
  8358. // "path": "promooffer/get",
  8359. // "response": {
  8360. // "$ref": "Offers"
  8361. // },
  8362. // "scopes": [
  8363. // "https://www.googleapis.com/auth/books"
  8364. // ]
  8365. // }
  8366. }
  8367. // method id "books.series.get":
  8368. type SeriesGetCall struct {
  8369. s *Service
  8370. urlParams_ gensupport.URLParams
  8371. ifNoneMatch_ string
  8372. ctx_ context.Context
  8373. }
  8374. // Get: Returns Series metadata for the given series ids.
  8375. func (r *SeriesService) Get(seriesId []string) *SeriesGetCall {
  8376. c := &SeriesGetCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  8377. c.urlParams_.SetMulti("series_id", append([]string{}, seriesId...))
  8378. return c
  8379. }
  8380. // Fields allows partial responses to be retrieved. See
  8381. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  8382. // for more information.
  8383. func (c *SeriesGetCall) Fields(s ...googleapi.Field) *SeriesGetCall {
  8384. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  8385. return c
  8386. }
  8387. // IfNoneMatch sets the optional parameter which makes the operation
  8388. // fail if the object's ETag matches the given value. This is useful for
  8389. // getting updates only after the object has changed since the last
  8390. // request. Use googleapi.IsNotModified to check whether the response
  8391. // error from Do is the result of In-None-Match.
  8392. func (c *SeriesGetCall) IfNoneMatch(entityTag string) *SeriesGetCall {
  8393. c.ifNoneMatch_ = entityTag
  8394. return c
  8395. }
  8396. // Context sets the context to be used in this call's Do method. Any
  8397. // pending HTTP request will be aborted if the provided context is
  8398. // canceled.
  8399. func (c *SeriesGetCall) Context(ctx context.Context) *SeriesGetCall {
  8400. c.ctx_ = ctx
  8401. return c
  8402. }
  8403. func (c *SeriesGetCall) doRequest(alt string) (*http.Response, error) {
  8404. var body io.Reader = nil
  8405. c.urlParams_.Set("alt", alt)
  8406. urls := googleapi.ResolveRelative(c.s.BasePath, "series/get")
  8407. urls += "?" + c.urlParams_.Encode()
  8408. req, _ := http.NewRequest("GET", urls, body)
  8409. googleapi.SetOpaque(req.URL)
  8410. req.Header.Set("User-Agent", c.s.userAgent())
  8411. if c.ifNoneMatch_ != "" {
  8412. req.Header.Set("If-None-Match", c.ifNoneMatch_)
  8413. }
  8414. if c.ctx_ != nil {
  8415. return ctxhttp.Do(c.ctx_, c.s.client, req)
  8416. }
  8417. return c.s.client.Do(req)
  8418. }
  8419. // Do executes the "books.series.get" call.
  8420. // Exactly one of *Series or error will be non-nil. Any non-2xx status
  8421. // code is an error. Response headers are in either
  8422. // *Series.ServerResponse.Header or (if a response was returned at all)
  8423. // in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to
  8424. // check whether the returned error was because http.StatusNotModified
  8425. // was returned.
  8426. func (c *SeriesGetCall) Do(opts ...googleapi.CallOption) (*Series, error) {
  8427. gensupport.SetOptions(c.urlParams_, opts...)
  8428. res, err := c.doRequest("json")
  8429. if res != nil && res.StatusCode == http.StatusNotModified {
  8430. if res.Body != nil {
  8431. res.Body.Close()
  8432. }
  8433. return nil, &googleapi.Error{
  8434. Code: res.StatusCode,
  8435. Header: res.Header,
  8436. }
  8437. }
  8438. if err != nil {
  8439. return nil, err
  8440. }
  8441. defer googleapi.CloseBody(res)
  8442. if err := googleapi.CheckResponse(res); err != nil {
  8443. return nil, err
  8444. }
  8445. ret := &Series{
  8446. ServerResponse: googleapi.ServerResponse{
  8447. Header: res.Header,
  8448. HTTPStatusCode: res.StatusCode,
  8449. },
  8450. }
  8451. if err := json.NewDecoder(res.Body).Decode(&ret); err != nil {
  8452. return nil, err
  8453. }
  8454. return ret, nil
  8455. // {
  8456. // "description": "Returns Series metadata for the given series ids.",
  8457. // "httpMethod": "GET",
  8458. // "id": "books.series.get",
  8459. // "parameterOrder": [
  8460. // "series_id"
  8461. // ],
  8462. // "parameters": {
  8463. // "series_id": {
  8464. // "description": "String that identifies the series",
  8465. // "location": "query",
  8466. // "repeated": true,
  8467. // "required": true,
  8468. // "type": "string"
  8469. // }
  8470. // },
  8471. // "path": "series/get",
  8472. // "response": {
  8473. // "$ref": "Series"
  8474. // },
  8475. // "scopes": [
  8476. // "https://www.googleapis.com/auth/books"
  8477. // ]
  8478. // }
  8479. }
  8480. // method id "books.series.membership.get":
  8481. type SeriesMembershipGetCall struct {
  8482. s *Service
  8483. urlParams_ gensupport.URLParams
  8484. ifNoneMatch_ string
  8485. ctx_ context.Context
  8486. }
  8487. // Get: Returns Series membership data given the series id.
  8488. func (r *SeriesMembershipService) Get(seriesId string) *SeriesMembershipGetCall {
  8489. c := &SeriesMembershipGetCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  8490. c.urlParams_.Set("series_id", seriesId)
  8491. return c
  8492. }
  8493. // PageSize sets the optional parameter "page_size": Number of maximum
  8494. // results per page to be included in the response.
  8495. func (c *SeriesMembershipGetCall) PageSize(pageSize int64) *SeriesMembershipGetCall {
  8496. c.urlParams_.Set("page_size", fmt.Sprint(pageSize))
  8497. return c
  8498. }
  8499. // PageToken sets the optional parameter "page_token": The value of the
  8500. // nextToken from the previous page.
  8501. func (c *SeriesMembershipGetCall) PageToken(pageToken string) *SeriesMembershipGetCall {
  8502. c.urlParams_.Set("page_token", pageToken)
  8503. return c
  8504. }
  8505. // Fields allows partial responses to be retrieved. See
  8506. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  8507. // for more information.
  8508. func (c *SeriesMembershipGetCall) Fields(s ...googleapi.Field) *SeriesMembershipGetCall {
  8509. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  8510. return c
  8511. }
  8512. // IfNoneMatch sets the optional parameter which makes the operation
  8513. // fail if the object's ETag matches the given value. This is useful for
  8514. // getting updates only after the object has changed since the last
  8515. // request. Use googleapi.IsNotModified to check whether the response
  8516. // error from Do is the result of In-None-Match.
  8517. func (c *SeriesMembershipGetCall) IfNoneMatch(entityTag string) *SeriesMembershipGetCall {
  8518. c.ifNoneMatch_ = entityTag
  8519. return c
  8520. }
  8521. // Context sets the context to be used in this call's Do method. Any
  8522. // pending HTTP request will be aborted if the provided context is
  8523. // canceled.
  8524. func (c *SeriesMembershipGetCall) Context(ctx context.Context) *SeriesMembershipGetCall {
  8525. c.ctx_ = ctx
  8526. return c
  8527. }
  8528. func (c *SeriesMembershipGetCall) doRequest(alt string) (*http.Response, error) {
  8529. var body io.Reader = nil
  8530. c.urlParams_.Set("alt", alt)
  8531. urls := googleapi.ResolveRelative(c.s.BasePath, "series/membership/get")
  8532. urls += "?" + c.urlParams_.Encode()
  8533. req, _ := http.NewRequest("GET", urls, body)
  8534. googleapi.SetOpaque(req.URL)
  8535. req.Header.Set("User-Agent", c.s.userAgent())
  8536. if c.ifNoneMatch_ != "" {
  8537. req.Header.Set("If-None-Match", c.ifNoneMatch_)
  8538. }
  8539. if c.ctx_ != nil {
  8540. return ctxhttp.Do(c.ctx_, c.s.client, req)
  8541. }
  8542. return c.s.client.Do(req)
  8543. }
  8544. // Do executes the "books.series.membership.get" call.
  8545. // Exactly one of *Seriesmembership or error will be non-nil. Any
  8546. // non-2xx status code is an error. Response headers are in either
  8547. // *Seriesmembership.ServerResponse.Header or (if a response was
  8548. // returned at all) in error.(*googleapi.Error).Header. Use
  8549. // googleapi.IsNotModified to check whether the returned error was
  8550. // because http.StatusNotModified was returned.
  8551. func (c *SeriesMembershipGetCall) Do(opts ...googleapi.CallOption) (*Seriesmembership, error) {
  8552. gensupport.SetOptions(c.urlParams_, opts...)
  8553. res, err := c.doRequest("json")
  8554. if res != nil && res.StatusCode == http.StatusNotModified {
  8555. if res.Body != nil {
  8556. res.Body.Close()
  8557. }
  8558. return nil, &googleapi.Error{
  8559. Code: res.StatusCode,
  8560. Header: res.Header,
  8561. }
  8562. }
  8563. if err != nil {
  8564. return nil, err
  8565. }
  8566. defer googleapi.CloseBody(res)
  8567. if err := googleapi.CheckResponse(res); err != nil {
  8568. return nil, err
  8569. }
  8570. ret := &Seriesmembership{
  8571. ServerResponse: googleapi.ServerResponse{
  8572. Header: res.Header,
  8573. HTTPStatusCode: res.StatusCode,
  8574. },
  8575. }
  8576. if err := json.NewDecoder(res.Body).Decode(&ret); err != nil {
  8577. return nil, err
  8578. }
  8579. return ret, nil
  8580. // {
  8581. // "description": "Returns Series membership data given the series id.",
  8582. // "httpMethod": "GET",
  8583. // "id": "books.series.membership.get",
  8584. // "parameterOrder": [
  8585. // "series_id"
  8586. // ],
  8587. // "parameters": {
  8588. // "page_size": {
  8589. // "description": "Number of maximum results per page to be included in the response.",
  8590. // "format": "uint32",
  8591. // "location": "query",
  8592. // "type": "integer"
  8593. // },
  8594. // "page_token": {
  8595. // "description": "The value of the nextToken from the previous page.",
  8596. // "location": "query",
  8597. // "type": "string"
  8598. // },
  8599. // "series_id": {
  8600. // "description": "String that identifies the series",
  8601. // "location": "query",
  8602. // "required": true,
  8603. // "type": "string"
  8604. // }
  8605. // },
  8606. // "path": "series/membership/get",
  8607. // "response": {
  8608. // "$ref": "Seriesmembership"
  8609. // },
  8610. // "scopes": [
  8611. // "https://www.googleapis.com/auth/books"
  8612. // ]
  8613. // }
  8614. }
  8615. // method id "books.volumes.get":
  8616. type VolumesGetCall struct {
  8617. s *Service
  8618. volumeId string
  8619. urlParams_ gensupport.URLParams
  8620. ifNoneMatch_ string
  8621. ctx_ context.Context
  8622. }
  8623. // Get: Gets volume information for a single volume.
  8624. func (r *VolumesService) Get(volumeId string) *VolumesGetCall {
  8625. c := &VolumesGetCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  8626. c.volumeId = volumeId
  8627. return c
  8628. }
  8629. // Country sets the optional parameter "country": ISO-3166-1 code to
  8630. // override the IP-based location.
  8631. func (c *VolumesGetCall) Country(country string) *VolumesGetCall {
  8632. c.urlParams_.Set("country", country)
  8633. return c
  8634. }
  8635. // IncludeNonComicsSeries sets the optional parameter
  8636. // "includeNonComicsSeries": Set to true to include non-comics series.
  8637. // Defaults to false.
  8638. func (c *VolumesGetCall) IncludeNonComicsSeries(includeNonComicsSeries bool) *VolumesGetCall {
  8639. c.urlParams_.Set("includeNonComicsSeries", fmt.Sprint(includeNonComicsSeries))
  8640. return c
  8641. }
  8642. // Partner sets the optional parameter "partner": Brand results for
  8643. // partner ID.
  8644. func (c *VolumesGetCall) Partner(partner string) *VolumesGetCall {
  8645. c.urlParams_.Set("partner", partner)
  8646. return c
  8647. }
  8648. // Projection sets the optional parameter "projection": Restrict
  8649. // information returned to a set of selected fields.
  8650. //
  8651. // Possible values:
  8652. // "full" - Includes all volume data.
  8653. // "lite" - Includes a subset of fields in volumeInfo and accessInfo.
  8654. func (c *VolumesGetCall) Projection(projection string) *VolumesGetCall {
  8655. c.urlParams_.Set("projection", projection)
  8656. return c
  8657. }
  8658. // Source sets the optional parameter "source": String to identify the
  8659. // originator of this request.
  8660. func (c *VolumesGetCall) Source(source string) *VolumesGetCall {
  8661. c.urlParams_.Set("source", source)
  8662. return c
  8663. }
  8664. // UserLibraryConsistentRead sets the optional parameter
  8665. // "user_library_consistent_read":
  8666. func (c *VolumesGetCall) UserLibraryConsistentRead(userLibraryConsistentRead bool) *VolumesGetCall {
  8667. c.urlParams_.Set("user_library_consistent_read", fmt.Sprint(userLibraryConsistentRead))
  8668. return c
  8669. }
  8670. // Fields allows partial responses to be retrieved. See
  8671. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  8672. // for more information.
  8673. func (c *VolumesGetCall) Fields(s ...googleapi.Field) *VolumesGetCall {
  8674. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  8675. return c
  8676. }
  8677. // IfNoneMatch sets the optional parameter which makes the operation
  8678. // fail if the object's ETag matches the given value. This is useful for
  8679. // getting updates only after the object has changed since the last
  8680. // request. Use googleapi.IsNotModified to check whether the response
  8681. // error from Do is the result of In-None-Match.
  8682. func (c *VolumesGetCall) IfNoneMatch(entityTag string) *VolumesGetCall {
  8683. c.ifNoneMatch_ = entityTag
  8684. return c
  8685. }
  8686. // Context sets the context to be used in this call's Do method. Any
  8687. // pending HTTP request will be aborted if the provided context is
  8688. // canceled.
  8689. func (c *VolumesGetCall) Context(ctx context.Context) *VolumesGetCall {
  8690. c.ctx_ = ctx
  8691. return c
  8692. }
  8693. func (c *VolumesGetCall) doRequest(alt string) (*http.Response, error) {
  8694. var body io.Reader = nil
  8695. c.urlParams_.Set("alt", alt)
  8696. urls := googleapi.ResolveRelative(c.s.BasePath, "volumes/{volumeId}")
  8697. urls += "?" + c.urlParams_.Encode()
  8698. req, _ := http.NewRequest("GET", urls, body)
  8699. googleapi.Expand(req.URL, map[string]string{
  8700. "volumeId": c.volumeId,
  8701. })
  8702. req.Header.Set("User-Agent", c.s.userAgent())
  8703. if c.ifNoneMatch_ != "" {
  8704. req.Header.Set("If-None-Match", c.ifNoneMatch_)
  8705. }
  8706. if c.ctx_ != nil {
  8707. return ctxhttp.Do(c.ctx_, c.s.client, req)
  8708. }
  8709. return c.s.client.Do(req)
  8710. }
  8711. // Do executes the "books.volumes.get" call.
  8712. // Exactly one of *Volume or error will be non-nil. Any non-2xx status
  8713. // code is an error. Response headers are in either
  8714. // *Volume.ServerResponse.Header or (if a response was returned at all)
  8715. // in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to
  8716. // check whether the returned error was because http.StatusNotModified
  8717. // was returned.
  8718. func (c *VolumesGetCall) Do(opts ...googleapi.CallOption) (*Volume, error) {
  8719. gensupport.SetOptions(c.urlParams_, opts...)
  8720. res, err := c.doRequest("json")
  8721. if res != nil && res.StatusCode == http.StatusNotModified {
  8722. if res.Body != nil {
  8723. res.Body.Close()
  8724. }
  8725. return nil, &googleapi.Error{
  8726. Code: res.StatusCode,
  8727. Header: res.Header,
  8728. }
  8729. }
  8730. if err != nil {
  8731. return nil, err
  8732. }
  8733. defer googleapi.CloseBody(res)
  8734. if err := googleapi.CheckResponse(res); err != nil {
  8735. return nil, err
  8736. }
  8737. ret := &Volume{
  8738. ServerResponse: googleapi.ServerResponse{
  8739. Header: res.Header,
  8740. HTTPStatusCode: res.StatusCode,
  8741. },
  8742. }
  8743. if err := json.NewDecoder(res.Body).Decode(&ret); err != nil {
  8744. return nil, err
  8745. }
  8746. return ret, nil
  8747. // {
  8748. // "description": "Gets volume information for a single volume.",
  8749. // "httpMethod": "GET",
  8750. // "id": "books.volumes.get",
  8751. // "parameterOrder": [
  8752. // "volumeId"
  8753. // ],
  8754. // "parameters": {
  8755. // "country": {
  8756. // "description": "ISO-3166-1 code to override the IP-based location.",
  8757. // "location": "query",
  8758. // "type": "string"
  8759. // },
  8760. // "includeNonComicsSeries": {
  8761. // "description": "Set to true to include non-comics series. Defaults to false.",
  8762. // "location": "query",
  8763. // "type": "boolean"
  8764. // },
  8765. // "partner": {
  8766. // "description": "Brand results for partner ID.",
  8767. // "location": "query",
  8768. // "type": "string"
  8769. // },
  8770. // "projection": {
  8771. // "description": "Restrict information returned to a set of selected fields.",
  8772. // "enum": [
  8773. // "full",
  8774. // "lite"
  8775. // ],
  8776. // "enumDescriptions": [
  8777. // "Includes all volume data.",
  8778. // "Includes a subset of fields in volumeInfo and accessInfo."
  8779. // ],
  8780. // "location": "query",
  8781. // "type": "string"
  8782. // },
  8783. // "source": {
  8784. // "description": "String to identify the originator of this request.",
  8785. // "location": "query",
  8786. // "type": "string"
  8787. // },
  8788. // "user_library_consistent_read": {
  8789. // "location": "query",
  8790. // "type": "boolean"
  8791. // },
  8792. // "volumeId": {
  8793. // "description": "ID of volume to retrieve.",
  8794. // "location": "path",
  8795. // "required": true,
  8796. // "type": "string"
  8797. // }
  8798. // },
  8799. // "path": "volumes/{volumeId}",
  8800. // "response": {
  8801. // "$ref": "Volume"
  8802. // },
  8803. // "scopes": [
  8804. // "https://www.googleapis.com/auth/books"
  8805. // ]
  8806. // }
  8807. }
  8808. // method id "books.volumes.list":
  8809. type VolumesListCall struct {
  8810. s *Service
  8811. urlParams_ gensupport.URLParams
  8812. ifNoneMatch_ string
  8813. ctx_ context.Context
  8814. }
  8815. // List: Performs a book search.
  8816. func (r *VolumesService) List(q string) *VolumesListCall {
  8817. c := &VolumesListCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  8818. c.urlParams_.Set("q", q)
  8819. return c
  8820. }
  8821. // Download sets the optional parameter "download": Restrict to volumes
  8822. // by download availability.
  8823. //
  8824. // Possible values:
  8825. // "epub" - All volumes with epub.
  8826. func (c *VolumesListCall) Download(download string) *VolumesListCall {
  8827. c.urlParams_.Set("download", download)
  8828. return c
  8829. }
  8830. // Filter sets the optional parameter "filter": Filter search results.
  8831. //
  8832. // Possible values:
  8833. // "ebooks" - All Google eBooks.
  8834. // "free-ebooks" - Google eBook with full volume text viewability.
  8835. // "full" - Public can view entire volume text.
  8836. // "paid-ebooks" - Google eBook with a price.
  8837. // "partial" - Public able to see parts of text.
  8838. func (c *VolumesListCall) Filter(filter string) *VolumesListCall {
  8839. c.urlParams_.Set("filter", filter)
  8840. return c
  8841. }
  8842. // LangRestrict sets the optional parameter "langRestrict": Restrict
  8843. // results to books with this language code.
  8844. func (c *VolumesListCall) LangRestrict(langRestrict string) *VolumesListCall {
  8845. c.urlParams_.Set("langRestrict", langRestrict)
  8846. return c
  8847. }
  8848. // LibraryRestrict sets the optional parameter "libraryRestrict":
  8849. // Restrict search to this user's library.
  8850. //
  8851. // Possible values:
  8852. // "my-library" - Restrict to the user's library, any shelf.
  8853. // "no-restrict" - Do not restrict based on user's library.
  8854. func (c *VolumesListCall) LibraryRestrict(libraryRestrict string) *VolumesListCall {
  8855. c.urlParams_.Set("libraryRestrict", libraryRestrict)
  8856. return c
  8857. }
  8858. // MaxResults sets the optional parameter "maxResults": Maximum number
  8859. // of results to return.
  8860. func (c *VolumesListCall) MaxResults(maxResults int64) *VolumesListCall {
  8861. c.urlParams_.Set("maxResults", fmt.Sprint(maxResults))
  8862. return c
  8863. }
  8864. // OrderBy sets the optional parameter "orderBy": Sort search results.
  8865. //
  8866. // Possible values:
  8867. // "newest" - Most recently published.
  8868. // "relevance" - Relevance to search terms.
  8869. func (c *VolumesListCall) OrderBy(orderBy string) *VolumesListCall {
  8870. c.urlParams_.Set("orderBy", orderBy)
  8871. return c
  8872. }
  8873. // Partner sets the optional parameter "partner": Restrict and brand
  8874. // results for partner ID.
  8875. func (c *VolumesListCall) Partner(partner string) *VolumesListCall {
  8876. c.urlParams_.Set("partner", partner)
  8877. return c
  8878. }
  8879. // PrintType sets the optional parameter "printType": Restrict to books
  8880. // or magazines.
  8881. //
  8882. // Possible values:
  8883. // "all" - All volume content types.
  8884. // "books" - Just books.
  8885. // "magazines" - Just magazines.
  8886. func (c *VolumesListCall) PrintType(printType string) *VolumesListCall {
  8887. c.urlParams_.Set("printType", printType)
  8888. return c
  8889. }
  8890. // Projection sets the optional parameter "projection": Restrict
  8891. // information returned to a set of selected fields.
  8892. //
  8893. // Possible values:
  8894. // "full" - Includes all volume data.
  8895. // "lite" - Includes a subset of fields in volumeInfo and accessInfo.
  8896. func (c *VolumesListCall) Projection(projection string) *VolumesListCall {
  8897. c.urlParams_.Set("projection", projection)
  8898. return c
  8899. }
  8900. // ShowPreorders sets the optional parameter "showPreorders": Set to
  8901. // true to show books available for preorder. Defaults to false.
  8902. func (c *VolumesListCall) ShowPreorders(showPreorders bool) *VolumesListCall {
  8903. c.urlParams_.Set("showPreorders", fmt.Sprint(showPreorders))
  8904. return c
  8905. }
  8906. // Source sets the optional parameter "source": String to identify the
  8907. // originator of this request.
  8908. func (c *VolumesListCall) Source(source string) *VolumesListCall {
  8909. c.urlParams_.Set("source", source)
  8910. return c
  8911. }
  8912. // StartIndex sets the optional parameter "startIndex": Index of the
  8913. // first result to return (starts at 0)
  8914. func (c *VolumesListCall) StartIndex(startIndex int64) *VolumesListCall {
  8915. c.urlParams_.Set("startIndex", fmt.Sprint(startIndex))
  8916. return c
  8917. }
  8918. // Fields allows partial responses to be retrieved. See
  8919. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  8920. // for more information.
  8921. func (c *VolumesListCall) Fields(s ...googleapi.Field) *VolumesListCall {
  8922. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  8923. return c
  8924. }
  8925. // IfNoneMatch sets the optional parameter which makes the operation
  8926. // fail if the object's ETag matches the given value. This is useful for
  8927. // getting updates only after the object has changed since the last
  8928. // request. Use googleapi.IsNotModified to check whether the response
  8929. // error from Do is the result of In-None-Match.
  8930. func (c *VolumesListCall) IfNoneMatch(entityTag string) *VolumesListCall {
  8931. c.ifNoneMatch_ = entityTag
  8932. return c
  8933. }
  8934. // Context sets the context to be used in this call's Do method. Any
  8935. // pending HTTP request will be aborted if the provided context is
  8936. // canceled.
  8937. func (c *VolumesListCall) Context(ctx context.Context) *VolumesListCall {
  8938. c.ctx_ = ctx
  8939. return c
  8940. }
  8941. func (c *VolumesListCall) doRequest(alt string) (*http.Response, error) {
  8942. var body io.Reader = nil
  8943. c.urlParams_.Set("alt", alt)
  8944. urls := googleapi.ResolveRelative(c.s.BasePath, "volumes")
  8945. urls += "?" + c.urlParams_.Encode()
  8946. req, _ := http.NewRequest("GET", urls, body)
  8947. googleapi.SetOpaque(req.URL)
  8948. req.Header.Set("User-Agent", c.s.userAgent())
  8949. if c.ifNoneMatch_ != "" {
  8950. req.Header.Set("If-None-Match", c.ifNoneMatch_)
  8951. }
  8952. if c.ctx_ != nil {
  8953. return ctxhttp.Do(c.ctx_, c.s.client, req)
  8954. }
  8955. return c.s.client.Do(req)
  8956. }
  8957. // Do executes the "books.volumes.list" call.
  8958. // Exactly one of *Volumes or error will be non-nil. Any non-2xx status
  8959. // code is an error. Response headers are in either
  8960. // *Volumes.ServerResponse.Header or (if a response was returned at all)
  8961. // in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to
  8962. // check whether the returned error was because http.StatusNotModified
  8963. // was returned.
  8964. func (c *VolumesListCall) Do(opts ...googleapi.CallOption) (*Volumes, error) {
  8965. gensupport.SetOptions(c.urlParams_, opts...)
  8966. res, err := c.doRequest("json")
  8967. if res != nil && res.StatusCode == http.StatusNotModified {
  8968. if res.Body != nil {
  8969. res.Body.Close()
  8970. }
  8971. return nil, &googleapi.Error{
  8972. Code: res.StatusCode,
  8973. Header: res.Header,
  8974. }
  8975. }
  8976. if err != nil {
  8977. return nil, err
  8978. }
  8979. defer googleapi.CloseBody(res)
  8980. if err := googleapi.CheckResponse(res); err != nil {
  8981. return nil, err
  8982. }
  8983. ret := &Volumes{
  8984. ServerResponse: googleapi.ServerResponse{
  8985. Header: res.Header,
  8986. HTTPStatusCode: res.StatusCode,
  8987. },
  8988. }
  8989. if err := json.NewDecoder(res.Body).Decode(&ret); err != nil {
  8990. return nil, err
  8991. }
  8992. return ret, nil
  8993. // {
  8994. // "description": "Performs a book search.",
  8995. // "httpMethod": "GET",
  8996. // "id": "books.volumes.list",
  8997. // "parameterOrder": [
  8998. // "q"
  8999. // ],
  9000. // "parameters": {
  9001. // "download": {
  9002. // "description": "Restrict to volumes by download availability.",
  9003. // "enum": [
  9004. // "epub"
  9005. // ],
  9006. // "enumDescriptions": [
  9007. // "All volumes with epub."
  9008. // ],
  9009. // "location": "query",
  9010. // "type": "string"
  9011. // },
  9012. // "filter": {
  9013. // "description": "Filter search results.",
  9014. // "enum": [
  9015. // "ebooks",
  9016. // "free-ebooks",
  9017. // "full",
  9018. // "paid-ebooks",
  9019. // "partial"
  9020. // ],
  9021. // "enumDescriptions": [
  9022. // "All Google eBooks.",
  9023. // "Google eBook with full volume text viewability.",
  9024. // "Public can view entire volume text.",
  9025. // "Google eBook with a price.",
  9026. // "Public able to see parts of text."
  9027. // ],
  9028. // "location": "query",
  9029. // "type": "string"
  9030. // },
  9031. // "langRestrict": {
  9032. // "description": "Restrict results to books with this language code.",
  9033. // "location": "query",
  9034. // "type": "string"
  9035. // },
  9036. // "libraryRestrict": {
  9037. // "description": "Restrict search to this user's library.",
  9038. // "enum": [
  9039. // "my-library",
  9040. // "no-restrict"
  9041. // ],
  9042. // "enumDescriptions": [
  9043. // "Restrict to the user's library, any shelf.",
  9044. // "Do not restrict based on user's library."
  9045. // ],
  9046. // "location": "query",
  9047. // "type": "string"
  9048. // },
  9049. // "maxResults": {
  9050. // "description": "Maximum number of results to return.",
  9051. // "format": "uint32",
  9052. // "location": "query",
  9053. // "maximum": "40",
  9054. // "minimum": "0",
  9055. // "type": "integer"
  9056. // },
  9057. // "orderBy": {
  9058. // "description": "Sort search results.",
  9059. // "enum": [
  9060. // "newest",
  9061. // "relevance"
  9062. // ],
  9063. // "enumDescriptions": [
  9064. // "Most recently published.",
  9065. // "Relevance to search terms."
  9066. // ],
  9067. // "location": "query",
  9068. // "type": "string"
  9069. // },
  9070. // "partner": {
  9071. // "description": "Restrict and brand results for partner ID.",
  9072. // "location": "query",
  9073. // "type": "string"
  9074. // },
  9075. // "printType": {
  9076. // "description": "Restrict to books or magazines.",
  9077. // "enum": [
  9078. // "all",
  9079. // "books",
  9080. // "magazines"
  9081. // ],
  9082. // "enumDescriptions": [
  9083. // "All volume content types.",
  9084. // "Just books.",
  9085. // "Just magazines."
  9086. // ],
  9087. // "location": "query",
  9088. // "type": "string"
  9089. // },
  9090. // "projection": {
  9091. // "description": "Restrict information returned to a set of selected fields.",
  9092. // "enum": [
  9093. // "full",
  9094. // "lite"
  9095. // ],
  9096. // "enumDescriptions": [
  9097. // "Includes all volume data.",
  9098. // "Includes a subset of fields in volumeInfo and accessInfo."
  9099. // ],
  9100. // "location": "query",
  9101. // "type": "string"
  9102. // },
  9103. // "q": {
  9104. // "description": "Full-text search query string.",
  9105. // "location": "query",
  9106. // "required": true,
  9107. // "type": "string"
  9108. // },
  9109. // "showPreorders": {
  9110. // "description": "Set to true to show books available for preorder. Defaults to false.",
  9111. // "location": "query",
  9112. // "type": "boolean"
  9113. // },
  9114. // "source": {
  9115. // "description": "String to identify the originator of this request.",
  9116. // "location": "query",
  9117. // "type": "string"
  9118. // },
  9119. // "startIndex": {
  9120. // "description": "Index of the first result to return (starts at 0)",
  9121. // "format": "uint32",
  9122. // "location": "query",
  9123. // "minimum": "0",
  9124. // "type": "integer"
  9125. // }
  9126. // },
  9127. // "path": "volumes",
  9128. // "response": {
  9129. // "$ref": "Volumes"
  9130. // },
  9131. // "scopes": [
  9132. // "https://www.googleapis.com/auth/books"
  9133. // ]
  9134. // }
  9135. }
  9136. // method id "books.volumes.associated.list":
  9137. type VolumesAssociatedListCall struct {
  9138. s *Service
  9139. volumeId string
  9140. urlParams_ gensupport.URLParams
  9141. ifNoneMatch_ string
  9142. ctx_ context.Context
  9143. }
  9144. // List: Return a list of associated books.
  9145. func (r *VolumesAssociatedService) List(volumeId string) *VolumesAssociatedListCall {
  9146. c := &VolumesAssociatedListCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  9147. c.volumeId = volumeId
  9148. return c
  9149. }
  9150. // Association sets the optional parameter "association": Association
  9151. // type.
  9152. //
  9153. // Possible values:
  9154. // "end-of-sample" - Recommendations for display end-of-sample.
  9155. // "end-of-volume" - Recommendations for display end-of-volume.
  9156. // "related-for-play" - Related volumes for Play Store.
  9157. func (c *VolumesAssociatedListCall) Association(association string) *VolumesAssociatedListCall {
  9158. c.urlParams_.Set("association", association)
  9159. return c
  9160. }
  9161. // Locale sets the optional parameter "locale": ISO-639-1 language and
  9162. // ISO-3166-1 country code. Ex: 'en_US'. Used for generating
  9163. // recommendations.
  9164. func (c *VolumesAssociatedListCall) Locale(locale string) *VolumesAssociatedListCall {
  9165. c.urlParams_.Set("locale", locale)
  9166. return c
  9167. }
  9168. // MaxAllowedMaturityRating sets the optional parameter
  9169. // "maxAllowedMaturityRating": The maximum allowed maturity rating of
  9170. // returned recommendations. Books with a higher maturity rating are
  9171. // filtered out.
  9172. //
  9173. // Possible values:
  9174. // "mature" - Show books which are rated mature or lower.
  9175. // "not-mature" - Show books which are rated not mature.
  9176. func (c *VolumesAssociatedListCall) MaxAllowedMaturityRating(maxAllowedMaturityRating string) *VolumesAssociatedListCall {
  9177. c.urlParams_.Set("maxAllowedMaturityRating", maxAllowedMaturityRating)
  9178. return c
  9179. }
  9180. // Source sets the optional parameter "source": String to identify the
  9181. // originator of this request.
  9182. func (c *VolumesAssociatedListCall) Source(source string) *VolumesAssociatedListCall {
  9183. c.urlParams_.Set("source", source)
  9184. return c
  9185. }
  9186. // Fields allows partial responses to be retrieved. See
  9187. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  9188. // for more information.
  9189. func (c *VolumesAssociatedListCall) Fields(s ...googleapi.Field) *VolumesAssociatedListCall {
  9190. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  9191. return c
  9192. }
  9193. // IfNoneMatch sets the optional parameter which makes the operation
  9194. // fail if the object's ETag matches the given value. This is useful for
  9195. // getting updates only after the object has changed since the last
  9196. // request. Use googleapi.IsNotModified to check whether the response
  9197. // error from Do is the result of In-None-Match.
  9198. func (c *VolumesAssociatedListCall) IfNoneMatch(entityTag string) *VolumesAssociatedListCall {
  9199. c.ifNoneMatch_ = entityTag
  9200. return c
  9201. }
  9202. // Context sets the context to be used in this call's Do method. Any
  9203. // pending HTTP request will be aborted if the provided context is
  9204. // canceled.
  9205. func (c *VolumesAssociatedListCall) Context(ctx context.Context) *VolumesAssociatedListCall {
  9206. c.ctx_ = ctx
  9207. return c
  9208. }
  9209. func (c *VolumesAssociatedListCall) doRequest(alt string) (*http.Response, error) {
  9210. var body io.Reader = nil
  9211. c.urlParams_.Set("alt", alt)
  9212. urls := googleapi.ResolveRelative(c.s.BasePath, "volumes/{volumeId}/associated")
  9213. urls += "?" + c.urlParams_.Encode()
  9214. req, _ := http.NewRequest("GET", urls, body)
  9215. googleapi.Expand(req.URL, map[string]string{
  9216. "volumeId": c.volumeId,
  9217. })
  9218. req.Header.Set("User-Agent", c.s.userAgent())
  9219. if c.ifNoneMatch_ != "" {
  9220. req.Header.Set("If-None-Match", c.ifNoneMatch_)
  9221. }
  9222. if c.ctx_ != nil {
  9223. return ctxhttp.Do(c.ctx_, c.s.client, req)
  9224. }
  9225. return c.s.client.Do(req)
  9226. }
  9227. // Do executes the "books.volumes.associated.list" call.
  9228. // Exactly one of *Volumes or error will be non-nil. Any non-2xx status
  9229. // code is an error. Response headers are in either
  9230. // *Volumes.ServerResponse.Header or (if a response was returned at all)
  9231. // in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to
  9232. // check whether the returned error was because http.StatusNotModified
  9233. // was returned.
  9234. func (c *VolumesAssociatedListCall) Do(opts ...googleapi.CallOption) (*Volumes, error) {
  9235. gensupport.SetOptions(c.urlParams_, opts...)
  9236. res, err := c.doRequest("json")
  9237. if res != nil && res.StatusCode == http.StatusNotModified {
  9238. if res.Body != nil {
  9239. res.Body.Close()
  9240. }
  9241. return nil, &googleapi.Error{
  9242. Code: res.StatusCode,
  9243. Header: res.Header,
  9244. }
  9245. }
  9246. if err != nil {
  9247. return nil, err
  9248. }
  9249. defer googleapi.CloseBody(res)
  9250. if err := googleapi.CheckResponse(res); err != nil {
  9251. return nil, err
  9252. }
  9253. ret := &Volumes{
  9254. ServerResponse: googleapi.ServerResponse{
  9255. Header: res.Header,
  9256. HTTPStatusCode: res.StatusCode,
  9257. },
  9258. }
  9259. if err := json.NewDecoder(res.Body).Decode(&ret); err != nil {
  9260. return nil, err
  9261. }
  9262. return ret, nil
  9263. // {
  9264. // "description": "Return a list of associated books.",
  9265. // "httpMethod": "GET",
  9266. // "id": "books.volumes.associated.list",
  9267. // "parameterOrder": [
  9268. // "volumeId"
  9269. // ],
  9270. // "parameters": {
  9271. // "association": {
  9272. // "description": "Association type.",
  9273. // "enum": [
  9274. // "end-of-sample",
  9275. // "end-of-volume",
  9276. // "related-for-play"
  9277. // ],
  9278. // "enumDescriptions": [
  9279. // "Recommendations for display end-of-sample.",
  9280. // "Recommendations for display end-of-volume.",
  9281. // "Related volumes for Play Store."
  9282. // ],
  9283. // "location": "query",
  9284. // "type": "string"
  9285. // },
  9286. // "locale": {
  9287. // "description": "ISO-639-1 language and ISO-3166-1 country code. Ex: 'en_US'. Used for generating recommendations.",
  9288. // "location": "query",
  9289. // "type": "string"
  9290. // },
  9291. // "maxAllowedMaturityRating": {
  9292. // "description": "The maximum allowed maturity rating of returned recommendations. Books with a higher maturity rating are filtered out.",
  9293. // "enum": [
  9294. // "mature",
  9295. // "not-mature"
  9296. // ],
  9297. // "enumDescriptions": [
  9298. // "Show books which are rated mature or lower.",
  9299. // "Show books which are rated not mature."
  9300. // ],
  9301. // "location": "query",
  9302. // "type": "string"
  9303. // },
  9304. // "source": {
  9305. // "description": "String to identify the originator of this request.",
  9306. // "location": "query",
  9307. // "type": "string"
  9308. // },
  9309. // "volumeId": {
  9310. // "description": "ID of the source volume.",
  9311. // "location": "path",
  9312. // "required": true,
  9313. // "type": "string"
  9314. // }
  9315. // },
  9316. // "path": "volumes/{volumeId}/associated",
  9317. // "response": {
  9318. // "$ref": "Volumes"
  9319. // },
  9320. // "scopes": [
  9321. // "https://www.googleapis.com/auth/books"
  9322. // ]
  9323. // }
  9324. }
  9325. // method id "books.volumes.mybooks.list":
  9326. type VolumesMybooksListCall struct {
  9327. s *Service
  9328. urlParams_ gensupport.URLParams
  9329. ifNoneMatch_ string
  9330. ctx_ context.Context
  9331. }
  9332. // List: Return a list of books in My Library.
  9333. func (r *VolumesMybooksService) List() *VolumesMybooksListCall {
  9334. c := &VolumesMybooksListCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  9335. return c
  9336. }
  9337. // AcquireMethod sets the optional parameter "acquireMethod": How the
  9338. // book was aquired
  9339. //
  9340. // Possible values:
  9341. // "PREORDERED" - Preordered books (not yet available)
  9342. // "PREVIOUSLY_RENTED" - User-rented books past their expiration time
  9343. // "PUBLIC_DOMAIN" - Public domain books
  9344. // "PURCHASED" - Purchased books
  9345. // "RENTED" - User-rented books
  9346. // "SAMPLE" - Sample books
  9347. // "UPLOADED" - User uploaded books
  9348. func (c *VolumesMybooksListCall) AcquireMethod(acquireMethod ...string) *VolumesMybooksListCall {
  9349. c.urlParams_.SetMulti("acquireMethod", append([]string{}, acquireMethod...))
  9350. return c
  9351. }
  9352. // Locale sets the optional parameter "locale": ISO-639-1 language and
  9353. // ISO-3166-1 country code. Ex:'en_US'. Used for generating
  9354. // recommendations.
  9355. func (c *VolumesMybooksListCall) Locale(locale string) *VolumesMybooksListCall {
  9356. c.urlParams_.Set("locale", locale)
  9357. return c
  9358. }
  9359. // MaxResults sets the optional parameter "maxResults": Maximum number
  9360. // of results to return.
  9361. func (c *VolumesMybooksListCall) MaxResults(maxResults int64) *VolumesMybooksListCall {
  9362. c.urlParams_.Set("maxResults", fmt.Sprint(maxResults))
  9363. return c
  9364. }
  9365. // ProcessingState sets the optional parameter "processingState": The
  9366. // processing state of the user uploaded volumes to be returned.
  9367. // Applicable only if the UPLOADED is specified in the acquireMethod.
  9368. //
  9369. // Possible values:
  9370. // "COMPLETED_FAILED" - The volume processing hase failed.
  9371. // "COMPLETED_SUCCESS" - The volume processing was completed.
  9372. // "RUNNING" - The volume processing is not completed.
  9373. func (c *VolumesMybooksListCall) ProcessingState(processingState ...string) *VolumesMybooksListCall {
  9374. c.urlParams_.SetMulti("processingState", append([]string{}, processingState...))
  9375. return c
  9376. }
  9377. // Source sets the optional parameter "source": String to identify the
  9378. // originator of this request.
  9379. func (c *VolumesMybooksListCall) Source(source string) *VolumesMybooksListCall {
  9380. c.urlParams_.Set("source", source)
  9381. return c
  9382. }
  9383. // StartIndex sets the optional parameter "startIndex": Index of the
  9384. // first result to return (starts at 0)
  9385. func (c *VolumesMybooksListCall) StartIndex(startIndex int64) *VolumesMybooksListCall {
  9386. c.urlParams_.Set("startIndex", fmt.Sprint(startIndex))
  9387. return c
  9388. }
  9389. // Fields allows partial responses to be retrieved. See
  9390. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  9391. // for more information.
  9392. func (c *VolumesMybooksListCall) Fields(s ...googleapi.Field) *VolumesMybooksListCall {
  9393. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  9394. return c
  9395. }
  9396. // IfNoneMatch sets the optional parameter which makes the operation
  9397. // fail if the object's ETag matches the given value. This is useful for
  9398. // getting updates only after the object has changed since the last
  9399. // request. Use googleapi.IsNotModified to check whether the response
  9400. // error from Do is the result of In-None-Match.
  9401. func (c *VolumesMybooksListCall) IfNoneMatch(entityTag string) *VolumesMybooksListCall {
  9402. c.ifNoneMatch_ = entityTag
  9403. return c
  9404. }
  9405. // Context sets the context to be used in this call's Do method. Any
  9406. // pending HTTP request will be aborted if the provided context is
  9407. // canceled.
  9408. func (c *VolumesMybooksListCall) Context(ctx context.Context) *VolumesMybooksListCall {
  9409. c.ctx_ = ctx
  9410. return c
  9411. }
  9412. func (c *VolumesMybooksListCall) doRequest(alt string) (*http.Response, error) {
  9413. var body io.Reader = nil
  9414. c.urlParams_.Set("alt", alt)
  9415. urls := googleapi.ResolveRelative(c.s.BasePath, "volumes/mybooks")
  9416. urls += "?" + c.urlParams_.Encode()
  9417. req, _ := http.NewRequest("GET", urls, body)
  9418. googleapi.SetOpaque(req.URL)
  9419. req.Header.Set("User-Agent", c.s.userAgent())
  9420. if c.ifNoneMatch_ != "" {
  9421. req.Header.Set("If-None-Match", c.ifNoneMatch_)
  9422. }
  9423. if c.ctx_ != nil {
  9424. return ctxhttp.Do(c.ctx_, c.s.client, req)
  9425. }
  9426. return c.s.client.Do(req)
  9427. }
  9428. // Do executes the "books.volumes.mybooks.list" call.
  9429. // Exactly one of *Volumes or error will be non-nil. Any non-2xx status
  9430. // code is an error. Response headers are in either
  9431. // *Volumes.ServerResponse.Header or (if a response was returned at all)
  9432. // in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to
  9433. // check whether the returned error was because http.StatusNotModified
  9434. // was returned.
  9435. func (c *VolumesMybooksListCall) Do(opts ...googleapi.CallOption) (*Volumes, error) {
  9436. gensupport.SetOptions(c.urlParams_, opts...)
  9437. res, err := c.doRequest("json")
  9438. if res != nil && res.StatusCode == http.StatusNotModified {
  9439. if res.Body != nil {
  9440. res.Body.Close()
  9441. }
  9442. return nil, &googleapi.Error{
  9443. Code: res.StatusCode,
  9444. Header: res.Header,
  9445. }
  9446. }
  9447. if err != nil {
  9448. return nil, err
  9449. }
  9450. defer googleapi.CloseBody(res)
  9451. if err := googleapi.CheckResponse(res); err != nil {
  9452. return nil, err
  9453. }
  9454. ret := &Volumes{
  9455. ServerResponse: googleapi.ServerResponse{
  9456. Header: res.Header,
  9457. HTTPStatusCode: res.StatusCode,
  9458. },
  9459. }
  9460. if err := json.NewDecoder(res.Body).Decode(&ret); err != nil {
  9461. return nil, err
  9462. }
  9463. return ret, nil
  9464. // {
  9465. // "description": "Return a list of books in My Library.",
  9466. // "httpMethod": "GET",
  9467. // "id": "books.volumes.mybooks.list",
  9468. // "parameters": {
  9469. // "acquireMethod": {
  9470. // "description": "How the book was aquired",
  9471. // "enum": [
  9472. // "PREORDERED",
  9473. // "PREVIOUSLY_RENTED",
  9474. // "PUBLIC_DOMAIN",
  9475. // "PURCHASED",
  9476. // "RENTED",
  9477. // "SAMPLE",
  9478. // "UPLOADED"
  9479. // ],
  9480. // "enumDescriptions": [
  9481. // "Preordered books (not yet available)",
  9482. // "User-rented books past their expiration time",
  9483. // "Public domain books",
  9484. // "Purchased books",
  9485. // "User-rented books",
  9486. // "Sample books",
  9487. // "User uploaded books"
  9488. // ],
  9489. // "location": "query",
  9490. // "repeated": true,
  9491. // "type": "string"
  9492. // },
  9493. // "locale": {
  9494. // "description": "ISO-639-1 language and ISO-3166-1 country code. Ex:'en_US'. Used for generating recommendations.",
  9495. // "location": "query",
  9496. // "type": "string"
  9497. // },
  9498. // "maxResults": {
  9499. // "description": "Maximum number of results to return.",
  9500. // "format": "uint32",
  9501. // "location": "query",
  9502. // "maximum": "100",
  9503. // "minimum": "0",
  9504. // "type": "integer"
  9505. // },
  9506. // "processingState": {
  9507. // "description": "The processing state of the user uploaded volumes to be returned. Applicable only if the UPLOADED is specified in the acquireMethod.",
  9508. // "enum": [
  9509. // "COMPLETED_FAILED",
  9510. // "COMPLETED_SUCCESS",
  9511. // "RUNNING"
  9512. // ],
  9513. // "enumDescriptions": [
  9514. // "The volume processing hase failed.",
  9515. // "The volume processing was completed.",
  9516. // "The volume processing is not completed."
  9517. // ],
  9518. // "location": "query",
  9519. // "repeated": true,
  9520. // "type": "string"
  9521. // },
  9522. // "source": {
  9523. // "description": "String to identify the originator of this request.",
  9524. // "location": "query",
  9525. // "type": "string"
  9526. // },
  9527. // "startIndex": {
  9528. // "description": "Index of the first result to return (starts at 0)",
  9529. // "format": "uint32",
  9530. // "location": "query",
  9531. // "minimum": "0",
  9532. // "type": "integer"
  9533. // }
  9534. // },
  9535. // "path": "volumes/mybooks",
  9536. // "response": {
  9537. // "$ref": "Volumes"
  9538. // },
  9539. // "scopes": [
  9540. // "https://www.googleapis.com/auth/books"
  9541. // ]
  9542. // }
  9543. }
  9544. // method id "books.volumes.recommended.list":
  9545. type VolumesRecommendedListCall struct {
  9546. s *Service
  9547. urlParams_ gensupport.URLParams
  9548. ifNoneMatch_ string
  9549. ctx_ context.Context
  9550. }
  9551. // List: Return a list of recommended books for the current user.
  9552. func (r *VolumesRecommendedService) List() *VolumesRecommendedListCall {
  9553. c := &VolumesRecommendedListCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  9554. return c
  9555. }
  9556. // Locale sets the optional parameter "locale": ISO-639-1 language and
  9557. // ISO-3166-1 country code. Ex: 'en_US'. Used for generating
  9558. // recommendations.
  9559. func (c *VolumesRecommendedListCall) Locale(locale string) *VolumesRecommendedListCall {
  9560. c.urlParams_.Set("locale", locale)
  9561. return c
  9562. }
  9563. // MaxAllowedMaturityRating sets the optional parameter
  9564. // "maxAllowedMaturityRating": The maximum allowed maturity rating of
  9565. // returned recommendations. Books with a higher maturity rating are
  9566. // filtered out.
  9567. //
  9568. // Possible values:
  9569. // "mature" - Show books which are rated mature or lower.
  9570. // "not-mature" - Show books which are rated not mature.
  9571. func (c *VolumesRecommendedListCall) MaxAllowedMaturityRating(maxAllowedMaturityRating string) *VolumesRecommendedListCall {
  9572. c.urlParams_.Set("maxAllowedMaturityRating", maxAllowedMaturityRating)
  9573. return c
  9574. }
  9575. // Source sets the optional parameter "source": String to identify the
  9576. // originator of this request.
  9577. func (c *VolumesRecommendedListCall) Source(source string) *VolumesRecommendedListCall {
  9578. c.urlParams_.Set("source", source)
  9579. return c
  9580. }
  9581. // TargetIds sets the optional parameter "targetIds": List of target ids
  9582. // used for experiments or user segments
  9583. func (c *VolumesRecommendedListCall) TargetIds(targetIds ...int64) *VolumesRecommendedListCall {
  9584. var targetIds_ []string
  9585. for _, v := range targetIds {
  9586. targetIds_ = append(targetIds_, fmt.Sprint(v))
  9587. }
  9588. c.urlParams_.SetMulti("targetIds", targetIds_)
  9589. return c
  9590. }
  9591. // Fields allows partial responses to be retrieved. See
  9592. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  9593. // for more information.
  9594. func (c *VolumesRecommendedListCall) Fields(s ...googleapi.Field) *VolumesRecommendedListCall {
  9595. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  9596. return c
  9597. }
  9598. // IfNoneMatch sets the optional parameter which makes the operation
  9599. // fail if the object's ETag matches the given value. This is useful for
  9600. // getting updates only after the object has changed since the last
  9601. // request. Use googleapi.IsNotModified to check whether the response
  9602. // error from Do is the result of In-None-Match.
  9603. func (c *VolumesRecommendedListCall) IfNoneMatch(entityTag string) *VolumesRecommendedListCall {
  9604. c.ifNoneMatch_ = entityTag
  9605. return c
  9606. }
  9607. // Context sets the context to be used in this call's Do method. Any
  9608. // pending HTTP request will be aborted if the provided context is
  9609. // canceled.
  9610. func (c *VolumesRecommendedListCall) Context(ctx context.Context) *VolumesRecommendedListCall {
  9611. c.ctx_ = ctx
  9612. return c
  9613. }
  9614. func (c *VolumesRecommendedListCall) doRequest(alt string) (*http.Response, error) {
  9615. var body io.Reader = nil
  9616. c.urlParams_.Set("alt", alt)
  9617. urls := googleapi.ResolveRelative(c.s.BasePath, "volumes/recommended")
  9618. urls += "?" + c.urlParams_.Encode()
  9619. req, _ := http.NewRequest("GET", urls, body)
  9620. googleapi.SetOpaque(req.URL)
  9621. req.Header.Set("User-Agent", c.s.userAgent())
  9622. if c.ifNoneMatch_ != "" {
  9623. req.Header.Set("If-None-Match", c.ifNoneMatch_)
  9624. }
  9625. if c.ctx_ != nil {
  9626. return ctxhttp.Do(c.ctx_, c.s.client, req)
  9627. }
  9628. return c.s.client.Do(req)
  9629. }
  9630. // Do executes the "books.volumes.recommended.list" call.
  9631. // Exactly one of *Volumes or error will be non-nil. Any non-2xx status
  9632. // code is an error. Response headers are in either
  9633. // *Volumes.ServerResponse.Header or (if a response was returned at all)
  9634. // in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to
  9635. // check whether the returned error was because http.StatusNotModified
  9636. // was returned.
  9637. func (c *VolumesRecommendedListCall) Do(opts ...googleapi.CallOption) (*Volumes, error) {
  9638. gensupport.SetOptions(c.urlParams_, opts...)
  9639. res, err := c.doRequest("json")
  9640. if res != nil && res.StatusCode == http.StatusNotModified {
  9641. if res.Body != nil {
  9642. res.Body.Close()
  9643. }
  9644. return nil, &googleapi.Error{
  9645. Code: res.StatusCode,
  9646. Header: res.Header,
  9647. }
  9648. }
  9649. if err != nil {
  9650. return nil, err
  9651. }
  9652. defer googleapi.CloseBody(res)
  9653. if err := googleapi.CheckResponse(res); err != nil {
  9654. return nil, err
  9655. }
  9656. ret := &Volumes{
  9657. ServerResponse: googleapi.ServerResponse{
  9658. Header: res.Header,
  9659. HTTPStatusCode: res.StatusCode,
  9660. },
  9661. }
  9662. if err := json.NewDecoder(res.Body).Decode(&ret); err != nil {
  9663. return nil, err
  9664. }
  9665. return ret, nil
  9666. // {
  9667. // "description": "Return a list of recommended books for the current user.",
  9668. // "httpMethod": "GET",
  9669. // "id": "books.volumes.recommended.list",
  9670. // "parameters": {
  9671. // "locale": {
  9672. // "description": "ISO-639-1 language and ISO-3166-1 country code. Ex: 'en_US'. Used for generating recommendations.",
  9673. // "location": "query",
  9674. // "type": "string"
  9675. // },
  9676. // "maxAllowedMaturityRating": {
  9677. // "description": "The maximum allowed maturity rating of returned recommendations. Books with a higher maturity rating are filtered out.",
  9678. // "enum": [
  9679. // "mature",
  9680. // "not-mature"
  9681. // ],
  9682. // "enumDescriptions": [
  9683. // "Show books which are rated mature or lower.",
  9684. // "Show books which are rated not mature."
  9685. // ],
  9686. // "location": "query",
  9687. // "type": "string"
  9688. // },
  9689. // "source": {
  9690. // "description": "String to identify the originator of this request.",
  9691. // "location": "query",
  9692. // "type": "string"
  9693. // },
  9694. // "targetIds": {
  9695. // "description": "List of target ids used for experiments or user segments",
  9696. // "format": "int64",
  9697. // "location": "query",
  9698. // "repeated": true,
  9699. // "type": "string"
  9700. // }
  9701. // },
  9702. // "path": "volumes/recommended",
  9703. // "response": {
  9704. // "$ref": "Volumes"
  9705. // },
  9706. // "scopes": [
  9707. // "https://www.googleapis.com/auth/books"
  9708. // ]
  9709. // }
  9710. }
  9711. // method id "books.volumes.recommended.rate":
  9712. type VolumesRecommendedRateCall struct {
  9713. s *Service
  9714. urlParams_ gensupport.URLParams
  9715. ctx_ context.Context
  9716. }
  9717. // Rate: Rate a recommended book for the current user.
  9718. func (r *VolumesRecommendedService) Rate(rating string, volumeId string) *VolumesRecommendedRateCall {
  9719. c := &VolumesRecommendedRateCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  9720. c.urlParams_.Set("rating", rating)
  9721. c.urlParams_.Set("volumeId", volumeId)
  9722. return c
  9723. }
  9724. // Locale sets the optional parameter "locale": ISO-639-1 language and
  9725. // ISO-3166-1 country code. Ex: 'en_US'. Used for generating
  9726. // recommendations.
  9727. func (c *VolumesRecommendedRateCall) Locale(locale string) *VolumesRecommendedRateCall {
  9728. c.urlParams_.Set("locale", locale)
  9729. return c
  9730. }
  9731. // Source sets the optional parameter "source": String to identify the
  9732. // originator of this request.
  9733. func (c *VolumesRecommendedRateCall) Source(source string) *VolumesRecommendedRateCall {
  9734. c.urlParams_.Set("source", source)
  9735. return c
  9736. }
  9737. // Fields allows partial responses to be retrieved. See
  9738. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  9739. // for more information.
  9740. func (c *VolumesRecommendedRateCall) Fields(s ...googleapi.Field) *VolumesRecommendedRateCall {
  9741. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  9742. return c
  9743. }
  9744. // Context sets the context to be used in this call's Do method. Any
  9745. // pending HTTP request will be aborted if the provided context is
  9746. // canceled.
  9747. func (c *VolumesRecommendedRateCall) Context(ctx context.Context) *VolumesRecommendedRateCall {
  9748. c.ctx_ = ctx
  9749. return c
  9750. }
  9751. func (c *VolumesRecommendedRateCall) doRequest(alt string) (*http.Response, error) {
  9752. var body io.Reader = nil
  9753. c.urlParams_.Set("alt", alt)
  9754. urls := googleapi.ResolveRelative(c.s.BasePath, "volumes/recommended/rate")
  9755. urls += "?" + c.urlParams_.Encode()
  9756. req, _ := http.NewRequest("POST", urls, body)
  9757. googleapi.SetOpaque(req.URL)
  9758. req.Header.Set("User-Agent", c.s.userAgent())
  9759. if c.ctx_ != nil {
  9760. return ctxhttp.Do(c.ctx_, c.s.client, req)
  9761. }
  9762. return c.s.client.Do(req)
  9763. }
  9764. // Do executes the "books.volumes.recommended.rate" call.
  9765. // Exactly one of *BooksVolumesRecommendedRateResponse or error will be
  9766. // non-nil. Any non-2xx status code is an error. Response headers are in
  9767. // either *BooksVolumesRecommendedRateResponse.ServerResponse.Header or
  9768. // (if a response was returned at all) in
  9769. // error.(*googleapi.Error).Header. Use googleapi.IsNotModified to check
  9770. // whether the returned error was because http.StatusNotModified was
  9771. // returned.
  9772. func (c *VolumesRecommendedRateCall) Do(opts ...googleapi.CallOption) (*BooksVolumesRecommendedRateResponse, error) {
  9773. gensupport.SetOptions(c.urlParams_, opts...)
  9774. res, err := c.doRequest("json")
  9775. if res != nil && res.StatusCode == http.StatusNotModified {
  9776. if res.Body != nil {
  9777. res.Body.Close()
  9778. }
  9779. return nil, &googleapi.Error{
  9780. Code: res.StatusCode,
  9781. Header: res.Header,
  9782. }
  9783. }
  9784. if err != nil {
  9785. return nil, err
  9786. }
  9787. defer googleapi.CloseBody(res)
  9788. if err := googleapi.CheckResponse(res); err != nil {
  9789. return nil, err
  9790. }
  9791. ret := &BooksVolumesRecommendedRateResponse{
  9792. ServerResponse: googleapi.ServerResponse{
  9793. Header: res.Header,
  9794. HTTPStatusCode: res.StatusCode,
  9795. },
  9796. }
  9797. if err := json.NewDecoder(res.Body).Decode(&ret); err != nil {
  9798. return nil, err
  9799. }
  9800. return ret, nil
  9801. // {
  9802. // "description": "Rate a recommended book for the current user.",
  9803. // "httpMethod": "POST",
  9804. // "id": "books.volumes.recommended.rate",
  9805. // "parameterOrder": [
  9806. // "rating",
  9807. // "volumeId"
  9808. // ],
  9809. // "parameters": {
  9810. // "locale": {
  9811. // "description": "ISO-639-1 language and ISO-3166-1 country code. Ex: 'en_US'. Used for generating recommendations.",
  9812. // "location": "query",
  9813. // "type": "string"
  9814. // },
  9815. // "rating": {
  9816. // "description": "Rating to be given to the volume.",
  9817. // "enum": [
  9818. // "HAVE_IT",
  9819. // "NOT_INTERESTED"
  9820. // ],
  9821. // "enumDescriptions": [
  9822. // "Rating indicating a dismissal due to ownership.",
  9823. // "Rating indicating a negative dismissal of a volume."
  9824. // ],
  9825. // "location": "query",
  9826. // "required": true,
  9827. // "type": "string"
  9828. // },
  9829. // "source": {
  9830. // "description": "String to identify the originator of this request.",
  9831. // "location": "query",
  9832. // "type": "string"
  9833. // },
  9834. // "volumeId": {
  9835. // "description": "ID of the source volume.",
  9836. // "location": "query",
  9837. // "required": true,
  9838. // "type": "string"
  9839. // }
  9840. // },
  9841. // "path": "volumes/recommended/rate",
  9842. // "response": {
  9843. // "$ref": "BooksVolumesRecommendedRateResponse"
  9844. // },
  9845. // "scopes": [
  9846. // "https://www.googleapis.com/auth/books"
  9847. // ]
  9848. // }
  9849. }
  9850. // method id "books.volumes.useruploaded.list":
  9851. type VolumesUseruploadedListCall struct {
  9852. s *Service
  9853. urlParams_ gensupport.URLParams
  9854. ifNoneMatch_ string
  9855. ctx_ context.Context
  9856. }
  9857. // List: Return a list of books uploaded by the current user.
  9858. func (r *VolumesUseruploadedService) List() *VolumesUseruploadedListCall {
  9859. c := &VolumesUseruploadedListCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  9860. return c
  9861. }
  9862. // Locale sets the optional parameter "locale": ISO-639-1 language and
  9863. // ISO-3166-1 country code. Ex: 'en_US'. Used for generating
  9864. // recommendations.
  9865. func (c *VolumesUseruploadedListCall) Locale(locale string) *VolumesUseruploadedListCall {
  9866. c.urlParams_.Set("locale", locale)
  9867. return c
  9868. }
  9869. // MaxResults sets the optional parameter "maxResults": Maximum number
  9870. // of results to return.
  9871. func (c *VolumesUseruploadedListCall) MaxResults(maxResults int64) *VolumesUseruploadedListCall {
  9872. c.urlParams_.Set("maxResults", fmt.Sprint(maxResults))
  9873. return c
  9874. }
  9875. // ProcessingState sets the optional parameter "processingState": The
  9876. // processing state of the user uploaded volumes to be returned.
  9877. //
  9878. // Possible values:
  9879. // "COMPLETED_FAILED" - The volume processing hase failed.
  9880. // "COMPLETED_SUCCESS" - The volume processing was completed.
  9881. // "RUNNING" - The volume processing is not completed.
  9882. func (c *VolumesUseruploadedListCall) ProcessingState(processingState ...string) *VolumesUseruploadedListCall {
  9883. c.urlParams_.SetMulti("processingState", append([]string{}, processingState...))
  9884. return c
  9885. }
  9886. // Source sets the optional parameter "source": String to identify the
  9887. // originator of this request.
  9888. func (c *VolumesUseruploadedListCall) Source(source string) *VolumesUseruploadedListCall {
  9889. c.urlParams_.Set("source", source)
  9890. return c
  9891. }
  9892. // StartIndex sets the optional parameter "startIndex": Index of the
  9893. // first result to return (starts at 0)
  9894. func (c *VolumesUseruploadedListCall) StartIndex(startIndex int64) *VolumesUseruploadedListCall {
  9895. c.urlParams_.Set("startIndex", fmt.Sprint(startIndex))
  9896. return c
  9897. }
  9898. // VolumeId sets the optional parameter "volumeId": The ids of the
  9899. // volumes to be returned. If not specified all that match the
  9900. // processingState are returned.
  9901. func (c *VolumesUseruploadedListCall) VolumeId(volumeId ...string) *VolumesUseruploadedListCall {
  9902. c.urlParams_.SetMulti("volumeId", append([]string{}, volumeId...))
  9903. return c
  9904. }
  9905. // Fields allows partial responses to be retrieved. See
  9906. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  9907. // for more information.
  9908. func (c *VolumesUseruploadedListCall) Fields(s ...googleapi.Field) *VolumesUseruploadedListCall {
  9909. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  9910. return c
  9911. }
  9912. // IfNoneMatch sets the optional parameter which makes the operation
  9913. // fail if the object's ETag matches the given value. This is useful for
  9914. // getting updates only after the object has changed since the last
  9915. // request. Use googleapi.IsNotModified to check whether the response
  9916. // error from Do is the result of In-None-Match.
  9917. func (c *VolumesUseruploadedListCall) IfNoneMatch(entityTag string) *VolumesUseruploadedListCall {
  9918. c.ifNoneMatch_ = entityTag
  9919. return c
  9920. }
  9921. // Context sets the context to be used in this call's Do method. Any
  9922. // pending HTTP request will be aborted if the provided context is
  9923. // canceled.
  9924. func (c *VolumesUseruploadedListCall) Context(ctx context.Context) *VolumesUseruploadedListCall {
  9925. c.ctx_ = ctx
  9926. return c
  9927. }
  9928. func (c *VolumesUseruploadedListCall) doRequest(alt string) (*http.Response, error) {
  9929. var body io.Reader = nil
  9930. c.urlParams_.Set("alt", alt)
  9931. urls := googleapi.ResolveRelative(c.s.BasePath, "volumes/useruploaded")
  9932. urls += "?" + c.urlParams_.Encode()
  9933. req, _ := http.NewRequest("GET", urls, body)
  9934. googleapi.SetOpaque(req.URL)
  9935. req.Header.Set("User-Agent", c.s.userAgent())
  9936. if c.ifNoneMatch_ != "" {
  9937. req.Header.Set("If-None-Match", c.ifNoneMatch_)
  9938. }
  9939. if c.ctx_ != nil {
  9940. return ctxhttp.Do(c.ctx_, c.s.client, req)
  9941. }
  9942. return c.s.client.Do(req)
  9943. }
  9944. // Do executes the "books.volumes.useruploaded.list" call.
  9945. // Exactly one of *Volumes or error will be non-nil. Any non-2xx status
  9946. // code is an error. Response headers are in either
  9947. // *Volumes.ServerResponse.Header or (if a response was returned at all)
  9948. // in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to
  9949. // check whether the returned error was because http.StatusNotModified
  9950. // was returned.
  9951. func (c *VolumesUseruploadedListCall) Do(opts ...googleapi.CallOption) (*Volumes, error) {
  9952. gensupport.SetOptions(c.urlParams_, opts...)
  9953. res, err := c.doRequest("json")
  9954. if res != nil && res.StatusCode == http.StatusNotModified {
  9955. if res.Body != nil {
  9956. res.Body.Close()
  9957. }
  9958. return nil, &googleapi.Error{
  9959. Code: res.StatusCode,
  9960. Header: res.Header,
  9961. }
  9962. }
  9963. if err != nil {
  9964. return nil, err
  9965. }
  9966. defer googleapi.CloseBody(res)
  9967. if err := googleapi.CheckResponse(res); err != nil {
  9968. return nil, err
  9969. }
  9970. ret := &Volumes{
  9971. ServerResponse: googleapi.ServerResponse{
  9972. Header: res.Header,
  9973. HTTPStatusCode: res.StatusCode,
  9974. },
  9975. }
  9976. if err := json.NewDecoder(res.Body).Decode(&ret); err != nil {
  9977. return nil, err
  9978. }
  9979. return ret, nil
  9980. // {
  9981. // "description": "Return a list of books uploaded by the current user.",
  9982. // "httpMethod": "GET",
  9983. // "id": "books.volumes.useruploaded.list",
  9984. // "parameters": {
  9985. // "locale": {
  9986. // "description": "ISO-639-1 language and ISO-3166-1 country code. Ex: 'en_US'. Used for generating recommendations.",
  9987. // "location": "query",
  9988. // "type": "string"
  9989. // },
  9990. // "maxResults": {
  9991. // "description": "Maximum number of results to return.",
  9992. // "format": "uint32",
  9993. // "location": "query",
  9994. // "maximum": "40",
  9995. // "minimum": "0",
  9996. // "type": "integer"
  9997. // },
  9998. // "processingState": {
  9999. // "description": "The processing state of the user uploaded volumes to be returned.",
  10000. // "enum": [
  10001. // "COMPLETED_FAILED",
  10002. // "COMPLETED_SUCCESS",
  10003. // "RUNNING"
  10004. // ],
  10005. // "enumDescriptions": [
  10006. // "The volume processing hase failed.",
  10007. // "The volume processing was completed.",
  10008. // "The volume processing is not completed."
  10009. // ],
  10010. // "location": "query",
  10011. // "repeated": true,
  10012. // "type": "string"
  10013. // },
  10014. // "source": {
  10015. // "description": "String to identify the originator of this request.",
  10016. // "location": "query",
  10017. // "type": "string"
  10018. // },
  10019. // "startIndex": {
  10020. // "description": "Index of the first result to return (starts at 0)",
  10021. // "format": "uint32",
  10022. // "location": "query",
  10023. // "minimum": "0",
  10024. // "type": "integer"
  10025. // },
  10026. // "volumeId": {
  10027. // "description": "The ids of the volumes to be returned. If not specified all that match the processingState are returned.",
  10028. // "location": "query",
  10029. // "repeated": true,
  10030. // "type": "string"
  10031. // }
  10032. // },
  10033. // "path": "volumes/useruploaded",
  10034. // "response": {
  10035. // "$ref": "Volumes"
  10036. // },
  10037. // "scopes": [
  10038. // "https://www.googleapis.com/auth/books"
  10039. // ]
  10040. // }
  10041. }