mapsengine-gen.go 475 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929930931932933934935936937938939940941942943944945946947948949950951952953954955956957958959960961962963964965966967968969970971972973974975976977978979980981982983984985986987988989990991992993994995996997998999100010011002100310041005100610071008100910101011101210131014101510161017101810191020102110221023102410251026102710281029103010311032103310341035103610371038103910401041104210431044104510461047104810491050105110521053105410551056105710581059106010611062106310641065106610671068106910701071107210731074107510761077107810791080108110821083108410851086108710881089109010911092109310941095109610971098109911001101110211031104110511061107110811091110111111121113111411151116111711181119112011211122112311241125112611271128112911301131113211331134113511361137113811391140114111421143114411451146114711481149115011511152115311541155115611571158115911601161116211631164116511661167116811691170117111721173117411751176117711781179118011811182118311841185118611871188118911901191119211931194119511961197119811991200120112021203120412051206120712081209121012111212121312141215121612171218121912201221122212231224122512261227122812291230123112321233123412351236123712381239124012411242124312441245124612471248124912501251125212531254125512561257125812591260126112621263126412651266126712681269127012711272127312741275127612771278127912801281128212831284128512861287128812891290129112921293129412951296129712981299130013011302130313041305130613071308130913101311131213131314131513161317131813191320132113221323132413251326132713281329133013311332133313341335133613371338133913401341134213431344134513461347134813491350135113521353135413551356135713581359136013611362136313641365136613671368136913701371137213731374137513761377137813791380138113821383138413851386138713881389139013911392139313941395139613971398139914001401140214031404140514061407140814091410141114121413141414151416141714181419142014211422142314241425142614271428142914301431143214331434143514361437143814391440144114421443144414451446144714481449145014511452145314541455145614571458145914601461146214631464146514661467146814691470147114721473147414751476147714781479148014811482148314841485148614871488148914901491149214931494149514961497149814991500150115021503150415051506150715081509151015111512151315141515151615171518151915201521152215231524152515261527152815291530153115321533153415351536153715381539154015411542154315441545154615471548154915501551155215531554155515561557155815591560156115621563156415651566156715681569157015711572157315741575157615771578157915801581158215831584158515861587158815891590159115921593159415951596159715981599160016011602160316041605160616071608160916101611161216131614161516161617161816191620162116221623162416251626162716281629163016311632163316341635163616371638163916401641164216431644164516461647164816491650165116521653165416551656165716581659166016611662166316641665166616671668166916701671167216731674167516761677167816791680168116821683168416851686168716881689169016911692169316941695169616971698169917001701170217031704170517061707170817091710171117121713171417151716171717181719172017211722172317241725172617271728172917301731173217331734173517361737173817391740174117421743174417451746174717481749175017511752175317541755175617571758175917601761176217631764176517661767176817691770177117721773177417751776177717781779178017811782178317841785178617871788178917901791179217931794179517961797179817991800180118021803180418051806180718081809181018111812181318141815181618171818181918201821182218231824182518261827182818291830183118321833183418351836183718381839184018411842184318441845184618471848184918501851185218531854185518561857185818591860186118621863186418651866186718681869187018711872187318741875187618771878187918801881188218831884188518861887188818891890189118921893189418951896189718981899190019011902190319041905190619071908190919101911191219131914191519161917191819191920192119221923192419251926192719281929193019311932193319341935193619371938193919401941194219431944194519461947194819491950195119521953195419551956195719581959196019611962196319641965196619671968196919701971197219731974197519761977197819791980198119821983198419851986198719881989199019911992199319941995199619971998199920002001200220032004200520062007200820092010201120122013201420152016201720182019202020212022202320242025202620272028202920302031203220332034203520362037203820392040204120422043204420452046204720482049205020512052205320542055205620572058205920602061206220632064206520662067206820692070207120722073207420752076207720782079208020812082208320842085208620872088208920902091209220932094209520962097209820992100210121022103210421052106210721082109211021112112211321142115211621172118211921202121212221232124212521262127212821292130213121322133213421352136213721382139214021412142214321442145214621472148214921502151215221532154215521562157215821592160216121622163216421652166216721682169217021712172217321742175217621772178217921802181218221832184218521862187218821892190219121922193219421952196219721982199220022012202220322042205220622072208220922102211221222132214221522162217221822192220222122222223222422252226222722282229223022312232223322342235223622372238223922402241224222432244224522462247224822492250225122522253225422552256225722582259226022612262226322642265226622672268226922702271227222732274227522762277227822792280228122822283228422852286228722882289229022912292229322942295229622972298229923002301230223032304230523062307230823092310231123122313231423152316231723182319232023212322232323242325232623272328232923302331233223332334233523362337233823392340234123422343234423452346234723482349235023512352235323542355235623572358235923602361236223632364236523662367236823692370237123722373237423752376237723782379238023812382238323842385238623872388238923902391239223932394239523962397239823992400240124022403240424052406240724082409241024112412241324142415241624172418241924202421242224232424242524262427242824292430243124322433243424352436243724382439244024412442244324442445244624472448244924502451245224532454245524562457245824592460246124622463246424652466246724682469247024712472247324742475247624772478247924802481248224832484248524862487248824892490249124922493249424952496249724982499250025012502250325042505250625072508250925102511251225132514251525162517251825192520252125222523252425252526252725282529253025312532253325342535253625372538253925402541254225432544254525462547254825492550255125522553255425552556255725582559256025612562256325642565256625672568256925702571257225732574257525762577257825792580258125822583258425852586258725882589259025912592259325942595259625972598259926002601260226032604260526062607260826092610261126122613261426152616261726182619262026212622262326242625262626272628262926302631263226332634263526362637263826392640264126422643264426452646264726482649265026512652265326542655265626572658265926602661266226632664266526662667266826692670267126722673267426752676267726782679268026812682268326842685268626872688268926902691269226932694269526962697269826992700270127022703270427052706270727082709271027112712271327142715271627172718271927202721272227232724272527262727272827292730273127322733273427352736273727382739274027412742274327442745274627472748274927502751275227532754275527562757275827592760276127622763276427652766276727682769277027712772277327742775277627772778277927802781278227832784278527862787278827892790279127922793279427952796279727982799280028012802280328042805280628072808280928102811281228132814281528162817281828192820282128222823282428252826282728282829283028312832283328342835283628372838283928402841284228432844284528462847284828492850285128522853285428552856285728582859286028612862286328642865286628672868286928702871287228732874287528762877287828792880288128822883288428852886288728882889289028912892289328942895289628972898289929002901290229032904290529062907290829092910291129122913291429152916291729182919292029212922292329242925292629272928292929302931293229332934293529362937293829392940294129422943294429452946294729482949295029512952295329542955295629572958295929602961296229632964296529662967296829692970297129722973297429752976297729782979298029812982298329842985298629872988298929902991299229932994299529962997299829993000300130023003300430053006300730083009301030113012301330143015301630173018301930203021302230233024302530263027302830293030303130323033303430353036303730383039304030413042304330443045304630473048304930503051305230533054305530563057305830593060306130623063306430653066306730683069307030713072307330743075307630773078307930803081308230833084308530863087308830893090309130923093309430953096309730983099310031013102310331043105310631073108310931103111311231133114311531163117311831193120312131223123312431253126312731283129313031313132313331343135313631373138313931403141314231433144314531463147314831493150315131523153315431553156315731583159316031613162316331643165316631673168316931703171317231733174317531763177317831793180318131823183318431853186318731883189319031913192319331943195319631973198319932003201320232033204320532063207320832093210321132123213321432153216321732183219322032213222322332243225322632273228322932303231323232333234323532363237323832393240324132423243324432453246324732483249325032513252325332543255325632573258325932603261326232633264326532663267326832693270327132723273327432753276327732783279328032813282328332843285328632873288328932903291329232933294329532963297329832993300330133023303330433053306330733083309331033113312331333143315331633173318331933203321332233233324332533263327332833293330333133323333333433353336333733383339334033413342334333443345334633473348334933503351335233533354335533563357335833593360336133623363336433653366336733683369337033713372337333743375337633773378337933803381338233833384338533863387338833893390339133923393339433953396339733983399340034013402340334043405340634073408340934103411341234133414341534163417341834193420342134223423342434253426342734283429343034313432343334343435343634373438343934403441344234433444344534463447344834493450345134523453345434553456345734583459346034613462346334643465346634673468346934703471347234733474347534763477347834793480348134823483348434853486348734883489349034913492349334943495349634973498349935003501350235033504350535063507350835093510351135123513351435153516351735183519352035213522352335243525352635273528352935303531353235333534353535363537353835393540354135423543354435453546354735483549355035513552355335543555355635573558355935603561356235633564356535663567356835693570357135723573357435753576357735783579358035813582358335843585358635873588358935903591359235933594359535963597359835993600360136023603360436053606360736083609361036113612361336143615361636173618361936203621362236233624362536263627362836293630363136323633363436353636363736383639364036413642364336443645364636473648364936503651365236533654365536563657365836593660366136623663366436653666366736683669367036713672367336743675367636773678367936803681368236833684368536863687368836893690369136923693369436953696369736983699370037013702370337043705370637073708370937103711371237133714371537163717371837193720372137223723372437253726372737283729373037313732373337343735373637373738373937403741374237433744374537463747374837493750375137523753375437553756375737583759376037613762376337643765376637673768376937703771377237733774377537763777377837793780378137823783378437853786378737883789379037913792379337943795379637973798379938003801380238033804380538063807380838093810381138123813381438153816381738183819382038213822382338243825382638273828382938303831383238333834383538363837383838393840384138423843384438453846384738483849385038513852385338543855385638573858385938603861386238633864386538663867386838693870387138723873387438753876387738783879388038813882388338843885388638873888388938903891389238933894389538963897389838993900390139023903390439053906390739083909391039113912391339143915391639173918391939203921392239233924392539263927392839293930393139323933393439353936393739383939394039413942394339443945394639473948394939503951395239533954395539563957395839593960396139623963396439653966396739683969397039713972397339743975397639773978397939803981398239833984398539863987398839893990399139923993399439953996399739983999400040014002400340044005400640074008400940104011401240134014401540164017401840194020402140224023402440254026402740284029403040314032403340344035403640374038403940404041404240434044404540464047404840494050405140524053405440554056405740584059406040614062406340644065406640674068406940704071407240734074407540764077407840794080408140824083408440854086408740884089409040914092409340944095409640974098409941004101410241034104410541064107410841094110411141124113411441154116411741184119412041214122412341244125412641274128412941304131413241334134413541364137413841394140414141424143414441454146414741484149415041514152415341544155415641574158415941604161416241634164416541664167416841694170417141724173417441754176417741784179418041814182418341844185418641874188418941904191419241934194419541964197419841994200420142024203420442054206420742084209421042114212421342144215421642174218421942204221422242234224422542264227422842294230423142324233423442354236423742384239424042414242424342444245424642474248424942504251425242534254425542564257425842594260426142624263426442654266426742684269427042714272427342744275427642774278427942804281428242834284428542864287428842894290429142924293429442954296429742984299430043014302430343044305430643074308430943104311431243134314431543164317431843194320432143224323432443254326432743284329433043314332433343344335433643374338433943404341434243434344434543464347434843494350435143524353435443554356435743584359436043614362436343644365436643674368436943704371437243734374437543764377437843794380438143824383438443854386438743884389439043914392439343944395439643974398439944004401440244034404440544064407440844094410441144124413441444154416441744184419442044214422442344244425442644274428442944304431443244334434443544364437443844394440444144424443444444454446444744484449445044514452445344544455445644574458445944604461446244634464446544664467446844694470447144724473447444754476447744784479448044814482448344844485448644874488448944904491449244934494449544964497449844994500450145024503450445054506450745084509451045114512451345144515451645174518451945204521452245234524452545264527452845294530453145324533453445354536453745384539454045414542454345444545454645474548454945504551455245534554455545564557455845594560456145624563456445654566456745684569457045714572457345744575457645774578457945804581458245834584458545864587458845894590459145924593459445954596459745984599460046014602460346044605460646074608460946104611461246134614461546164617461846194620462146224623462446254626462746284629463046314632463346344635463646374638463946404641464246434644464546464647464846494650465146524653465446554656465746584659466046614662466346644665466646674668466946704671467246734674467546764677467846794680468146824683468446854686468746884689469046914692469346944695469646974698469947004701470247034704470547064707470847094710471147124713471447154716471747184719472047214722472347244725472647274728472947304731473247334734473547364737473847394740474147424743474447454746474747484749475047514752475347544755475647574758475947604761476247634764476547664767476847694770477147724773477447754776477747784779478047814782478347844785478647874788478947904791479247934794479547964797479847994800480148024803480448054806480748084809481048114812481348144815481648174818481948204821482248234824482548264827482848294830483148324833483448354836483748384839484048414842484348444845484648474848484948504851485248534854485548564857485848594860486148624863486448654866486748684869487048714872487348744875487648774878487948804881488248834884488548864887488848894890489148924893489448954896489748984899490049014902490349044905490649074908490949104911491249134914491549164917491849194920492149224923492449254926492749284929493049314932493349344935493649374938493949404941494249434944494549464947494849494950495149524953495449554956495749584959496049614962496349644965496649674968496949704971497249734974497549764977497849794980498149824983498449854986498749884989499049914992499349944995499649974998499950005001500250035004500550065007500850095010501150125013501450155016501750185019502050215022502350245025502650275028502950305031503250335034503550365037503850395040504150425043504450455046504750485049505050515052505350545055505650575058505950605061506250635064506550665067506850695070507150725073507450755076507750785079508050815082508350845085508650875088508950905091509250935094509550965097509850995100510151025103510451055106510751085109511051115112511351145115511651175118511951205121512251235124512551265127512851295130513151325133513451355136513751385139514051415142514351445145514651475148514951505151515251535154515551565157515851595160516151625163516451655166516751685169517051715172517351745175517651775178517951805181518251835184518551865187518851895190519151925193519451955196519751985199520052015202520352045205520652075208520952105211521252135214521552165217521852195220522152225223522452255226522752285229523052315232523352345235523652375238523952405241524252435244524552465247524852495250525152525253525452555256525752585259526052615262526352645265526652675268526952705271527252735274527552765277527852795280528152825283528452855286528752885289529052915292529352945295529652975298529953005301530253035304530553065307530853095310531153125313531453155316531753185319532053215322532353245325532653275328532953305331533253335334533553365337533853395340534153425343534453455346534753485349535053515352535353545355535653575358535953605361536253635364536553665367536853695370537153725373537453755376537753785379538053815382538353845385538653875388538953905391539253935394539553965397539853995400540154025403540454055406540754085409541054115412541354145415541654175418541954205421542254235424542554265427542854295430543154325433543454355436543754385439544054415442544354445445544654475448544954505451545254535454545554565457545854595460546154625463546454655466546754685469547054715472547354745475547654775478547954805481548254835484548554865487548854895490549154925493549454955496549754985499550055015502550355045505550655075508550955105511551255135514551555165517551855195520552155225523552455255526552755285529553055315532553355345535553655375538553955405541554255435544554555465547554855495550555155525553555455555556555755585559556055615562556355645565556655675568556955705571557255735574557555765577557855795580558155825583558455855586558755885589559055915592559355945595559655975598559956005601560256035604560556065607560856095610561156125613561456155616561756185619562056215622562356245625562656275628562956305631563256335634563556365637563856395640564156425643564456455646564756485649565056515652565356545655565656575658565956605661566256635664566556665667566856695670567156725673567456755676567756785679568056815682568356845685568656875688568956905691569256935694569556965697569856995700570157025703570457055706570757085709571057115712571357145715571657175718571957205721572257235724572557265727572857295730573157325733573457355736573757385739574057415742574357445745574657475748574957505751575257535754575557565757575857595760576157625763576457655766576757685769577057715772577357745775577657775778577957805781578257835784578557865787578857895790579157925793579457955796579757985799580058015802580358045805580658075808580958105811581258135814581558165817581858195820582158225823582458255826582758285829583058315832583358345835583658375838583958405841584258435844584558465847584858495850585158525853585458555856585758585859586058615862586358645865586658675868586958705871587258735874587558765877587858795880588158825883588458855886588758885889589058915892589358945895589658975898589959005901590259035904590559065907590859095910591159125913591459155916591759185919592059215922592359245925592659275928592959305931593259335934593559365937593859395940594159425943594459455946594759485949595059515952595359545955595659575958595959605961596259635964596559665967596859695970597159725973597459755976597759785979598059815982598359845985598659875988598959905991599259935994599559965997599859996000600160026003600460056006600760086009601060116012601360146015601660176018601960206021602260236024602560266027602860296030603160326033603460356036603760386039604060416042604360446045604660476048604960506051605260536054605560566057605860596060606160626063606460656066606760686069607060716072607360746075607660776078607960806081608260836084608560866087608860896090609160926093609460956096609760986099610061016102610361046105610661076108610961106111611261136114611561166117611861196120612161226123612461256126612761286129613061316132613361346135613661376138613961406141614261436144614561466147614861496150615161526153615461556156615761586159616061616162616361646165616661676168616961706171617261736174617561766177617861796180618161826183618461856186618761886189619061916192619361946195619661976198619962006201620262036204620562066207620862096210621162126213621462156216621762186219622062216222622362246225622662276228622962306231623262336234623562366237623862396240624162426243624462456246624762486249625062516252625362546255625662576258625962606261626262636264626562666267626862696270627162726273627462756276627762786279628062816282628362846285628662876288628962906291629262936294629562966297629862996300630163026303630463056306630763086309631063116312631363146315631663176318631963206321632263236324632563266327632863296330633163326333633463356336633763386339634063416342634363446345634663476348634963506351635263536354635563566357635863596360636163626363636463656366636763686369637063716372637363746375637663776378637963806381638263836384638563866387638863896390639163926393639463956396639763986399640064016402640364046405640664076408640964106411641264136414641564166417641864196420642164226423642464256426642764286429643064316432643364346435643664376438643964406441644264436444644564466447644864496450645164526453645464556456645764586459646064616462646364646465646664676468646964706471647264736474647564766477647864796480648164826483648464856486648764886489649064916492649364946495649664976498649965006501650265036504650565066507650865096510651165126513651465156516651765186519652065216522652365246525652665276528652965306531653265336534653565366537653865396540654165426543654465456546654765486549655065516552655365546555655665576558655965606561656265636564656565666567656865696570657165726573657465756576657765786579658065816582658365846585658665876588658965906591659265936594659565966597659865996600660166026603660466056606660766086609661066116612661366146615661666176618661966206621662266236624662566266627662866296630663166326633663466356636663766386639664066416642664366446645664666476648664966506651665266536654665566566657665866596660666166626663666466656666666766686669667066716672667366746675667666776678667966806681668266836684668566866687668866896690669166926693669466956696669766986699670067016702670367046705670667076708670967106711671267136714671567166717671867196720672167226723672467256726672767286729673067316732673367346735673667376738673967406741674267436744674567466747674867496750675167526753675467556756675767586759676067616762676367646765676667676768676967706771677267736774677567766777677867796780678167826783678467856786678767886789679067916792679367946795679667976798679968006801680268036804680568066807680868096810681168126813681468156816681768186819682068216822682368246825682668276828682968306831683268336834683568366837683868396840684168426843684468456846684768486849685068516852685368546855685668576858685968606861686268636864686568666867686868696870687168726873687468756876687768786879688068816882688368846885688668876888688968906891689268936894689568966897689868996900690169026903690469056906690769086909691069116912691369146915691669176918691969206921692269236924692569266927692869296930693169326933693469356936693769386939694069416942694369446945694669476948694969506951695269536954695569566957695869596960696169626963696469656966696769686969697069716972697369746975697669776978697969806981698269836984698569866987698869896990699169926993699469956996699769986999700070017002700370047005700670077008700970107011701270137014701570167017701870197020702170227023702470257026702770287029703070317032703370347035703670377038703970407041704270437044704570467047704870497050705170527053705470557056705770587059706070617062706370647065706670677068706970707071707270737074707570767077707870797080708170827083708470857086708770887089709070917092709370947095709670977098709971007101710271037104710571067107710871097110711171127113711471157116711771187119712071217122712371247125712671277128712971307131713271337134713571367137713871397140714171427143714471457146714771487149715071517152715371547155715671577158715971607161716271637164716571667167716871697170717171727173717471757176717771787179718071817182718371847185718671877188718971907191719271937194719571967197719871997200720172027203720472057206720772087209721072117212721372147215721672177218721972207221722272237224722572267227722872297230723172327233723472357236723772387239724072417242724372447245724672477248724972507251725272537254725572567257725872597260726172627263726472657266726772687269727072717272727372747275727672777278727972807281728272837284728572867287728872897290729172927293729472957296729772987299730073017302730373047305730673077308730973107311731273137314731573167317731873197320732173227323732473257326732773287329733073317332733373347335733673377338733973407341734273437344734573467347734873497350735173527353735473557356735773587359736073617362736373647365736673677368736973707371737273737374737573767377737873797380738173827383738473857386738773887389739073917392739373947395739673977398739974007401740274037404740574067407740874097410741174127413741474157416741774187419742074217422742374247425742674277428742974307431743274337434743574367437743874397440744174427443744474457446744774487449745074517452745374547455745674577458745974607461746274637464746574667467746874697470747174727473747474757476747774787479748074817482748374847485748674877488748974907491749274937494749574967497749874997500750175027503750475057506750775087509751075117512751375147515751675177518751975207521752275237524752575267527752875297530753175327533753475357536753775387539754075417542754375447545754675477548754975507551755275537554755575567557755875597560756175627563756475657566756775687569757075717572757375747575757675777578757975807581758275837584758575867587758875897590759175927593759475957596759775987599760076017602760376047605760676077608760976107611761276137614761576167617761876197620762176227623762476257626762776287629763076317632763376347635763676377638763976407641764276437644764576467647764876497650765176527653765476557656765776587659766076617662766376647665766676677668766976707671767276737674767576767677767876797680768176827683768476857686768776887689769076917692769376947695769676977698769977007701770277037704770577067707770877097710771177127713771477157716771777187719772077217722772377247725772677277728772977307731773277337734773577367737773877397740774177427743774477457746774777487749775077517752775377547755775677577758775977607761776277637764776577667767776877697770777177727773777477757776777777787779778077817782778377847785778677877788778977907791779277937794779577967797779877997800780178027803780478057806780778087809781078117812781378147815781678177818781978207821782278237824782578267827782878297830783178327833783478357836783778387839784078417842784378447845784678477848784978507851785278537854785578567857785878597860786178627863786478657866786778687869787078717872787378747875787678777878787978807881788278837884788578867887788878897890789178927893789478957896789778987899790079017902790379047905790679077908790979107911791279137914791579167917791879197920792179227923792479257926792779287929793079317932793379347935793679377938793979407941794279437944794579467947794879497950795179527953795479557956795779587959796079617962796379647965796679677968796979707971797279737974797579767977797879797980798179827983798479857986798779887989799079917992799379947995799679977998799980008001800280038004800580068007800880098010801180128013801480158016801780188019802080218022802380248025802680278028802980308031803280338034803580368037803880398040804180428043804480458046804780488049805080518052805380548055805680578058805980608061806280638064806580668067806880698070807180728073807480758076807780788079808080818082808380848085808680878088808980908091809280938094809580968097809880998100810181028103810481058106810781088109811081118112811381148115811681178118811981208121812281238124812581268127812881298130813181328133813481358136813781388139814081418142814381448145814681478148814981508151815281538154815581568157815881598160816181628163816481658166816781688169817081718172817381748175817681778178817981808181818281838184818581868187818881898190819181928193819481958196819781988199820082018202820382048205820682078208820982108211821282138214821582168217821882198220822182228223822482258226822782288229823082318232823382348235823682378238823982408241824282438244824582468247824882498250825182528253825482558256825782588259826082618262826382648265826682678268826982708271827282738274827582768277827882798280828182828283828482858286828782888289829082918292829382948295829682978298829983008301830283038304830583068307830883098310831183128313831483158316831783188319832083218322832383248325832683278328832983308331833283338334833583368337833883398340834183428343834483458346834783488349835083518352835383548355835683578358835983608361836283638364836583668367836883698370837183728373837483758376837783788379838083818382838383848385838683878388838983908391839283938394839583968397839883998400840184028403840484058406840784088409841084118412841384148415841684178418841984208421842284238424842584268427842884298430843184328433843484358436843784388439844084418442844384448445844684478448844984508451845284538454845584568457845884598460846184628463846484658466846784688469847084718472847384748475847684778478847984808481848284838484848584868487848884898490849184928493849484958496849784988499850085018502850385048505850685078508850985108511851285138514851585168517851885198520852185228523852485258526852785288529853085318532853385348535853685378538853985408541854285438544854585468547854885498550855185528553855485558556855785588559856085618562856385648565856685678568856985708571857285738574857585768577857885798580858185828583858485858586858785888589859085918592859385948595859685978598859986008601860286038604860586068607860886098610861186128613861486158616861786188619862086218622862386248625862686278628862986308631863286338634863586368637863886398640864186428643864486458646864786488649865086518652865386548655865686578658865986608661866286638664866586668667866886698670867186728673867486758676867786788679868086818682868386848685868686878688868986908691869286938694869586968697869886998700870187028703870487058706870787088709871087118712871387148715871687178718871987208721872287238724872587268727872887298730873187328733873487358736873787388739874087418742874387448745874687478748874987508751875287538754875587568757875887598760876187628763876487658766876787688769877087718772877387748775877687778778877987808781878287838784878587868787878887898790879187928793879487958796879787988799880088018802880388048805880688078808880988108811881288138814881588168817881888198820882188228823882488258826882788288829883088318832883388348835883688378838883988408841884288438844884588468847884888498850885188528853885488558856885788588859886088618862886388648865886688678868886988708871887288738874887588768877887888798880888188828883888488858886888788888889889088918892889388948895889688978898889989008901890289038904890589068907890889098910891189128913891489158916891789188919892089218922892389248925892689278928892989308931893289338934893589368937893889398940894189428943894489458946894789488949895089518952895389548955895689578958895989608961896289638964896589668967896889698970897189728973897489758976897789788979898089818982898389848985898689878988898989908991899289938994899589968997899889999000900190029003900490059006900790089009901090119012901390149015901690179018901990209021902290239024902590269027902890299030903190329033903490359036903790389039904090419042904390449045904690479048904990509051905290539054905590569057905890599060906190629063906490659066906790689069907090719072907390749075907690779078907990809081908290839084908590869087908890899090909190929093909490959096909790989099910091019102910391049105910691079108910991109111911291139114911591169117911891199120912191229123912491259126912791289129913091319132913391349135913691379138913991409141914291439144914591469147914891499150915191529153915491559156915791589159916091619162916391649165916691679168916991709171917291739174917591769177917891799180918191829183918491859186918791889189919091919192919391949195919691979198919992009201920292039204920592069207920892099210921192129213921492159216921792189219922092219222922392249225922692279228922992309231923292339234923592369237923892399240924192429243924492459246924792489249925092519252925392549255925692579258925992609261926292639264926592669267926892699270927192729273927492759276927792789279928092819282928392849285928692879288928992909291929292939294929592969297929892999300930193029303930493059306930793089309931093119312931393149315931693179318931993209321932293239324932593269327932893299330933193329333933493359336933793389339934093419342934393449345934693479348934993509351935293539354935593569357935893599360936193629363936493659366936793689369937093719372937393749375937693779378937993809381938293839384938593869387938893899390939193929393939493959396939793989399940094019402940394049405940694079408940994109411941294139414941594169417941894199420942194229423942494259426942794289429943094319432943394349435943694379438943994409441944294439444944594469447944894499450945194529453945494559456945794589459946094619462946394649465946694679468946994709471947294739474947594769477947894799480948194829483948494859486948794889489949094919492949394949495949694979498949995009501950295039504950595069507950895099510951195129513951495159516951795189519952095219522952395249525952695279528952995309531953295339534953595369537953895399540954195429543954495459546954795489549955095519552955395549555955695579558955995609561956295639564956595669567956895699570957195729573957495759576957795789579958095819582958395849585958695879588958995909591959295939594959595969597959895999600960196029603960496059606960796089609961096119612961396149615961696179618961996209621962296239624962596269627962896299630963196329633963496359636963796389639964096419642964396449645964696479648964996509651965296539654965596569657965896599660966196629663966496659666966796689669967096719672967396749675967696779678967996809681968296839684968596869687968896899690969196929693969496959696969796989699970097019702970397049705970697079708970997109711971297139714971597169717971897199720972197229723972497259726972797289729973097319732973397349735973697379738973997409741974297439744974597469747974897499750975197529753975497559756975797589759976097619762976397649765976697679768976997709771977297739774977597769777977897799780978197829783978497859786978797889789979097919792979397949795979697979798979998009801980298039804980598069807980898099810981198129813981498159816981798189819982098219822982398249825982698279828982998309831983298339834983598369837983898399840984198429843984498459846984798489849985098519852985398549855985698579858985998609861986298639864986598669867986898699870987198729873987498759876987798789879988098819882988398849885988698879888988998909891989298939894989598969897989898999900990199029903990499059906990799089909991099119912991399149915991699179918991999209921992299239924992599269927992899299930993199329933993499359936993799389939994099419942994399449945994699479948994999509951995299539954995599569957995899599960996199629963996499659966996799689969997099719972997399749975997699779978997999809981998299839984998599869987998899899990999199929993999499959996999799989999100001000110002100031000410005100061000710008100091001010011100121001310014100151001610017100181001910020100211002210023100241002510026100271002810029100301003110032100331003410035100361003710038100391004010041100421004310044100451004610047100481004910050100511005210053100541005510056100571005810059100601006110062100631006410065100661006710068100691007010071100721007310074100751007610077100781007910080100811008210083100841008510086100871008810089100901009110092100931009410095100961009710098100991010010101101021010310104101051010610107101081010910110101111011210113101141011510116101171011810119101201012110122101231012410125101261012710128101291013010131101321013310134101351013610137101381013910140101411014210143101441014510146101471014810149101501015110152101531015410155101561015710158101591016010161101621016310164101651016610167101681016910170101711017210173101741017510176101771017810179101801018110182101831018410185101861018710188101891019010191101921019310194101951019610197101981019910200102011020210203102041020510206102071020810209102101021110212102131021410215102161021710218102191022010221102221022310224102251022610227102281022910230102311023210233102341023510236102371023810239102401024110242102431024410245102461024710248102491025010251102521025310254102551025610257102581025910260102611026210263102641026510266102671026810269102701027110272102731027410275102761027710278102791028010281102821028310284102851028610287102881028910290102911029210293102941029510296102971029810299103001030110302103031030410305103061030710308103091031010311103121031310314103151031610317103181031910320103211032210323103241032510326103271032810329103301033110332103331033410335103361033710338103391034010341103421034310344103451034610347103481034910350103511035210353103541035510356103571035810359103601036110362103631036410365103661036710368103691037010371103721037310374103751037610377103781037910380103811038210383103841038510386103871038810389103901039110392103931039410395103961039710398103991040010401104021040310404104051040610407104081040910410104111041210413104141041510416104171041810419104201042110422104231042410425104261042710428104291043010431104321043310434104351043610437104381043910440104411044210443104441044510446104471044810449104501045110452104531045410455104561045710458104591046010461104621046310464104651046610467104681046910470104711047210473104741047510476104771047810479104801048110482104831048410485104861048710488104891049010491104921049310494104951049610497104981049910500105011050210503105041050510506105071050810509105101051110512105131051410515105161051710518105191052010521105221052310524105251052610527105281052910530105311053210533105341053510536105371053810539105401054110542105431054410545105461054710548105491055010551105521055310554105551055610557105581055910560105611056210563105641056510566105671056810569105701057110572105731057410575105761057710578105791058010581105821058310584105851058610587105881058910590105911059210593105941059510596105971059810599106001060110602106031060410605106061060710608106091061010611106121061310614106151061610617106181061910620106211062210623106241062510626106271062810629106301063110632106331063410635106361063710638106391064010641106421064310644106451064610647106481064910650106511065210653106541065510656106571065810659106601066110662106631066410665106661066710668106691067010671106721067310674106751067610677106781067910680106811068210683106841068510686106871068810689106901069110692106931069410695106961069710698106991070010701107021070310704107051070610707107081070910710107111071210713107141071510716107171071810719107201072110722107231072410725107261072710728107291073010731107321073310734107351073610737107381073910740107411074210743107441074510746107471074810749107501075110752107531075410755107561075710758107591076010761107621076310764107651076610767107681076910770107711077210773107741077510776107771077810779107801078110782107831078410785107861078710788107891079010791107921079310794107951079610797107981079910800108011080210803108041080510806108071080810809108101081110812108131081410815108161081710818108191082010821108221082310824108251082610827108281082910830108311083210833108341083510836108371083810839108401084110842108431084410845108461084710848108491085010851108521085310854108551085610857108581085910860108611086210863108641086510866108671086810869108701087110872108731087410875108761087710878108791088010881108821088310884108851088610887108881088910890108911089210893108941089510896108971089810899109001090110902109031090410905109061090710908109091091010911109121091310914109151091610917109181091910920109211092210923109241092510926109271092810929109301093110932109331093410935109361093710938109391094010941109421094310944109451094610947109481094910950109511095210953109541095510956109571095810959109601096110962109631096410965109661096710968109691097010971109721097310974109751097610977109781097910980109811098210983109841098510986109871098810989109901099110992109931099410995109961099710998109991100011001110021100311004110051100611007110081100911010110111101211013110141101511016110171101811019110201102111022110231102411025110261102711028110291103011031110321103311034110351103611037110381103911040110411104211043110441104511046110471104811049110501105111052110531105411055110561105711058110591106011061110621106311064110651106611067110681106911070110711107211073110741107511076110771107811079110801108111082110831108411085110861108711088110891109011091110921109311094110951109611097110981109911100111011110211103111041110511106111071110811109111101111111112111131111411115111161111711118111191112011121111221112311124111251112611127111281112911130111311113211133111341113511136111371113811139111401114111142111431114411145111461114711148111491115011151111521115311154111551115611157111581115911160111611116211163111641116511166111671116811169111701117111172111731117411175111761117711178111791118011181111821118311184111851118611187111881118911190111911119211193111941119511196111971119811199112001120111202112031120411205112061120711208112091121011211112121121311214112151121611217112181121911220112211122211223112241122511226112271122811229112301123111232112331123411235112361123711238112391124011241112421124311244112451124611247112481124911250112511125211253112541125511256112571125811259112601126111262112631126411265112661126711268112691127011271112721127311274112751127611277112781127911280112811128211283112841128511286112871128811289112901129111292112931129411295112961129711298112991130011301113021130311304113051130611307113081130911310113111131211313113141131511316113171131811319113201132111322113231132411325113261132711328113291133011331113321133311334113351133611337113381133911340113411134211343113441134511346113471134811349113501135111352113531135411355113561135711358113591136011361113621136311364113651136611367113681136911370113711137211373113741137511376113771137811379113801138111382113831138411385113861138711388113891139011391113921139311394113951139611397113981139911400114011140211403114041140511406114071140811409114101141111412114131141411415114161141711418114191142011421114221142311424114251142611427114281142911430114311143211433114341143511436114371143811439114401144111442114431144411445114461144711448114491145011451114521145311454114551145611457114581145911460114611146211463114641146511466114671146811469114701147111472114731147411475114761147711478114791148011481114821148311484114851148611487114881148911490114911149211493114941149511496114971149811499115001150111502115031150411505115061150711508115091151011511115121151311514115151151611517115181151911520115211152211523115241152511526115271152811529115301153111532115331153411535115361153711538115391154011541115421154311544115451154611547115481154911550115511155211553115541155511556115571155811559115601156111562115631156411565115661156711568115691157011571115721157311574115751157611577115781157911580115811158211583115841158511586115871158811589115901159111592115931159411595115961159711598115991160011601116021160311604116051160611607116081160911610116111161211613116141161511616116171161811619116201162111622116231162411625116261162711628116291163011631116321163311634116351163611637116381163911640116411164211643116441164511646116471164811649116501165111652116531165411655116561165711658116591166011661116621166311664116651166611667116681166911670116711167211673116741167511676116771167811679116801168111682116831168411685116861168711688116891169011691116921169311694116951169611697116981169911700117011170211703117041170511706117071170811709117101171111712117131171411715117161171711718117191172011721117221172311724117251172611727117281172911730117311173211733117341173511736117371173811739117401174111742117431174411745117461174711748117491175011751117521175311754117551175611757117581175911760117611176211763117641176511766117671176811769117701177111772117731177411775117761177711778117791178011781117821178311784117851178611787117881178911790117911179211793117941179511796117971179811799118001180111802118031180411805118061180711808118091181011811118121181311814118151181611817118181181911820118211182211823118241182511826118271182811829118301183111832118331183411835118361183711838118391184011841118421184311844118451184611847118481184911850118511185211853118541185511856118571185811859118601186111862118631186411865118661186711868118691187011871118721187311874118751187611877118781187911880118811188211883118841188511886118871188811889118901189111892118931189411895118961189711898118991190011901119021190311904119051190611907119081190911910119111191211913119141191511916119171191811919119201192111922119231192411925119261192711928119291193011931119321193311934119351193611937119381193911940119411194211943119441194511946119471194811949119501195111952119531195411955119561195711958119591196011961119621196311964119651196611967119681196911970119711197211973119741197511976119771197811979119801198111982119831198411985119861198711988119891199011991119921199311994119951199611997119981199912000120011200212003120041200512006120071200812009120101201112012120131201412015120161201712018120191202012021120221202312024120251202612027120281202912030120311203212033120341203512036120371203812039120401204112042120431204412045120461204712048120491205012051120521205312054120551205612057120581205912060120611206212063120641206512066120671206812069120701207112072120731207412075120761207712078120791208012081120821208312084120851208612087120881208912090120911209212093120941209512096120971209812099121001210112102121031210412105121061210712108121091211012111121121211312114121151211612117121181211912120121211212212123121241212512126121271212812129121301213112132121331213412135121361213712138121391214012141121421214312144121451214612147121481214912150121511215212153121541215512156121571215812159121601216112162121631216412165121661216712168121691217012171121721217312174121751217612177121781217912180121811218212183121841218512186121871218812189121901219112192121931219412195121961219712198121991220012201122021220312204122051220612207122081220912210122111221212213122141221512216122171221812219122201222112222122231222412225122261222712228122291223012231122321223312234122351223612237122381223912240122411224212243122441224512246122471224812249122501225112252122531225412255122561225712258122591226012261122621226312264122651226612267122681226912270122711227212273122741227512276122771227812279122801228112282122831228412285122861228712288122891229012291122921229312294122951229612297122981229912300123011230212303123041230512306123071230812309123101231112312123131231412315123161231712318123191232012321123221232312324123251232612327123281232912330123311233212333123341233512336123371233812339123401234112342123431234412345123461234712348123491235012351123521235312354123551235612357123581235912360123611236212363123641236512366123671236812369123701237112372123731237412375123761237712378123791238012381123821238312384123851238612387123881238912390123911239212393123941239512396123971239812399124001240112402124031240412405124061240712408124091241012411124121241312414124151241612417124181241912420124211242212423124241242512426124271242812429124301243112432124331243412435124361243712438124391244012441124421244312444124451244612447124481244912450124511245212453124541245512456124571245812459124601246112462124631246412465124661246712468124691247012471124721247312474124751247612477124781247912480124811248212483124841248512486124871248812489124901249112492124931249412495124961249712498124991250012501125021250312504125051250612507125081250912510125111251212513125141251512516125171251812519125201252112522125231252412525125261252712528125291253012531125321253312534125351253612537125381253912540125411254212543125441254512546125471254812549125501255112552125531255412555125561255712558125591256012561125621256312564125651256612567125681256912570125711257212573125741257512576125771257812579125801258112582125831258412585125861258712588125891259012591125921259312594125951259612597125981259912600126011260212603126041260512606126071260812609126101261112612126131261412615126161261712618126191262012621126221262312624126251262612627126281262912630126311263212633126341263512636126371263812639126401264112642126431264412645126461264712648126491265012651126521265312654126551265612657126581265912660126611266212663126641266512666126671266812669126701267112672126731267412675126761267712678126791268012681126821268312684126851268612687126881268912690126911269212693126941269512696126971269812699127001270112702127031270412705127061270712708127091271012711127121271312714127151271612717127181271912720127211272212723127241272512726127271272812729127301273112732127331273412735127361273712738127391274012741127421274312744127451274612747127481274912750127511275212753127541275512756127571275812759127601276112762127631276412765127661276712768127691277012771127721277312774127751277612777127781277912780127811278212783127841278512786127871278812789127901279112792127931279412795127961279712798127991280012801128021280312804128051280612807128081280912810128111281212813128141281512816128171281812819128201282112822128231282412825128261282712828128291283012831128321283312834128351283612837128381283912840128411284212843128441284512846128471284812849128501285112852128531285412855128561285712858128591286012861128621286312864128651286612867128681286912870128711287212873128741287512876128771287812879128801288112882128831288412885128861288712888128891289012891128921289312894128951289612897128981289912900129011290212903129041290512906129071290812909129101291112912129131291412915129161291712918129191292012921129221292312924129251292612927129281292912930129311293212933129341293512936129371293812939129401294112942129431294412945129461294712948129491295012951129521295312954129551295612957129581295912960129611296212963129641296512966129671296812969129701297112972129731297412975129761297712978129791298012981129821298312984129851298612987129881298912990129911299212993129941299512996129971299812999130001300113002130031300413005130061300713008130091301013011130121301313014130151301613017130181301913020130211302213023130241302513026130271302813029130301303113032130331303413035130361303713038130391304013041130421304313044130451304613047130481304913050130511305213053130541305513056130571305813059130601306113062130631306413065130661306713068130691307013071130721307313074130751307613077130781307913080130811308213083130841308513086130871308813089130901309113092130931309413095130961309713098130991310013101131021310313104131051310613107131081310913110131111311213113131141311513116131171311813119131201312113122131231312413125131261312713128131291313013131131321313313134131351313613137131381313913140131411314213143131441314513146131471314813149131501315113152131531315413155131561315713158131591316013161131621316313164131651316613167131681316913170131711317213173131741317513176131771317813179131801318113182131831318413185131861318713188131891319013191131921319313194131951319613197131981319913200132011320213203132041320513206132071320813209132101321113212132131321413215132161321713218132191322013221132221322313224132251322613227132281322913230132311323213233132341323513236132371323813239132401324113242132431324413245132461324713248132491325013251132521325313254132551325613257132581325913260132611326213263132641326513266132671326813269132701327113272132731327413275132761327713278132791328013281132821328313284132851328613287132881328913290132911329213293132941329513296132971329813299133001330113302133031330413305133061330713308133091331013311133121331313314133151331613317133181331913320133211332213323133241332513326133271332813329133301333113332133331333413335133361333713338133391334013341133421334313344133451334613347133481334913350133511335213353133541335513356133571335813359133601336113362133631336413365133661336713368133691337013371133721337313374133751337613377133781337913380133811338213383133841338513386133871338813389133901339113392133931339413395133961339713398133991340013401134021340313404134051340613407134081340913410134111341213413134141341513416134171341813419134201342113422134231342413425134261342713428134291343013431134321343313434134351343613437134381343913440134411344213443134441344513446134471344813449134501345113452134531345413455134561345713458134591346013461134621346313464134651346613467134681346913470134711347213473134741347513476134771347813479134801348113482134831348413485134861348713488134891349013491134921349313494134951349613497134981349913500135011350213503135041350513506135071350813509135101351113512135131351413515135161351713518135191352013521135221352313524135251352613527135281352913530135311353213533135341353513536135371353813539135401354113542135431354413545135461354713548135491355013551135521355313554135551355613557135581355913560135611356213563135641356513566135671356813569135701357113572135731357413575135761357713578135791358013581135821358313584135851358613587135881358913590135911359213593135941359513596135971359813599136001360113602136031360413605136061360713608136091361013611136121361313614136151361613617136181361913620136211362213623136241362513626136271362813629136301363113632136331363413635136361363713638136391364013641136421364313644136451364613647136481364913650136511365213653136541365513656136571365813659136601366113662136631366413665136661366713668136691367013671136721367313674136751367613677136781367913680136811368213683136841368513686136871368813689136901369113692136931369413695136961369713698136991370013701137021370313704137051370613707137081370913710137111371213713137141371513716137171371813719137201372113722137231372413725137261372713728137291373013731137321373313734137351373613737137381373913740137411374213743137441374513746137471374813749137501375113752137531375413755137561375713758137591376013761137621376313764137651376613767137681376913770137711377213773137741377513776137771377813779137801378113782137831378413785137861378713788137891379013791137921379313794137951379613797137981379913800138011380213803138041380513806138071380813809138101381113812138131381413815138161381713818138191382013821138221382313824138251382613827138281382913830138311383213833138341383513836138371383813839138401384113842138431384413845138461384713848138491385013851138521385313854138551385613857138581385913860138611386213863138641386513866138671386813869138701387113872138731387413875138761387713878138791388013881138821388313884138851388613887138881388913890138911389213893138941389513896138971389813899139001390113902139031390413905139061390713908139091391013911139121391313914139151391613917139181391913920139211392213923139241392513926139271392813929139301393113932139331393413935139361393713938139391394013941139421394313944139451394613947139481394913950139511395213953139541395513956139571395813959139601396113962139631396413965139661396713968139691397013971139721397313974139751397613977139781397913980139811398213983139841398513986139871398813989139901399113992139931399413995139961399713998139991400014001140021400314004140051400614007140081400914010140111401214013140141401514016140171401814019140201402114022140231402414025140261402714028140291403014031140321403314034140351403614037140381403914040140411404214043140441404514046140471404814049140501405114052140531405414055140561405714058140591406014061140621406314064140651406614067140681406914070140711407214073140741407514076140771407814079140801408114082140831408414085140861408714088140891409014091140921409314094140951409614097140981409914100141011410214103141041410514106141071410814109141101411114112141131411414115141161411714118141191412014121141221412314124141251412614127141281412914130141311413214133141341413514136141371413814139141401414114142141431414414145141461414714148141491415014151141521415314154141551415614157141581415914160141611416214163141641416514166141671416814169141701417114172141731417414175141761417714178141791418014181141821418314184141851418614187141881418914190141911419214193141941419514196141971419814199142001420114202142031420414205142061420714208142091421014211142121421314214142151421614217142181421914220142211422214223142241422514226142271422814229142301423114232142331423414235142361423714238142391424014241142421424314244142451424614247142481424914250142511425214253142541425514256142571425814259142601426114262142631426414265142661426714268142691427014271142721427314274142751427614277142781427914280142811428214283142841428514286142871428814289142901429114292142931429414295142961429714298142991430014301143021430314304143051430614307143081430914310143111431214313143141431514316143171431814319143201432114322143231432414325143261432714328143291433014331143321433314334143351433614337143381433914340143411434214343143441434514346143471434814349143501435114352143531435414355143561435714358143591436014361143621436314364
  1. // Package mapsengine provides access to the Google Maps Engine API.
  2. //
  3. // See https://developers.google.com/maps-engine/
  4. //
  5. // Usage example:
  6. //
  7. // import "google.golang.org/api/mapsengine/v1"
  8. // ...
  9. // mapsengineService, err := mapsengine.New(oauthHttpClient)
  10. package mapsengine // import "google.golang.org/api/mapsengine/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 = "mapsengine:v1"
  41. const apiName = "mapsengine"
  42. const apiVersion = "v1"
  43. const basePath = "https://www.googleapis.com/mapsengine/v1/"
  44. // OAuth2 scopes used by this API.
  45. const (
  46. // View and manage your Google My Maps data
  47. MapsengineScope = "https://www.googleapis.com/auth/mapsengine"
  48. // View your Google My Maps data
  49. MapsengineReadonlyScope = "https://www.googleapis.com/auth/mapsengine.readonly"
  50. )
  51. func New(client *http.Client) (*Service, error) {
  52. if client == nil {
  53. return nil, errors.New("client is nil")
  54. }
  55. s := &Service{client: client, BasePath: basePath}
  56. s.Assets = NewAssetsService(s)
  57. s.Layers = NewLayersService(s)
  58. s.Maps = NewMapsService(s)
  59. s.Projects = NewProjectsService(s)
  60. s.RasterCollections = NewRasterCollectionsService(s)
  61. s.Rasters = NewRastersService(s)
  62. s.Tables = NewTablesService(s)
  63. return s, nil
  64. }
  65. type Service struct {
  66. client *http.Client
  67. BasePath string // API endpoint base URL
  68. UserAgent string // optional additional User-Agent fragment
  69. Assets *AssetsService
  70. Layers *LayersService
  71. Maps *MapsService
  72. Projects *ProjectsService
  73. RasterCollections *RasterCollectionsService
  74. Rasters *RastersService
  75. Tables *TablesService
  76. }
  77. func (s *Service) userAgent() string {
  78. if s.UserAgent == "" {
  79. return googleapi.UserAgent
  80. }
  81. return googleapi.UserAgent + " " + s.UserAgent
  82. }
  83. func NewAssetsService(s *Service) *AssetsService {
  84. rs := &AssetsService{s: s}
  85. rs.Parents = NewAssetsParentsService(s)
  86. rs.Permissions = NewAssetsPermissionsService(s)
  87. return rs
  88. }
  89. type AssetsService struct {
  90. s *Service
  91. Parents *AssetsParentsService
  92. Permissions *AssetsPermissionsService
  93. }
  94. func NewAssetsParentsService(s *Service) *AssetsParentsService {
  95. rs := &AssetsParentsService{s: s}
  96. return rs
  97. }
  98. type AssetsParentsService struct {
  99. s *Service
  100. }
  101. func NewAssetsPermissionsService(s *Service) *AssetsPermissionsService {
  102. rs := &AssetsPermissionsService{s: s}
  103. return rs
  104. }
  105. type AssetsPermissionsService struct {
  106. s *Service
  107. }
  108. func NewLayersService(s *Service) *LayersService {
  109. rs := &LayersService{s: s}
  110. rs.Parents = NewLayersParentsService(s)
  111. rs.Permissions = NewLayersPermissionsService(s)
  112. return rs
  113. }
  114. type LayersService struct {
  115. s *Service
  116. Parents *LayersParentsService
  117. Permissions *LayersPermissionsService
  118. }
  119. func NewLayersParentsService(s *Service) *LayersParentsService {
  120. rs := &LayersParentsService{s: s}
  121. return rs
  122. }
  123. type LayersParentsService struct {
  124. s *Service
  125. }
  126. func NewLayersPermissionsService(s *Service) *LayersPermissionsService {
  127. rs := &LayersPermissionsService{s: s}
  128. return rs
  129. }
  130. type LayersPermissionsService struct {
  131. s *Service
  132. }
  133. func NewMapsService(s *Service) *MapsService {
  134. rs := &MapsService{s: s}
  135. rs.Permissions = NewMapsPermissionsService(s)
  136. return rs
  137. }
  138. type MapsService struct {
  139. s *Service
  140. Permissions *MapsPermissionsService
  141. }
  142. func NewMapsPermissionsService(s *Service) *MapsPermissionsService {
  143. rs := &MapsPermissionsService{s: s}
  144. return rs
  145. }
  146. type MapsPermissionsService struct {
  147. s *Service
  148. }
  149. func NewProjectsService(s *Service) *ProjectsService {
  150. rs := &ProjectsService{s: s}
  151. rs.Icons = NewProjectsIconsService(s)
  152. return rs
  153. }
  154. type ProjectsService struct {
  155. s *Service
  156. Icons *ProjectsIconsService
  157. }
  158. func NewProjectsIconsService(s *Service) *ProjectsIconsService {
  159. rs := &ProjectsIconsService{s: s}
  160. return rs
  161. }
  162. type ProjectsIconsService struct {
  163. s *Service
  164. }
  165. func NewRasterCollectionsService(s *Service) *RasterCollectionsService {
  166. rs := &RasterCollectionsService{s: s}
  167. rs.Parents = NewRasterCollectionsParentsService(s)
  168. rs.Permissions = NewRasterCollectionsPermissionsService(s)
  169. rs.Rasters = NewRasterCollectionsRastersService(s)
  170. return rs
  171. }
  172. type RasterCollectionsService struct {
  173. s *Service
  174. Parents *RasterCollectionsParentsService
  175. Permissions *RasterCollectionsPermissionsService
  176. Rasters *RasterCollectionsRastersService
  177. }
  178. func NewRasterCollectionsParentsService(s *Service) *RasterCollectionsParentsService {
  179. rs := &RasterCollectionsParentsService{s: s}
  180. return rs
  181. }
  182. type RasterCollectionsParentsService struct {
  183. s *Service
  184. }
  185. func NewRasterCollectionsPermissionsService(s *Service) *RasterCollectionsPermissionsService {
  186. rs := &RasterCollectionsPermissionsService{s: s}
  187. return rs
  188. }
  189. type RasterCollectionsPermissionsService struct {
  190. s *Service
  191. }
  192. func NewRasterCollectionsRastersService(s *Service) *RasterCollectionsRastersService {
  193. rs := &RasterCollectionsRastersService{s: s}
  194. return rs
  195. }
  196. type RasterCollectionsRastersService struct {
  197. s *Service
  198. }
  199. func NewRastersService(s *Service) *RastersService {
  200. rs := &RastersService{s: s}
  201. rs.Files = NewRastersFilesService(s)
  202. rs.Parents = NewRastersParentsService(s)
  203. rs.Permissions = NewRastersPermissionsService(s)
  204. return rs
  205. }
  206. type RastersService struct {
  207. s *Service
  208. Files *RastersFilesService
  209. Parents *RastersParentsService
  210. Permissions *RastersPermissionsService
  211. }
  212. func NewRastersFilesService(s *Service) *RastersFilesService {
  213. rs := &RastersFilesService{s: s}
  214. return rs
  215. }
  216. type RastersFilesService struct {
  217. s *Service
  218. }
  219. func NewRastersParentsService(s *Service) *RastersParentsService {
  220. rs := &RastersParentsService{s: s}
  221. return rs
  222. }
  223. type RastersParentsService struct {
  224. s *Service
  225. }
  226. func NewRastersPermissionsService(s *Service) *RastersPermissionsService {
  227. rs := &RastersPermissionsService{s: s}
  228. return rs
  229. }
  230. type RastersPermissionsService struct {
  231. s *Service
  232. }
  233. func NewTablesService(s *Service) *TablesService {
  234. rs := &TablesService{s: s}
  235. rs.Features = NewTablesFeaturesService(s)
  236. rs.Files = NewTablesFilesService(s)
  237. rs.Parents = NewTablesParentsService(s)
  238. rs.Permissions = NewTablesPermissionsService(s)
  239. return rs
  240. }
  241. type TablesService struct {
  242. s *Service
  243. Features *TablesFeaturesService
  244. Files *TablesFilesService
  245. Parents *TablesParentsService
  246. Permissions *TablesPermissionsService
  247. }
  248. func NewTablesFeaturesService(s *Service) *TablesFeaturesService {
  249. rs := &TablesFeaturesService{s: s}
  250. return rs
  251. }
  252. type TablesFeaturesService struct {
  253. s *Service
  254. }
  255. func NewTablesFilesService(s *Service) *TablesFilesService {
  256. rs := &TablesFilesService{s: s}
  257. return rs
  258. }
  259. type TablesFilesService struct {
  260. s *Service
  261. }
  262. func NewTablesParentsService(s *Service) *TablesParentsService {
  263. rs := &TablesParentsService{s: s}
  264. return rs
  265. }
  266. type TablesParentsService struct {
  267. s *Service
  268. }
  269. func NewTablesPermissionsService(s *Service) *TablesPermissionsService {
  270. rs := &TablesPermissionsService{s: s}
  271. return rs
  272. }
  273. type TablesPermissionsService struct {
  274. s *Service
  275. }
  276. // AcquisitionTime: Acquisition time represents acquired time of a
  277. // raster.
  278. type AcquisitionTime struct {
  279. // End: The end time if acquisition time is a range. The value is an RFC
  280. // 3339 formatted date-time value (1970-01-01T00:00:00Z).
  281. End string `json:"end,omitempty"`
  282. // Precision: The precision of acquisition time.
  283. //
  284. // Possible values:
  285. // "day"
  286. // "hour"
  287. // "minute"
  288. // "month"
  289. // "second"
  290. // "year"
  291. Precision string `json:"precision,omitempty"`
  292. // Start: The acquisition time, or start time if acquisition time is a
  293. // range. The value is an RFC 3339 formatted date-time value
  294. // (1970-01-01T00:00:00Z).
  295. Start string `json:"start,omitempty"`
  296. // ForceSendFields is a list of field names (e.g. "End") to
  297. // unconditionally include in API requests. By default, fields with
  298. // empty values are omitted from API requests. However, any non-pointer,
  299. // non-interface field appearing in ForceSendFields will be sent to the
  300. // server regardless of whether the field is empty or not. This may be
  301. // used to include empty fields in Patch requests.
  302. ForceSendFields []string `json:"-"`
  303. }
  304. func (s *AcquisitionTime) MarshalJSON() ([]byte, error) {
  305. type noMethod AcquisitionTime
  306. raw := noMethod(*s)
  307. return gensupport.MarshalJSON(raw, s.ForceSendFields)
  308. }
  309. // Asset: An asset is any Google Maps Engine resource that has a
  310. // globally unique ID. Assets include maps, layers, vector tables,
  311. // raster collections, and rasters. Projects and features are not
  312. // considered assets.
  313. //
  314. // More detailed information about an asset can be obtained by querying
  315. // the asset's particular endpoint.
  316. type Asset struct {
  317. // Bbox: A rectangular bounding box which contains all of the data in
  318. // this asset. The box is expressed as \"west, south, east, north\". The
  319. // numbers represent latitude and longitude in decimal degrees.
  320. Bbox []float64 `json:"bbox,omitempty"`
  321. // CreationTime: The creation time of this asset. The value is an RFC
  322. // 3339-formatted date-time value (for example, 1970-01-01T00:00:00Z).
  323. CreationTime string `json:"creationTime,omitempty"`
  324. // CreatorEmail: The email address of the creator of this asset. This is
  325. // only returned on GET requests and not LIST requests.
  326. CreatorEmail string `json:"creatorEmail,omitempty"`
  327. // Description: The asset's description.
  328. Description string `json:"description,omitempty"`
  329. // Etag: The ETag, used to refer to the current version of the asset.
  330. Etag string `json:"etag,omitempty"`
  331. // Id: The asset's globally unique ID.
  332. Id string `json:"id,omitempty"`
  333. // LastModifiedTime: The last modified time of this asset. The value is
  334. // an RFC 3339-formatted date-time value (for example,
  335. // 1970-01-01T00:00:00Z).
  336. LastModifiedTime string `json:"lastModifiedTime,omitempty"`
  337. // LastModifierEmail: The email address of the last modifier of this
  338. // asset. This is only returned on GET requests and not LIST requests.
  339. LastModifierEmail string `json:"lastModifierEmail,omitempty"`
  340. // Name: The asset's name.
  341. Name string `json:"name,omitempty"`
  342. // ProjectId: The ID of the project to which the asset belongs.
  343. ProjectId string `json:"projectId,omitempty"`
  344. // Resource: The URL to query to retrieve the asset's complete object.
  345. // The assets endpoint only returns high-level information about a
  346. // resource.
  347. Resource string `json:"resource,omitempty"`
  348. // Tags: An array of text strings, with each string representing a tag.
  349. // More information about tags can be found in the Tagging data article
  350. // of the Maps Engine help center.
  351. Tags []string `json:"tags,omitempty"`
  352. // Type: The type of asset. One of raster, rasterCollection, table, map,
  353. // or layer.
  354. //
  355. // Possible values:
  356. // "layer"
  357. // "map"
  358. // "raster"
  359. // "rasterCollection"
  360. // "table"
  361. Type string `json:"type,omitempty"`
  362. // WritersCanEditPermissions: If true, WRITERs of the asset are able to
  363. // edit the asset permissions.
  364. WritersCanEditPermissions bool `json:"writersCanEditPermissions,omitempty"`
  365. // ServerResponse contains the HTTP response code and headers from the
  366. // server.
  367. googleapi.ServerResponse `json:"-"`
  368. // ForceSendFields is a list of field names (e.g. "Bbox") to
  369. // unconditionally include in API requests. By default, fields with
  370. // empty values are omitted from API requests. However, any non-pointer,
  371. // non-interface field appearing in ForceSendFields will be sent to the
  372. // server regardless of whether the field is empty or not. This may be
  373. // used to include empty fields in Patch requests.
  374. ForceSendFields []string `json:"-"`
  375. }
  376. func (s *Asset) MarshalJSON() ([]byte, error) {
  377. type noMethod Asset
  378. raw := noMethod(*s)
  379. return gensupport.MarshalJSON(raw, s.ForceSendFields)
  380. }
  381. // AssetsListResponse: The response returned by a call to
  382. // resources.List.
  383. type AssetsListResponse struct {
  384. // Assets: Assets returned.
  385. Assets []*Asset `json:"assets,omitempty"`
  386. // NextPageToken: Next page token.
  387. NextPageToken string `json:"nextPageToken,omitempty"`
  388. // ServerResponse contains the HTTP response code and headers from the
  389. // server.
  390. googleapi.ServerResponse `json:"-"`
  391. // ForceSendFields is a list of field names (e.g. "Assets") to
  392. // unconditionally include in API requests. By default, fields with
  393. // empty values are omitted from API requests. However, any non-pointer,
  394. // non-interface field appearing in ForceSendFields will be sent to the
  395. // server regardless of whether the field is empty or not. This may be
  396. // used to include empty fields in Patch requests.
  397. ForceSendFields []string `json:"-"`
  398. }
  399. func (s *AssetsListResponse) MarshalJSON() ([]byte, error) {
  400. type noMethod AssetsListResponse
  401. raw := noMethod(*s)
  402. return gensupport.MarshalJSON(raw, s.ForceSendFields)
  403. }
  404. // Border: Border in line style. Both color and width are required.
  405. type Border struct {
  406. // Color: Color of the border.
  407. Color string `json:"color,omitempty"`
  408. // Opacity: Opacity of the border.
  409. Opacity float64 `json:"opacity,omitempty"`
  410. // Width: Width of the border, in pixels.
  411. Width float64 `json:"width,omitempty"`
  412. // ForceSendFields is a list of field names (e.g. "Color") to
  413. // unconditionally include in API requests. By default, fields with
  414. // empty values are omitted from API requests. However, any non-pointer,
  415. // non-interface field appearing in ForceSendFields will be sent to the
  416. // server regardless of whether the field is empty or not. This may be
  417. // used to include empty fields in Patch requests.
  418. ForceSendFields []string `json:"-"`
  419. }
  420. func (s *Border) MarshalJSON() ([]byte, error) {
  421. type noMethod Border
  422. raw := noMethod(*s)
  423. return gensupport.MarshalJSON(raw, s.ForceSendFields)
  424. }
  425. // Color: Basic color used in styling.
  426. type Color struct {
  427. // Color: The CSS style color, can be in format of "red" or "#7733EE".
  428. Color string `json:"color,omitempty"`
  429. // Opacity: Opacity ranges from 0 to 1, inclusive. If not provided,
  430. // default to 1.
  431. Opacity float64 `json:"opacity,omitempty"`
  432. // ForceSendFields is a list of field names (e.g. "Color") to
  433. // unconditionally include in API requests. By default, fields with
  434. // empty values are omitted from API requests. However, any non-pointer,
  435. // non-interface field appearing in ForceSendFields will be sent to the
  436. // server regardless of whether the field is empty or not. This may be
  437. // used to include empty fields in Patch requests.
  438. ForceSendFields []string `json:"-"`
  439. }
  440. func (s *Color) MarshalJSON() ([]byte, error) {
  441. type noMethod Color
  442. raw := noMethod(*s)
  443. return gensupport.MarshalJSON(raw, s.ForceSendFields)
  444. }
  445. type Datasource struct {
  446. // Id: The ID of a datasource.
  447. Id string `json:"id,omitempty"`
  448. // ForceSendFields is a list of field names (e.g. "Id") to
  449. // unconditionally include in API requests. By default, fields with
  450. // empty values are omitted from API requests. However, any non-pointer,
  451. // non-interface field appearing in ForceSendFields will be sent to the
  452. // server regardless of whether the field is empty or not. This may be
  453. // used to include empty fields in Patch requests.
  454. ForceSendFields []string `json:"-"`
  455. }
  456. func (s *Datasource) MarshalJSON() ([]byte, error) {
  457. type noMethod Datasource
  458. raw := noMethod(*s)
  459. return gensupport.MarshalJSON(raw, s.ForceSendFields)
  460. }
  461. // DisplayRule: A display rule of the vector style.
  462. type DisplayRule struct {
  463. // Filters: This display rule will only be applied to features that
  464. // match all of the filters here. If filters is empty, then the rule
  465. // applies to all features.
  466. Filters []*Filter `json:"filters,omitempty"`
  467. // LineOptions: Style applied to lines. Required for LineString
  468. // Geometry.
  469. LineOptions *LineStyle `json:"lineOptions,omitempty"`
  470. // Name: Display rule name. Name is not unique and cannot be used for
  471. // identification purpose.
  472. Name string `json:"name,omitempty"`
  473. // PointOptions: Style applied to points. Required for Point Geometry.
  474. PointOptions *PointStyle `json:"pointOptions,omitempty"`
  475. // PolygonOptions: Style applied to polygons. Required for Polygon
  476. // Geometry.
  477. PolygonOptions *PolygonStyle `json:"polygonOptions,omitempty"`
  478. // ZoomLevels: The zoom levels that this display rule apply.
  479. ZoomLevels *ZoomLevels `json:"zoomLevels,omitempty"`
  480. // ForceSendFields is a list of field names (e.g. "Filters") to
  481. // unconditionally include in API requests. By default, fields with
  482. // empty values are omitted from API requests. However, any non-pointer,
  483. // non-interface field appearing in ForceSendFields will be sent to the
  484. // server regardless of whether the field is empty or not. This may be
  485. // used to include empty fields in Patch requests.
  486. ForceSendFields []string `json:"-"`
  487. }
  488. func (s *DisplayRule) MarshalJSON() ([]byte, error) {
  489. type noMethod DisplayRule
  490. raw := noMethod(*s)
  491. return gensupport.MarshalJSON(raw, s.ForceSendFields)
  492. }
  493. // Feature: A feature within a table.
  494. type Feature struct {
  495. // Geometry: The geometry member of this Feature.
  496. Geometry GeoJsonGeometry `json:"geometry,omitempty"`
  497. // Properties: Key/value pairs of this Feature.
  498. Properties GeoJsonProperties `json:"properties,omitempty"`
  499. // Type: Identifies this object as a feature.
  500. Type string `json:"type,omitempty"`
  501. // ServerResponse contains the HTTP response code and headers from the
  502. // server.
  503. googleapi.ServerResponse `json:"-"`
  504. // ForceSendFields is a list of field names (e.g. "Geometry") to
  505. // unconditionally include in API requests. By default, fields with
  506. // empty values are omitted from API requests. However, any non-pointer,
  507. // non-interface field appearing in ForceSendFields will be sent to the
  508. // server regardless of whether the field is empty or not. This may be
  509. // used to include empty fields in Patch requests.
  510. ForceSendFields []string `json:"-"`
  511. }
  512. func (s *Feature) MarshalJSON() ([]byte, error) {
  513. type noMethod Feature
  514. raw := noMethod(*s)
  515. return gensupport.MarshalJSON(raw, s.ForceSendFields)
  516. }
  517. // FeatureInfo: A feature info contains information about individual
  518. // feature.
  519. type FeatureInfo struct {
  520. // Content: HTML template of the info window. If not provided, a default
  521. // template with all attributes will be generated.
  522. Content string `json:"content,omitempty"`
  523. // ForceSendFields is a list of field names (e.g. "Content") to
  524. // unconditionally include in API requests. By default, fields with
  525. // empty values are omitted from API requests. However, any non-pointer,
  526. // non-interface field appearing in ForceSendFields will be sent to the
  527. // server regardless of whether the field is empty or not. This may be
  528. // used to include empty fields in Patch requests.
  529. ForceSendFields []string `json:"-"`
  530. }
  531. func (s *FeatureInfo) MarshalJSON() ([]byte, error) {
  532. type noMethod FeatureInfo
  533. raw := noMethod(*s)
  534. return gensupport.MarshalJSON(raw, s.ForceSendFields)
  535. }
  536. // FeaturesBatchDeleteRequest: The request sent to features.BatchDelete.
  537. type FeaturesBatchDeleteRequest struct {
  538. GxIds []string `json:"gx_ids,omitempty"`
  539. PrimaryKeys []string `json:"primaryKeys,omitempty"`
  540. // ForceSendFields is a list of field names (e.g. "GxIds") to
  541. // unconditionally include in API requests. By default, fields with
  542. // empty values are omitted from API requests. However, any non-pointer,
  543. // non-interface field appearing in ForceSendFields will be sent to the
  544. // server regardless of whether the field is empty or not. This may be
  545. // used to include empty fields in Patch requests.
  546. ForceSendFields []string `json:"-"`
  547. }
  548. func (s *FeaturesBatchDeleteRequest) MarshalJSON() ([]byte, error) {
  549. type noMethod FeaturesBatchDeleteRequest
  550. raw := noMethod(*s)
  551. return gensupport.MarshalJSON(raw, s.ForceSendFields)
  552. }
  553. // FeaturesBatchInsertRequest: The request sent to features.Insert.
  554. type FeaturesBatchInsertRequest struct {
  555. Features []*Feature `json:"features,omitempty"`
  556. // NormalizeGeometries: If true, the server will normalize feature
  557. // geometries. It is assumed that the South Pole is exterior to any
  558. // polygons given. See here for a list of normalizations. If false, all
  559. // feature geometries must be given already normalized. The points in
  560. // all LinearRings must be listed in counter-clockwise order, and
  561. // LinearRings may not intersect.
  562. //
  563. // Default: true
  564. NormalizeGeometries *bool `json:"normalizeGeometries,omitempty"`
  565. // ForceSendFields is a list of field names (e.g. "Features") to
  566. // unconditionally include in API requests. By default, fields with
  567. // empty values are omitted from API requests. However, any non-pointer,
  568. // non-interface field appearing in ForceSendFields will be sent to the
  569. // server regardless of whether the field is empty or not. This may be
  570. // used to include empty fields in Patch requests.
  571. ForceSendFields []string `json:"-"`
  572. }
  573. func (s *FeaturesBatchInsertRequest) MarshalJSON() ([]byte, error) {
  574. type noMethod FeaturesBatchInsertRequest
  575. raw := noMethod(*s)
  576. return gensupport.MarshalJSON(raw, s.ForceSendFields)
  577. }
  578. // FeaturesBatchPatchRequest: The request sent to features.BatchPatch.
  579. type FeaturesBatchPatchRequest struct {
  580. Features []*Feature `json:"features,omitempty"`
  581. // NormalizeGeometries: If true, the server will normalize feature
  582. // geometries. It is assumed that the South Pole is exterior to any
  583. // polygons given. See here for a list of normalizations. If false, all
  584. // feature geometries must be given already normalized. The points in
  585. // all LinearRings must be listed in counter-clockwise order, and
  586. // LinearRings may not intersect.
  587. //
  588. // Default: true
  589. NormalizeGeometries *bool `json:"normalizeGeometries,omitempty"`
  590. // ForceSendFields is a list of field names (e.g. "Features") to
  591. // unconditionally include in API requests. By default, fields with
  592. // empty values are omitted from API requests. However, any non-pointer,
  593. // non-interface field appearing in ForceSendFields will be sent to the
  594. // server regardless of whether the field is empty or not. This may be
  595. // used to include empty fields in Patch requests.
  596. ForceSendFields []string `json:"-"`
  597. }
  598. func (s *FeaturesBatchPatchRequest) MarshalJSON() ([]byte, error) {
  599. type noMethod FeaturesBatchPatchRequest
  600. raw := noMethod(*s)
  601. return gensupport.MarshalJSON(raw, s.ForceSendFields)
  602. }
  603. // FeaturesListResponse: The response returned by a call to
  604. // features.List.
  605. type FeaturesListResponse struct {
  606. // AllowedQueriesPerSecond: An indicator of the maximum rate at which
  607. // queries may be made, if all queries were as expensive as this query.
  608. AllowedQueriesPerSecond float64 `json:"allowedQueriesPerSecond,omitempty"`
  609. // Features: Resources returned.
  610. Features []*Feature `json:"features,omitempty"`
  611. // NextPageToken: Next page token.
  612. NextPageToken string `json:"nextPageToken,omitempty"`
  613. // Schema: The feature schema.
  614. Schema *Schema `json:"schema,omitempty"`
  615. Type string `json:"type,omitempty"`
  616. // ServerResponse contains the HTTP response code and headers from the
  617. // server.
  618. googleapi.ServerResponse `json:"-"`
  619. // ForceSendFields is a list of field names (e.g.
  620. // "AllowedQueriesPerSecond") to unconditionally include in API
  621. // requests. By default, fields with empty values are omitted from API
  622. // requests. However, any non-pointer, non-interface field appearing in
  623. // ForceSendFields will be sent to the server regardless of whether the
  624. // field is empty or not. This may be used to include empty fields in
  625. // Patch requests.
  626. ForceSendFields []string `json:"-"`
  627. }
  628. func (s *FeaturesListResponse) MarshalJSON() ([]byte, error) {
  629. type noMethod FeaturesListResponse
  630. raw := noMethod(*s)
  631. return gensupport.MarshalJSON(raw, s.ForceSendFields)
  632. }
  633. // File: A single File, which is a component of an Asset.
  634. type File struct {
  635. // Filename: The name of the file.
  636. Filename string `json:"filename,omitempty"`
  637. // Size: The size of the file in bytes.
  638. Size int64 `json:"size,omitempty,string"`
  639. // UploadStatus: The upload status of the file.
  640. //
  641. // Possible values:
  642. // "canceled"
  643. // "complete"
  644. // "failed"
  645. // "inProgress"
  646. UploadStatus string `json:"uploadStatus,omitempty"`
  647. // ForceSendFields is a list of field names (e.g. "Filename") to
  648. // unconditionally include in API requests. By default, fields with
  649. // empty values are omitted from API requests. However, any non-pointer,
  650. // non-interface field appearing in ForceSendFields will be sent to the
  651. // server regardless of whether the field is empty or not. This may be
  652. // used to include empty fields in Patch requests.
  653. ForceSendFields []string `json:"-"`
  654. }
  655. func (s *File) MarshalJSON() ([]byte, error) {
  656. type noMethod File
  657. raw := noMethod(*s)
  658. return gensupport.MarshalJSON(raw, s.ForceSendFields)
  659. }
  660. // Filter: Conditions for filtering features.
  661. type Filter struct {
  662. // Column: The column name to filter on.
  663. Column string `json:"column,omitempty"`
  664. // Operator: Operation used to evaluate the filter.
  665. //
  666. // Possible values:
  667. // "!="
  668. // "<"
  669. // "<="
  670. // "=="
  671. // ">"
  672. // ">="
  673. // "contains"
  674. // "endsWith"
  675. // "startsWith"
  676. Operator string `json:"operator,omitempty"`
  677. // Value: Value to be evaluated against attribute.
  678. Value interface{} `json:"value,omitempty"`
  679. // ForceSendFields is a list of field names (e.g. "Column") to
  680. // unconditionally include in API requests. By default, fields with
  681. // empty values are omitted from API requests. However, any non-pointer,
  682. // non-interface field appearing in ForceSendFields will be sent to the
  683. // server regardless of whether the field is empty or not. This may be
  684. // used to include empty fields in Patch requests.
  685. ForceSendFields []string `json:"-"`
  686. }
  687. func (s *Filter) MarshalJSON() ([]byte, error) {
  688. type noMethod Filter
  689. raw := noMethod(*s)
  690. return gensupport.MarshalJSON(raw, s.ForceSendFields)
  691. }
  692. type GeoJsonGeometry map[string]interface{}
  693. func (t GeoJsonGeometry) Type() string {
  694. return googleapi.VariantType(t)
  695. }
  696. func (t GeoJsonGeometry) GeometryCollection() (r GeoJsonGeometryCollection, ok bool) {
  697. if t.Type() != "GeometryCollection" {
  698. return r, false
  699. }
  700. ok = googleapi.ConvertVariant(map[string]interface{}(t), &r)
  701. return r, ok
  702. }
  703. func (t GeoJsonGeometry) LineString() (r GeoJsonLineString, ok bool) {
  704. if t.Type() != "LineString" {
  705. return r, false
  706. }
  707. ok = googleapi.ConvertVariant(map[string]interface{}(t), &r)
  708. return r, ok
  709. }
  710. func (t GeoJsonGeometry) MultiLineString() (r GeoJsonMultiLineString, ok bool) {
  711. if t.Type() != "MultiLineString" {
  712. return r, false
  713. }
  714. ok = googleapi.ConvertVariant(map[string]interface{}(t), &r)
  715. return r, ok
  716. }
  717. func (t GeoJsonGeometry) MultiPoint() (r GeoJsonMultiPoint, ok bool) {
  718. if t.Type() != "MultiPoint" {
  719. return r, false
  720. }
  721. ok = googleapi.ConvertVariant(map[string]interface{}(t), &r)
  722. return r, ok
  723. }
  724. func (t GeoJsonGeometry) MultiPolygon() (r GeoJsonMultiPolygon, ok bool) {
  725. if t.Type() != "MultiPolygon" {
  726. return r, false
  727. }
  728. ok = googleapi.ConvertVariant(map[string]interface{}(t), &r)
  729. return r, ok
  730. }
  731. func (t GeoJsonGeometry) Point() (r GeoJsonPoint, ok bool) {
  732. if t.Type() != "Point" {
  733. return r, false
  734. }
  735. ok = googleapi.ConvertVariant(map[string]interface{}(t), &r)
  736. return r, ok
  737. }
  738. func (t GeoJsonGeometry) Polygon() (r GeoJsonPolygon, ok bool) {
  739. if t.Type() != "Polygon" {
  740. return r, false
  741. }
  742. ok = googleapi.ConvertVariant(map[string]interface{}(t), &r)
  743. return r, ok
  744. }
  745. // GeoJsonGeometryCollection: A heterogenous collection of
  746. // GeoJsonGeometry objects.
  747. type GeoJsonGeometryCollection struct {
  748. // Geometries: An array of geometry objects. There must be at least 2
  749. // different types of geometries in the array.
  750. Geometries []GeoJsonGeometry `json:"geometries,omitempty"`
  751. // Type: Identifies this object as a GeoJsonGeometryCollection.
  752. //
  753. // Possible values:
  754. // "GeometryCollection"
  755. Type string `json:"type,omitempty"`
  756. // ForceSendFields is a list of field names (e.g. "Geometries") to
  757. // unconditionally include in API requests. By default, fields with
  758. // empty values are omitted from API requests. However, any non-pointer,
  759. // non-interface field appearing in ForceSendFields will be sent to the
  760. // server regardless of whether the field is empty or not. This may be
  761. // used to include empty fields in Patch requests.
  762. ForceSendFields []string `json:"-"`
  763. }
  764. func (s *GeoJsonGeometryCollection) MarshalJSON() ([]byte, error) {
  765. type noMethod GeoJsonGeometryCollection
  766. raw := noMethod(*s)
  767. return gensupport.MarshalJSON(raw, s.ForceSendFields)
  768. }
  769. type GeoJsonLineString struct {
  770. // Coordinates: An array of two or more positions, representing a line.
  771. Coordinates [][]float64 `json:"coordinates,omitempty"`
  772. // Type: Identifies this object as a GeoJsonLineString.
  773. //
  774. // Possible values:
  775. // "LineString"
  776. Type string `json:"type,omitempty"`
  777. // ForceSendFields is a list of field names (e.g. "Coordinates") to
  778. // unconditionally include in API requests. By default, fields with
  779. // empty values are omitted from API requests. However, any non-pointer,
  780. // non-interface field appearing in ForceSendFields will be sent to the
  781. // server regardless of whether the field is empty or not. This may be
  782. // used to include empty fields in Patch requests.
  783. ForceSendFields []string `json:"-"`
  784. }
  785. func (s *GeoJsonLineString) MarshalJSON() ([]byte, error) {
  786. type noMethod GeoJsonLineString
  787. raw := noMethod(*s)
  788. return gensupport.MarshalJSON(raw, s.ForceSendFields)
  789. }
  790. // GeoJsonMultiLineString: Multi Line String
  791. type GeoJsonMultiLineString struct {
  792. // Coordinates: An array of at least two GeoJsonLineString coordinate
  793. // arrays.
  794. Coordinates [][][]float64 `json:"coordinates,omitempty"`
  795. // Type: Identifies this object as a GeoJsonMultiLineString.
  796. //
  797. // Possible values:
  798. // "MultiLineString"
  799. Type string `json:"type,omitempty"`
  800. // ForceSendFields is a list of field names (e.g. "Coordinates") to
  801. // unconditionally include in API requests. By default, fields with
  802. // empty values are omitted from API requests. However, any non-pointer,
  803. // non-interface field appearing in ForceSendFields will be sent to the
  804. // server regardless of whether the field is empty or not. This may be
  805. // used to include empty fields in Patch requests.
  806. ForceSendFields []string `json:"-"`
  807. }
  808. func (s *GeoJsonMultiLineString) MarshalJSON() ([]byte, error) {
  809. type noMethod GeoJsonMultiLineString
  810. raw := noMethod(*s)
  811. return gensupport.MarshalJSON(raw, s.ForceSendFields)
  812. }
  813. type GeoJsonMultiPoint struct {
  814. // Coordinates: An array of at least two GeoJsonPoint coordinate arrays.
  815. Coordinates [][]float64 `json:"coordinates,omitempty"`
  816. // Type: Identifies this object as a GeoJsonMultiPoint.
  817. //
  818. // Possible values:
  819. // "MultiPoint"
  820. Type string `json:"type,omitempty"`
  821. // ForceSendFields is a list of field names (e.g. "Coordinates") to
  822. // unconditionally include in API requests. By default, fields with
  823. // empty values are omitted from API requests. However, any non-pointer,
  824. // non-interface field appearing in ForceSendFields will be sent to the
  825. // server regardless of whether the field is empty or not. This may be
  826. // used to include empty fields in Patch requests.
  827. ForceSendFields []string `json:"-"`
  828. }
  829. func (s *GeoJsonMultiPoint) MarshalJSON() ([]byte, error) {
  830. type noMethod GeoJsonMultiPoint
  831. raw := noMethod(*s)
  832. return gensupport.MarshalJSON(raw, s.ForceSendFields)
  833. }
  834. type GeoJsonMultiPolygon struct {
  835. // Coordinates: An array of at least two GeoJsonPolygon coordinate
  836. // arrays.
  837. Coordinates [][][][]float64 `json:"coordinates,omitempty"`
  838. // Type: Identifies this object as a GeoJsonMultiPolygon.
  839. //
  840. // Possible values:
  841. // "MultiPolygon"
  842. Type string `json:"type,omitempty"`
  843. // ForceSendFields is a list of field names (e.g. "Coordinates") to
  844. // unconditionally include in API requests. By default, fields with
  845. // empty values are omitted from API requests. However, any non-pointer,
  846. // non-interface field appearing in ForceSendFields will be sent to the
  847. // server regardless of whether the field is empty or not. This may be
  848. // used to include empty fields in Patch requests.
  849. ForceSendFields []string `json:"-"`
  850. }
  851. func (s *GeoJsonMultiPolygon) MarshalJSON() ([]byte, error) {
  852. type noMethod GeoJsonMultiPolygon
  853. raw := noMethod(*s)
  854. return gensupport.MarshalJSON(raw, s.ForceSendFields)
  855. }
  856. type GeoJsonPoint struct {
  857. // Coordinates: A single GeoJsonPosition, specifying the location of the
  858. // point.
  859. Coordinates []float64 `json:"coordinates,omitempty"`
  860. // Type: Identifies this object as a GeoJsonPoint.
  861. //
  862. // Possible values:
  863. // "Point"
  864. Type string `json:"type,omitempty"`
  865. // ForceSendFields is a list of field names (e.g. "Coordinates") to
  866. // unconditionally include in API requests. By default, fields with
  867. // empty values are omitted from API requests. However, any non-pointer,
  868. // non-interface field appearing in ForceSendFields will be sent to the
  869. // server regardless of whether the field is empty or not. This may be
  870. // used to include empty fields in Patch requests.
  871. ForceSendFields []string `json:"-"`
  872. }
  873. func (s *GeoJsonPoint) MarshalJSON() ([]byte, error) {
  874. type noMethod GeoJsonPoint
  875. raw := noMethod(*s)
  876. return gensupport.MarshalJSON(raw, s.ForceSendFields)
  877. }
  878. type GeoJsonPolygon struct {
  879. // Coordinates: An array of LinearRings. A LinearRing is a
  880. // GeoJsonLineString which is closed (that is, the first and last
  881. // GeoJsonPositions are equal), and which contains at least four
  882. // GeoJsonPositions. For polygons with multiple rings, the first
  883. // LinearRing is the exterior ring, and any subsequent rings are
  884. // interior rings (that is, holes).
  885. Coordinates [][][]float64 `json:"coordinates,omitempty"`
  886. // Type: Identifies this object as a GeoJsonPolygon.
  887. //
  888. // Possible values:
  889. // "Polygon"
  890. Type string `json:"type,omitempty"`
  891. // ForceSendFields is a list of field names (e.g. "Coordinates") to
  892. // unconditionally include in API requests. By default, fields with
  893. // empty values are omitted from API requests. However, any non-pointer,
  894. // non-interface field appearing in ForceSendFields will be sent to the
  895. // server regardless of whether the field is empty or not. This may be
  896. // used to include empty fields in Patch requests.
  897. ForceSendFields []string `json:"-"`
  898. }
  899. func (s *GeoJsonPolygon) MarshalJSON() ([]byte, error) {
  900. type noMethod GeoJsonPolygon
  901. raw := noMethod(*s)
  902. return gensupport.MarshalJSON(raw, s.ForceSendFields)
  903. }
  904. type GeoJsonProperties interface{}
  905. // Icon: An icon is a user-uploaded image that can be used to style
  906. // point geometries.
  907. type Icon struct {
  908. // Description: The description of this Icon, supplied by the author.
  909. Description string `json:"description,omitempty"`
  910. // Id: An ID used to refer to this Icon.
  911. Id string `json:"id,omitempty"`
  912. // Name: The name of this Icon, supplied by the author.
  913. Name string `json:"name,omitempty"`
  914. // ServerResponse contains the HTTP response code and headers from the
  915. // server.
  916. googleapi.ServerResponse `json:"-"`
  917. // ForceSendFields is a list of field names (e.g. "Description") to
  918. // unconditionally include in API requests. By default, fields with
  919. // empty values are omitted from API requests. However, any non-pointer,
  920. // non-interface field appearing in ForceSendFields will be sent to the
  921. // server regardless of whether the field is empty or not. This may be
  922. // used to include empty fields in Patch requests.
  923. ForceSendFields []string `json:"-"`
  924. }
  925. func (s *Icon) MarshalJSON() ([]byte, error) {
  926. type noMethod Icon
  927. raw := noMethod(*s)
  928. return gensupport.MarshalJSON(raw, s.ForceSendFields)
  929. }
  930. // IconStyle: Style for icon, this is part of point style.
  931. type IconStyle struct {
  932. // Id: Custom icon id.
  933. Id string `json:"id,omitempty"`
  934. // Name: Stock icon name. To use a stock icon, prefix it with 'gx_'. See
  935. // Stock icon names for valid icon names. For example, to specify
  936. // small_red, set name to 'gx_small_red'.
  937. Name string `json:"name,omitempty"`
  938. // ScaledShape: A scalable shape.
  939. ScaledShape *ScaledShape `json:"scaledShape,omitempty"`
  940. // ScalingFunction: The function used to scale shapes. Required when a
  941. // scaledShape is specified.
  942. ScalingFunction *ScalingFunction `json:"scalingFunction,omitempty"`
  943. // ForceSendFields is a list of field names (e.g. "Id") to
  944. // unconditionally include in API requests. By default, fields with
  945. // empty values are omitted from API requests. However, any non-pointer,
  946. // non-interface field appearing in ForceSendFields will be sent to the
  947. // server regardless of whether the field is empty or not. This may be
  948. // used to include empty fields in Patch requests.
  949. ForceSendFields []string `json:"-"`
  950. }
  951. func (s *IconStyle) MarshalJSON() ([]byte, error) {
  952. type noMethod IconStyle
  953. raw := noMethod(*s)
  954. return gensupport.MarshalJSON(raw, s.ForceSendFields)
  955. }
  956. // IconsListResponse: The response returned by a call to icons.List.
  957. type IconsListResponse struct {
  958. // Icons: Resources returned.
  959. Icons []*Icon `json:"icons,omitempty"`
  960. // NextPageToken: Next page token.
  961. NextPageToken string `json:"nextPageToken,omitempty"`
  962. // ServerResponse contains the HTTP response code and headers from the
  963. // server.
  964. googleapi.ServerResponse `json:"-"`
  965. // ForceSendFields is a list of field names (e.g. "Icons") to
  966. // unconditionally include in API requests. By default, fields with
  967. // empty values are omitted from API requests. However, any non-pointer,
  968. // non-interface field appearing in ForceSendFields will be sent to the
  969. // server regardless of whether the field is empty or not. This may be
  970. // used to include empty fields in Patch requests.
  971. ForceSendFields []string `json:"-"`
  972. }
  973. func (s *IconsListResponse) MarshalJSON() ([]byte, error) {
  974. type noMethod IconsListResponse
  975. raw := noMethod(*s)
  976. return gensupport.MarshalJSON(raw, s.ForceSendFields)
  977. }
  978. // LabelStyle: Text label style.
  979. type LabelStyle struct {
  980. // Color: Color of the text. If not provided, default to black.
  981. Color string `json:"color,omitempty"`
  982. // Column: The column value of the feature to be displayed.
  983. Column string `json:"column,omitempty"`
  984. // FontStyle: Font style of the label, defaults to 'normal'.
  985. //
  986. // Possible values:
  987. // "italic"
  988. // "normal"
  989. FontStyle string `json:"fontStyle,omitempty"`
  990. // FontWeight: Font weight of the label, defaults to 'normal'.
  991. //
  992. // Possible values:
  993. // "bold"
  994. // "normal"
  995. FontWeight string `json:"fontWeight,omitempty"`
  996. // Opacity: Opacity of the text.
  997. Opacity float64 `json:"opacity,omitempty"`
  998. // Outline: Outline color of the text.
  999. Outline *Color `json:"outline,omitempty"`
  1000. // Size: Font size of the label, in pixels. 8 <= size <= 15. If not
  1001. // provided, a default size will be provided.
  1002. Size float64 `json:"size,omitempty"`
  1003. // ForceSendFields is a list of field names (e.g. "Color") to
  1004. // unconditionally include in API requests. By default, fields with
  1005. // empty values are omitted from API requests. However, any non-pointer,
  1006. // non-interface field appearing in ForceSendFields will be sent to the
  1007. // server regardless of whether the field is empty or not. This may be
  1008. // used to include empty fields in Patch requests.
  1009. ForceSendFields []string `json:"-"`
  1010. }
  1011. func (s *LabelStyle) MarshalJSON() ([]byte, error) {
  1012. type noMethod LabelStyle
  1013. raw := noMethod(*s)
  1014. return gensupport.MarshalJSON(raw, s.ForceSendFields)
  1015. }
  1016. // Layer: A Layer combines multiple datasources, with styling
  1017. // information, for presentation on a map.
  1018. type Layer struct {
  1019. // Bbox: A rectangular bounding box which contains all of the data in
  1020. // this Layer. The box is expressed as \"west, south, east, north\". The
  1021. // numbers represent latitude and longitude in decimal degrees.
  1022. Bbox []float64 `json:"bbox,omitempty"`
  1023. // CreationTime: The creation time of this layer. The value is an RFC
  1024. // 3339 formatted date-time value (e.g. 1970-01-01T00:00:00Z).
  1025. CreationTime string `json:"creationTime,omitempty"`
  1026. // CreatorEmail: The email address of the creator of this layer. This is
  1027. // only returned on GET requests and not LIST requests.
  1028. CreatorEmail string `json:"creatorEmail,omitempty"`
  1029. // DatasourceType: Deprecated: The type of the datasources used to build
  1030. // this Layer. Note: This has been replaced by layerType, but is still
  1031. // available for now to maintain backward compatibility.
  1032. //
  1033. // Possible values:
  1034. // "image"
  1035. // "table"
  1036. DatasourceType string `json:"datasourceType,omitempty"`
  1037. // Datasources: An array of datasources used to build this layer. If
  1038. // layerType is "image", or layerType is not specified and
  1039. // datasourceType is "image", then each element in this array is a
  1040. // reference to an Image or RasterCollection. If layerType is "vector",
  1041. // or layerType is not specified and datasourceType is "table" then each
  1042. // element in this array is a reference to a Vector Table.
  1043. Datasources []*Datasource `json:"datasources,omitempty"`
  1044. // Description: The description of this Layer, supplied by the author.
  1045. Description string `json:"description,omitempty"`
  1046. // DraftAccessList: Deprecated: The name of an access list of the Map
  1047. // Editor type. The user on whose behalf the request is being sent must
  1048. // be an editor on that access list. Note: Google Maps Engine no longer
  1049. // uses access lists. Instead, each asset has its own list of
  1050. // permissions. For backward compatibility, the API still accepts access
  1051. // lists for projects that are already using access lists. If you
  1052. // created a GME account/project after July 14th, 2014, you will not be
  1053. // able to send API requests that include access lists. Note: This is an
  1054. // input field only. It is not returned in response to a list or get
  1055. // request.
  1056. DraftAccessList string `json:"draftAccessList,omitempty"`
  1057. // Etag: The ETag, used to refer to the current version of the asset.
  1058. Etag string `json:"etag,omitempty"`
  1059. // Id: A globally unique ID, used to refer to this Layer.
  1060. Id string `json:"id,omitempty"`
  1061. // LastModifiedTime: The last modified time of this layer. The value is
  1062. // an RFC 3339 formatted date-time value (e.g. 1970-01-01T00:00:00Z).
  1063. LastModifiedTime string `json:"lastModifiedTime,omitempty"`
  1064. // LastModifierEmail: The email address of the last modifier of this
  1065. // layer. This is only returned on GET requests and not LIST requests.
  1066. LastModifierEmail string `json:"lastModifierEmail,omitempty"`
  1067. // LayerType: The type of the datasources used to build this Layer. This
  1068. // should be used instead of datasourceType. At least one of layerType
  1069. // and datasourceType and must be specified, but layerType takes
  1070. // precedence.
  1071. //
  1072. // Possible values:
  1073. // "image"
  1074. // "vector"
  1075. LayerType string `json:"layerType,omitempty"`
  1076. // Name: The name of this Layer, supplied by the author.
  1077. Name string `json:"name,omitempty"`
  1078. // ProcessingStatus: The processing status of this layer.
  1079. //
  1080. // Possible values:
  1081. // "complete"
  1082. // "failed"
  1083. // "notReady"
  1084. // "processing"
  1085. // "ready"
  1086. ProcessingStatus string `json:"processingStatus,omitempty"`
  1087. // ProjectId: The ID of the project that this Layer is in.
  1088. ProjectId string `json:"projectId,omitempty"`
  1089. // PublishedAccessList: Deprecated: The access list to whom view
  1090. // permissions are granted. The value must be the name of a Maps Engine
  1091. // access list of the Map Viewer type, and the user must be a viewer on
  1092. // that list. Note: Google Maps Engine no longer uses access lists.
  1093. // Instead, each asset has its own list of permissions. For backward
  1094. // compatibility, the API still accepts access lists for projects that
  1095. // are already using access lists. If you created a GME account/project
  1096. // after July 14th, 2014, you will not be able to send API requests that
  1097. // include access lists. Note: This is an input field only. It is not
  1098. // returned in response to a list or get request.
  1099. PublishedAccessList string `json:"publishedAccessList,omitempty"`
  1100. // PublishingStatus: The publishing status of this layer.
  1101. //
  1102. // Possible values:
  1103. // "notPublished"
  1104. // "published"
  1105. PublishingStatus string `json:"publishingStatus,omitempty"`
  1106. // Style: The styling information for a vector layer. Note: Style
  1107. // information is returned in response to a get request but not a list
  1108. // request. After requesting a list of layers, you'll need to send a get
  1109. // request to retrieve the VectorStyles for each layer.
  1110. Style *VectorStyle `json:"style,omitempty"`
  1111. // Tags: Tags of this Layer.
  1112. Tags []string `json:"tags,omitempty"`
  1113. // WritersCanEditPermissions: If true, WRITERs of the asset are able to
  1114. // edit the asset permissions.
  1115. WritersCanEditPermissions bool `json:"writersCanEditPermissions,omitempty"`
  1116. // ServerResponse contains the HTTP response code and headers from the
  1117. // server.
  1118. googleapi.ServerResponse `json:"-"`
  1119. // ForceSendFields is a list of field names (e.g. "Bbox") to
  1120. // unconditionally include in API requests. By default, fields with
  1121. // empty values are omitted from API requests. However, any non-pointer,
  1122. // non-interface field appearing in ForceSendFields will be sent to the
  1123. // server regardless of whether the field is empty or not. This may be
  1124. // used to include empty fields in Patch requests.
  1125. ForceSendFields []string `json:"-"`
  1126. }
  1127. func (s *Layer) MarshalJSON() ([]byte, error) {
  1128. type noMethod Layer
  1129. raw := noMethod(*s)
  1130. return gensupport.MarshalJSON(raw, s.ForceSendFields)
  1131. }
  1132. // LayersListResponse: The response returned by a call to layers.List.
  1133. // Note: The list response does not include all the fields available in
  1134. // a layer. Refer to the layer resource description for details of the
  1135. // fields that are not included. You'll need to send a get request to
  1136. // retrieve the additional fields for each layer.
  1137. type LayersListResponse struct {
  1138. // Layers: Resources returned.
  1139. Layers []*Layer `json:"layers,omitempty"`
  1140. // NextPageToken: Next page token.
  1141. NextPageToken string `json:"nextPageToken,omitempty"`
  1142. // ServerResponse contains the HTTP response code and headers from the
  1143. // server.
  1144. googleapi.ServerResponse `json:"-"`
  1145. // ForceSendFields is a list of field names (e.g. "Layers") to
  1146. // unconditionally include in API requests. By default, fields with
  1147. // empty values are omitted from API requests. However, any non-pointer,
  1148. // non-interface field appearing in ForceSendFields will be sent to the
  1149. // server regardless of whether the field is empty or not. This may be
  1150. // used to include empty fields in Patch requests.
  1151. ForceSendFields []string `json:"-"`
  1152. }
  1153. func (s *LayersListResponse) MarshalJSON() ([]byte, error) {
  1154. type noMethod LayersListResponse
  1155. raw := noMethod(*s)
  1156. return gensupport.MarshalJSON(raw, s.ForceSendFields)
  1157. }
  1158. // LineStyle: Style for lines.
  1159. type LineStyle struct {
  1160. // Border: Border of the line. 0 < border.width <= 5.
  1161. Border *Border `json:"border,omitempty"`
  1162. // Dash: Dash defines the pattern of the line, the values are pixel
  1163. // lengths of alternating dash and gap. If dash is not provided, then it
  1164. // means a solid line. Dash can contain up to 10 values and must contain
  1165. // even number of values.
  1166. Dash []float64 `json:"dash,omitempty"`
  1167. // Label: Label style for the line.
  1168. Label *LabelStyle `json:"label,omitempty"`
  1169. // Stroke: Stroke of the line.
  1170. Stroke *LineStyleStroke `json:"stroke,omitempty"`
  1171. // ForceSendFields is a list of field names (e.g. "Border") to
  1172. // unconditionally include in API requests. By default, fields with
  1173. // empty values are omitted from API requests. However, any non-pointer,
  1174. // non-interface field appearing in ForceSendFields will be sent to the
  1175. // server regardless of whether the field is empty or not. This may be
  1176. // used to include empty fields in Patch requests.
  1177. ForceSendFields []string `json:"-"`
  1178. }
  1179. func (s *LineStyle) MarshalJSON() ([]byte, error) {
  1180. type noMethod LineStyle
  1181. raw := noMethod(*s)
  1182. return gensupport.MarshalJSON(raw, s.ForceSendFields)
  1183. }
  1184. // LineStyleStroke: Stroke of the line.
  1185. type LineStyleStroke struct {
  1186. // Color: Color of the line.
  1187. Color string `json:"color,omitempty"`
  1188. // Opacity: Opacity of the line.
  1189. Opacity float64 `json:"opacity,omitempty"`
  1190. // Width: Width of the line, in pixels. 0 <= width <= 10. If width is
  1191. // set to 0, the line will be invisible.
  1192. Width float64 `json:"width,omitempty"`
  1193. // ForceSendFields is a list of field names (e.g. "Color") to
  1194. // unconditionally include in API requests. By default, fields with
  1195. // empty values are omitted from API requests. However, any non-pointer,
  1196. // non-interface field appearing in ForceSendFields will be sent to the
  1197. // server regardless of whether the field is empty or not. This may be
  1198. // used to include empty fields in Patch requests.
  1199. ForceSendFields []string `json:"-"`
  1200. }
  1201. func (s *LineStyleStroke) MarshalJSON() ([]byte, error) {
  1202. type noMethod LineStyleStroke
  1203. raw := noMethod(*s)
  1204. return gensupport.MarshalJSON(raw, s.ForceSendFields)
  1205. }
  1206. // Map: A Map is a collection of Layers, optionally contained within
  1207. // folders.
  1208. type Map struct {
  1209. // Bbox: A rectangular bounding box which contains all of the data in
  1210. // this Map. The box is expressed as \"west, south, east, north\". The
  1211. // numbers represent latitude and longitude in decimal degrees.
  1212. Bbox []float64 `json:"bbox,omitempty"`
  1213. // Contents: The contents of this Map.
  1214. Contents []MapItem `json:"contents,omitempty"`
  1215. // CreationTime: The creation time of this map. The value is an RFC 3339
  1216. // formatted date-time value (e.g. 1970-01-01T00:00:00Z).
  1217. CreationTime string `json:"creationTime,omitempty"`
  1218. // CreatorEmail: The email address of the creator of this map. This is
  1219. // only returned on GET requests and not LIST requests.
  1220. CreatorEmail string `json:"creatorEmail,omitempty"`
  1221. // DefaultViewport: An array of four numbers (west, south, east, north)
  1222. // which defines the rectangular bounding box of the default viewport.
  1223. // The numbers represent latitude and longitude in decimal degrees.
  1224. DefaultViewport []float64 `json:"defaultViewport,omitempty"`
  1225. // Description: The description of this Map, supplied by the author.
  1226. Description string `json:"description,omitempty"`
  1227. // DraftAccessList: Deprecated: The name of an access list of the Map
  1228. // Editor type. The user on whose behalf the request is being sent must
  1229. // be an editor on that access list. Note: Google Maps Engine no longer
  1230. // uses access lists. Instead, each asset has its own list of
  1231. // permissions. For backward compatibility, the API still accepts access
  1232. // lists for projects that are already using access lists. If you
  1233. // created a GME account/project after July 14th, 2014, you will not be
  1234. // able to send API requests that include access lists. Note: This is an
  1235. // input field only. It is not returned in response to a list or get
  1236. // request.
  1237. DraftAccessList string `json:"draftAccessList,omitempty"`
  1238. // Etag: The ETag, used to refer to the current version of the asset.
  1239. Etag string `json:"etag,omitempty"`
  1240. // Id: A globally unique ID, used to refer to this Map.
  1241. Id string `json:"id,omitempty"`
  1242. // LastModifiedTime: The last modified time of this map. The value is an
  1243. // RFC 3339 formatted date-time value (e.g. 1970-01-01T00:00:00Z).
  1244. LastModifiedTime string `json:"lastModifiedTime,omitempty"`
  1245. // LastModifierEmail: The email address of the last modifier of this
  1246. // map. This is only returned on GET requests and not LIST requests.
  1247. LastModifierEmail string `json:"lastModifierEmail,omitempty"`
  1248. // Name: The name of this Map, supplied by the author.
  1249. Name string `json:"name,omitempty"`
  1250. // ProcessingStatus: The processing status of this map. Map processing
  1251. // is automatically started once a map becomes ready for processing.
  1252. //
  1253. // Possible values:
  1254. // "complete"
  1255. // "failed"
  1256. // "notReady"
  1257. // "processing"
  1258. // "ready"
  1259. ProcessingStatus string `json:"processingStatus,omitempty"`
  1260. // ProjectId: The ID of the project that this Map is in.
  1261. ProjectId string `json:"projectId,omitempty"`
  1262. // PublishedAccessList: Deprecated: The access list to whom view
  1263. // permissions are granted. The value must be the name of a Maps Engine
  1264. // access list of the Map Viewer type, and the user must be a viewer on
  1265. // that list. Note: Google Maps Engine no longer uses access lists.
  1266. // Instead, each asset has its own list of permissions. For backward
  1267. // compatibility, the API still accepts access lists for projects that
  1268. // are already using access lists. If you created a GME account/project
  1269. // after July 14th, 2014, you will not be able to send API requests that
  1270. // include access lists. This is an input field only. It is not returned
  1271. // in response to a list or get request.
  1272. PublishedAccessList string `json:"publishedAccessList,omitempty"`
  1273. // PublishingStatus: The publishing status of this map.
  1274. //
  1275. // Possible values:
  1276. // "notPublished"
  1277. // "published"
  1278. PublishingStatus string `json:"publishingStatus,omitempty"`
  1279. // Tags: Tags of this Map.
  1280. Tags []string `json:"tags,omitempty"`
  1281. // Versions: Deprecated: An array containing the available versions of
  1282. // this Map. Currently may only contain "published". The
  1283. // publishingStatus field should be used instead.
  1284. Versions []string `json:"versions,omitempty"`
  1285. // WritersCanEditPermissions: If true, WRITERs of the asset are able to
  1286. // edit the asset permissions.
  1287. WritersCanEditPermissions bool `json:"writersCanEditPermissions,omitempty"`
  1288. // ServerResponse contains the HTTP response code and headers from the
  1289. // server.
  1290. googleapi.ServerResponse `json:"-"`
  1291. // ForceSendFields is a list of field names (e.g. "Bbox") to
  1292. // unconditionally include in API requests. By default, fields with
  1293. // empty values are omitted from API requests. However, any non-pointer,
  1294. // non-interface field appearing in ForceSendFields will be sent to the
  1295. // server regardless of whether the field is empty or not. This may be
  1296. // used to include empty fields in Patch requests.
  1297. ForceSendFields []string `json:"-"`
  1298. }
  1299. func (s *Map) MarshalJSON() ([]byte, error) {
  1300. type noMethod Map
  1301. raw := noMethod(*s)
  1302. return gensupport.MarshalJSON(raw, s.ForceSendFields)
  1303. }
  1304. type MapFolder struct {
  1305. Contents []MapItem `json:"contents,omitempty"`
  1306. // DefaultViewport: An array of four numbers (west, south, east, north)
  1307. // which defines the rectangular bounding box of the default viewport.
  1308. // The numbers represent latitude and longitude in decimal degrees.
  1309. DefaultViewport []float64 `json:"defaultViewport,omitempty"`
  1310. // Expandable: The expandability setting of this MapFolder. If true, the
  1311. // folder can be expanded.
  1312. Expandable bool `json:"expandable,omitempty"`
  1313. // Key: A user defined alias for this MapFolder, specific to this Map.
  1314. Key string `json:"key,omitempty"`
  1315. // Name: The name of this MapFolder.
  1316. Name string `json:"name,omitempty"`
  1317. // Type: Identifies this object as a MapFolder.
  1318. //
  1319. // Possible values:
  1320. // "folder"
  1321. Type string `json:"type,omitempty"`
  1322. // Visibility: The visibility setting of this MapFolder. One of
  1323. // "defaultOn" or "defaultOff".
  1324. Visibility string `json:"visibility,omitempty"`
  1325. // ForceSendFields is a list of field names (e.g. "Contents") to
  1326. // unconditionally include in API requests. By default, fields with
  1327. // empty values are omitted from API requests. However, any non-pointer,
  1328. // non-interface field appearing in ForceSendFields will be sent to the
  1329. // server regardless of whether the field is empty or not. This may be
  1330. // used to include empty fields in Patch requests.
  1331. ForceSendFields []string `json:"-"`
  1332. }
  1333. func (s *MapFolder) MarshalJSON() ([]byte, error) {
  1334. type noMethod MapFolder
  1335. raw := noMethod(*s)
  1336. return gensupport.MarshalJSON(raw, s.ForceSendFields)
  1337. }
  1338. type MapItem map[string]interface{}
  1339. func (t MapItem) Type() string {
  1340. return googleapi.VariantType(t)
  1341. }
  1342. func (t MapItem) Folder() (r MapFolder, ok bool) {
  1343. if t.Type() != "Folder" {
  1344. return r, false
  1345. }
  1346. ok = googleapi.ConvertVariant(map[string]interface{}(t), &r)
  1347. return r, ok
  1348. }
  1349. func (t MapItem) KmlLink() (r MapKmlLink, ok bool) {
  1350. if t.Type() != "KmlLink" {
  1351. return r, false
  1352. }
  1353. ok = googleapi.ConvertVariant(map[string]interface{}(t), &r)
  1354. return r, ok
  1355. }
  1356. func (t MapItem) Layer() (r MapLayer, ok bool) {
  1357. if t.Type() != "Layer" {
  1358. return r, false
  1359. }
  1360. ok = googleapi.ConvertVariant(map[string]interface{}(t), &r)
  1361. return r, ok
  1362. }
  1363. type MapKmlLink struct {
  1364. // DefaultViewport: An array of four numbers (west, south, east, north)
  1365. // which defines the rectangular bounding box of the default viewport.
  1366. // The numbers represent latitude and longitude in decimal degrees.
  1367. DefaultViewport []float64 `json:"defaultViewport,omitempty"`
  1368. // KmlUrl: The URL to the KML file represented by this MapKmlLink.
  1369. KmlUrl string `json:"kmlUrl,omitempty"`
  1370. // Name: The name of this MapKmlLink.
  1371. Name string `json:"name,omitempty"`
  1372. // Type: Identifies this object as a MapKmlLink.
  1373. //
  1374. // Possible values:
  1375. // "kmlLink"
  1376. Type string `json:"type,omitempty"`
  1377. // Visibility: The visibility setting of this MapKmlLink. One of
  1378. // "defaultOn" or "defaultOff".
  1379. Visibility string `json:"visibility,omitempty"`
  1380. // ForceSendFields is a list of field names (e.g. "DefaultViewport") to
  1381. // unconditionally include in API requests. By default, fields with
  1382. // empty values are omitted from API requests. However, any non-pointer,
  1383. // non-interface field appearing in ForceSendFields will be sent to the
  1384. // server regardless of whether the field is empty or not. This may be
  1385. // used to include empty fields in Patch requests.
  1386. ForceSendFields []string `json:"-"`
  1387. }
  1388. func (s *MapKmlLink) MarshalJSON() ([]byte, error) {
  1389. type noMethod MapKmlLink
  1390. raw := noMethod(*s)
  1391. return gensupport.MarshalJSON(raw, s.ForceSendFields)
  1392. }
  1393. type MapLayer struct {
  1394. // DefaultViewport: An array of four numbers (west, south, east, north)
  1395. // which defines the rectangular bounding box of the default viewport.
  1396. // The numbers represent latitude and longitude in decimal degrees.
  1397. DefaultViewport []float64 `json:"defaultViewport,omitempty"`
  1398. // Id: The ID of this MapLayer. This ID can be used to request more
  1399. // details about the layer.
  1400. Id string `json:"id,omitempty"`
  1401. // Key: A user defined alias for this MapLayer, specific to this Map.
  1402. Key string `json:"key,omitempty"`
  1403. // Name: The name of this MapLayer.
  1404. Name string `json:"name,omitempty"`
  1405. // Type: Identifies this object as a MapLayer.
  1406. //
  1407. // Possible values:
  1408. // "layer"
  1409. Type string `json:"type,omitempty"`
  1410. // Visibility: The visibility setting of this MapLayer. One of
  1411. // "defaultOn" or "defaultOff".
  1412. Visibility string `json:"visibility,omitempty"`
  1413. // ForceSendFields is a list of field names (e.g. "DefaultViewport") to
  1414. // unconditionally include in API requests. By default, fields with
  1415. // empty values are omitted from API requests. However, any non-pointer,
  1416. // non-interface field appearing in ForceSendFields will be sent to the
  1417. // server regardless of whether the field is empty or not. This may be
  1418. // used to include empty fields in Patch requests.
  1419. ForceSendFields []string `json:"-"`
  1420. }
  1421. func (s *MapLayer) MarshalJSON() ([]byte, error) {
  1422. type noMethod MapLayer
  1423. raw := noMethod(*s)
  1424. return gensupport.MarshalJSON(raw, s.ForceSendFields)
  1425. }
  1426. // MapsListResponse: The response returned by a call to maps.List.
  1427. type MapsListResponse struct {
  1428. // Maps: Resources returned.
  1429. Maps []*Map `json:"maps,omitempty"`
  1430. // NextPageToken: Next page token.
  1431. NextPageToken string `json:"nextPageToken,omitempty"`
  1432. // ServerResponse contains the HTTP response code and headers from the
  1433. // server.
  1434. googleapi.ServerResponse `json:"-"`
  1435. // ForceSendFields is a list of field names (e.g. "Maps") to
  1436. // unconditionally include in API requests. By default, fields with
  1437. // empty values are omitted from API requests. However, any non-pointer,
  1438. // non-interface field appearing in ForceSendFields will be sent to the
  1439. // server regardless of whether the field is empty or not. This may be
  1440. // used to include empty fields in Patch requests.
  1441. ForceSendFields []string `json:"-"`
  1442. }
  1443. func (s *MapsListResponse) MarshalJSON() ([]byte, error) {
  1444. type noMethod MapsListResponse
  1445. raw := noMethod(*s)
  1446. return gensupport.MarshalJSON(raw, s.ForceSendFields)
  1447. }
  1448. // Parent: A list of the parents of an asset.
  1449. type Parent struct {
  1450. // Id: The ID of this parent.
  1451. Id string `json:"id,omitempty"`
  1452. // ForceSendFields is a list of field names (e.g. "Id") to
  1453. // unconditionally include in API requests. By default, fields with
  1454. // empty values are omitted from API requests. However, any non-pointer,
  1455. // non-interface field appearing in ForceSendFields will be sent to the
  1456. // server regardless of whether the field is empty or not. This may be
  1457. // used to include empty fields in Patch requests.
  1458. ForceSendFields []string `json:"-"`
  1459. }
  1460. func (s *Parent) MarshalJSON() ([]byte, error) {
  1461. type noMethod Parent
  1462. raw := noMethod(*s)
  1463. return gensupport.MarshalJSON(raw, s.ForceSendFields)
  1464. }
  1465. // ParentsListResponse: The response returned by a call to parents.List.
  1466. type ParentsListResponse struct {
  1467. // NextPageToken: Next page token.
  1468. NextPageToken string `json:"nextPageToken,omitempty"`
  1469. // Parents: The parent assets.
  1470. Parents []*Parent `json:"parents,omitempty"`
  1471. // ServerResponse contains the HTTP response code and headers from the
  1472. // server.
  1473. googleapi.ServerResponse `json:"-"`
  1474. // ForceSendFields is a list of field names (e.g. "NextPageToken") to
  1475. // unconditionally include in API requests. By default, fields with
  1476. // empty values are omitted from API requests. However, any non-pointer,
  1477. // non-interface field appearing in ForceSendFields will be sent to the
  1478. // server regardless of whether the field is empty or not. This may be
  1479. // used to include empty fields in Patch requests.
  1480. ForceSendFields []string `json:"-"`
  1481. }
  1482. func (s *ParentsListResponse) MarshalJSON() ([]byte, error) {
  1483. type noMethod ParentsListResponse
  1484. raw := noMethod(*s)
  1485. return gensupport.MarshalJSON(raw, s.ForceSendFields)
  1486. }
  1487. // Permission: A permission defines the user or group that has access to
  1488. // an asset, and the type of access they have.
  1489. type Permission struct {
  1490. // Discoverable: Indicates whether a public asset is listed and can be
  1491. // found via a web search (value true), or is visible only to people who
  1492. // have a link to the asset (value false).
  1493. Discoverable bool `json:"discoverable,omitempty"`
  1494. // Id: The unique identifier of the permission. This could be the email
  1495. // address of the user or group this permission refers to, or the string
  1496. // "anyone" for public permissions.
  1497. Id string `json:"id,omitempty"`
  1498. // Role: The type of access granted to this user or group.
  1499. //
  1500. // Possible values:
  1501. // "owner"
  1502. // "reader"
  1503. // "viewer"
  1504. // "writer"
  1505. Role string `json:"role,omitempty"`
  1506. // Type: The account type.
  1507. //
  1508. // Possible values:
  1509. // "anyone"
  1510. // "group"
  1511. // "user"
  1512. Type string `json:"type,omitempty"`
  1513. // ForceSendFields is a list of field names (e.g. "Discoverable") 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 *Permission) MarshalJSON() ([]byte, error) {
  1522. type noMethod Permission
  1523. raw := noMethod(*s)
  1524. return gensupport.MarshalJSON(raw, s.ForceSendFields)
  1525. }
  1526. // PermissionsBatchDeleteRequest: The request sent to
  1527. // mapsengine.permissions.batchDelete.
  1528. type PermissionsBatchDeleteRequest struct {
  1529. // Ids: An array of permission ids to be removed. This could be the
  1530. // email address of the user or group this permission refers to, or the
  1531. // string "anyone" for public permissions.
  1532. Ids []string `json:"ids,omitempty"`
  1533. // ForceSendFields is a list of field names (e.g. "Ids") to
  1534. // unconditionally include in API requests. By default, fields with
  1535. // empty values are omitted from API requests. However, any non-pointer,
  1536. // non-interface field appearing in ForceSendFields will be sent to the
  1537. // server regardless of whether the field is empty or not. This may be
  1538. // used to include empty fields in Patch requests.
  1539. ForceSendFields []string `json:"-"`
  1540. }
  1541. func (s *PermissionsBatchDeleteRequest) MarshalJSON() ([]byte, error) {
  1542. type noMethod PermissionsBatchDeleteRequest
  1543. raw := noMethod(*s)
  1544. return gensupport.MarshalJSON(raw, s.ForceSendFields)
  1545. }
  1546. // PermissionsBatchDeleteResponse: The response returned by a call to
  1547. // mapsengine.permissions.batchDelete.
  1548. type PermissionsBatchDeleteResponse struct {
  1549. // ServerResponse contains the HTTP response code and headers from the
  1550. // server.
  1551. googleapi.ServerResponse `json:"-"`
  1552. }
  1553. // PermissionsBatchUpdateRequest: The request sent to
  1554. // mapsengine.permissions.batchUpdate.
  1555. type PermissionsBatchUpdateRequest struct {
  1556. // Permissions: The permissions to be inserted or updated.
  1557. Permissions []*Permission `json:"permissions,omitempty"`
  1558. // ForceSendFields is a list of field names (e.g. "Permissions") to
  1559. // unconditionally include in API requests. By default, fields with
  1560. // empty values are omitted from API requests. However, any non-pointer,
  1561. // non-interface field appearing in ForceSendFields will be sent to the
  1562. // server regardless of whether the field is empty or not. This may be
  1563. // used to include empty fields in Patch requests.
  1564. ForceSendFields []string `json:"-"`
  1565. }
  1566. func (s *PermissionsBatchUpdateRequest) MarshalJSON() ([]byte, error) {
  1567. type noMethod PermissionsBatchUpdateRequest
  1568. raw := noMethod(*s)
  1569. return gensupport.MarshalJSON(raw, s.ForceSendFields)
  1570. }
  1571. // PermissionsBatchUpdateResponse: The response returned by a call to
  1572. // mapsengine.permissions.batchUpdate.
  1573. type PermissionsBatchUpdateResponse struct {
  1574. // ServerResponse contains the HTTP response code and headers from the
  1575. // server.
  1576. googleapi.ServerResponse `json:"-"`
  1577. }
  1578. type PermissionsListResponse struct {
  1579. // Permissions: The set of permissions associated with this asset.
  1580. Permissions []*Permission `json:"permissions,omitempty"`
  1581. // ServerResponse contains the HTTP response code and headers from the
  1582. // server.
  1583. googleapi.ServerResponse `json:"-"`
  1584. // ForceSendFields is a list of field names (e.g. "Permissions") to
  1585. // unconditionally include in API requests. By default, fields with
  1586. // empty values are omitted from API requests. However, any non-pointer,
  1587. // non-interface field appearing in ForceSendFields will be sent to the
  1588. // server regardless of whether the field is empty or not. This may be
  1589. // used to include empty fields in Patch requests.
  1590. ForceSendFields []string `json:"-"`
  1591. }
  1592. func (s *PermissionsListResponse) MarshalJSON() ([]byte, error) {
  1593. type noMethod PermissionsListResponse
  1594. raw := noMethod(*s)
  1595. return gensupport.MarshalJSON(raw, s.ForceSendFields)
  1596. }
  1597. // PointStyle: Style for points.
  1598. type PointStyle struct {
  1599. // Icon: Icon for the point; if it isn't null, exactly one of 'name',
  1600. // 'id' or 'scaledShape' must be set.
  1601. Icon *IconStyle `json:"icon,omitempty"`
  1602. // Label: Label style for the point.
  1603. Label *LabelStyle `json:"label,omitempty"`
  1604. // ForceSendFields is a list of field names (e.g. "Icon") to
  1605. // unconditionally include in API requests. By default, fields with
  1606. // empty values are omitted from API requests. However, any non-pointer,
  1607. // non-interface field appearing in ForceSendFields will be sent to the
  1608. // server regardless of whether the field is empty or not. This may be
  1609. // used to include empty fields in Patch requests.
  1610. ForceSendFields []string `json:"-"`
  1611. }
  1612. func (s *PointStyle) MarshalJSON() ([]byte, error) {
  1613. type noMethod PointStyle
  1614. raw := noMethod(*s)
  1615. return gensupport.MarshalJSON(raw, s.ForceSendFields)
  1616. }
  1617. // PolygonStyle: Style for polygons.
  1618. type PolygonStyle struct {
  1619. // Fill: Fill color of the polygon. If not provided, the polygon will be
  1620. // transparent and not visible if there is no border.
  1621. Fill *Color `json:"fill,omitempty"`
  1622. // Label: Label style for the polygon.
  1623. Label *LabelStyle `json:"label,omitempty"`
  1624. // Stroke: Border of the polygon. 0 < border.width <= 10.
  1625. Stroke *Border `json:"stroke,omitempty"`
  1626. // ForceSendFields is a list of field names (e.g. "Fill") to
  1627. // unconditionally include in API requests. By default, fields with
  1628. // empty values are omitted from API requests. However, any non-pointer,
  1629. // non-interface field appearing in ForceSendFields will be sent to the
  1630. // server regardless of whether the field is empty or not. This may be
  1631. // used to include empty fields in Patch requests.
  1632. ForceSendFields []string `json:"-"`
  1633. }
  1634. func (s *PolygonStyle) MarshalJSON() ([]byte, error) {
  1635. type noMethod PolygonStyle
  1636. raw := noMethod(*s)
  1637. return gensupport.MarshalJSON(raw, s.ForceSendFields)
  1638. }
  1639. // ProcessResponse: The response returned by a call to any asset's
  1640. // Process method.
  1641. type ProcessResponse struct {
  1642. // ServerResponse contains the HTTP response code and headers from the
  1643. // server.
  1644. googleapi.ServerResponse `json:"-"`
  1645. }
  1646. // Project: A Maps Engine project groups a collection of resources.
  1647. type Project struct {
  1648. // Id: An ID used to refer to this Maps Engine project.
  1649. Id string `json:"id,omitempty"`
  1650. // Name: A user provided name for this Maps Engine project.
  1651. Name string `json:"name,omitempty"`
  1652. // ForceSendFields is a list of field names (e.g. "Id") to
  1653. // unconditionally include in API requests. By default, fields with
  1654. // empty values are omitted from API requests. However, any non-pointer,
  1655. // non-interface field appearing in ForceSendFields will be sent to the
  1656. // server regardless of whether the field is empty or not. This may be
  1657. // used to include empty fields in Patch requests.
  1658. ForceSendFields []string `json:"-"`
  1659. }
  1660. func (s *Project) MarshalJSON() ([]byte, error) {
  1661. type noMethod Project
  1662. raw := noMethod(*s)
  1663. return gensupport.MarshalJSON(raw, s.ForceSendFields)
  1664. }
  1665. // ProjectsListResponse: The response returned by a call to
  1666. // projects.List.
  1667. type ProjectsListResponse struct {
  1668. // Projects: Projects returned.
  1669. Projects []*Project `json:"projects,omitempty"`
  1670. // ServerResponse contains the HTTP response code and headers from the
  1671. // server.
  1672. googleapi.ServerResponse `json:"-"`
  1673. // ForceSendFields is a list of field names (e.g. "Projects") to
  1674. // unconditionally include in API requests. By default, fields with
  1675. // empty values are omitted from API requests. However, any non-pointer,
  1676. // non-interface field appearing in ForceSendFields will be sent to the
  1677. // server regardless of whether the field is empty or not. This may be
  1678. // used to include empty fields in Patch requests.
  1679. ForceSendFields []string `json:"-"`
  1680. }
  1681. func (s *ProjectsListResponse) MarshalJSON() ([]byte, error) {
  1682. type noMethod ProjectsListResponse
  1683. raw := noMethod(*s)
  1684. return gensupport.MarshalJSON(raw, s.ForceSendFields)
  1685. }
  1686. // PublishResponse: The response returned by a call to any asset's
  1687. // Publish method.
  1688. type PublishResponse struct {
  1689. // ServerResponse contains the HTTP response code and headers from the
  1690. // server.
  1691. googleapi.ServerResponse `json:"-"`
  1692. }
  1693. // PublishedLayer: The published version of a layer.
  1694. type PublishedLayer struct {
  1695. // Description: The description of this Layer, supplied by the author.
  1696. Description string `json:"description,omitempty"`
  1697. // Id: A globally unique ID, used to refer to this Layer.
  1698. Id string `json:"id,omitempty"`
  1699. // LayerType: The type of the datasources used to build this Layer. This
  1700. // should be used instead of datasourceType. At least one of layerType
  1701. // and datasourceType and must be specified, but layerType takes
  1702. // precedence.
  1703. //
  1704. // Possible values:
  1705. // "image"
  1706. // "vector"
  1707. LayerType string `json:"layerType,omitempty"`
  1708. // Name: The name of this Layer, supplied by the author.
  1709. Name string `json:"name,omitempty"`
  1710. // ProjectId: The ID of the project that this Layer is in.
  1711. ProjectId string `json:"projectId,omitempty"`
  1712. // ServerResponse contains the HTTP response code and headers from the
  1713. // server.
  1714. googleapi.ServerResponse `json:"-"`
  1715. // ForceSendFields is a list of field names (e.g. "Description") to
  1716. // unconditionally include in API requests. By default, fields with
  1717. // empty values are omitted from API requests. However, any non-pointer,
  1718. // non-interface field appearing in ForceSendFields will be sent to the
  1719. // server regardless of whether the field is empty or not. This may be
  1720. // used to include empty fields in Patch requests.
  1721. ForceSendFields []string `json:"-"`
  1722. }
  1723. func (s *PublishedLayer) MarshalJSON() ([]byte, error) {
  1724. type noMethod PublishedLayer
  1725. raw := noMethod(*s)
  1726. return gensupport.MarshalJSON(raw, s.ForceSendFields)
  1727. }
  1728. // PublishedLayersListResponse: The response returned by a call to
  1729. // layers.List.published.
  1730. type PublishedLayersListResponse struct {
  1731. // Layers: Resources returned.
  1732. Layers []*PublishedLayer `json:"layers,omitempty"`
  1733. // NextPageToken: Next page token.
  1734. NextPageToken string `json:"nextPageToken,omitempty"`
  1735. // ServerResponse contains the HTTP response code and headers from the
  1736. // server.
  1737. googleapi.ServerResponse `json:"-"`
  1738. // ForceSendFields is a list of field names (e.g. "Layers") to
  1739. // unconditionally include in API requests. By default, fields with
  1740. // empty values are omitted from API requests. However, any non-pointer,
  1741. // non-interface field appearing in ForceSendFields will be sent to the
  1742. // server regardless of whether the field is empty or not. This may be
  1743. // used to include empty fields in Patch requests.
  1744. ForceSendFields []string `json:"-"`
  1745. }
  1746. func (s *PublishedLayersListResponse) MarshalJSON() ([]byte, error) {
  1747. type noMethod PublishedLayersListResponse
  1748. raw := noMethod(*s)
  1749. return gensupport.MarshalJSON(raw, s.ForceSendFields)
  1750. }
  1751. // PublishedMap: The published version of a map asset.
  1752. type PublishedMap struct {
  1753. // Contents: The contents of this Map.
  1754. Contents []MapItem `json:"contents,omitempty"`
  1755. // DefaultViewport: An array of four numbers (west, south, east, north)
  1756. // which defines the rectangular bounding box of the default viewport.
  1757. // The numbers represent latitude and longitude in decimal degrees.
  1758. DefaultViewport []float64 `json:"defaultViewport,omitempty"`
  1759. // Description: The description of this Map, supplied by the author.
  1760. Description string `json:"description,omitempty"`
  1761. // Id: A globally unique ID, used to refer to this Map.
  1762. Id string `json:"id,omitempty"`
  1763. // Name: The name of this Map, supplied by the author.
  1764. Name string `json:"name,omitempty"`
  1765. // ProjectId: The ID of the project that this Map is in.
  1766. ProjectId string `json:"projectId,omitempty"`
  1767. // ServerResponse contains the HTTP response code and headers from the
  1768. // server.
  1769. googleapi.ServerResponse `json:"-"`
  1770. // ForceSendFields is a list of field names (e.g. "Contents") to
  1771. // unconditionally include in API requests. By default, fields with
  1772. // empty values are omitted from API requests. However, any non-pointer,
  1773. // non-interface field appearing in ForceSendFields will be sent to the
  1774. // server regardless of whether the field is empty or not. This may be
  1775. // used to include empty fields in Patch requests.
  1776. ForceSendFields []string `json:"-"`
  1777. }
  1778. func (s *PublishedMap) MarshalJSON() ([]byte, error) {
  1779. type noMethod PublishedMap
  1780. raw := noMethod(*s)
  1781. return gensupport.MarshalJSON(raw, s.ForceSendFields)
  1782. }
  1783. // PublishedMapsListResponse: The response returned by a call to
  1784. // maps.List.published.
  1785. type PublishedMapsListResponse struct {
  1786. // Maps: Resources returned.
  1787. Maps []*PublishedMap `json:"maps,omitempty"`
  1788. // NextPageToken: Next page token.
  1789. NextPageToken string `json:"nextPageToken,omitempty"`
  1790. // ServerResponse contains the HTTP response code and headers from the
  1791. // server.
  1792. googleapi.ServerResponse `json:"-"`
  1793. // ForceSendFields is a list of field names (e.g. "Maps") to
  1794. // unconditionally include in API requests. By default, fields with
  1795. // empty values are omitted from API requests. However, any non-pointer,
  1796. // non-interface field appearing in ForceSendFields will be sent to the
  1797. // server regardless of whether the field is empty or not. This may be
  1798. // used to include empty fields in Patch requests.
  1799. ForceSendFields []string `json:"-"`
  1800. }
  1801. func (s *PublishedMapsListResponse) MarshalJSON() ([]byte, error) {
  1802. type noMethod PublishedMapsListResponse
  1803. raw := noMethod(*s)
  1804. return gensupport.MarshalJSON(raw, s.ForceSendFields)
  1805. }
  1806. // Raster: A geo-referenced raster.
  1807. type Raster struct {
  1808. // AcquisitionTime: The acquisition time of this Raster.
  1809. AcquisitionTime *AcquisitionTime `json:"acquisitionTime,omitempty"`
  1810. // Attribution: The name of the attribution to be used for this Raster.
  1811. Attribution string `json:"attribution,omitempty"`
  1812. // Bbox: A rectangular bounding box which contains all of the data in
  1813. // this Raster. The box is expressed as \"west, south, east, north\".
  1814. // The numbers represent latitudes and longitudes in decimal degrees.
  1815. Bbox []float64 `json:"bbox,omitempty"`
  1816. // CreationTime: The creation time of this raster. The value is an RFC
  1817. // 3339 formatted date-time value (e.g. 1970-01-01T00:00:00Z).
  1818. CreationTime string `json:"creationTime,omitempty"`
  1819. // CreatorEmail: The email address of the creator of this raster. This
  1820. // is only returned on GET requests and not LIST requests.
  1821. CreatorEmail string `json:"creatorEmail,omitempty"`
  1822. // Description: The description of this Raster, supplied by the author.
  1823. Description string `json:"description,omitempty"`
  1824. // DraftAccessList: Deprecated: The name of an access list of the Map
  1825. // Editor type. The user on whose behalf the request is being sent must
  1826. // be an editor on that access list. Note: Google Maps Engine no longer
  1827. // uses access lists. Instead, each asset has its own list of
  1828. // permissions. For backward compatibility, the API still accepts access
  1829. // lists for projects that are already using access lists. If you
  1830. // created a GME account/project after July 14th, 2014, you will not be
  1831. // able to send API requests that include access lists. Note: This is an
  1832. // input field only. It is not returned in response to a list or get
  1833. // request.
  1834. DraftAccessList string `json:"draftAccessList,omitempty"`
  1835. // Etag: The ETag, used to refer to the current version of the asset.
  1836. Etag string `json:"etag,omitempty"`
  1837. // Files: The files associated with this Raster.
  1838. Files []*File `json:"files,omitempty"`
  1839. // Id: A globally unique ID, used to refer to this Raster.
  1840. Id string `json:"id,omitempty"`
  1841. // LastModifiedTime: The last modified time of this raster. The value is
  1842. // an RFC 3339 formatted date-time value (e.g. 1970-01-01T00:00:00Z).
  1843. LastModifiedTime string `json:"lastModifiedTime,omitempty"`
  1844. // LastModifierEmail: The email address of the last modifier of this
  1845. // raster. This is only returned on GET requests and not LIST requests.
  1846. LastModifierEmail string `json:"lastModifierEmail,omitempty"`
  1847. // MaskType: The mask processing type of this Raster.
  1848. MaskType string `json:"maskType,omitempty"`
  1849. // Name: The name of this Raster, supplied by the author.
  1850. Name string `json:"name,omitempty"`
  1851. // ProcessingStatus: The processing status of this Raster.
  1852. //
  1853. // Possible values:
  1854. // "complete"
  1855. // "failed"
  1856. // "notReady"
  1857. // "processing"
  1858. // "ready"
  1859. ProcessingStatus string `json:"processingStatus,omitempty"`
  1860. // ProjectId: The ID of the project that this Raster is in.
  1861. ProjectId string `json:"projectId,omitempty"`
  1862. // RasterType: The type of this Raster. Always "image" today.
  1863. //
  1864. // Possible values:
  1865. // "image"
  1866. RasterType string `json:"rasterType,omitempty"`
  1867. // Tags: Tags of this Raster.
  1868. Tags []string `json:"tags,omitempty"`
  1869. // WritersCanEditPermissions: If true, WRITERs of the asset are able to
  1870. // edit the asset permissions.
  1871. WritersCanEditPermissions bool `json:"writersCanEditPermissions,omitempty"`
  1872. // ServerResponse contains the HTTP response code and headers from the
  1873. // server.
  1874. googleapi.ServerResponse `json:"-"`
  1875. // ForceSendFields is a list of field names (e.g. "AcquisitionTime") to
  1876. // unconditionally include in API requests. By default, fields with
  1877. // empty values are omitted from API requests. However, any non-pointer,
  1878. // non-interface field appearing in ForceSendFields will be sent to the
  1879. // server regardless of whether the field is empty or not. This may be
  1880. // used to include empty fields in Patch requests.
  1881. ForceSendFields []string `json:"-"`
  1882. }
  1883. func (s *Raster) MarshalJSON() ([]byte, error) {
  1884. type noMethod Raster
  1885. raw := noMethod(*s)
  1886. return gensupport.MarshalJSON(raw, s.ForceSendFields)
  1887. }
  1888. // RasterCollection: A raster collection groups multiple Raster
  1889. // resources for inclusion in a Layer.
  1890. type RasterCollection struct {
  1891. // Attribution: The name of the attribution to be used for this
  1892. // RasterCollection. Note: Attribution is returned in response to a get
  1893. // request but not a list request. After requesting a list of raster
  1894. // collections, you'll need to send a get request to retrieve the
  1895. // attribution for each raster collection.
  1896. Attribution string `json:"attribution,omitempty"`
  1897. // Bbox: A rectangular bounding box which contains all of the data in
  1898. // this RasterCollection. The box is expressed as \"west, south, east,
  1899. // north\". The numbers represent latitude and longitude in decimal
  1900. // degrees.
  1901. Bbox []float64 `json:"bbox,omitempty"`
  1902. // CreationTime: The creation time of this RasterCollection. The value
  1903. // is an RFC 3339 formatted date-time value (e.g. 1970-01-01T00:00:00Z).
  1904. CreationTime string `json:"creationTime,omitempty"`
  1905. // CreatorEmail: The email address of the creator of this raster
  1906. // collection. This is only returned on GET requests and not LIST
  1907. // requests.
  1908. CreatorEmail string `json:"creatorEmail,omitempty"`
  1909. // Description: The description of this RasterCollection, supplied by
  1910. // the author.
  1911. Description string `json:"description,omitempty"`
  1912. // DraftAccessList: Deprecated: The name of an access list of the Map
  1913. // Editor type. The user on whose behalf the request is being sent must
  1914. // be an editor on that access list. Note: Google Maps Engine no longer
  1915. // uses access lists. Instead, each asset has its own list of
  1916. // permissions. For backward compatibility, the API still accepts access
  1917. // lists for projects that are already using access lists. If you
  1918. // created a GME account/project after July 14th, 2014, you will not be
  1919. // able to send API requests that include access lists. Note: This is an
  1920. // input field only. It is not returned in response to a list or get
  1921. // request.
  1922. DraftAccessList string `json:"draftAccessList,omitempty"`
  1923. // Etag: The ETag, used to refer to the current version of the asset.
  1924. Etag string `json:"etag,omitempty"`
  1925. // Id: A globally unique ID, used to refer to this RasterCollection.
  1926. Id string `json:"id,omitempty"`
  1927. // LastModifiedTime: The last modified time of this RasterCollection.
  1928. // The value is an RFC 3339 formatted date-time value (e.g.
  1929. // 1970-01-01T00:00:00Z).
  1930. LastModifiedTime string `json:"lastModifiedTime,omitempty"`
  1931. // LastModifierEmail: The email address of the last modifier of this
  1932. // raster collection. This is only returned on GET requests and not LIST
  1933. // requests.
  1934. LastModifierEmail string `json:"lastModifierEmail,omitempty"`
  1935. // Mosaic: True if this RasterCollection is a mosaic.
  1936. Mosaic bool `json:"mosaic,omitempty"`
  1937. // Name: The name of this RasterCollection, supplied by the author.
  1938. Name string `json:"name,omitempty"`
  1939. // ProcessingStatus: The processing status of this RasterCollection.
  1940. //
  1941. // Possible values:
  1942. // "complete"
  1943. // "failed"
  1944. // "notReady"
  1945. // "processing"
  1946. // "ready"
  1947. ProcessingStatus string `json:"processingStatus,omitempty"`
  1948. // ProjectId: The ID of the project that this RasterCollection is in.
  1949. ProjectId string `json:"projectId,omitempty"`
  1950. // RasterType: The type of rasters contained within this
  1951. // RasterCollection.
  1952. //
  1953. // Possible values:
  1954. // "image"
  1955. RasterType string `json:"rasterType,omitempty"`
  1956. // Tags: Tags of this RasterCollection.
  1957. Tags []string `json:"tags,omitempty"`
  1958. // WritersCanEditPermissions: If true, WRITERs of the asset are able to
  1959. // edit the asset permissions.
  1960. WritersCanEditPermissions bool `json:"writersCanEditPermissions,omitempty"`
  1961. // ServerResponse contains the HTTP response code and headers from the
  1962. // server.
  1963. googleapi.ServerResponse `json:"-"`
  1964. // ForceSendFields is a list of field names (e.g. "Attribution") to
  1965. // unconditionally include in API requests. By default, fields with
  1966. // empty values are omitted from API requests. However, any non-pointer,
  1967. // non-interface field appearing in ForceSendFields will be sent to the
  1968. // server regardless of whether the field is empty or not. This may be
  1969. // used to include empty fields in Patch requests.
  1970. ForceSendFields []string `json:"-"`
  1971. }
  1972. func (s *RasterCollection) MarshalJSON() ([]byte, error) {
  1973. type noMethod RasterCollection
  1974. raw := noMethod(*s)
  1975. return gensupport.MarshalJSON(raw, s.ForceSendFields)
  1976. }
  1977. // RasterCollectionsListResponse: The response returned by a call to
  1978. // raster_collections.List. Note: The list response does not include all
  1979. // the fields available in a raster collection. Refer to the
  1980. // RasterCollection resource description for details of the fields that
  1981. // are not included. You'll need to send a get request to retrieve the
  1982. // additional fields for each raster collection.
  1983. type RasterCollectionsListResponse struct {
  1984. // NextPageToken: Next page token.
  1985. NextPageToken string `json:"nextPageToken,omitempty"`
  1986. // RasterCollections: Resources returned.
  1987. RasterCollections []*RasterCollection `json:"rasterCollections,omitempty"`
  1988. // ServerResponse contains the HTTP response code and headers from the
  1989. // server.
  1990. googleapi.ServerResponse `json:"-"`
  1991. // ForceSendFields is a list of field names (e.g. "NextPageToken") to
  1992. // unconditionally include in API requests. By default, fields with
  1993. // empty values are omitted from API requests. However, any non-pointer,
  1994. // non-interface field appearing in ForceSendFields will be sent to the
  1995. // server regardless of whether the field is empty or not. This may be
  1996. // used to include empty fields in Patch requests.
  1997. ForceSendFields []string `json:"-"`
  1998. }
  1999. func (s *RasterCollectionsListResponse) MarshalJSON() ([]byte, error) {
  2000. type noMethod RasterCollectionsListResponse
  2001. raw := noMethod(*s)
  2002. return gensupport.MarshalJSON(raw, s.ForceSendFields)
  2003. }
  2004. // RasterCollectionsRaster: A raster resource.
  2005. type RasterCollectionsRaster struct {
  2006. // Bbox: A rectangular bounding box which contains all of the data in
  2007. // this Raster. The box is expressed as \"west, south, east, north\".
  2008. // The numbers represent latitudes and longitudes in decimal degrees.
  2009. Bbox []float64 `json:"bbox,omitempty"`
  2010. // CreationTime: The creation time of this raster. The value is an RFC
  2011. // 3339 formatted date-time value (e.g. 1970-01-01T00:00:00Z).
  2012. CreationTime string `json:"creationTime,omitempty"`
  2013. // Description: The description of this Raster, supplied by the author.
  2014. Description string `json:"description,omitempty"`
  2015. // Id: A globally unique ID, used to refer to this Raster.
  2016. Id string `json:"id,omitempty"`
  2017. // LastModifiedTime: The last modified time of this raster. The value is
  2018. // an RFC 3339 formatted date-time value (e.g. 1970-01-01T00:00:00Z).
  2019. LastModifiedTime string `json:"lastModifiedTime,omitempty"`
  2020. // Name: The name of this Raster, supplied by the author.
  2021. Name string `json:"name,omitempty"`
  2022. // ProjectId: The ID of the project that this Raster is in.
  2023. ProjectId string `json:"projectId,omitempty"`
  2024. // RasterType: The type of this Raster. Always "image" today.
  2025. RasterType string `json:"rasterType,omitempty"`
  2026. // Tags: Tags of this Raster.
  2027. Tags []string `json:"tags,omitempty"`
  2028. // ForceSendFields is a list of field names (e.g. "Bbox") to
  2029. // unconditionally include in API requests. By default, fields with
  2030. // empty values are omitted from API requests. However, any non-pointer,
  2031. // non-interface field appearing in ForceSendFields will be sent to the
  2032. // server regardless of whether the field is empty or not. This may be
  2033. // used to include empty fields in Patch requests.
  2034. ForceSendFields []string `json:"-"`
  2035. }
  2036. func (s *RasterCollectionsRaster) MarshalJSON() ([]byte, error) {
  2037. type noMethod RasterCollectionsRaster
  2038. raw := noMethod(*s)
  2039. return gensupport.MarshalJSON(raw, s.ForceSendFields)
  2040. }
  2041. // RasterCollectionsRasterBatchDeleteRequest: The request sent to
  2042. // rasterCollections.Rasters.BatchDelete.
  2043. type RasterCollectionsRasterBatchDeleteRequest struct {
  2044. // Ids: An array of Raster asset IDs to be removed from this
  2045. // RasterCollection.
  2046. Ids []string `json:"ids,omitempty"`
  2047. // ForceSendFields is a list of field names (e.g. "Ids") to
  2048. // unconditionally include in API requests. By default, fields with
  2049. // empty values are omitted from API requests. However, any non-pointer,
  2050. // non-interface field appearing in ForceSendFields will be sent to the
  2051. // server regardless of whether the field is empty or not. This may be
  2052. // used to include empty fields in Patch requests.
  2053. ForceSendFields []string `json:"-"`
  2054. }
  2055. func (s *RasterCollectionsRasterBatchDeleteRequest) MarshalJSON() ([]byte, error) {
  2056. type noMethod RasterCollectionsRasterBatchDeleteRequest
  2057. raw := noMethod(*s)
  2058. return gensupport.MarshalJSON(raw, s.ForceSendFields)
  2059. }
  2060. // RasterCollectionsRastersBatchDeleteResponse: The response returned by
  2061. // a call to rasterCollections.rasters.batchDelete.
  2062. type RasterCollectionsRastersBatchDeleteResponse struct {
  2063. // ServerResponse contains the HTTP response code and headers from the
  2064. // server.
  2065. googleapi.ServerResponse `json:"-"`
  2066. }
  2067. // RasterCollectionsRastersBatchInsertRequest: The request sent to
  2068. // rasterCollections.Rasters.BatchInsert.
  2069. type RasterCollectionsRastersBatchInsertRequest struct {
  2070. // Ids: An array of Raster asset IDs to be added to this
  2071. // RasterCollection.
  2072. Ids []string `json:"ids,omitempty"`
  2073. // ForceSendFields is a list of field names (e.g. "Ids") to
  2074. // unconditionally include in API requests. By default, fields with
  2075. // empty values are omitted from API requests. However, any non-pointer,
  2076. // non-interface field appearing in ForceSendFields will be sent to the
  2077. // server regardless of whether the field is empty or not. This may be
  2078. // used to include empty fields in Patch requests.
  2079. ForceSendFields []string `json:"-"`
  2080. }
  2081. func (s *RasterCollectionsRastersBatchInsertRequest) MarshalJSON() ([]byte, error) {
  2082. type noMethod RasterCollectionsRastersBatchInsertRequest
  2083. raw := noMethod(*s)
  2084. return gensupport.MarshalJSON(raw, s.ForceSendFields)
  2085. }
  2086. // RasterCollectionsRastersBatchInsertResponse: The response returned by
  2087. // a call to rasterCollections.rasters.batchInsert.
  2088. type RasterCollectionsRastersBatchInsertResponse struct {
  2089. // ServerResponse contains the HTTP response code and headers from the
  2090. // server.
  2091. googleapi.ServerResponse `json:"-"`
  2092. }
  2093. // RasterCollectionsRastersListResponse: The response returned by a call
  2094. // to rasterCollections.rasters.List.
  2095. type RasterCollectionsRastersListResponse struct {
  2096. // NextPageToken: Next page token.
  2097. NextPageToken string `json:"nextPageToken,omitempty"`
  2098. // Rasters: Resources returned.
  2099. Rasters []*RasterCollectionsRaster `json:"rasters,omitempty"`
  2100. // ServerResponse contains the HTTP response code and headers from the
  2101. // server.
  2102. googleapi.ServerResponse `json:"-"`
  2103. // ForceSendFields is a list of field names (e.g. "NextPageToken") to
  2104. // unconditionally include in API requests. By default, fields with
  2105. // empty values are omitted from API requests. However, any non-pointer,
  2106. // non-interface field appearing in ForceSendFields will be sent to the
  2107. // server regardless of whether the field is empty or not. This may be
  2108. // used to include empty fields in Patch requests.
  2109. ForceSendFields []string `json:"-"`
  2110. }
  2111. func (s *RasterCollectionsRastersListResponse) MarshalJSON() ([]byte, error) {
  2112. type noMethod RasterCollectionsRastersListResponse
  2113. raw := noMethod(*s)
  2114. return gensupport.MarshalJSON(raw, s.ForceSendFields)
  2115. }
  2116. // RastersListResponse: The response returned by a call to rasters.List.
  2117. type RastersListResponse struct {
  2118. // NextPageToken: Next page token.
  2119. NextPageToken string `json:"nextPageToken,omitempty"`
  2120. // Rasters: Resources returned.
  2121. Rasters []*Raster `json:"rasters,omitempty"`
  2122. // ServerResponse contains the HTTP response code and headers from the
  2123. // server.
  2124. googleapi.ServerResponse `json:"-"`
  2125. // ForceSendFields is a list of field names (e.g. "NextPageToken") to
  2126. // unconditionally include in API requests. By default, fields with
  2127. // empty values are omitted from API requests. However, any non-pointer,
  2128. // non-interface field appearing in ForceSendFields will be sent to the
  2129. // server regardless of whether the field is empty or not. This may be
  2130. // used to include empty fields in Patch requests.
  2131. ForceSendFields []string `json:"-"`
  2132. }
  2133. func (s *RastersListResponse) MarshalJSON() ([]byte, error) {
  2134. type noMethod RastersListResponse
  2135. raw := noMethod(*s)
  2136. return gensupport.MarshalJSON(raw, s.ForceSendFields)
  2137. }
  2138. // ScaledShape: Parameters for styling points as scaled shapes.
  2139. type ScaledShape struct {
  2140. // Border: Border color/width of the shape. If not specified the shape
  2141. // won't have a border.
  2142. Border *Border `json:"border,omitempty"`
  2143. // Fill: The fill color of the shape. If not specified the shape will be
  2144. // transparent (although the borders may not be).
  2145. Fill *Color `json:"fill,omitempty"`
  2146. // Shape: Name of the shape.
  2147. //
  2148. // Possible values:
  2149. // "circle"
  2150. Shape string `json:"shape,omitempty"`
  2151. // ForceSendFields is a list of field names (e.g. "Border") to
  2152. // unconditionally include in API requests. By default, fields with
  2153. // empty values are omitted from API requests. However, any non-pointer,
  2154. // non-interface field appearing in ForceSendFields will be sent to the
  2155. // server regardless of whether the field is empty or not. This may be
  2156. // used to include empty fields in Patch requests.
  2157. ForceSendFields []string `json:"-"`
  2158. }
  2159. func (s *ScaledShape) MarshalJSON() ([]byte, error) {
  2160. type noMethod ScaledShape
  2161. raw := noMethod(*s)
  2162. return gensupport.MarshalJSON(raw, s.ForceSendFields)
  2163. }
  2164. // ScalingFunction: Parameters for scaling scaled shapes.
  2165. type ScalingFunction struct {
  2166. // Column: Name of the numeric column used to scale a shape.
  2167. Column string `json:"column,omitempty"`
  2168. // ScalingType: The type of scaling function to use. Defaults to SQRT.
  2169. // Currently only linear and square root scaling are supported.
  2170. //
  2171. // Possible values:
  2172. // "linear"
  2173. // "sqrt"
  2174. ScalingType string `json:"scalingType,omitempty"`
  2175. // SizeRange: The range of shape sizes, in pixels. For circles, the size
  2176. // corresponds to the diameter.
  2177. SizeRange *SizeRange `json:"sizeRange,omitempty"`
  2178. // ValueRange: The range of values to display across the size range.
  2179. ValueRange *ValueRange `json:"valueRange,omitempty"`
  2180. // ForceSendFields is a list of field names (e.g. "Column") to
  2181. // unconditionally include in API requests. By default, fields with
  2182. // empty values are omitted from API requests. However, any non-pointer,
  2183. // non-interface field appearing in ForceSendFields will be sent to the
  2184. // server regardless of whether the field is empty or not. This may be
  2185. // used to include empty fields in Patch requests.
  2186. ForceSendFields []string `json:"-"`
  2187. }
  2188. func (s *ScalingFunction) MarshalJSON() ([]byte, error) {
  2189. type noMethod ScalingFunction
  2190. raw := noMethod(*s)
  2191. return gensupport.MarshalJSON(raw, s.ForceSendFields)
  2192. }
  2193. // Schema: A schema indicating the properties which may be associated
  2194. // with features within a Table, and the types of those properties.
  2195. type Schema struct {
  2196. // Columns: An array of TableColumn objects. The first object in the
  2197. // array must be named geometry and be of type points, lineStrings,
  2198. // polygons, or mixedGeometry.
  2199. Columns []*TableColumn `json:"columns,omitempty"`
  2200. // PrimaryGeometry: The name of the column that contains a feature's
  2201. // geometry. This field can be omitted during table create; Google Maps
  2202. // Engine supports only a single geometry column, which must be named
  2203. // geometry and be the first object in the columns array.
  2204. PrimaryGeometry string `json:"primaryGeometry,omitempty"`
  2205. // PrimaryKey: The name of the column that contains the unique
  2206. // identifier of a Feature.
  2207. PrimaryKey string `json:"primaryKey,omitempty"`
  2208. // ForceSendFields is a list of field names (e.g. "Columns") to
  2209. // unconditionally include in API requests. By default, fields with
  2210. // empty values are omitted from API requests. However, any non-pointer,
  2211. // non-interface field appearing in ForceSendFields will be sent to the
  2212. // server regardless of whether the field is empty or not. This may be
  2213. // used to include empty fields in Patch requests.
  2214. ForceSendFields []string `json:"-"`
  2215. }
  2216. func (s *Schema) MarshalJSON() ([]byte, error) {
  2217. type noMethod Schema
  2218. raw := noMethod(*s)
  2219. return gensupport.MarshalJSON(raw, s.ForceSendFields)
  2220. }
  2221. // SizeRange: Scaled shape size range in pixels. For circles, size
  2222. // corresponds to diameter.
  2223. type SizeRange struct {
  2224. // Max: Maximum size, in pixels.
  2225. Max float64 `json:"max,omitempty"`
  2226. // Min: Minimum size, in pixels.
  2227. Min float64 `json:"min,omitempty"`
  2228. // ForceSendFields is a list of field names (e.g. "Max") to
  2229. // unconditionally include in API requests. By default, fields with
  2230. // empty values are omitted from API requests. However, any non-pointer,
  2231. // non-interface field appearing in ForceSendFields will be sent to the
  2232. // server regardless of whether the field is empty or not. This may be
  2233. // used to include empty fields in Patch requests.
  2234. ForceSendFields []string `json:"-"`
  2235. }
  2236. func (s *SizeRange) MarshalJSON() ([]byte, error) {
  2237. type noMethod SizeRange
  2238. raw := noMethod(*s)
  2239. return gensupport.MarshalJSON(raw, s.ForceSendFields)
  2240. }
  2241. // Table: A collection of geographic features, and associated metadata.
  2242. type Table struct {
  2243. // Bbox: A rectangular bounding box which contains all of the data in
  2244. // this Table. The box is expressed as \"west, south, east, north\". The
  2245. // numbers represent latitude and longitude in decimal degrees.
  2246. Bbox []float64 `json:"bbox,omitempty"`
  2247. // CreationTime: The creation time of this table. The value is an RFC
  2248. // 3339 formatted date-time value (e.g. 1970-01-01T00:00:00Z).
  2249. CreationTime string `json:"creationTime,omitempty"`
  2250. // CreatorEmail: The email address of the creator of this table. This is
  2251. // only returned on GET requests and not LIST requests.
  2252. CreatorEmail string `json:"creatorEmail,omitempty"`
  2253. // Description: The description of this table, supplied by the author.
  2254. Description string `json:"description,omitempty"`
  2255. // DraftAccessList: Deprecated: The name of an access list of the Map
  2256. // Editor type. The user on whose behalf the request is being sent must
  2257. // be an editor on that access list. Note: Google Maps Engine no longer
  2258. // uses access lists. Instead, each asset has its own list of
  2259. // permissions. For backward compatibility, the API still accepts access
  2260. // lists for projects that are already using access lists. If you
  2261. // created a GME account/project after July 14th, 2014, you will not be
  2262. // able to send API requests that include access lists. Note: This is an
  2263. // input field only. It is not returned in response to a list or get
  2264. // request.
  2265. DraftAccessList string `json:"draftAccessList,omitempty"`
  2266. // Etag: The ETag, used to refer to the current version of the asset.
  2267. Etag string `json:"etag,omitempty"`
  2268. // Files: The files associated with this table.
  2269. Files []*File `json:"files,omitempty"`
  2270. // Id: A globally unique ID, used to refer to this table.
  2271. Id string `json:"id,omitempty"`
  2272. // LastModifiedTime: The last modified time of this table. The value is
  2273. // an RFC 3339 formatted date-time value (e.g. 1970-01-01T00:00:00Z).
  2274. LastModifiedTime string `json:"lastModifiedTime,omitempty"`
  2275. // LastModifierEmail: The email address of the last modifier of this
  2276. // table. This is only returned on GET requests and not LIST requests.
  2277. LastModifierEmail string `json:"lastModifierEmail,omitempty"`
  2278. // Name: The name of this table, supplied by the author.
  2279. Name string `json:"name,omitempty"`
  2280. // ProcessingStatus: The processing status of this table.
  2281. //
  2282. // Possible values:
  2283. // "complete"
  2284. // "failed"
  2285. // "notReady"
  2286. // "processing"
  2287. // "ready"
  2288. ProcessingStatus string `json:"processingStatus,omitempty"`
  2289. // ProjectId: The ID of the project to which the table belongs.
  2290. ProjectId string `json:"projectId,omitempty"`
  2291. // PublishedAccessList: Deprecated: The access list to whom view
  2292. // permissions are granted. The value must be the name of a Maps Engine
  2293. // access list of the Map Viewer type, and the user must be a viewer on
  2294. // that list. Note: Google Maps Engine no longer uses access lists.
  2295. // Instead, each asset has its own list of permissions. For backward
  2296. // compatibility, the API still accepts access lists for projects that
  2297. // are already using access lists. If you created a GME account/project
  2298. // after July 14th, 2014, you will not be able to send API requests that
  2299. // include access lists. Note: This is an input field only. It is not
  2300. // returned in response to a list or get request.
  2301. PublishedAccessList string `json:"publishedAccessList,omitempty"`
  2302. // Schema: The schema for this table. Note: The schema is returned in
  2303. // response to a get request but not a list request. After requesting a
  2304. // list of tables, you'll need to send a get request to retrieve the
  2305. // schema for each table.
  2306. Schema *Schema `json:"schema,omitempty"`
  2307. // SourceEncoding: Encoding of the uploaded files. Valid values include
  2308. // UTF-8, CP1251, ISO 8859-1, and Shift_JIS.
  2309. SourceEncoding string `json:"sourceEncoding,omitempty"`
  2310. // Tags: An array of text strings, with each string representing a tag.
  2311. // More information about tags can be found in the Tagging data article
  2312. // of the Maps Engine help center.
  2313. Tags []string `json:"tags,omitempty"`
  2314. // WritersCanEditPermissions: If true, WRITERs of the asset are able to
  2315. // edit the asset permissions.
  2316. WritersCanEditPermissions bool `json:"writersCanEditPermissions,omitempty"`
  2317. // ServerResponse contains the HTTP response code and headers from the
  2318. // server.
  2319. googleapi.ServerResponse `json:"-"`
  2320. // ForceSendFields is a list of field names (e.g. "Bbox") to
  2321. // unconditionally include in API requests. By default, fields with
  2322. // empty values are omitted from API requests. However, any non-pointer,
  2323. // non-interface field appearing in ForceSendFields will be sent to the
  2324. // server regardless of whether the field is empty or not. This may be
  2325. // used to include empty fields in Patch requests.
  2326. ForceSendFields []string `json:"-"`
  2327. }
  2328. func (s *Table) MarshalJSON() ([]byte, error) {
  2329. type noMethod Table
  2330. raw := noMethod(*s)
  2331. return gensupport.MarshalJSON(raw, s.ForceSendFields)
  2332. }
  2333. type TableColumn struct {
  2334. // Name: The column name.
  2335. Name string `json:"name,omitempty"`
  2336. // Type: The type of data stored in this column.
  2337. //
  2338. // Possible values:
  2339. // "datetime"
  2340. // "double"
  2341. // "integer"
  2342. // "lineStrings"
  2343. // "mixedGeometry"
  2344. // "points"
  2345. // "polygons"
  2346. // "string"
  2347. Type string `json:"type,omitempty"`
  2348. // ForceSendFields is a list of field names (e.g. "Name") to
  2349. // unconditionally include in API requests. By default, fields with
  2350. // empty values are omitted from API requests. However, any non-pointer,
  2351. // non-interface field appearing in ForceSendFields will be sent to the
  2352. // server regardless of whether the field is empty or not. This may be
  2353. // used to include empty fields in Patch requests.
  2354. ForceSendFields []string `json:"-"`
  2355. }
  2356. func (s *TableColumn) MarshalJSON() ([]byte, error) {
  2357. type noMethod TableColumn
  2358. raw := noMethod(*s)
  2359. return gensupport.MarshalJSON(raw, s.ForceSendFields)
  2360. }
  2361. // TablesListResponse: The response returned by a call to tables.List.
  2362. // Note: The list response does not include all the fields available in
  2363. // a table. Refer to the table resource description for details of the
  2364. // fields that are not included. You'll need to send a get request to
  2365. // retrieve the additional fields for each table.
  2366. type TablesListResponse struct {
  2367. // NextPageToken: Next page token.
  2368. NextPageToken string `json:"nextPageToken,omitempty"`
  2369. // Tables: Resources returned.
  2370. Tables []*Table `json:"tables,omitempty"`
  2371. // ServerResponse contains the HTTP response code and headers from the
  2372. // server.
  2373. googleapi.ServerResponse `json:"-"`
  2374. // ForceSendFields is a list of field names (e.g. "NextPageToken") to
  2375. // unconditionally include in API requests. By default, fields with
  2376. // empty values are omitted from API requests. However, any non-pointer,
  2377. // non-interface field appearing in ForceSendFields will be sent to the
  2378. // server regardless of whether the field is empty or not. This may be
  2379. // used to include empty fields in Patch requests.
  2380. ForceSendFields []string `json:"-"`
  2381. }
  2382. func (s *TablesListResponse) MarshalJSON() ([]byte, error) {
  2383. type noMethod TablesListResponse
  2384. raw := noMethod(*s)
  2385. return gensupport.MarshalJSON(raw, s.ForceSendFields)
  2386. }
  2387. // ValueRange: Range of values used for scaling shapes. The min/max
  2388. // values will be drawn as shapes with the min/max size.
  2389. type ValueRange struct {
  2390. // Max: Maximum value.
  2391. Max float64 `json:"max,omitempty"`
  2392. // Min: Minimum value.
  2393. Min float64 `json:"min,omitempty"`
  2394. // ForceSendFields is a list of field names (e.g. "Max") to
  2395. // unconditionally include in API requests. By default, fields with
  2396. // empty values are omitted from API requests. However, any non-pointer,
  2397. // non-interface field appearing in ForceSendFields will be sent to the
  2398. // server regardless of whether the field is empty or not. This may be
  2399. // used to include empty fields in Patch requests.
  2400. ForceSendFields []string `json:"-"`
  2401. }
  2402. func (s *ValueRange) MarshalJSON() ([]byte, error) {
  2403. type noMethod ValueRange
  2404. raw := noMethod(*s)
  2405. return gensupport.MarshalJSON(raw, s.ForceSendFields)
  2406. }
  2407. // VectorStyle: A vector style contains styling information for vector
  2408. // layer.
  2409. type VectorStyle struct {
  2410. DisplayRules []*DisplayRule `json:"displayRules,omitempty"`
  2411. // FeatureInfo: Individual feature info, this is called Info Window in
  2412. // Maps Engine UI. If not provided, a default template with all
  2413. // attributes will be generated.
  2414. FeatureInfo *FeatureInfo `json:"featureInfo,omitempty"`
  2415. // Type: The type of the vector style. Currently, only displayRule is
  2416. // supported.
  2417. //
  2418. // Possible values:
  2419. // "displayRule"
  2420. Type string `json:"type,omitempty"`
  2421. // ForceSendFields is a list of field names (e.g. "DisplayRules") to
  2422. // unconditionally include in API requests. By default, fields with
  2423. // empty values are omitted from API requests. However, any non-pointer,
  2424. // non-interface field appearing in ForceSendFields will be sent to the
  2425. // server regardless of whether the field is empty or not. This may be
  2426. // used to include empty fields in Patch requests.
  2427. ForceSendFields []string `json:"-"`
  2428. }
  2429. func (s *VectorStyle) MarshalJSON() ([]byte, error) {
  2430. type noMethod VectorStyle
  2431. raw := noMethod(*s)
  2432. return gensupport.MarshalJSON(raw, s.ForceSendFields)
  2433. }
  2434. // ZoomLevels: Zoom level range. Zoom levels are restricted between 0
  2435. // and 24, inclusive.
  2436. type ZoomLevels struct {
  2437. // Max: Maximum zoom level.
  2438. Max int64 `json:"max,omitempty"`
  2439. // Min: Minimum zoom level.
  2440. Min int64 `json:"min,omitempty"`
  2441. // ForceSendFields is a list of field names (e.g. "Max") to
  2442. // unconditionally include in API requests. By default, fields with
  2443. // empty values are omitted from API requests. However, any non-pointer,
  2444. // non-interface field appearing in ForceSendFields will be sent to the
  2445. // server regardless of whether the field is empty or not. This may be
  2446. // used to include empty fields in Patch requests.
  2447. ForceSendFields []string `json:"-"`
  2448. }
  2449. func (s *ZoomLevels) MarshalJSON() ([]byte, error) {
  2450. type noMethod ZoomLevels
  2451. raw := noMethod(*s)
  2452. return gensupport.MarshalJSON(raw, s.ForceSendFields)
  2453. }
  2454. // method id "mapsengine.assets.get":
  2455. type AssetsGetCall struct {
  2456. s *Service
  2457. id string
  2458. urlParams_ gensupport.URLParams
  2459. ifNoneMatch_ string
  2460. ctx_ context.Context
  2461. }
  2462. // Get: Return metadata for a particular asset.
  2463. func (r *AssetsService) Get(id string) *AssetsGetCall {
  2464. c := &AssetsGetCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  2465. c.id = id
  2466. return c
  2467. }
  2468. // Fields allows partial responses to be retrieved. See
  2469. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  2470. // for more information.
  2471. func (c *AssetsGetCall) Fields(s ...googleapi.Field) *AssetsGetCall {
  2472. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  2473. return c
  2474. }
  2475. // IfNoneMatch sets the optional parameter which makes the operation
  2476. // fail if the object's ETag matches the given value. This is useful for
  2477. // getting updates only after the object has changed since the last
  2478. // request. Use googleapi.IsNotModified to check whether the response
  2479. // error from Do is the result of In-None-Match.
  2480. func (c *AssetsGetCall) IfNoneMatch(entityTag string) *AssetsGetCall {
  2481. c.ifNoneMatch_ = entityTag
  2482. return c
  2483. }
  2484. // Context sets the context to be used in this call's Do method. Any
  2485. // pending HTTP request will be aborted if the provided context is
  2486. // canceled.
  2487. func (c *AssetsGetCall) Context(ctx context.Context) *AssetsGetCall {
  2488. c.ctx_ = ctx
  2489. return c
  2490. }
  2491. func (c *AssetsGetCall) doRequest(alt string) (*http.Response, error) {
  2492. var body io.Reader = nil
  2493. c.urlParams_.Set("alt", alt)
  2494. urls := googleapi.ResolveRelative(c.s.BasePath, "assets/{id}")
  2495. urls += "?" + c.urlParams_.Encode()
  2496. req, _ := http.NewRequest("GET", urls, body)
  2497. googleapi.Expand(req.URL, map[string]string{
  2498. "id": c.id,
  2499. })
  2500. req.Header.Set("User-Agent", c.s.userAgent())
  2501. if c.ifNoneMatch_ != "" {
  2502. req.Header.Set("If-None-Match", c.ifNoneMatch_)
  2503. }
  2504. if c.ctx_ != nil {
  2505. return ctxhttp.Do(c.ctx_, c.s.client, req)
  2506. }
  2507. return c.s.client.Do(req)
  2508. }
  2509. // Do executes the "mapsengine.assets.get" call.
  2510. // Exactly one of *Asset or error will be non-nil. Any non-2xx status
  2511. // code is an error. Response headers are in either
  2512. // *Asset.ServerResponse.Header or (if a response was returned at all)
  2513. // in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to
  2514. // check whether the returned error was because http.StatusNotModified
  2515. // was returned.
  2516. func (c *AssetsGetCall) Do(opts ...googleapi.CallOption) (*Asset, error) {
  2517. gensupport.SetOptions(c.urlParams_, opts...)
  2518. res, err := c.doRequest("json")
  2519. if res != nil && res.StatusCode == http.StatusNotModified {
  2520. if res.Body != nil {
  2521. res.Body.Close()
  2522. }
  2523. return nil, &googleapi.Error{
  2524. Code: res.StatusCode,
  2525. Header: res.Header,
  2526. }
  2527. }
  2528. if err != nil {
  2529. return nil, err
  2530. }
  2531. defer googleapi.CloseBody(res)
  2532. if err := googleapi.CheckResponse(res); err != nil {
  2533. return nil, err
  2534. }
  2535. ret := &Asset{
  2536. ServerResponse: googleapi.ServerResponse{
  2537. Header: res.Header,
  2538. HTTPStatusCode: res.StatusCode,
  2539. },
  2540. }
  2541. if err := json.NewDecoder(res.Body).Decode(&ret); err != nil {
  2542. return nil, err
  2543. }
  2544. return ret, nil
  2545. // {
  2546. // "description": "Return metadata for a particular asset.",
  2547. // "httpMethod": "GET",
  2548. // "id": "mapsengine.assets.get",
  2549. // "parameterOrder": [
  2550. // "id"
  2551. // ],
  2552. // "parameters": {
  2553. // "id": {
  2554. // "description": "The ID of the asset.",
  2555. // "location": "path",
  2556. // "required": true,
  2557. // "type": "string"
  2558. // }
  2559. // },
  2560. // "path": "assets/{id}",
  2561. // "response": {
  2562. // "$ref": "Asset"
  2563. // },
  2564. // "scopes": [
  2565. // "https://www.googleapis.com/auth/mapsengine",
  2566. // "https://www.googleapis.com/auth/mapsengine.readonly"
  2567. // ]
  2568. // }
  2569. }
  2570. // method id "mapsengine.assets.list":
  2571. type AssetsListCall struct {
  2572. s *Service
  2573. urlParams_ gensupport.URLParams
  2574. ifNoneMatch_ string
  2575. ctx_ context.Context
  2576. }
  2577. // List: Return all assets readable by the current user.
  2578. func (r *AssetsService) List() *AssetsListCall {
  2579. c := &AssetsListCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  2580. return c
  2581. }
  2582. // Bbox sets the optional parameter "bbox": A bounding box, expressed as
  2583. // "west,south,east,north". If set, only assets which intersect this
  2584. // bounding box will be returned.
  2585. func (c *AssetsListCall) Bbox(bbox string) *AssetsListCall {
  2586. c.urlParams_.Set("bbox", bbox)
  2587. return c
  2588. }
  2589. // CreatedAfter sets the optional parameter "createdAfter": An RFC 3339
  2590. // formatted date-time value (e.g. 1970-01-01T00:00:00Z). Returned
  2591. // assets will have been created at or after this time.
  2592. func (c *AssetsListCall) CreatedAfter(createdAfter string) *AssetsListCall {
  2593. c.urlParams_.Set("createdAfter", createdAfter)
  2594. return c
  2595. }
  2596. // CreatedBefore sets the optional parameter "createdBefore": An RFC
  2597. // 3339 formatted date-time value (e.g. 1970-01-01T00:00:00Z). Returned
  2598. // assets will have been created at or before this time.
  2599. func (c *AssetsListCall) CreatedBefore(createdBefore string) *AssetsListCall {
  2600. c.urlParams_.Set("createdBefore", createdBefore)
  2601. return c
  2602. }
  2603. // CreatorEmail sets the optional parameter "creatorEmail": An email
  2604. // address representing a user. Returned assets that have been created
  2605. // by the user associated with the provided email address.
  2606. func (c *AssetsListCall) CreatorEmail(creatorEmail string) *AssetsListCall {
  2607. c.urlParams_.Set("creatorEmail", creatorEmail)
  2608. return c
  2609. }
  2610. // MaxResults sets the optional parameter "maxResults": The maximum
  2611. // number of items to include in a single response page. The maximum
  2612. // supported value is 100.
  2613. func (c *AssetsListCall) MaxResults(maxResults int64) *AssetsListCall {
  2614. c.urlParams_.Set("maxResults", fmt.Sprint(maxResults))
  2615. return c
  2616. }
  2617. // ModifiedAfter sets the optional parameter "modifiedAfter": An RFC
  2618. // 3339 formatted date-time value (e.g. 1970-01-01T00:00:00Z). Returned
  2619. // assets will have been modified at or after this time.
  2620. func (c *AssetsListCall) ModifiedAfter(modifiedAfter string) *AssetsListCall {
  2621. c.urlParams_.Set("modifiedAfter", modifiedAfter)
  2622. return c
  2623. }
  2624. // ModifiedBefore sets the optional parameter "modifiedBefore": An RFC
  2625. // 3339 formatted date-time value (e.g. 1970-01-01T00:00:00Z). Returned
  2626. // assets will have been modified at or before this time.
  2627. func (c *AssetsListCall) ModifiedBefore(modifiedBefore string) *AssetsListCall {
  2628. c.urlParams_.Set("modifiedBefore", modifiedBefore)
  2629. return c
  2630. }
  2631. // PageToken sets the optional parameter "pageToken": The continuation
  2632. // token, used to page through large result sets. To get the next page
  2633. // of results, set this parameter to the value of nextPageToken from the
  2634. // previous response.
  2635. func (c *AssetsListCall) PageToken(pageToken string) *AssetsListCall {
  2636. c.urlParams_.Set("pageToken", pageToken)
  2637. return c
  2638. }
  2639. // ProjectId sets the optional parameter "projectId": The ID of a Maps
  2640. // Engine project, used to filter the response. To list all available
  2641. // projects with their IDs, send a Projects: list request. You can also
  2642. // find your project ID as the value of the DashboardPlace:cid URL
  2643. // parameter when signed in to mapsengine.google.com.
  2644. func (c *AssetsListCall) ProjectId(projectId string) *AssetsListCall {
  2645. c.urlParams_.Set("projectId", projectId)
  2646. return c
  2647. }
  2648. // Role sets the optional parameter "role": The role parameter indicates
  2649. // that the response should only contain assets where the current user
  2650. // has the specified level of access.
  2651. //
  2652. // Possible values:
  2653. // "owner" - The user can read, write and administer the asset.
  2654. // "reader" - The user can read the asset.
  2655. // "writer" - The user can read and write the asset.
  2656. func (c *AssetsListCall) Role(role string) *AssetsListCall {
  2657. c.urlParams_.Set("role", role)
  2658. return c
  2659. }
  2660. // Search sets the optional parameter "search": An unstructured search
  2661. // string used to filter the set of results based on asset metadata.
  2662. func (c *AssetsListCall) Search(search string) *AssetsListCall {
  2663. c.urlParams_.Set("search", search)
  2664. return c
  2665. }
  2666. // Tags sets the optional parameter "tags": A comma separated list of
  2667. // tags. Returned assets will contain all the tags from the list.
  2668. func (c *AssetsListCall) Tags(tags string) *AssetsListCall {
  2669. c.urlParams_.Set("tags", tags)
  2670. return c
  2671. }
  2672. // Type sets the optional parameter "type": A comma separated list of
  2673. // asset types. Returned assets will have one of the types from the
  2674. // provided list. Supported values are 'map', 'layer',
  2675. // 'rasterCollection' and 'table'.
  2676. func (c *AssetsListCall) Type(type_ string) *AssetsListCall {
  2677. c.urlParams_.Set("type", type_)
  2678. return c
  2679. }
  2680. // Fields allows partial responses to be retrieved. See
  2681. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  2682. // for more information.
  2683. func (c *AssetsListCall) Fields(s ...googleapi.Field) *AssetsListCall {
  2684. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  2685. return c
  2686. }
  2687. // IfNoneMatch sets the optional parameter which makes the operation
  2688. // fail if the object's ETag matches the given value. This is useful for
  2689. // getting updates only after the object has changed since the last
  2690. // request. Use googleapi.IsNotModified to check whether the response
  2691. // error from Do is the result of In-None-Match.
  2692. func (c *AssetsListCall) IfNoneMatch(entityTag string) *AssetsListCall {
  2693. c.ifNoneMatch_ = entityTag
  2694. return c
  2695. }
  2696. // Context sets the context to be used in this call's Do method. Any
  2697. // pending HTTP request will be aborted if the provided context is
  2698. // canceled.
  2699. func (c *AssetsListCall) Context(ctx context.Context) *AssetsListCall {
  2700. c.ctx_ = ctx
  2701. return c
  2702. }
  2703. func (c *AssetsListCall) doRequest(alt string) (*http.Response, error) {
  2704. var body io.Reader = nil
  2705. c.urlParams_.Set("alt", alt)
  2706. urls := googleapi.ResolveRelative(c.s.BasePath, "assets")
  2707. urls += "?" + c.urlParams_.Encode()
  2708. req, _ := http.NewRequest("GET", urls, body)
  2709. googleapi.SetOpaque(req.URL)
  2710. req.Header.Set("User-Agent", c.s.userAgent())
  2711. if c.ifNoneMatch_ != "" {
  2712. req.Header.Set("If-None-Match", c.ifNoneMatch_)
  2713. }
  2714. if c.ctx_ != nil {
  2715. return ctxhttp.Do(c.ctx_, c.s.client, req)
  2716. }
  2717. return c.s.client.Do(req)
  2718. }
  2719. // Do executes the "mapsengine.assets.list" call.
  2720. // Exactly one of *AssetsListResponse or error will be non-nil. Any
  2721. // non-2xx status code is an error. Response headers are in either
  2722. // *AssetsListResponse.ServerResponse.Header or (if a response was
  2723. // returned at all) in error.(*googleapi.Error).Header. Use
  2724. // googleapi.IsNotModified to check whether the returned error was
  2725. // because http.StatusNotModified was returned.
  2726. func (c *AssetsListCall) Do(opts ...googleapi.CallOption) (*AssetsListResponse, error) {
  2727. gensupport.SetOptions(c.urlParams_, opts...)
  2728. res, err := c.doRequest("json")
  2729. if res != nil && res.StatusCode == http.StatusNotModified {
  2730. if res.Body != nil {
  2731. res.Body.Close()
  2732. }
  2733. return nil, &googleapi.Error{
  2734. Code: res.StatusCode,
  2735. Header: res.Header,
  2736. }
  2737. }
  2738. if err != nil {
  2739. return nil, err
  2740. }
  2741. defer googleapi.CloseBody(res)
  2742. if err := googleapi.CheckResponse(res); err != nil {
  2743. return nil, err
  2744. }
  2745. ret := &AssetsListResponse{
  2746. ServerResponse: googleapi.ServerResponse{
  2747. Header: res.Header,
  2748. HTTPStatusCode: res.StatusCode,
  2749. },
  2750. }
  2751. if err := json.NewDecoder(res.Body).Decode(&ret); err != nil {
  2752. return nil, err
  2753. }
  2754. return ret, nil
  2755. // {
  2756. // "description": "Return all assets readable by the current user.",
  2757. // "httpMethod": "GET",
  2758. // "id": "mapsengine.assets.list",
  2759. // "parameters": {
  2760. // "bbox": {
  2761. // "description": "A bounding box, expressed as \"west,south,east,north\". If set, only assets which intersect this bounding box will be returned.",
  2762. // "location": "query",
  2763. // "type": "string"
  2764. // },
  2765. // "createdAfter": {
  2766. // "description": "An RFC 3339 formatted date-time value (e.g. 1970-01-01T00:00:00Z). Returned assets will have been created at or after this time.",
  2767. // "format": "date-time",
  2768. // "location": "query",
  2769. // "type": "string"
  2770. // },
  2771. // "createdBefore": {
  2772. // "description": "An RFC 3339 formatted date-time value (e.g. 1970-01-01T00:00:00Z). Returned assets will have been created at or before this time.",
  2773. // "format": "date-time",
  2774. // "location": "query",
  2775. // "type": "string"
  2776. // },
  2777. // "creatorEmail": {
  2778. // "description": "An email address representing a user. Returned assets that have been created by the user associated with the provided email address.",
  2779. // "location": "query",
  2780. // "type": "string"
  2781. // },
  2782. // "maxResults": {
  2783. // "description": "The maximum number of items to include in a single response page. The maximum supported value is 100.",
  2784. // "format": "uint32",
  2785. // "location": "query",
  2786. // "type": "integer"
  2787. // },
  2788. // "modifiedAfter": {
  2789. // "description": "An RFC 3339 formatted date-time value (e.g. 1970-01-01T00:00:00Z). Returned assets will have been modified at or after this time.",
  2790. // "format": "date-time",
  2791. // "location": "query",
  2792. // "type": "string"
  2793. // },
  2794. // "modifiedBefore": {
  2795. // "description": "An RFC 3339 formatted date-time value (e.g. 1970-01-01T00:00:00Z). Returned assets will have been modified at or before this time.",
  2796. // "format": "date-time",
  2797. // "location": "query",
  2798. // "type": "string"
  2799. // },
  2800. // "pageToken": {
  2801. // "description": "The continuation token, used to page through large result sets. To get the next page of results, set this parameter to the value of nextPageToken from the previous response.",
  2802. // "location": "query",
  2803. // "type": "string"
  2804. // },
  2805. // "projectId": {
  2806. // "description": "The ID of a Maps Engine project, used to filter the response. To list all available projects with their IDs, send a Projects: list request. You can also find your project ID as the value of the DashboardPlace:cid URL parameter when signed in to mapsengine.google.com.",
  2807. // "location": "query",
  2808. // "type": "string"
  2809. // },
  2810. // "role": {
  2811. // "description": "The role parameter indicates that the response should only contain assets where the current user has the specified level of access.",
  2812. // "enum": [
  2813. // "owner",
  2814. // "reader",
  2815. // "writer"
  2816. // ],
  2817. // "enumDescriptions": [
  2818. // "The user can read, write and administer the asset.",
  2819. // "The user can read the asset.",
  2820. // "The user can read and write the asset."
  2821. // ],
  2822. // "location": "query",
  2823. // "type": "string"
  2824. // },
  2825. // "search": {
  2826. // "description": "An unstructured search string used to filter the set of results based on asset metadata.",
  2827. // "location": "query",
  2828. // "type": "string"
  2829. // },
  2830. // "tags": {
  2831. // "description": "A comma separated list of tags. Returned assets will contain all the tags from the list.",
  2832. // "location": "query",
  2833. // "type": "string"
  2834. // },
  2835. // "type": {
  2836. // "description": "A comma separated list of asset types. Returned assets will have one of the types from the provided list. Supported values are 'map', 'layer', 'rasterCollection' and 'table'.",
  2837. // "location": "query",
  2838. // "type": "string"
  2839. // }
  2840. // },
  2841. // "path": "assets",
  2842. // "response": {
  2843. // "$ref": "AssetsListResponse"
  2844. // },
  2845. // "scopes": [
  2846. // "https://www.googleapis.com/auth/mapsengine",
  2847. // "https://www.googleapis.com/auth/mapsengine.readonly"
  2848. // ]
  2849. // }
  2850. }
  2851. // Pages invokes f for each page of results.
  2852. // A non-nil error returned from f will halt the iteration.
  2853. // The provided context supersedes any context provided to the Context method.
  2854. func (c *AssetsListCall) Pages(ctx context.Context, f func(*AssetsListResponse) error) error {
  2855. c.ctx_ = ctx
  2856. defer c.PageToken(c.urlParams_.Get("pageToken")) // reset paging to original point
  2857. for {
  2858. x, err := c.Do()
  2859. if err != nil {
  2860. return err
  2861. }
  2862. if err := f(x); err != nil {
  2863. return err
  2864. }
  2865. if x.NextPageToken == "" {
  2866. return nil
  2867. }
  2868. c.PageToken(x.NextPageToken)
  2869. }
  2870. }
  2871. // method id "mapsengine.assets.parents.list":
  2872. type AssetsParentsListCall struct {
  2873. s *Service
  2874. id string
  2875. urlParams_ gensupport.URLParams
  2876. ifNoneMatch_ string
  2877. ctx_ context.Context
  2878. }
  2879. // List: Return all parent ids of the specified asset.
  2880. func (r *AssetsParentsService) List(id string) *AssetsParentsListCall {
  2881. c := &AssetsParentsListCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  2882. c.id = id
  2883. return c
  2884. }
  2885. // MaxResults sets the optional parameter "maxResults": The maximum
  2886. // number of items to include in a single response page. The maximum
  2887. // supported value is 50.
  2888. func (c *AssetsParentsListCall) MaxResults(maxResults int64) *AssetsParentsListCall {
  2889. c.urlParams_.Set("maxResults", fmt.Sprint(maxResults))
  2890. return c
  2891. }
  2892. // PageToken sets the optional parameter "pageToken": The continuation
  2893. // token, used to page through large result sets. To get the next page
  2894. // of results, set this parameter to the value of nextPageToken from the
  2895. // previous response.
  2896. func (c *AssetsParentsListCall) PageToken(pageToken string) *AssetsParentsListCall {
  2897. c.urlParams_.Set("pageToken", pageToken)
  2898. return c
  2899. }
  2900. // Fields allows partial responses to be retrieved. See
  2901. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  2902. // for more information.
  2903. func (c *AssetsParentsListCall) Fields(s ...googleapi.Field) *AssetsParentsListCall {
  2904. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  2905. return c
  2906. }
  2907. // IfNoneMatch sets the optional parameter which makes the operation
  2908. // fail if the object's ETag matches the given value. This is useful for
  2909. // getting updates only after the object has changed since the last
  2910. // request. Use googleapi.IsNotModified to check whether the response
  2911. // error from Do is the result of In-None-Match.
  2912. func (c *AssetsParentsListCall) IfNoneMatch(entityTag string) *AssetsParentsListCall {
  2913. c.ifNoneMatch_ = entityTag
  2914. return c
  2915. }
  2916. // Context sets the context to be used in this call's Do method. Any
  2917. // pending HTTP request will be aborted if the provided context is
  2918. // canceled.
  2919. func (c *AssetsParentsListCall) Context(ctx context.Context) *AssetsParentsListCall {
  2920. c.ctx_ = ctx
  2921. return c
  2922. }
  2923. func (c *AssetsParentsListCall) doRequest(alt string) (*http.Response, error) {
  2924. var body io.Reader = nil
  2925. c.urlParams_.Set("alt", alt)
  2926. urls := googleapi.ResolveRelative(c.s.BasePath, "assets/{id}/parents")
  2927. urls += "?" + c.urlParams_.Encode()
  2928. req, _ := http.NewRequest("GET", urls, body)
  2929. googleapi.Expand(req.URL, map[string]string{
  2930. "id": c.id,
  2931. })
  2932. req.Header.Set("User-Agent", c.s.userAgent())
  2933. if c.ifNoneMatch_ != "" {
  2934. req.Header.Set("If-None-Match", c.ifNoneMatch_)
  2935. }
  2936. if c.ctx_ != nil {
  2937. return ctxhttp.Do(c.ctx_, c.s.client, req)
  2938. }
  2939. return c.s.client.Do(req)
  2940. }
  2941. // Do executes the "mapsengine.assets.parents.list" call.
  2942. // Exactly one of *ParentsListResponse or error will be non-nil. Any
  2943. // non-2xx status code is an error. Response headers are in either
  2944. // *ParentsListResponse.ServerResponse.Header or (if a response was
  2945. // returned at all) in error.(*googleapi.Error).Header. Use
  2946. // googleapi.IsNotModified to check whether the returned error was
  2947. // because http.StatusNotModified was returned.
  2948. func (c *AssetsParentsListCall) Do(opts ...googleapi.CallOption) (*ParentsListResponse, error) {
  2949. gensupport.SetOptions(c.urlParams_, opts...)
  2950. res, err := c.doRequest("json")
  2951. if res != nil && res.StatusCode == http.StatusNotModified {
  2952. if res.Body != nil {
  2953. res.Body.Close()
  2954. }
  2955. return nil, &googleapi.Error{
  2956. Code: res.StatusCode,
  2957. Header: res.Header,
  2958. }
  2959. }
  2960. if err != nil {
  2961. return nil, err
  2962. }
  2963. defer googleapi.CloseBody(res)
  2964. if err := googleapi.CheckResponse(res); err != nil {
  2965. return nil, err
  2966. }
  2967. ret := &ParentsListResponse{
  2968. ServerResponse: googleapi.ServerResponse{
  2969. Header: res.Header,
  2970. HTTPStatusCode: res.StatusCode,
  2971. },
  2972. }
  2973. if err := json.NewDecoder(res.Body).Decode(&ret); err != nil {
  2974. return nil, err
  2975. }
  2976. return ret, nil
  2977. // {
  2978. // "description": "Return all parent ids of the specified asset.",
  2979. // "httpMethod": "GET",
  2980. // "id": "mapsengine.assets.parents.list",
  2981. // "parameterOrder": [
  2982. // "id"
  2983. // ],
  2984. // "parameters": {
  2985. // "id": {
  2986. // "description": "The ID of the asset whose parents will be listed.",
  2987. // "location": "path",
  2988. // "required": true,
  2989. // "type": "string"
  2990. // },
  2991. // "maxResults": {
  2992. // "description": "The maximum number of items to include in a single response page. The maximum supported value is 50.",
  2993. // "format": "uint32",
  2994. // "location": "query",
  2995. // "type": "integer"
  2996. // },
  2997. // "pageToken": {
  2998. // "description": "The continuation token, used to page through large result sets. To get the next page of results, set this parameter to the value of nextPageToken from the previous response.",
  2999. // "location": "query",
  3000. // "type": "string"
  3001. // }
  3002. // },
  3003. // "path": "assets/{id}/parents",
  3004. // "response": {
  3005. // "$ref": "ParentsListResponse"
  3006. // },
  3007. // "scopes": [
  3008. // "https://www.googleapis.com/auth/mapsengine",
  3009. // "https://www.googleapis.com/auth/mapsengine.readonly"
  3010. // ]
  3011. // }
  3012. }
  3013. // Pages invokes f for each page of results.
  3014. // A non-nil error returned from f will halt the iteration.
  3015. // The provided context supersedes any context provided to the Context method.
  3016. func (c *AssetsParentsListCall) Pages(ctx context.Context, f func(*ParentsListResponse) error) error {
  3017. c.ctx_ = ctx
  3018. defer c.PageToken(c.urlParams_.Get("pageToken")) // reset paging to original point
  3019. for {
  3020. x, err := c.Do()
  3021. if err != nil {
  3022. return err
  3023. }
  3024. if err := f(x); err != nil {
  3025. return err
  3026. }
  3027. if x.NextPageToken == "" {
  3028. return nil
  3029. }
  3030. c.PageToken(x.NextPageToken)
  3031. }
  3032. }
  3033. // method id "mapsengine.assets.permissions.list":
  3034. type AssetsPermissionsListCall struct {
  3035. s *Service
  3036. id string
  3037. urlParams_ gensupport.URLParams
  3038. ifNoneMatch_ string
  3039. ctx_ context.Context
  3040. }
  3041. // List: Return all of the permissions for the specified asset.
  3042. func (r *AssetsPermissionsService) List(id string) *AssetsPermissionsListCall {
  3043. c := &AssetsPermissionsListCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  3044. c.id = id
  3045. return c
  3046. }
  3047. // Fields allows partial responses to be retrieved. See
  3048. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  3049. // for more information.
  3050. func (c *AssetsPermissionsListCall) Fields(s ...googleapi.Field) *AssetsPermissionsListCall {
  3051. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  3052. return c
  3053. }
  3054. // IfNoneMatch sets the optional parameter which makes the operation
  3055. // fail if the object's ETag matches the given value. This is useful for
  3056. // getting updates only after the object has changed since the last
  3057. // request. Use googleapi.IsNotModified to check whether the response
  3058. // error from Do is the result of In-None-Match.
  3059. func (c *AssetsPermissionsListCall) IfNoneMatch(entityTag string) *AssetsPermissionsListCall {
  3060. c.ifNoneMatch_ = entityTag
  3061. return c
  3062. }
  3063. // Context sets the context to be used in this call's Do method. Any
  3064. // pending HTTP request will be aborted if the provided context is
  3065. // canceled.
  3066. func (c *AssetsPermissionsListCall) Context(ctx context.Context) *AssetsPermissionsListCall {
  3067. c.ctx_ = ctx
  3068. return c
  3069. }
  3070. func (c *AssetsPermissionsListCall) doRequest(alt string) (*http.Response, error) {
  3071. var body io.Reader = nil
  3072. c.urlParams_.Set("alt", alt)
  3073. urls := googleapi.ResolveRelative(c.s.BasePath, "assets/{id}/permissions")
  3074. urls += "?" + c.urlParams_.Encode()
  3075. req, _ := http.NewRequest("GET", urls, body)
  3076. googleapi.Expand(req.URL, map[string]string{
  3077. "id": c.id,
  3078. })
  3079. req.Header.Set("User-Agent", c.s.userAgent())
  3080. if c.ifNoneMatch_ != "" {
  3081. req.Header.Set("If-None-Match", c.ifNoneMatch_)
  3082. }
  3083. if c.ctx_ != nil {
  3084. return ctxhttp.Do(c.ctx_, c.s.client, req)
  3085. }
  3086. return c.s.client.Do(req)
  3087. }
  3088. // Do executes the "mapsengine.assets.permissions.list" call.
  3089. // Exactly one of *PermissionsListResponse or error will be non-nil. Any
  3090. // non-2xx status code is an error. Response headers are in either
  3091. // *PermissionsListResponse.ServerResponse.Header or (if a response was
  3092. // returned at all) in error.(*googleapi.Error).Header. Use
  3093. // googleapi.IsNotModified to check whether the returned error was
  3094. // because http.StatusNotModified was returned.
  3095. func (c *AssetsPermissionsListCall) Do(opts ...googleapi.CallOption) (*PermissionsListResponse, error) {
  3096. gensupport.SetOptions(c.urlParams_, opts...)
  3097. res, err := c.doRequest("json")
  3098. if res != nil && res.StatusCode == http.StatusNotModified {
  3099. if res.Body != nil {
  3100. res.Body.Close()
  3101. }
  3102. return nil, &googleapi.Error{
  3103. Code: res.StatusCode,
  3104. Header: res.Header,
  3105. }
  3106. }
  3107. if err != nil {
  3108. return nil, err
  3109. }
  3110. defer googleapi.CloseBody(res)
  3111. if err := googleapi.CheckResponse(res); err != nil {
  3112. return nil, err
  3113. }
  3114. ret := &PermissionsListResponse{
  3115. ServerResponse: googleapi.ServerResponse{
  3116. Header: res.Header,
  3117. HTTPStatusCode: res.StatusCode,
  3118. },
  3119. }
  3120. if err := json.NewDecoder(res.Body).Decode(&ret); err != nil {
  3121. return nil, err
  3122. }
  3123. return ret, nil
  3124. // {
  3125. // "description": "Return all of the permissions for the specified asset.",
  3126. // "httpMethod": "GET",
  3127. // "id": "mapsengine.assets.permissions.list",
  3128. // "parameterOrder": [
  3129. // "id"
  3130. // ],
  3131. // "parameters": {
  3132. // "id": {
  3133. // "description": "The ID of the asset whose permissions will be listed.",
  3134. // "location": "path",
  3135. // "required": true,
  3136. // "type": "string"
  3137. // }
  3138. // },
  3139. // "path": "assets/{id}/permissions",
  3140. // "response": {
  3141. // "$ref": "PermissionsListResponse"
  3142. // },
  3143. // "scopes": [
  3144. // "https://www.googleapis.com/auth/mapsengine",
  3145. // "https://www.googleapis.com/auth/mapsengine.readonly"
  3146. // ]
  3147. // }
  3148. }
  3149. // method id "mapsengine.layers.cancelProcessing":
  3150. type LayersCancelProcessingCall struct {
  3151. s *Service
  3152. id string
  3153. urlParams_ gensupport.URLParams
  3154. ctx_ context.Context
  3155. }
  3156. // CancelProcessing: Cancel processing on a layer asset.
  3157. func (r *LayersService) CancelProcessing(id string) *LayersCancelProcessingCall {
  3158. c := &LayersCancelProcessingCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  3159. c.id = id
  3160. return c
  3161. }
  3162. // Fields allows partial responses to be retrieved. See
  3163. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  3164. // for more information.
  3165. func (c *LayersCancelProcessingCall) Fields(s ...googleapi.Field) *LayersCancelProcessingCall {
  3166. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  3167. return c
  3168. }
  3169. // Context sets the context to be used in this call's Do method. Any
  3170. // pending HTTP request will be aborted if the provided context is
  3171. // canceled.
  3172. func (c *LayersCancelProcessingCall) Context(ctx context.Context) *LayersCancelProcessingCall {
  3173. c.ctx_ = ctx
  3174. return c
  3175. }
  3176. func (c *LayersCancelProcessingCall) doRequest(alt string) (*http.Response, error) {
  3177. var body io.Reader = nil
  3178. c.urlParams_.Set("alt", alt)
  3179. urls := googleapi.ResolveRelative(c.s.BasePath, "layers/{id}/cancelProcessing")
  3180. urls += "?" + c.urlParams_.Encode()
  3181. req, _ := http.NewRequest("POST", urls, body)
  3182. googleapi.Expand(req.URL, map[string]string{
  3183. "id": c.id,
  3184. })
  3185. req.Header.Set("User-Agent", c.s.userAgent())
  3186. if c.ctx_ != nil {
  3187. return ctxhttp.Do(c.ctx_, c.s.client, req)
  3188. }
  3189. return c.s.client.Do(req)
  3190. }
  3191. // Do executes the "mapsengine.layers.cancelProcessing" call.
  3192. // Exactly one of *ProcessResponse or error will be non-nil. Any non-2xx
  3193. // status code is an error. Response headers are in either
  3194. // *ProcessResponse.ServerResponse.Header or (if a response was returned
  3195. // at all) in error.(*googleapi.Error).Header. Use
  3196. // googleapi.IsNotModified to check whether the returned error was
  3197. // because http.StatusNotModified was returned.
  3198. func (c *LayersCancelProcessingCall) Do(opts ...googleapi.CallOption) (*ProcessResponse, error) {
  3199. gensupport.SetOptions(c.urlParams_, opts...)
  3200. res, err := c.doRequest("json")
  3201. if res != nil && res.StatusCode == http.StatusNotModified {
  3202. if res.Body != nil {
  3203. res.Body.Close()
  3204. }
  3205. return nil, &googleapi.Error{
  3206. Code: res.StatusCode,
  3207. Header: res.Header,
  3208. }
  3209. }
  3210. if err != nil {
  3211. return nil, err
  3212. }
  3213. defer googleapi.CloseBody(res)
  3214. if err := googleapi.CheckResponse(res); err != nil {
  3215. return nil, err
  3216. }
  3217. ret := &ProcessResponse{
  3218. ServerResponse: googleapi.ServerResponse{
  3219. Header: res.Header,
  3220. HTTPStatusCode: res.StatusCode,
  3221. },
  3222. }
  3223. if err := json.NewDecoder(res.Body).Decode(&ret); err != nil {
  3224. return nil, err
  3225. }
  3226. return ret, nil
  3227. // {
  3228. // "description": "Cancel processing on a layer asset.",
  3229. // "httpMethod": "POST",
  3230. // "id": "mapsengine.layers.cancelProcessing",
  3231. // "parameterOrder": [
  3232. // "id"
  3233. // ],
  3234. // "parameters": {
  3235. // "id": {
  3236. // "description": "The ID of the layer.",
  3237. // "location": "path",
  3238. // "required": true,
  3239. // "type": "string"
  3240. // }
  3241. // },
  3242. // "path": "layers/{id}/cancelProcessing",
  3243. // "response": {
  3244. // "$ref": "ProcessResponse"
  3245. // },
  3246. // "scopes": [
  3247. // "https://www.googleapis.com/auth/mapsengine"
  3248. // ]
  3249. // }
  3250. }
  3251. // method id "mapsengine.layers.create":
  3252. type LayersCreateCall struct {
  3253. s *Service
  3254. layer *Layer
  3255. urlParams_ gensupport.URLParams
  3256. ctx_ context.Context
  3257. }
  3258. // Create: Create a layer asset.
  3259. func (r *LayersService) Create(layer *Layer) *LayersCreateCall {
  3260. c := &LayersCreateCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  3261. c.layer = layer
  3262. return c
  3263. }
  3264. // Process sets the optional parameter "process": Whether to queue the
  3265. // created layer for processing.
  3266. func (c *LayersCreateCall) Process(process bool) *LayersCreateCall {
  3267. c.urlParams_.Set("process", fmt.Sprint(process))
  3268. return c
  3269. }
  3270. // Fields allows partial responses to be retrieved. See
  3271. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  3272. // for more information.
  3273. func (c *LayersCreateCall) Fields(s ...googleapi.Field) *LayersCreateCall {
  3274. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  3275. return c
  3276. }
  3277. // Context sets the context to be used in this call's Do method. Any
  3278. // pending HTTP request will be aborted if the provided context is
  3279. // canceled.
  3280. func (c *LayersCreateCall) Context(ctx context.Context) *LayersCreateCall {
  3281. c.ctx_ = ctx
  3282. return c
  3283. }
  3284. func (c *LayersCreateCall) doRequest(alt string) (*http.Response, error) {
  3285. var body io.Reader = nil
  3286. body, err := googleapi.WithoutDataWrapper.JSONReader(c.layer)
  3287. if err != nil {
  3288. return nil, err
  3289. }
  3290. ctype := "application/json"
  3291. c.urlParams_.Set("alt", alt)
  3292. urls := googleapi.ResolveRelative(c.s.BasePath, "layers")
  3293. urls += "?" + c.urlParams_.Encode()
  3294. req, _ := http.NewRequest("POST", urls, body)
  3295. googleapi.SetOpaque(req.URL)
  3296. req.Header.Set("Content-Type", ctype)
  3297. req.Header.Set("User-Agent", c.s.userAgent())
  3298. if c.ctx_ != nil {
  3299. return ctxhttp.Do(c.ctx_, c.s.client, req)
  3300. }
  3301. return c.s.client.Do(req)
  3302. }
  3303. // Do executes the "mapsengine.layers.create" call.
  3304. // Exactly one of *Layer or error will be non-nil. Any non-2xx status
  3305. // code is an error. Response headers are in either
  3306. // *Layer.ServerResponse.Header or (if a response was returned at all)
  3307. // in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to
  3308. // check whether the returned error was because http.StatusNotModified
  3309. // was returned.
  3310. func (c *LayersCreateCall) Do(opts ...googleapi.CallOption) (*Layer, error) {
  3311. gensupport.SetOptions(c.urlParams_, opts...)
  3312. res, err := c.doRequest("json")
  3313. if res != nil && res.StatusCode == http.StatusNotModified {
  3314. if res.Body != nil {
  3315. res.Body.Close()
  3316. }
  3317. return nil, &googleapi.Error{
  3318. Code: res.StatusCode,
  3319. Header: res.Header,
  3320. }
  3321. }
  3322. if err != nil {
  3323. return nil, err
  3324. }
  3325. defer googleapi.CloseBody(res)
  3326. if err := googleapi.CheckResponse(res); err != nil {
  3327. return nil, err
  3328. }
  3329. ret := &Layer{
  3330. ServerResponse: googleapi.ServerResponse{
  3331. Header: res.Header,
  3332. HTTPStatusCode: res.StatusCode,
  3333. },
  3334. }
  3335. if err := json.NewDecoder(res.Body).Decode(&ret); err != nil {
  3336. return nil, err
  3337. }
  3338. return ret, nil
  3339. // {
  3340. // "description": "Create a layer asset.",
  3341. // "httpMethod": "POST",
  3342. // "id": "mapsengine.layers.create",
  3343. // "parameters": {
  3344. // "process": {
  3345. // "description": "Whether to queue the created layer for processing.",
  3346. // "location": "query",
  3347. // "type": "boolean"
  3348. // }
  3349. // },
  3350. // "path": "layers",
  3351. // "request": {
  3352. // "$ref": "Layer"
  3353. // },
  3354. // "response": {
  3355. // "$ref": "Layer"
  3356. // },
  3357. // "scopes": [
  3358. // "https://www.googleapis.com/auth/mapsengine"
  3359. // ]
  3360. // }
  3361. }
  3362. // method id "mapsengine.layers.delete":
  3363. type LayersDeleteCall struct {
  3364. s *Service
  3365. id string
  3366. urlParams_ gensupport.URLParams
  3367. ctx_ context.Context
  3368. }
  3369. // Delete: Delete a layer.
  3370. func (r *LayersService) Delete(id string) *LayersDeleteCall {
  3371. c := &LayersDeleteCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  3372. c.id = id
  3373. return c
  3374. }
  3375. // Fields allows partial responses to be retrieved. See
  3376. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  3377. // for more information.
  3378. func (c *LayersDeleteCall) Fields(s ...googleapi.Field) *LayersDeleteCall {
  3379. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  3380. return c
  3381. }
  3382. // Context sets the context to be used in this call's Do method. Any
  3383. // pending HTTP request will be aborted if the provided context is
  3384. // canceled.
  3385. func (c *LayersDeleteCall) Context(ctx context.Context) *LayersDeleteCall {
  3386. c.ctx_ = ctx
  3387. return c
  3388. }
  3389. func (c *LayersDeleteCall) doRequest(alt string) (*http.Response, error) {
  3390. var body io.Reader = nil
  3391. c.urlParams_.Set("alt", alt)
  3392. urls := googleapi.ResolveRelative(c.s.BasePath, "layers/{id}")
  3393. urls += "?" + c.urlParams_.Encode()
  3394. req, _ := http.NewRequest("DELETE", urls, body)
  3395. googleapi.Expand(req.URL, map[string]string{
  3396. "id": c.id,
  3397. })
  3398. req.Header.Set("User-Agent", c.s.userAgent())
  3399. if c.ctx_ != nil {
  3400. return ctxhttp.Do(c.ctx_, c.s.client, req)
  3401. }
  3402. return c.s.client.Do(req)
  3403. }
  3404. // Do executes the "mapsengine.layers.delete" call.
  3405. func (c *LayersDeleteCall) Do(opts ...googleapi.CallOption) error {
  3406. gensupport.SetOptions(c.urlParams_, opts...)
  3407. res, err := c.doRequest("json")
  3408. if err != nil {
  3409. return err
  3410. }
  3411. defer googleapi.CloseBody(res)
  3412. if err := googleapi.CheckResponse(res); err != nil {
  3413. return err
  3414. }
  3415. return nil
  3416. // {
  3417. // "description": "Delete a layer.",
  3418. // "httpMethod": "DELETE",
  3419. // "id": "mapsengine.layers.delete",
  3420. // "parameterOrder": [
  3421. // "id"
  3422. // ],
  3423. // "parameters": {
  3424. // "id": {
  3425. // "description": "The ID of the layer. Only the layer creator or project owner are permitted to delete. If the layer is published, or included in a map, the request will fail. Unpublish the layer, and remove it from all maps prior to deleting.",
  3426. // "location": "path",
  3427. // "required": true,
  3428. // "type": "string"
  3429. // }
  3430. // },
  3431. // "path": "layers/{id}",
  3432. // "scopes": [
  3433. // "https://www.googleapis.com/auth/mapsengine"
  3434. // ]
  3435. // }
  3436. }
  3437. // method id "mapsengine.layers.get":
  3438. type LayersGetCall struct {
  3439. s *Service
  3440. id string
  3441. urlParams_ gensupport.URLParams
  3442. ifNoneMatch_ string
  3443. ctx_ context.Context
  3444. }
  3445. // Get: Return metadata for a particular layer.
  3446. func (r *LayersService) Get(id string) *LayersGetCall {
  3447. c := &LayersGetCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  3448. c.id = id
  3449. return c
  3450. }
  3451. // Version sets the optional parameter "version": Deprecated: The
  3452. // version parameter indicates which version of the layer should be
  3453. // returned. When version is set to published, the published version of
  3454. // the layer will be returned. Please use the layers.getPublished
  3455. // endpoint instead.
  3456. //
  3457. // Possible values:
  3458. // "draft" - The draft version.
  3459. // "published" - The published version.
  3460. func (c *LayersGetCall) Version(version string) *LayersGetCall {
  3461. c.urlParams_.Set("version", version)
  3462. return c
  3463. }
  3464. // Fields allows partial responses to be retrieved. See
  3465. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  3466. // for more information.
  3467. func (c *LayersGetCall) Fields(s ...googleapi.Field) *LayersGetCall {
  3468. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  3469. return c
  3470. }
  3471. // IfNoneMatch sets the optional parameter which makes the operation
  3472. // fail if the object's ETag matches the given value. This is useful for
  3473. // getting updates only after the object has changed since the last
  3474. // request. Use googleapi.IsNotModified to check whether the response
  3475. // error from Do is the result of In-None-Match.
  3476. func (c *LayersGetCall) IfNoneMatch(entityTag string) *LayersGetCall {
  3477. c.ifNoneMatch_ = entityTag
  3478. return c
  3479. }
  3480. // Context sets the context to be used in this call's Do method. Any
  3481. // pending HTTP request will be aborted if the provided context is
  3482. // canceled.
  3483. func (c *LayersGetCall) Context(ctx context.Context) *LayersGetCall {
  3484. c.ctx_ = ctx
  3485. return c
  3486. }
  3487. func (c *LayersGetCall) doRequest(alt string) (*http.Response, error) {
  3488. var body io.Reader = nil
  3489. c.urlParams_.Set("alt", alt)
  3490. urls := googleapi.ResolveRelative(c.s.BasePath, "layers/{id}")
  3491. urls += "?" + c.urlParams_.Encode()
  3492. req, _ := http.NewRequest("GET", urls, body)
  3493. googleapi.Expand(req.URL, map[string]string{
  3494. "id": c.id,
  3495. })
  3496. req.Header.Set("User-Agent", c.s.userAgent())
  3497. if c.ifNoneMatch_ != "" {
  3498. req.Header.Set("If-None-Match", c.ifNoneMatch_)
  3499. }
  3500. if c.ctx_ != nil {
  3501. return ctxhttp.Do(c.ctx_, c.s.client, req)
  3502. }
  3503. return c.s.client.Do(req)
  3504. }
  3505. // Do executes the "mapsengine.layers.get" call.
  3506. // Exactly one of *Layer or error will be non-nil. Any non-2xx status
  3507. // code is an error. Response headers are in either
  3508. // *Layer.ServerResponse.Header or (if a response was returned at all)
  3509. // in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to
  3510. // check whether the returned error was because http.StatusNotModified
  3511. // was returned.
  3512. func (c *LayersGetCall) Do(opts ...googleapi.CallOption) (*Layer, error) {
  3513. gensupport.SetOptions(c.urlParams_, opts...)
  3514. res, err := c.doRequest("json")
  3515. if res != nil && res.StatusCode == http.StatusNotModified {
  3516. if res.Body != nil {
  3517. res.Body.Close()
  3518. }
  3519. return nil, &googleapi.Error{
  3520. Code: res.StatusCode,
  3521. Header: res.Header,
  3522. }
  3523. }
  3524. if err != nil {
  3525. return nil, err
  3526. }
  3527. defer googleapi.CloseBody(res)
  3528. if err := googleapi.CheckResponse(res); err != nil {
  3529. return nil, err
  3530. }
  3531. ret := &Layer{
  3532. ServerResponse: googleapi.ServerResponse{
  3533. Header: res.Header,
  3534. HTTPStatusCode: res.StatusCode,
  3535. },
  3536. }
  3537. if err := json.NewDecoder(res.Body).Decode(&ret); err != nil {
  3538. return nil, err
  3539. }
  3540. return ret, nil
  3541. // {
  3542. // "description": "Return metadata for a particular layer.",
  3543. // "httpMethod": "GET",
  3544. // "id": "mapsengine.layers.get",
  3545. // "parameterOrder": [
  3546. // "id"
  3547. // ],
  3548. // "parameters": {
  3549. // "id": {
  3550. // "description": "The ID of the layer.",
  3551. // "location": "path",
  3552. // "required": true,
  3553. // "type": "string"
  3554. // },
  3555. // "version": {
  3556. // "description": "Deprecated: The version parameter indicates which version of the layer should be returned. When version is set to published, the published version of the layer will be returned. Please use the layers.getPublished endpoint instead.",
  3557. // "enum": [
  3558. // "draft",
  3559. // "published"
  3560. // ],
  3561. // "enumDescriptions": [
  3562. // "The draft version.",
  3563. // "The published version."
  3564. // ],
  3565. // "location": "query",
  3566. // "type": "string"
  3567. // }
  3568. // },
  3569. // "path": "layers/{id}",
  3570. // "response": {
  3571. // "$ref": "Layer"
  3572. // },
  3573. // "scopes": [
  3574. // "https://www.googleapis.com/auth/mapsengine",
  3575. // "https://www.googleapis.com/auth/mapsengine.readonly"
  3576. // ]
  3577. // }
  3578. }
  3579. // method id "mapsengine.layers.getPublished":
  3580. type LayersGetPublishedCall struct {
  3581. s *Service
  3582. id string
  3583. urlParams_ gensupport.URLParams
  3584. ifNoneMatch_ string
  3585. ctx_ context.Context
  3586. }
  3587. // GetPublished: Return the published metadata for a particular layer.
  3588. func (r *LayersService) GetPublished(id string) *LayersGetPublishedCall {
  3589. c := &LayersGetPublishedCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  3590. c.id = id
  3591. return c
  3592. }
  3593. // Fields allows partial responses to be retrieved. See
  3594. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  3595. // for more information.
  3596. func (c *LayersGetPublishedCall) Fields(s ...googleapi.Field) *LayersGetPublishedCall {
  3597. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  3598. return c
  3599. }
  3600. // IfNoneMatch sets the optional parameter which makes the operation
  3601. // fail if the object's ETag matches the given value. This is useful for
  3602. // getting updates only after the object has changed since the last
  3603. // request. Use googleapi.IsNotModified to check whether the response
  3604. // error from Do is the result of In-None-Match.
  3605. func (c *LayersGetPublishedCall) IfNoneMatch(entityTag string) *LayersGetPublishedCall {
  3606. c.ifNoneMatch_ = entityTag
  3607. return c
  3608. }
  3609. // Context sets the context to be used in this call's Do method. Any
  3610. // pending HTTP request will be aborted if the provided context is
  3611. // canceled.
  3612. func (c *LayersGetPublishedCall) Context(ctx context.Context) *LayersGetPublishedCall {
  3613. c.ctx_ = ctx
  3614. return c
  3615. }
  3616. func (c *LayersGetPublishedCall) doRequest(alt string) (*http.Response, error) {
  3617. var body io.Reader = nil
  3618. c.urlParams_.Set("alt", alt)
  3619. urls := googleapi.ResolveRelative(c.s.BasePath, "layers/{id}/published")
  3620. urls += "?" + c.urlParams_.Encode()
  3621. req, _ := http.NewRequest("GET", urls, body)
  3622. googleapi.Expand(req.URL, map[string]string{
  3623. "id": c.id,
  3624. })
  3625. req.Header.Set("User-Agent", c.s.userAgent())
  3626. if c.ifNoneMatch_ != "" {
  3627. req.Header.Set("If-None-Match", c.ifNoneMatch_)
  3628. }
  3629. if c.ctx_ != nil {
  3630. return ctxhttp.Do(c.ctx_, c.s.client, req)
  3631. }
  3632. return c.s.client.Do(req)
  3633. }
  3634. // Do executes the "mapsengine.layers.getPublished" call.
  3635. // Exactly one of *PublishedLayer or error will be non-nil. Any non-2xx
  3636. // status code is an error. Response headers are in either
  3637. // *PublishedLayer.ServerResponse.Header or (if a response was returned
  3638. // at all) in error.(*googleapi.Error).Header. Use
  3639. // googleapi.IsNotModified to check whether the returned error was
  3640. // because http.StatusNotModified was returned.
  3641. func (c *LayersGetPublishedCall) Do(opts ...googleapi.CallOption) (*PublishedLayer, error) {
  3642. gensupport.SetOptions(c.urlParams_, opts...)
  3643. res, err := c.doRequest("json")
  3644. if res != nil && res.StatusCode == http.StatusNotModified {
  3645. if res.Body != nil {
  3646. res.Body.Close()
  3647. }
  3648. return nil, &googleapi.Error{
  3649. Code: res.StatusCode,
  3650. Header: res.Header,
  3651. }
  3652. }
  3653. if err != nil {
  3654. return nil, err
  3655. }
  3656. defer googleapi.CloseBody(res)
  3657. if err := googleapi.CheckResponse(res); err != nil {
  3658. return nil, err
  3659. }
  3660. ret := &PublishedLayer{
  3661. ServerResponse: googleapi.ServerResponse{
  3662. Header: res.Header,
  3663. HTTPStatusCode: res.StatusCode,
  3664. },
  3665. }
  3666. if err := json.NewDecoder(res.Body).Decode(&ret); err != nil {
  3667. return nil, err
  3668. }
  3669. return ret, nil
  3670. // {
  3671. // "description": "Return the published metadata for a particular layer.",
  3672. // "httpMethod": "GET",
  3673. // "id": "mapsengine.layers.getPublished",
  3674. // "parameterOrder": [
  3675. // "id"
  3676. // ],
  3677. // "parameters": {
  3678. // "id": {
  3679. // "description": "The ID of the layer.",
  3680. // "location": "path",
  3681. // "required": true,
  3682. // "type": "string"
  3683. // }
  3684. // },
  3685. // "path": "layers/{id}/published",
  3686. // "response": {
  3687. // "$ref": "PublishedLayer"
  3688. // },
  3689. // "scopes": [
  3690. // "https://www.googleapis.com/auth/mapsengine",
  3691. // "https://www.googleapis.com/auth/mapsengine.readonly"
  3692. // ]
  3693. // }
  3694. }
  3695. // method id "mapsengine.layers.list":
  3696. type LayersListCall struct {
  3697. s *Service
  3698. urlParams_ gensupport.URLParams
  3699. ifNoneMatch_ string
  3700. ctx_ context.Context
  3701. }
  3702. // List: Return all layers readable by the current user.
  3703. func (r *LayersService) List() *LayersListCall {
  3704. c := &LayersListCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  3705. return c
  3706. }
  3707. // Bbox sets the optional parameter "bbox": A bounding box, expressed as
  3708. // "west,south,east,north". If set, only assets which intersect this
  3709. // bounding box will be returned.
  3710. func (c *LayersListCall) Bbox(bbox string) *LayersListCall {
  3711. c.urlParams_.Set("bbox", bbox)
  3712. return c
  3713. }
  3714. // CreatedAfter sets the optional parameter "createdAfter": An RFC 3339
  3715. // formatted date-time value (e.g. 1970-01-01T00:00:00Z). Returned
  3716. // assets will have been created at or after this time.
  3717. func (c *LayersListCall) CreatedAfter(createdAfter string) *LayersListCall {
  3718. c.urlParams_.Set("createdAfter", createdAfter)
  3719. return c
  3720. }
  3721. // CreatedBefore sets the optional parameter "createdBefore": An RFC
  3722. // 3339 formatted date-time value (e.g. 1970-01-01T00:00:00Z). Returned
  3723. // assets will have been created at or before this time.
  3724. func (c *LayersListCall) CreatedBefore(createdBefore string) *LayersListCall {
  3725. c.urlParams_.Set("createdBefore", createdBefore)
  3726. return c
  3727. }
  3728. // CreatorEmail sets the optional parameter "creatorEmail": An email
  3729. // address representing a user. Returned assets that have been created
  3730. // by the user associated with the provided email address.
  3731. func (c *LayersListCall) CreatorEmail(creatorEmail string) *LayersListCall {
  3732. c.urlParams_.Set("creatorEmail", creatorEmail)
  3733. return c
  3734. }
  3735. // MaxResults sets the optional parameter "maxResults": The maximum
  3736. // number of items to include in a single response page. The maximum
  3737. // supported value is 100.
  3738. func (c *LayersListCall) MaxResults(maxResults int64) *LayersListCall {
  3739. c.urlParams_.Set("maxResults", fmt.Sprint(maxResults))
  3740. return c
  3741. }
  3742. // ModifiedAfter sets the optional parameter "modifiedAfter": An RFC
  3743. // 3339 formatted date-time value (e.g. 1970-01-01T00:00:00Z). Returned
  3744. // assets will have been modified at or after this time.
  3745. func (c *LayersListCall) ModifiedAfter(modifiedAfter string) *LayersListCall {
  3746. c.urlParams_.Set("modifiedAfter", modifiedAfter)
  3747. return c
  3748. }
  3749. // ModifiedBefore sets the optional parameter "modifiedBefore": An RFC
  3750. // 3339 formatted date-time value (e.g. 1970-01-01T00:00:00Z). Returned
  3751. // assets will have been modified at or before this time.
  3752. func (c *LayersListCall) ModifiedBefore(modifiedBefore string) *LayersListCall {
  3753. c.urlParams_.Set("modifiedBefore", modifiedBefore)
  3754. return c
  3755. }
  3756. // PageToken sets the optional parameter "pageToken": The continuation
  3757. // token, used to page through large result sets. To get the next page
  3758. // of results, set this parameter to the value of nextPageToken from the
  3759. // previous response.
  3760. func (c *LayersListCall) PageToken(pageToken string) *LayersListCall {
  3761. c.urlParams_.Set("pageToken", pageToken)
  3762. return c
  3763. }
  3764. // ProcessingStatus sets the optional parameter "processingStatus":
  3765. //
  3766. // Possible values:
  3767. // "complete" - The layer has completed processing.
  3768. // "failed" - The layer has failed processing.
  3769. // "notReady" - The layer is not ready for processing.
  3770. // "processing" - The layer is processing.
  3771. // "ready" - The layer is ready for processing.
  3772. func (c *LayersListCall) ProcessingStatus(processingStatus string) *LayersListCall {
  3773. c.urlParams_.Set("processingStatus", processingStatus)
  3774. return c
  3775. }
  3776. // ProjectId sets the optional parameter "projectId": The ID of a Maps
  3777. // Engine project, used to filter the response. To list all available
  3778. // projects with their IDs, send a Projects: list request. You can also
  3779. // find your project ID as the value of the DashboardPlace:cid URL
  3780. // parameter when signed in to mapsengine.google.com.
  3781. func (c *LayersListCall) ProjectId(projectId string) *LayersListCall {
  3782. c.urlParams_.Set("projectId", projectId)
  3783. return c
  3784. }
  3785. // Role sets the optional parameter "role": The role parameter indicates
  3786. // that the response should only contain assets where the current user
  3787. // has the specified level of access.
  3788. //
  3789. // Possible values:
  3790. // "owner" - The user can read, write and administer the asset.
  3791. // "reader" - The user can read the asset.
  3792. // "writer" - The user can read and write the asset.
  3793. func (c *LayersListCall) Role(role string) *LayersListCall {
  3794. c.urlParams_.Set("role", role)
  3795. return c
  3796. }
  3797. // Search sets the optional parameter "search": An unstructured search
  3798. // string used to filter the set of results based on asset metadata.
  3799. func (c *LayersListCall) Search(search string) *LayersListCall {
  3800. c.urlParams_.Set("search", search)
  3801. return c
  3802. }
  3803. // Tags sets the optional parameter "tags": A comma separated list of
  3804. // tags. Returned assets will contain all the tags from the list.
  3805. func (c *LayersListCall) Tags(tags string) *LayersListCall {
  3806. c.urlParams_.Set("tags", tags)
  3807. return c
  3808. }
  3809. // Fields allows partial responses to be retrieved. See
  3810. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  3811. // for more information.
  3812. func (c *LayersListCall) Fields(s ...googleapi.Field) *LayersListCall {
  3813. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  3814. return c
  3815. }
  3816. // IfNoneMatch sets the optional parameter which makes the operation
  3817. // fail if the object's ETag matches the given value. This is useful for
  3818. // getting updates only after the object has changed since the last
  3819. // request. Use googleapi.IsNotModified to check whether the response
  3820. // error from Do is the result of In-None-Match.
  3821. func (c *LayersListCall) IfNoneMatch(entityTag string) *LayersListCall {
  3822. c.ifNoneMatch_ = entityTag
  3823. return c
  3824. }
  3825. // Context sets the context to be used in this call's Do method. Any
  3826. // pending HTTP request will be aborted if the provided context is
  3827. // canceled.
  3828. func (c *LayersListCall) Context(ctx context.Context) *LayersListCall {
  3829. c.ctx_ = ctx
  3830. return c
  3831. }
  3832. func (c *LayersListCall) doRequest(alt string) (*http.Response, error) {
  3833. var body io.Reader = nil
  3834. c.urlParams_.Set("alt", alt)
  3835. urls := googleapi.ResolveRelative(c.s.BasePath, "layers")
  3836. urls += "?" + c.urlParams_.Encode()
  3837. req, _ := http.NewRequest("GET", urls, body)
  3838. googleapi.SetOpaque(req.URL)
  3839. req.Header.Set("User-Agent", c.s.userAgent())
  3840. if c.ifNoneMatch_ != "" {
  3841. req.Header.Set("If-None-Match", c.ifNoneMatch_)
  3842. }
  3843. if c.ctx_ != nil {
  3844. return ctxhttp.Do(c.ctx_, c.s.client, req)
  3845. }
  3846. return c.s.client.Do(req)
  3847. }
  3848. // Do executes the "mapsengine.layers.list" call.
  3849. // Exactly one of *LayersListResponse or error will be non-nil. Any
  3850. // non-2xx status code is an error. Response headers are in either
  3851. // *LayersListResponse.ServerResponse.Header or (if a response was
  3852. // returned at all) in error.(*googleapi.Error).Header. Use
  3853. // googleapi.IsNotModified to check whether the returned error was
  3854. // because http.StatusNotModified was returned.
  3855. func (c *LayersListCall) Do(opts ...googleapi.CallOption) (*LayersListResponse, error) {
  3856. gensupport.SetOptions(c.urlParams_, opts...)
  3857. res, err := c.doRequest("json")
  3858. if res != nil && res.StatusCode == http.StatusNotModified {
  3859. if res.Body != nil {
  3860. res.Body.Close()
  3861. }
  3862. return nil, &googleapi.Error{
  3863. Code: res.StatusCode,
  3864. Header: res.Header,
  3865. }
  3866. }
  3867. if err != nil {
  3868. return nil, err
  3869. }
  3870. defer googleapi.CloseBody(res)
  3871. if err := googleapi.CheckResponse(res); err != nil {
  3872. return nil, err
  3873. }
  3874. ret := &LayersListResponse{
  3875. ServerResponse: googleapi.ServerResponse{
  3876. Header: res.Header,
  3877. HTTPStatusCode: res.StatusCode,
  3878. },
  3879. }
  3880. if err := json.NewDecoder(res.Body).Decode(&ret); err != nil {
  3881. return nil, err
  3882. }
  3883. return ret, nil
  3884. // {
  3885. // "description": "Return all layers readable by the current user.",
  3886. // "httpMethod": "GET",
  3887. // "id": "mapsengine.layers.list",
  3888. // "parameters": {
  3889. // "bbox": {
  3890. // "description": "A bounding box, expressed as \"west,south,east,north\". If set, only assets which intersect this bounding box will be returned.",
  3891. // "location": "query",
  3892. // "type": "string"
  3893. // },
  3894. // "createdAfter": {
  3895. // "description": "An RFC 3339 formatted date-time value (e.g. 1970-01-01T00:00:00Z). Returned assets will have been created at or after this time.",
  3896. // "format": "date-time",
  3897. // "location": "query",
  3898. // "type": "string"
  3899. // },
  3900. // "createdBefore": {
  3901. // "description": "An RFC 3339 formatted date-time value (e.g. 1970-01-01T00:00:00Z). Returned assets will have been created at or before this time.",
  3902. // "format": "date-time",
  3903. // "location": "query",
  3904. // "type": "string"
  3905. // },
  3906. // "creatorEmail": {
  3907. // "description": "An email address representing a user. Returned assets that have been created by the user associated with the provided email address.",
  3908. // "location": "query",
  3909. // "type": "string"
  3910. // },
  3911. // "maxResults": {
  3912. // "description": "The maximum number of items to include in a single response page. The maximum supported value is 100.",
  3913. // "format": "uint32",
  3914. // "location": "query",
  3915. // "type": "integer"
  3916. // },
  3917. // "modifiedAfter": {
  3918. // "description": "An RFC 3339 formatted date-time value (e.g. 1970-01-01T00:00:00Z). Returned assets will have been modified at or after this time.",
  3919. // "format": "date-time",
  3920. // "location": "query",
  3921. // "type": "string"
  3922. // },
  3923. // "modifiedBefore": {
  3924. // "description": "An RFC 3339 formatted date-time value (e.g. 1970-01-01T00:00:00Z). Returned assets will have been modified at or before this time.",
  3925. // "format": "date-time",
  3926. // "location": "query",
  3927. // "type": "string"
  3928. // },
  3929. // "pageToken": {
  3930. // "description": "The continuation token, used to page through large result sets. To get the next page of results, set this parameter to the value of nextPageToken from the previous response.",
  3931. // "location": "query",
  3932. // "type": "string"
  3933. // },
  3934. // "processingStatus": {
  3935. // "enum": [
  3936. // "complete",
  3937. // "failed",
  3938. // "notReady",
  3939. // "processing",
  3940. // "ready"
  3941. // ],
  3942. // "enumDescriptions": [
  3943. // "The layer has completed processing.",
  3944. // "The layer has failed processing.",
  3945. // "The layer is not ready for processing.",
  3946. // "The layer is processing.",
  3947. // "The layer is ready for processing."
  3948. // ],
  3949. // "location": "query",
  3950. // "type": "string"
  3951. // },
  3952. // "projectId": {
  3953. // "description": "The ID of a Maps Engine project, used to filter the response. To list all available projects with their IDs, send a Projects: list request. You can also find your project ID as the value of the DashboardPlace:cid URL parameter when signed in to mapsengine.google.com.",
  3954. // "location": "query",
  3955. // "type": "string"
  3956. // },
  3957. // "role": {
  3958. // "description": "The role parameter indicates that the response should only contain assets where the current user has the specified level of access.",
  3959. // "enum": [
  3960. // "owner",
  3961. // "reader",
  3962. // "writer"
  3963. // ],
  3964. // "enumDescriptions": [
  3965. // "The user can read, write and administer the asset.",
  3966. // "The user can read the asset.",
  3967. // "The user can read and write the asset."
  3968. // ],
  3969. // "location": "query",
  3970. // "type": "string"
  3971. // },
  3972. // "search": {
  3973. // "description": "An unstructured search string used to filter the set of results based on asset metadata.",
  3974. // "location": "query",
  3975. // "type": "string"
  3976. // },
  3977. // "tags": {
  3978. // "description": "A comma separated list of tags. Returned assets will contain all the tags from the list.",
  3979. // "location": "query",
  3980. // "type": "string"
  3981. // }
  3982. // },
  3983. // "path": "layers",
  3984. // "response": {
  3985. // "$ref": "LayersListResponse"
  3986. // },
  3987. // "scopes": [
  3988. // "https://www.googleapis.com/auth/mapsengine",
  3989. // "https://www.googleapis.com/auth/mapsengine.readonly"
  3990. // ]
  3991. // }
  3992. }
  3993. // Pages invokes f for each page of results.
  3994. // A non-nil error returned from f will halt the iteration.
  3995. // The provided context supersedes any context provided to the Context method.
  3996. func (c *LayersListCall) Pages(ctx context.Context, f func(*LayersListResponse) error) error {
  3997. c.ctx_ = ctx
  3998. defer c.PageToken(c.urlParams_.Get("pageToken")) // reset paging to original point
  3999. for {
  4000. x, err := c.Do()
  4001. if err != nil {
  4002. return err
  4003. }
  4004. if err := f(x); err != nil {
  4005. return err
  4006. }
  4007. if x.NextPageToken == "" {
  4008. return nil
  4009. }
  4010. c.PageToken(x.NextPageToken)
  4011. }
  4012. }
  4013. // method id "mapsengine.layers.listPublished":
  4014. type LayersListPublishedCall struct {
  4015. s *Service
  4016. urlParams_ gensupport.URLParams
  4017. ifNoneMatch_ string
  4018. ctx_ context.Context
  4019. }
  4020. // ListPublished: Return all published layers readable by the current
  4021. // user.
  4022. func (r *LayersService) ListPublished() *LayersListPublishedCall {
  4023. c := &LayersListPublishedCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  4024. return c
  4025. }
  4026. // MaxResults sets the optional parameter "maxResults": The maximum
  4027. // number of items to include in a single response page. The maximum
  4028. // supported value is 100.
  4029. func (c *LayersListPublishedCall) MaxResults(maxResults int64) *LayersListPublishedCall {
  4030. c.urlParams_.Set("maxResults", fmt.Sprint(maxResults))
  4031. return c
  4032. }
  4033. // PageToken sets the optional parameter "pageToken": The continuation
  4034. // token, used to page through large result sets. To get the next page
  4035. // of results, set this parameter to the value of nextPageToken from the
  4036. // previous response.
  4037. func (c *LayersListPublishedCall) PageToken(pageToken string) *LayersListPublishedCall {
  4038. c.urlParams_.Set("pageToken", pageToken)
  4039. return c
  4040. }
  4041. // ProjectId sets the optional parameter "projectId": The ID of a Maps
  4042. // Engine project, used to filter the response. To list all available
  4043. // projects with their IDs, send a Projects: list request. You can also
  4044. // find your project ID as the value of the DashboardPlace:cid URL
  4045. // parameter when signed in to mapsengine.google.com.
  4046. func (c *LayersListPublishedCall) ProjectId(projectId string) *LayersListPublishedCall {
  4047. c.urlParams_.Set("projectId", projectId)
  4048. return c
  4049. }
  4050. // Fields allows partial responses to be retrieved. See
  4051. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  4052. // for more information.
  4053. func (c *LayersListPublishedCall) Fields(s ...googleapi.Field) *LayersListPublishedCall {
  4054. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  4055. return c
  4056. }
  4057. // IfNoneMatch sets the optional parameter which makes the operation
  4058. // fail if the object's ETag matches the given value. This is useful for
  4059. // getting updates only after the object has changed since the last
  4060. // request. Use googleapi.IsNotModified to check whether the response
  4061. // error from Do is the result of In-None-Match.
  4062. func (c *LayersListPublishedCall) IfNoneMatch(entityTag string) *LayersListPublishedCall {
  4063. c.ifNoneMatch_ = entityTag
  4064. return c
  4065. }
  4066. // Context sets the context to be used in this call's Do method. Any
  4067. // pending HTTP request will be aborted if the provided context is
  4068. // canceled.
  4069. func (c *LayersListPublishedCall) Context(ctx context.Context) *LayersListPublishedCall {
  4070. c.ctx_ = ctx
  4071. return c
  4072. }
  4073. func (c *LayersListPublishedCall) doRequest(alt string) (*http.Response, error) {
  4074. var body io.Reader = nil
  4075. c.urlParams_.Set("alt", alt)
  4076. urls := googleapi.ResolveRelative(c.s.BasePath, "layers/published")
  4077. urls += "?" + c.urlParams_.Encode()
  4078. req, _ := http.NewRequest("GET", urls, body)
  4079. googleapi.SetOpaque(req.URL)
  4080. req.Header.Set("User-Agent", c.s.userAgent())
  4081. if c.ifNoneMatch_ != "" {
  4082. req.Header.Set("If-None-Match", c.ifNoneMatch_)
  4083. }
  4084. if c.ctx_ != nil {
  4085. return ctxhttp.Do(c.ctx_, c.s.client, req)
  4086. }
  4087. return c.s.client.Do(req)
  4088. }
  4089. // Do executes the "mapsengine.layers.listPublished" call.
  4090. // Exactly one of *PublishedLayersListResponse or error will be non-nil.
  4091. // Any non-2xx status code is an error. Response headers are in either
  4092. // *PublishedLayersListResponse.ServerResponse.Header or (if a response
  4093. // was returned at all) in error.(*googleapi.Error).Header. Use
  4094. // googleapi.IsNotModified to check whether the returned error was
  4095. // because http.StatusNotModified was returned.
  4096. func (c *LayersListPublishedCall) Do(opts ...googleapi.CallOption) (*PublishedLayersListResponse, error) {
  4097. gensupport.SetOptions(c.urlParams_, opts...)
  4098. res, err := c.doRequest("json")
  4099. if res != nil && res.StatusCode == http.StatusNotModified {
  4100. if res.Body != nil {
  4101. res.Body.Close()
  4102. }
  4103. return nil, &googleapi.Error{
  4104. Code: res.StatusCode,
  4105. Header: res.Header,
  4106. }
  4107. }
  4108. if err != nil {
  4109. return nil, err
  4110. }
  4111. defer googleapi.CloseBody(res)
  4112. if err := googleapi.CheckResponse(res); err != nil {
  4113. return nil, err
  4114. }
  4115. ret := &PublishedLayersListResponse{
  4116. ServerResponse: googleapi.ServerResponse{
  4117. Header: res.Header,
  4118. HTTPStatusCode: res.StatusCode,
  4119. },
  4120. }
  4121. if err := json.NewDecoder(res.Body).Decode(&ret); err != nil {
  4122. return nil, err
  4123. }
  4124. return ret, nil
  4125. // {
  4126. // "description": "Return all published layers readable by the current user.",
  4127. // "httpMethod": "GET",
  4128. // "id": "mapsengine.layers.listPublished",
  4129. // "parameters": {
  4130. // "maxResults": {
  4131. // "description": "The maximum number of items to include in a single response page. The maximum supported value is 100.",
  4132. // "format": "uint32",
  4133. // "location": "query",
  4134. // "type": "integer"
  4135. // },
  4136. // "pageToken": {
  4137. // "description": "The continuation token, used to page through large result sets. To get the next page of results, set this parameter to the value of nextPageToken from the previous response.",
  4138. // "location": "query",
  4139. // "type": "string"
  4140. // },
  4141. // "projectId": {
  4142. // "description": "The ID of a Maps Engine project, used to filter the response. To list all available projects with their IDs, send a Projects: list request. You can also find your project ID as the value of the DashboardPlace:cid URL parameter when signed in to mapsengine.google.com.",
  4143. // "location": "query",
  4144. // "type": "string"
  4145. // }
  4146. // },
  4147. // "path": "layers/published",
  4148. // "response": {
  4149. // "$ref": "PublishedLayersListResponse"
  4150. // },
  4151. // "scopes": [
  4152. // "https://www.googleapis.com/auth/mapsengine",
  4153. // "https://www.googleapis.com/auth/mapsengine.readonly"
  4154. // ]
  4155. // }
  4156. }
  4157. // Pages invokes f for each page of results.
  4158. // A non-nil error returned from f will halt the iteration.
  4159. // The provided context supersedes any context provided to the Context method.
  4160. func (c *LayersListPublishedCall) Pages(ctx context.Context, f func(*PublishedLayersListResponse) error) error {
  4161. c.ctx_ = ctx
  4162. defer c.PageToken(c.urlParams_.Get("pageToken")) // reset paging to original point
  4163. for {
  4164. x, err := c.Do()
  4165. if err != nil {
  4166. return err
  4167. }
  4168. if err := f(x); err != nil {
  4169. return err
  4170. }
  4171. if x.NextPageToken == "" {
  4172. return nil
  4173. }
  4174. c.PageToken(x.NextPageToken)
  4175. }
  4176. }
  4177. // method id "mapsengine.layers.patch":
  4178. type LayersPatchCall struct {
  4179. s *Service
  4180. id string
  4181. layer *Layer
  4182. urlParams_ gensupport.URLParams
  4183. ctx_ context.Context
  4184. }
  4185. // Patch: Mutate a layer asset.
  4186. func (r *LayersService) Patch(id string, layer *Layer) *LayersPatchCall {
  4187. c := &LayersPatchCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  4188. c.id = id
  4189. c.layer = layer
  4190. return c
  4191. }
  4192. // Fields allows partial responses to be retrieved. See
  4193. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  4194. // for more information.
  4195. func (c *LayersPatchCall) Fields(s ...googleapi.Field) *LayersPatchCall {
  4196. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  4197. return c
  4198. }
  4199. // Context sets the context to be used in this call's Do method. Any
  4200. // pending HTTP request will be aborted if the provided context is
  4201. // canceled.
  4202. func (c *LayersPatchCall) Context(ctx context.Context) *LayersPatchCall {
  4203. c.ctx_ = ctx
  4204. return c
  4205. }
  4206. func (c *LayersPatchCall) doRequest(alt string) (*http.Response, error) {
  4207. var body io.Reader = nil
  4208. body, err := googleapi.WithoutDataWrapper.JSONReader(c.layer)
  4209. if err != nil {
  4210. return nil, err
  4211. }
  4212. ctype := "application/json"
  4213. c.urlParams_.Set("alt", alt)
  4214. urls := googleapi.ResolveRelative(c.s.BasePath, "layers/{id}")
  4215. urls += "?" + c.urlParams_.Encode()
  4216. req, _ := http.NewRequest("PATCH", urls, body)
  4217. googleapi.Expand(req.URL, map[string]string{
  4218. "id": c.id,
  4219. })
  4220. req.Header.Set("Content-Type", ctype)
  4221. req.Header.Set("User-Agent", c.s.userAgent())
  4222. if c.ctx_ != nil {
  4223. return ctxhttp.Do(c.ctx_, c.s.client, req)
  4224. }
  4225. return c.s.client.Do(req)
  4226. }
  4227. // Do executes the "mapsengine.layers.patch" call.
  4228. func (c *LayersPatchCall) Do(opts ...googleapi.CallOption) error {
  4229. gensupport.SetOptions(c.urlParams_, opts...)
  4230. res, err := c.doRequest("json")
  4231. if err != nil {
  4232. return err
  4233. }
  4234. defer googleapi.CloseBody(res)
  4235. if err := googleapi.CheckResponse(res); err != nil {
  4236. return err
  4237. }
  4238. return nil
  4239. // {
  4240. // "description": "Mutate a layer asset.",
  4241. // "httpMethod": "PATCH",
  4242. // "id": "mapsengine.layers.patch",
  4243. // "parameterOrder": [
  4244. // "id"
  4245. // ],
  4246. // "parameters": {
  4247. // "id": {
  4248. // "description": "The ID of the layer.",
  4249. // "location": "path",
  4250. // "required": true,
  4251. // "type": "string"
  4252. // }
  4253. // },
  4254. // "path": "layers/{id}",
  4255. // "request": {
  4256. // "$ref": "Layer"
  4257. // },
  4258. // "scopes": [
  4259. // "https://www.googleapis.com/auth/mapsengine"
  4260. // ]
  4261. // }
  4262. }
  4263. // method id "mapsengine.layers.process":
  4264. type LayersProcessCall struct {
  4265. s *Service
  4266. id string
  4267. urlParams_ gensupport.URLParams
  4268. ctx_ context.Context
  4269. }
  4270. // Process: Process a layer asset.
  4271. func (r *LayersService) Process(id string) *LayersProcessCall {
  4272. c := &LayersProcessCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  4273. c.id = id
  4274. return c
  4275. }
  4276. // Fields allows partial responses to be retrieved. See
  4277. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  4278. // for more information.
  4279. func (c *LayersProcessCall) Fields(s ...googleapi.Field) *LayersProcessCall {
  4280. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  4281. return c
  4282. }
  4283. // Context sets the context to be used in this call's Do method. Any
  4284. // pending HTTP request will be aborted if the provided context is
  4285. // canceled.
  4286. func (c *LayersProcessCall) Context(ctx context.Context) *LayersProcessCall {
  4287. c.ctx_ = ctx
  4288. return c
  4289. }
  4290. func (c *LayersProcessCall) doRequest(alt string) (*http.Response, error) {
  4291. var body io.Reader = nil
  4292. c.urlParams_.Set("alt", alt)
  4293. urls := googleapi.ResolveRelative(c.s.BasePath, "layers/{id}/process")
  4294. urls += "?" + c.urlParams_.Encode()
  4295. req, _ := http.NewRequest("POST", urls, body)
  4296. googleapi.Expand(req.URL, map[string]string{
  4297. "id": c.id,
  4298. })
  4299. req.Header.Set("User-Agent", c.s.userAgent())
  4300. if c.ctx_ != nil {
  4301. return ctxhttp.Do(c.ctx_, c.s.client, req)
  4302. }
  4303. return c.s.client.Do(req)
  4304. }
  4305. // Do executes the "mapsengine.layers.process" call.
  4306. // Exactly one of *ProcessResponse or error will be non-nil. Any non-2xx
  4307. // status code is an error. Response headers are in either
  4308. // *ProcessResponse.ServerResponse.Header or (if a response was returned
  4309. // at all) in error.(*googleapi.Error).Header. Use
  4310. // googleapi.IsNotModified to check whether the returned error was
  4311. // because http.StatusNotModified was returned.
  4312. func (c *LayersProcessCall) Do(opts ...googleapi.CallOption) (*ProcessResponse, error) {
  4313. gensupport.SetOptions(c.urlParams_, opts...)
  4314. res, err := c.doRequest("json")
  4315. if res != nil && res.StatusCode == http.StatusNotModified {
  4316. if res.Body != nil {
  4317. res.Body.Close()
  4318. }
  4319. return nil, &googleapi.Error{
  4320. Code: res.StatusCode,
  4321. Header: res.Header,
  4322. }
  4323. }
  4324. if err != nil {
  4325. return nil, err
  4326. }
  4327. defer googleapi.CloseBody(res)
  4328. if err := googleapi.CheckResponse(res); err != nil {
  4329. return nil, err
  4330. }
  4331. ret := &ProcessResponse{
  4332. ServerResponse: googleapi.ServerResponse{
  4333. Header: res.Header,
  4334. HTTPStatusCode: res.StatusCode,
  4335. },
  4336. }
  4337. if err := json.NewDecoder(res.Body).Decode(&ret); err != nil {
  4338. return nil, err
  4339. }
  4340. return ret, nil
  4341. // {
  4342. // "description": "Process a layer asset.",
  4343. // "httpMethod": "POST",
  4344. // "id": "mapsengine.layers.process",
  4345. // "parameterOrder": [
  4346. // "id"
  4347. // ],
  4348. // "parameters": {
  4349. // "id": {
  4350. // "description": "The ID of the layer.",
  4351. // "location": "path",
  4352. // "required": true,
  4353. // "type": "string"
  4354. // }
  4355. // },
  4356. // "path": "layers/{id}/process",
  4357. // "response": {
  4358. // "$ref": "ProcessResponse"
  4359. // },
  4360. // "scopes": [
  4361. // "https://www.googleapis.com/auth/mapsengine"
  4362. // ]
  4363. // }
  4364. }
  4365. // method id "mapsengine.layers.publish":
  4366. type LayersPublishCall struct {
  4367. s *Service
  4368. id string
  4369. urlParams_ gensupport.URLParams
  4370. ctx_ context.Context
  4371. }
  4372. // Publish: Publish a layer asset.
  4373. func (r *LayersService) Publish(id string) *LayersPublishCall {
  4374. c := &LayersPublishCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  4375. c.id = id
  4376. return c
  4377. }
  4378. // Force sets the optional parameter "force": If set to true, the API
  4379. // will allow publication of the layer even if it's out of date. If not
  4380. // true, you'll need to reprocess any out-of-date layer before
  4381. // publishing.
  4382. func (c *LayersPublishCall) Force(force bool) *LayersPublishCall {
  4383. c.urlParams_.Set("force", fmt.Sprint(force))
  4384. return c
  4385. }
  4386. // Fields allows partial responses to be retrieved. See
  4387. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  4388. // for more information.
  4389. func (c *LayersPublishCall) Fields(s ...googleapi.Field) *LayersPublishCall {
  4390. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  4391. return c
  4392. }
  4393. // Context sets the context to be used in this call's Do method. Any
  4394. // pending HTTP request will be aborted if the provided context is
  4395. // canceled.
  4396. func (c *LayersPublishCall) Context(ctx context.Context) *LayersPublishCall {
  4397. c.ctx_ = ctx
  4398. return c
  4399. }
  4400. func (c *LayersPublishCall) doRequest(alt string) (*http.Response, error) {
  4401. var body io.Reader = nil
  4402. c.urlParams_.Set("alt", alt)
  4403. urls := googleapi.ResolveRelative(c.s.BasePath, "layers/{id}/publish")
  4404. urls += "?" + c.urlParams_.Encode()
  4405. req, _ := http.NewRequest("POST", urls, body)
  4406. googleapi.Expand(req.URL, map[string]string{
  4407. "id": c.id,
  4408. })
  4409. req.Header.Set("User-Agent", c.s.userAgent())
  4410. if c.ctx_ != nil {
  4411. return ctxhttp.Do(c.ctx_, c.s.client, req)
  4412. }
  4413. return c.s.client.Do(req)
  4414. }
  4415. // Do executes the "mapsengine.layers.publish" call.
  4416. // Exactly one of *PublishResponse or error will be non-nil. Any non-2xx
  4417. // status code is an error. Response headers are in either
  4418. // *PublishResponse.ServerResponse.Header or (if a response was returned
  4419. // at all) in error.(*googleapi.Error).Header. Use
  4420. // googleapi.IsNotModified to check whether the returned error was
  4421. // because http.StatusNotModified was returned.
  4422. func (c *LayersPublishCall) Do(opts ...googleapi.CallOption) (*PublishResponse, error) {
  4423. gensupport.SetOptions(c.urlParams_, opts...)
  4424. res, err := c.doRequest("json")
  4425. if res != nil && res.StatusCode == http.StatusNotModified {
  4426. if res.Body != nil {
  4427. res.Body.Close()
  4428. }
  4429. return nil, &googleapi.Error{
  4430. Code: res.StatusCode,
  4431. Header: res.Header,
  4432. }
  4433. }
  4434. if err != nil {
  4435. return nil, err
  4436. }
  4437. defer googleapi.CloseBody(res)
  4438. if err := googleapi.CheckResponse(res); err != nil {
  4439. return nil, err
  4440. }
  4441. ret := &PublishResponse{
  4442. ServerResponse: googleapi.ServerResponse{
  4443. Header: res.Header,
  4444. HTTPStatusCode: res.StatusCode,
  4445. },
  4446. }
  4447. if err := json.NewDecoder(res.Body).Decode(&ret); err != nil {
  4448. return nil, err
  4449. }
  4450. return ret, nil
  4451. // {
  4452. // "description": "Publish a layer asset.",
  4453. // "httpMethod": "POST",
  4454. // "id": "mapsengine.layers.publish",
  4455. // "parameterOrder": [
  4456. // "id"
  4457. // ],
  4458. // "parameters": {
  4459. // "force": {
  4460. // "description": "If set to true, the API will allow publication of the layer even if it's out of date. If not true, you'll need to reprocess any out-of-date layer before publishing.",
  4461. // "location": "query",
  4462. // "type": "boolean"
  4463. // },
  4464. // "id": {
  4465. // "description": "The ID of the layer.",
  4466. // "location": "path",
  4467. // "required": true,
  4468. // "type": "string"
  4469. // }
  4470. // },
  4471. // "path": "layers/{id}/publish",
  4472. // "response": {
  4473. // "$ref": "PublishResponse"
  4474. // },
  4475. // "scopes": [
  4476. // "https://www.googleapis.com/auth/mapsengine"
  4477. // ]
  4478. // }
  4479. }
  4480. // method id "mapsengine.layers.unpublish":
  4481. type LayersUnpublishCall struct {
  4482. s *Service
  4483. id string
  4484. urlParams_ gensupport.URLParams
  4485. ctx_ context.Context
  4486. }
  4487. // Unpublish: Unpublish a layer asset.
  4488. func (r *LayersService) Unpublish(id string) *LayersUnpublishCall {
  4489. c := &LayersUnpublishCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  4490. c.id = id
  4491. return c
  4492. }
  4493. // Fields allows partial responses to be retrieved. See
  4494. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  4495. // for more information.
  4496. func (c *LayersUnpublishCall) Fields(s ...googleapi.Field) *LayersUnpublishCall {
  4497. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  4498. return c
  4499. }
  4500. // Context sets the context to be used in this call's Do method. Any
  4501. // pending HTTP request will be aborted if the provided context is
  4502. // canceled.
  4503. func (c *LayersUnpublishCall) Context(ctx context.Context) *LayersUnpublishCall {
  4504. c.ctx_ = ctx
  4505. return c
  4506. }
  4507. func (c *LayersUnpublishCall) doRequest(alt string) (*http.Response, error) {
  4508. var body io.Reader = nil
  4509. c.urlParams_.Set("alt", alt)
  4510. urls := googleapi.ResolveRelative(c.s.BasePath, "layers/{id}/unpublish")
  4511. urls += "?" + c.urlParams_.Encode()
  4512. req, _ := http.NewRequest("POST", urls, body)
  4513. googleapi.Expand(req.URL, map[string]string{
  4514. "id": c.id,
  4515. })
  4516. req.Header.Set("User-Agent", c.s.userAgent())
  4517. if c.ctx_ != nil {
  4518. return ctxhttp.Do(c.ctx_, c.s.client, req)
  4519. }
  4520. return c.s.client.Do(req)
  4521. }
  4522. // Do executes the "mapsengine.layers.unpublish" call.
  4523. // Exactly one of *PublishResponse or error will be non-nil. Any non-2xx
  4524. // status code is an error. Response headers are in either
  4525. // *PublishResponse.ServerResponse.Header or (if a response was returned
  4526. // at all) in error.(*googleapi.Error).Header. Use
  4527. // googleapi.IsNotModified to check whether the returned error was
  4528. // because http.StatusNotModified was returned.
  4529. func (c *LayersUnpublishCall) Do(opts ...googleapi.CallOption) (*PublishResponse, error) {
  4530. gensupport.SetOptions(c.urlParams_, opts...)
  4531. res, err := c.doRequest("json")
  4532. if res != nil && res.StatusCode == http.StatusNotModified {
  4533. if res.Body != nil {
  4534. res.Body.Close()
  4535. }
  4536. return nil, &googleapi.Error{
  4537. Code: res.StatusCode,
  4538. Header: res.Header,
  4539. }
  4540. }
  4541. if err != nil {
  4542. return nil, err
  4543. }
  4544. defer googleapi.CloseBody(res)
  4545. if err := googleapi.CheckResponse(res); err != nil {
  4546. return nil, err
  4547. }
  4548. ret := &PublishResponse{
  4549. ServerResponse: googleapi.ServerResponse{
  4550. Header: res.Header,
  4551. HTTPStatusCode: res.StatusCode,
  4552. },
  4553. }
  4554. if err := json.NewDecoder(res.Body).Decode(&ret); err != nil {
  4555. return nil, err
  4556. }
  4557. return ret, nil
  4558. // {
  4559. // "description": "Unpublish a layer asset.",
  4560. // "httpMethod": "POST",
  4561. // "id": "mapsengine.layers.unpublish",
  4562. // "parameterOrder": [
  4563. // "id"
  4564. // ],
  4565. // "parameters": {
  4566. // "id": {
  4567. // "description": "The ID of the layer.",
  4568. // "location": "path",
  4569. // "required": true,
  4570. // "type": "string"
  4571. // }
  4572. // },
  4573. // "path": "layers/{id}/unpublish",
  4574. // "response": {
  4575. // "$ref": "PublishResponse"
  4576. // },
  4577. // "scopes": [
  4578. // "https://www.googleapis.com/auth/mapsengine"
  4579. // ]
  4580. // }
  4581. }
  4582. // method id "mapsengine.layers.parents.list":
  4583. type LayersParentsListCall struct {
  4584. s *Service
  4585. id string
  4586. urlParams_ gensupport.URLParams
  4587. ifNoneMatch_ string
  4588. ctx_ context.Context
  4589. }
  4590. // List: Return all parent ids of the specified layer.
  4591. func (r *LayersParentsService) List(id string) *LayersParentsListCall {
  4592. c := &LayersParentsListCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  4593. c.id = id
  4594. return c
  4595. }
  4596. // MaxResults sets the optional parameter "maxResults": The maximum
  4597. // number of items to include in a single response page. The maximum
  4598. // supported value is 50.
  4599. func (c *LayersParentsListCall) MaxResults(maxResults int64) *LayersParentsListCall {
  4600. c.urlParams_.Set("maxResults", fmt.Sprint(maxResults))
  4601. return c
  4602. }
  4603. // PageToken sets the optional parameter "pageToken": The continuation
  4604. // token, used to page through large result sets. To get the next page
  4605. // of results, set this parameter to the value of nextPageToken from the
  4606. // previous response.
  4607. func (c *LayersParentsListCall) PageToken(pageToken string) *LayersParentsListCall {
  4608. c.urlParams_.Set("pageToken", pageToken)
  4609. return c
  4610. }
  4611. // Fields allows partial responses to be retrieved. See
  4612. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  4613. // for more information.
  4614. func (c *LayersParentsListCall) Fields(s ...googleapi.Field) *LayersParentsListCall {
  4615. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  4616. return c
  4617. }
  4618. // IfNoneMatch sets the optional parameter which makes the operation
  4619. // fail if the object's ETag matches the given value. This is useful for
  4620. // getting updates only after the object has changed since the last
  4621. // request. Use googleapi.IsNotModified to check whether the response
  4622. // error from Do is the result of In-None-Match.
  4623. func (c *LayersParentsListCall) IfNoneMatch(entityTag string) *LayersParentsListCall {
  4624. c.ifNoneMatch_ = entityTag
  4625. return c
  4626. }
  4627. // Context sets the context to be used in this call's Do method. Any
  4628. // pending HTTP request will be aborted if the provided context is
  4629. // canceled.
  4630. func (c *LayersParentsListCall) Context(ctx context.Context) *LayersParentsListCall {
  4631. c.ctx_ = ctx
  4632. return c
  4633. }
  4634. func (c *LayersParentsListCall) doRequest(alt string) (*http.Response, error) {
  4635. var body io.Reader = nil
  4636. c.urlParams_.Set("alt", alt)
  4637. urls := googleapi.ResolveRelative(c.s.BasePath, "layers/{id}/parents")
  4638. urls += "?" + c.urlParams_.Encode()
  4639. req, _ := http.NewRequest("GET", urls, body)
  4640. googleapi.Expand(req.URL, map[string]string{
  4641. "id": c.id,
  4642. })
  4643. req.Header.Set("User-Agent", c.s.userAgent())
  4644. if c.ifNoneMatch_ != "" {
  4645. req.Header.Set("If-None-Match", c.ifNoneMatch_)
  4646. }
  4647. if c.ctx_ != nil {
  4648. return ctxhttp.Do(c.ctx_, c.s.client, req)
  4649. }
  4650. return c.s.client.Do(req)
  4651. }
  4652. // Do executes the "mapsengine.layers.parents.list" call.
  4653. // Exactly one of *ParentsListResponse or error will be non-nil. Any
  4654. // non-2xx status code is an error. Response headers are in either
  4655. // *ParentsListResponse.ServerResponse.Header or (if a response was
  4656. // returned at all) in error.(*googleapi.Error).Header. Use
  4657. // googleapi.IsNotModified to check whether the returned error was
  4658. // because http.StatusNotModified was returned.
  4659. func (c *LayersParentsListCall) Do(opts ...googleapi.CallOption) (*ParentsListResponse, error) {
  4660. gensupport.SetOptions(c.urlParams_, opts...)
  4661. res, err := c.doRequest("json")
  4662. if res != nil && res.StatusCode == http.StatusNotModified {
  4663. if res.Body != nil {
  4664. res.Body.Close()
  4665. }
  4666. return nil, &googleapi.Error{
  4667. Code: res.StatusCode,
  4668. Header: res.Header,
  4669. }
  4670. }
  4671. if err != nil {
  4672. return nil, err
  4673. }
  4674. defer googleapi.CloseBody(res)
  4675. if err := googleapi.CheckResponse(res); err != nil {
  4676. return nil, err
  4677. }
  4678. ret := &ParentsListResponse{
  4679. ServerResponse: googleapi.ServerResponse{
  4680. Header: res.Header,
  4681. HTTPStatusCode: res.StatusCode,
  4682. },
  4683. }
  4684. if err := json.NewDecoder(res.Body).Decode(&ret); err != nil {
  4685. return nil, err
  4686. }
  4687. return ret, nil
  4688. // {
  4689. // "description": "Return all parent ids of the specified layer.",
  4690. // "httpMethod": "GET",
  4691. // "id": "mapsengine.layers.parents.list",
  4692. // "parameterOrder": [
  4693. // "id"
  4694. // ],
  4695. // "parameters": {
  4696. // "id": {
  4697. // "description": "The ID of the layer whose parents will be listed.",
  4698. // "location": "path",
  4699. // "required": true,
  4700. // "type": "string"
  4701. // },
  4702. // "maxResults": {
  4703. // "description": "The maximum number of items to include in a single response page. The maximum supported value is 50.",
  4704. // "format": "uint32",
  4705. // "location": "query",
  4706. // "type": "integer"
  4707. // },
  4708. // "pageToken": {
  4709. // "description": "The continuation token, used to page through large result sets. To get the next page of results, set this parameter to the value of nextPageToken from the previous response.",
  4710. // "location": "query",
  4711. // "type": "string"
  4712. // }
  4713. // },
  4714. // "path": "layers/{id}/parents",
  4715. // "response": {
  4716. // "$ref": "ParentsListResponse"
  4717. // },
  4718. // "scopes": [
  4719. // "https://www.googleapis.com/auth/mapsengine",
  4720. // "https://www.googleapis.com/auth/mapsengine.readonly"
  4721. // ]
  4722. // }
  4723. }
  4724. // Pages invokes f for each page of results.
  4725. // A non-nil error returned from f will halt the iteration.
  4726. // The provided context supersedes any context provided to the Context method.
  4727. func (c *LayersParentsListCall) Pages(ctx context.Context, f func(*ParentsListResponse) error) error {
  4728. c.ctx_ = ctx
  4729. defer c.PageToken(c.urlParams_.Get("pageToken")) // reset paging to original point
  4730. for {
  4731. x, err := c.Do()
  4732. if err != nil {
  4733. return err
  4734. }
  4735. if err := f(x); err != nil {
  4736. return err
  4737. }
  4738. if x.NextPageToken == "" {
  4739. return nil
  4740. }
  4741. c.PageToken(x.NextPageToken)
  4742. }
  4743. }
  4744. // method id "mapsengine.layers.permissions.batchDelete":
  4745. type LayersPermissionsBatchDeleteCall struct {
  4746. s *Service
  4747. id string
  4748. permissionsbatchdeleterequest *PermissionsBatchDeleteRequest
  4749. urlParams_ gensupport.URLParams
  4750. ctx_ context.Context
  4751. }
  4752. // BatchDelete: Remove permission entries from an already existing
  4753. // asset.
  4754. func (r *LayersPermissionsService) BatchDelete(id string, permissionsbatchdeleterequest *PermissionsBatchDeleteRequest) *LayersPermissionsBatchDeleteCall {
  4755. c := &LayersPermissionsBatchDeleteCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  4756. c.id = id
  4757. c.permissionsbatchdeleterequest = permissionsbatchdeleterequest
  4758. return c
  4759. }
  4760. // Fields allows partial responses to be retrieved. See
  4761. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  4762. // for more information.
  4763. func (c *LayersPermissionsBatchDeleteCall) Fields(s ...googleapi.Field) *LayersPermissionsBatchDeleteCall {
  4764. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  4765. return c
  4766. }
  4767. // Context sets the context to be used in this call's Do method. Any
  4768. // pending HTTP request will be aborted if the provided context is
  4769. // canceled.
  4770. func (c *LayersPermissionsBatchDeleteCall) Context(ctx context.Context) *LayersPermissionsBatchDeleteCall {
  4771. c.ctx_ = ctx
  4772. return c
  4773. }
  4774. func (c *LayersPermissionsBatchDeleteCall) doRequest(alt string) (*http.Response, error) {
  4775. var body io.Reader = nil
  4776. body, err := googleapi.WithoutDataWrapper.JSONReader(c.permissionsbatchdeleterequest)
  4777. if err != nil {
  4778. return nil, err
  4779. }
  4780. ctype := "application/json"
  4781. c.urlParams_.Set("alt", alt)
  4782. urls := googleapi.ResolveRelative(c.s.BasePath, "layers/{id}/permissions/batchDelete")
  4783. urls += "?" + c.urlParams_.Encode()
  4784. req, _ := http.NewRequest("POST", urls, body)
  4785. googleapi.Expand(req.URL, map[string]string{
  4786. "id": c.id,
  4787. })
  4788. req.Header.Set("Content-Type", ctype)
  4789. req.Header.Set("User-Agent", c.s.userAgent())
  4790. if c.ctx_ != nil {
  4791. return ctxhttp.Do(c.ctx_, c.s.client, req)
  4792. }
  4793. return c.s.client.Do(req)
  4794. }
  4795. // Do executes the "mapsengine.layers.permissions.batchDelete" call.
  4796. // Exactly one of *PermissionsBatchDeleteResponse or error will be
  4797. // non-nil. Any non-2xx status code is an error. Response headers are in
  4798. // either *PermissionsBatchDeleteResponse.ServerResponse.Header or (if a
  4799. // response was returned at all) in error.(*googleapi.Error).Header. Use
  4800. // googleapi.IsNotModified to check whether the returned error was
  4801. // because http.StatusNotModified was returned.
  4802. func (c *LayersPermissionsBatchDeleteCall) Do(opts ...googleapi.CallOption) (*PermissionsBatchDeleteResponse, error) {
  4803. gensupport.SetOptions(c.urlParams_, opts...)
  4804. res, err := c.doRequest("json")
  4805. if res != nil && res.StatusCode == http.StatusNotModified {
  4806. if res.Body != nil {
  4807. res.Body.Close()
  4808. }
  4809. return nil, &googleapi.Error{
  4810. Code: res.StatusCode,
  4811. Header: res.Header,
  4812. }
  4813. }
  4814. if err != nil {
  4815. return nil, err
  4816. }
  4817. defer googleapi.CloseBody(res)
  4818. if err := googleapi.CheckResponse(res); err != nil {
  4819. return nil, err
  4820. }
  4821. ret := &PermissionsBatchDeleteResponse{
  4822. ServerResponse: googleapi.ServerResponse{
  4823. Header: res.Header,
  4824. HTTPStatusCode: res.StatusCode,
  4825. },
  4826. }
  4827. if err := json.NewDecoder(res.Body).Decode(&ret); err != nil {
  4828. return nil, err
  4829. }
  4830. return ret, nil
  4831. // {
  4832. // "description": "Remove permission entries from an already existing asset.",
  4833. // "httpMethod": "POST",
  4834. // "id": "mapsengine.layers.permissions.batchDelete",
  4835. // "parameterOrder": [
  4836. // "id"
  4837. // ],
  4838. // "parameters": {
  4839. // "id": {
  4840. // "description": "The ID of the asset from which permissions will be removed.",
  4841. // "location": "path",
  4842. // "required": true,
  4843. // "type": "string"
  4844. // }
  4845. // },
  4846. // "path": "layers/{id}/permissions/batchDelete",
  4847. // "request": {
  4848. // "$ref": "PermissionsBatchDeleteRequest"
  4849. // },
  4850. // "response": {
  4851. // "$ref": "PermissionsBatchDeleteResponse"
  4852. // },
  4853. // "scopes": [
  4854. // "https://www.googleapis.com/auth/mapsengine"
  4855. // ]
  4856. // }
  4857. }
  4858. // method id "mapsengine.layers.permissions.batchUpdate":
  4859. type LayersPermissionsBatchUpdateCall struct {
  4860. s *Service
  4861. id string
  4862. permissionsbatchupdaterequest *PermissionsBatchUpdateRequest
  4863. urlParams_ gensupport.URLParams
  4864. ctx_ context.Context
  4865. }
  4866. // BatchUpdate: Add or update permission entries to an already existing
  4867. // asset.
  4868. //
  4869. // An asset can hold up to 20 different permission entries. Each
  4870. // batchInsert request is atomic.
  4871. func (r *LayersPermissionsService) BatchUpdate(id string, permissionsbatchupdaterequest *PermissionsBatchUpdateRequest) *LayersPermissionsBatchUpdateCall {
  4872. c := &LayersPermissionsBatchUpdateCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  4873. c.id = id
  4874. c.permissionsbatchupdaterequest = permissionsbatchupdaterequest
  4875. return c
  4876. }
  4877. // Fields allows partial responses to be retrieved. See
  4878. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  4879. // for more information.
  4880. func (c *LayersPermissionsBatchUpdateCall) Fields(s ...googleapi.Field) *LayersPermissionsBatchUpdateCall {
  4881. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  4882. return c
  4883. }
  4884. // Context sets the context to be used in this call's Do method. Any
  4885. // pending HTTP request will be aborted if the provided context is
  4886. // canceled.
  4887. func (c *LayersPermissionsBatchUpdateCall) Context(ctx context.Context) *LayersPermissionsBatchUpdateCall {
  4888. c.ctx_ = ctx
  4889. return c
  4890. }
  4891. func (c *LayersPermissionsBatchUpdateCall) doRequest(alt string) (*http.Response, error) {
  4892. var body io.Reader = nil
  4893. body, err := googleapi.WithoutDataWrapper.JSONReader(c.permissionsbatchupdaterequest)
  4894. if err != nil {
  4895. return nil, err
  4896. }
  4897. ctype := "application/json"
  4898. c.urlParams_.Set("alt", alt)
  4899. urls := googleapi.ResolveRelative(c.s.BasePath, "layers/{id}/permissions/batchUpdate")
  4900. urls += "?" + c.urlParams_.Encode()
  4901. req, _ := http.NewRequest("POST", urls, body)
  4902. googleapi.Expand(req.URL, map[string]string{
  4903. "id": c.id,
  4904. })
  4905. req.Header.Set("Content-Type", ctype)
  4906. req.Header.Set("User-Agent", c.s.userAgent())
  4907. if c.ctx_ != nil {
  4908. return ctxhttp.Do(c.ctx_, c.s.client, req)
  4909. }
  4910. return c.s.client.Do(req)
  4911. }
  4912. // Do executes the "mapsengine.layers.permissions.batchUpdate" call.
  4913. // Exactly one of *PermissionsBatchUpdateResponse or error will be
  4914. // non-nil. Any non-2xx status code is an error. Response headers are in
  4915. // either *PermissionsBatchUpdateResponse.ServerResponse.Header or (if a
  4916. // response was returned at all) in error.(*googleapi.Error).Header. Use
  4917. // googleapi.IsNotModified to check whether the returned error was
  4918. // because http.StatusNotModified was returned.
  4919. func (c *LayersPermissionsBatchUpdateCall) Do(opts ...googleapi.CallOption) (*PermissionsBatchUpdateResponse, error) {
  4920. gensupport.SetOptions(c.urlParams_, opts...)
  4921. res, err := c.doRequest("json")
  4922. if res != nil && res.StatusCode == http.StatusNotModified {
  4923. if res.Body != nil {
  4924. res.Body.Close()
  4925. }
  4926. return nil, &googleapi.Error{
  4927. Code: res.StatusCode,
  4928. Header: res.Header,
  4929. }
  4930. }
  4931. if err != nil {
  4932. return nil, err
  4933. }
  4934. defer googleapi.CloseBody(res)
  4935. if err := googleapi.CheckResponse(res); err != nil {
  4936. return nil, err
  4937. }
  4938. ret := &PermissionsBatchUpdateResponse{
  4939. ServerResponse: googleapi.ServerResponse{
  4940. Header: res.Header,
  4941. HTTPStatusCode: res.StatusCode,
  4942. },
  4943. }
  4944. if err := json.NewDecoder(res.Body).Decode(&ret); err != nil {
  4945. return nil, err
  4946. }
  4947. return ret, nil
  4948. // {
  4949. // "description": "Add or update permission entries to an already existing asset.\n\nAn asset can hold up to 20 different permission entries. Each batchInsert request is atomic.",
  4950. // "httpMethod": "POST",
  4951. // "id": "mapsengine.layers.permissions.batchUpdate",
  4952. // "parameterOrder": [
  4953. // "id"
  4954. // ],
  4955. // "parameters": {
  4956. // "id": {
  4957. // "description": "The ID of the asset to which permissions will be added.",
  4958. // "location": "path",
  4959. // "required": true,
  4960. // "type": "string"
  4961. // }
  4962. // },
  4963. // "path": "layers/{id}/permissions/batchUpdate",
  4964. // "request": {
  4965. // "$ref": "PermissionsBatchUpdateRequest"
  4966. // },
  4967. // "response": {
  4968. // "$ref": "PermissionsBatchUpdateResponse"
  4969. // },
  4970. // "scopes": [
  4971. // "https://www.googleapis.com/auth/mapsengine"
  4972. // ]
  4973. // }
  4974. }
  4975. // method id "mapsengine.layers.permissions.list":
  4976. type LayersPermissionsListCall struct {
  4977. s *Service
  4978. id string
  4979. urlParams_ gensupport.URLParams
  4980. ifNoneMatch_ string
  4981. ctx_ context.Context
  4982. }
  4983. // List: Return all of the permissions for the specified asset.
  4984. func (r *LayersPermissionsService) List(id string) *LayersPermissionsListCall {
  4985. c := &LayersPermissionsListCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  4986. c.id = id
  4987. return c
  4988. }
  4989. // Fields allows partial responses to be retrieved. See
  4990. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  4991. // for more information.
  4992. func (c *LayersPermissionsListCall) Fields(s ...googleapi.Field) *LayersPermissionsListCall {
  4993. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  4994. return c
  4995. }
  4996. // IfNoneMatch sets the optional parameter which makes the operation
  4997. // fail if the object's ETag matches the given value. This is useful for
  4998. // getting updates only after the object has changed since the last
  4999. // request. Use googleapi.IsNotModified to check whether the response
  5000. // error from Do is the result of In-None-Match.
  5001. func (c *LayersPermissionsListCall) IfNoneMatch(entityTag string) *LayersPermissionsListCall {
  5002. c.ifNoneMatch_ = entityTag
  5003. return c
  5004. }
  5005. // Context sets the context to be used in this call's Do method. Any
  5006. // pending HTTP request will be aborted if the provided context is
  5007. // canceled.
  5008. func (c *LayersPermissionsListCall) Context(ctx context.Context) *LayersPermissionsListCall {
  5009. c.ctx_ = ctx
  5010. return c
  5011. }
  5012. func (c *LayersPermissionsListCall) doRequest(alt string) (*http.Response, error) {
  5013. var body io.Reader = nil
  5014. c.urlParams_.Set("alt", alt)
  5015. urls := googleapi.ResolveRelative(c.s.BasePath, "layers/{id}/permissions")
  5016. urls += "?" + c.urlParams_.Encode()
  5017. req, _ := http.NewRequest("GET", urls, body)
  5018. googleapi.Expand(req.URL, map[string]string{
  5019. "id": c.id,
  5020. })
  5021. req.Header.Set("User-Agent", c.s.userAgent())
  5022. if c.ifNoneMatch_ != "" {
  5023. req.Header.Set("If-None-Match", c.ifNoneMatch_)
  5024. }
  5025. if c.ctx_ != nil {
  5026. return ctxhttp.Do(c.ctx_, c.s.client, req)
  5027. }
  5028. return c.s.client.Do(req)
  5029. }
  5030. // Do executes the "mapsengine.layers.permissions.list" call.
  5031. // Exactly one of *PermissionsListResponse or error will be non-nil. Any
  5032. // non-2xx status code is an error. Response headers are in either
  5033. // *PermissionsListResponse.ServerResponse.Header or (if a response was
  5034. // returned at all) in error.(*googleapi.Error).Header. Use
  5035. // googleapi.IsNotModified to check whether the returned error was
  5036. // because http.StatusNotModified was returned.
  5037. func (c *LayersPermissionsListCall) Do(opts ...googleapi.CallOption) (*PermissionsListResponse, error) {
  5038. gensupport.SetOptions(c.urlParams_, opts...)
  5039. res, err := c.doRequest("json")
  5040. if res != nil && res.StatusCode == http.StatusNotModified {
  5041. if res.Body != nil {
  5042. res.Body.Close()
  5043. }
  5044. return nil, &googleapi.Error{
  5045. Code: res.StatusCode,
  5046. Header: res.Header,
  5047. }
  5048. }
  5049. if err != nil {
  5050. return nil, err
  5051. }
  5052. defer googleapi.CloseBody(res)
  5053. if err := googleapi.CheckResponse(res); err != nil {
  5054. return nil, err
  5055. }
  5056. ret := &PermissionsListResponse{
  5057. ServerResponse: googleapi.ServerResponse{
  5058. Header: res.Header,
  5059. HTTPStatusCode: res.StatusCode,
  5060. },
  5061. }
  5062. if err := json.NewDecoder(res.Body).Decode(&ret); err != nil {
  5063. return nil, err
  5064. }
  5065. return ret, nil
  5066. // {
  5067. // "description": "Return all of the permissions for the specified asset.",
  5068. // "httpMethod": "GET",
  5069. // "id": "mapsengine.layers.permissions.list",
  5070. // "parameterOrder": [
  5071. // "id"
  5072. // ],
  5073. // "parameters": {
  5074. // "id": {
  5075. // "description": "The ID of the asset whose permissions will be listed.",
  5076. // "location": "path",
  5077. // "required": true,
  5078. // "type": "string"
  5079. // }
  5080. // },
  5081. // "path": "layers/{id}/permissions",
  5082. // "response": {
  5083. // "$ref": "PermissionsListResponse"
  5084. // },
  5085. // "scopes": [
  5086. // "https://www.googleapis.com/auth/mapsengine",
  5087. // "https://www.googleapis.com/auth/mapsengine.readonly"
  5088. // ]
  5089. // }
  5090. }
  5091. // method id "mapsengine.maps.create":
  5092. type MapsCreateCall struct {
  5093. s *Service
  5094. map_ *Map
  5095. urlParams_ gensupport.URLParams
  5096. ctx_ context.Context
  5097. }
  5098. // Create: Create a map asset.
  5099. func (r *MapsService) Create(map_ *Map) *MapsCreateCall {
  5100. c := &MapsCreateCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  5101. c.map_ = map_
  5102. return c
  5103. }
  5104. // Fields allows partial responses to be retrieved. See
  5105. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  5106. // for more information.
  5107. func (c *MapsCreateCall) Fields(s ...googleapi.Field) *MapsCreateCall {
  5108. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  5109. return c
  5110. }
  5111. // Context sets the context to be used in this call's Do method. Any
  5112. // pending HTTP request will be aborted if the provided context is
  5113. // canceled.
  5114. func (c *MapsCreateCall) Context(ctx context.Context) *MapsCreateCall {
  5115. c.ctx_ = ctx
  5116. return c
  5117. }
  5118. func (c *MapsCreateCall) doRequest(alt string) (*http.Response, error) {
  5119. var body io.Reader = nil
  5120. body, err := googleapi.WithoutDataWrapper.JSONReader(c.map_)
  5121. if err != nil {
  5122. return nil, err
  5123. }
  5124. ctype := "application/json"
  5125. c.urlParams_.Set("alt", alt)
  5126. urls := googleapi.ResolveRelative(c.s.BasePath, "maps")
  5127. urls += "?" + c.urlParams_.Encode()
  5128. req, _ := http.NewRequest("POST", urls, body)
  5129. googleapi.SetOpaque(req.URL)
  5130. req.Header.Set("Content-Type", ctype)
  5131. req.Header.Set("User-Agent", c.s.userAgent())
  5132. if c.ctx_ != nil {
  5133. return ctxhttp.Do(c.ctx_, c.s.client, req)
  5134. }
  5135. return c.s.client.Do(req)
  5136. }
  5137. // Do executes the "mapsengine.maps.create" call.
  5138. // Exactly one of *Map or error will be non-nil. Any non-2xx status code
  5139. // is an error. Response headers are in either
  5140. // *Map.ServerResponse.Header or (if a response was returned at all) in
  5141. // error.(*googleapi.Error).Header. Use googleapi.IsNotModified to check
  5142. // whether the returned error was because http.StatusNotModified was
  5143. // returned.
  5144. func (c *MapsCreateCall) Do(opts ...googleapi.CallOption) (*Map, error) {
  5145. gensupport.SetOptions(c.urlParams_, opts...)
  5146. res, err := c.doRequest("json")
  5147. if res != nil && res.StatusCode == http.StatusNotModified {
  5148. if res.Body != nil {
  5149. res.Body.Close()
  5150. }
  5151. return nil, &googleapi.Error{
  5152. Code: res.StatusCode,
  5153. Header: res.Header,
  5154. }
  5155. }
  5156. if err != nil {
  5157. return nil, err
  5158. }
  5159. defer googleapi.CloseBody(res)
  5160. if err := googleapi.CheckResponse(res); err != nil {
  5161. return nil, err
  5162. }
  5163. ret := &Map{
  5164. ServerResponse: googleapi.ServerResponse{
  5165. Header: res.Header,
  5166. HTTPStatusCode: res.StatusCode,
  5167. },
  5168. }
  5169. if err := json.NewDecoder(res.Body).Decode(&ret); err != nil {
  5170. return nil, err
  5171. }
  5172. return ret, nil
  5173. // {
  5174. // "description": "Create a map asset.",
  5175. // "httpMethod": "POST",
  5176. // "id": "mapsengine.maps.create",
  5177. // "path": "maps",
  5178. // "request": {
  5179. // "$ref": "Map"
  5180. // },
  5181. // "response": {
  5182. // "$ref": "Map"
  5183. // },
  5184. // "scopes": [
  5185. // "https://www.googleapis.com/auth/mapsengine"
  5186. // ]
  5187. // }
  5188. }
  5189. // method id "mapsengine.maps.delete":
  5190. type MapsDeleteCall struct {
  5191. s *Service
  5192. id string
  5193. urlParams_ gensupport.URLParams
  5194. ctx_ context.Context
  5195. }
  5196. // Delete: Delete a map.
  5197. func (r *MapsService) Delete(id string) *MapsDeleteCall {
  5198. c := &MapsDeleteCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  5199. c.id = id
  5200. return c
  5201. }
  5202. // Fields allows partial responses to be retrieved. See
  5203. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  5204. // for more information.
  5205. func (c *MapsDeleteCall) Fields(s ...googleapi.Field) *MapsDeleteCall {
  5206. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  5207. return c
  5208. }
  5209. // Context sets the context to be used in this call's Do method. Any
  5210. // pending HTTP request will be aborted if the provided context is
  5211. // canceled.
  5212. func (c *MapsDeleteCall) Context(ctx context.Context) *MapsDeleteCall {
  5213. c.ctx_ = ctx
  5214. return c
  5215. }
  5216. func (c *MapsDeleteCall) doRequest(alt string) (*http.Response, error) {
  5217. var body io.Reader = nil
  5218. c.urlParams_.Set("alt", alt)
  5219. urls := googleapi.ResolveRelative(c.s.BasePath, "maps/{id}")
  5220. urls += "?" + c.urlParams_.Encode()
  5221. req, _ := http.NewRequest("DELETE", urls, body)
  5222. googleapi.Expand(req.URL, map[string]string{
  5223. "id": c.id,
  5224. })
  5225. req.Header.Set("User-Agent", c.s.userAgent())
  5226. if c.ctx_ != nil {
  5227. return ctxhttp.Do(c.ctx_, c.s.client, req)
  5228. }
  5229. return c.s.client.Do(req)
  5230. }
  5231. // Do executes the "mapsengine.maps.delete" call.
  5232. func (c *MapsDeleteCall) Do(opts ...googleapi.CallOption) error {
  5233. gensupport.SetOptions(c.urlParams_, opts...)
  5234. res, err := c.doRequest("json")
  5235. if err != nil {
  5236. return err
  5237. }
  5238. defer googleapi.CloseBody(res)
  5239. if err := googleapi.CheckResponse(res); err != nil {
  5240. return err
  5241. }
  5242. return nil
  5243. // {
  5244. // "description": "Delete a map.",
  5245. // "httpMethod": "DELETE",
  5246. // "id": "mapsengine.maps.delete",
  5247. // "parameterOrder": [
  5248. // "id"
  5249. // ],
  5250. // "parameters": {
  5251. // "id": {
  5252. // "description": "The ID of the map. Only the map creator or project owner are permitted to delete. If the map is published the request will fail. Unpublish the map prior to deleting.",
  5253. // "location": "path",
  5254. // "required": true,
  5255. // "type": "string"
  5256. // }
  5257. // },
  5258. // "path": "maps/{id}",
  5259. // "scopes": [
  5260. // "https://www.googleapis.com/auth/mapsengine"
  5261. // ]
  5262. // }
  5263. }
  5264. // method id "mapsengine.maps.get":
  5265. type MapsGetCall struct {
  5266. s *Service
  5267. id string
  5268. urlParams_ gensupport.URLParams
  5269. ifNoneMatch_ string
  5270. ctx_ context.Context
  5271. }
  5272. // Get: Return metadata for a particular map.
  5273. func (r *MapsService) Get(id string) *MapsGetCall {
  5274. c := &MapsGetCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  5275. c.id = id
  5276. return c
  5277. }
  5278. // Version sets the optional parameter "version": Deprecated: The
  5279. // version parameter indicates which version of the map should be
  5280. // returned. When version is set to published, the published version of
  5281. // the map will be returned. Please use the maps.getPublished endpoint
  5282. // instead.
  5283. //
  5284. // Possible values:
  5285. // "draft" - The draft version.
  5286. // "published" - The published version.
  5287. func (c *MapsGetCall) Version(version string) *MapsGetCall {
  5288. c.urlParams_.Set("version", version)
  5289. return c
  5290. }
  5291. // Fields allows partial responses to be retrieved. See
  5292. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  5293. // for more information.
  5294. func (c *MapsGetCall) Fields(s ...googleapi.Field) *MapsGetCall {
  5295. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  5296. return c
  5297. }
  5298. // IfNoneMatch sets the optional parameter which makes the operation
  5299. // fail if the object's ETag matches the given value. This is useful for
  5300. // getting updates only after the object has changed since the last
  5301. // request. Use googleapi.IsNotModified to check whether the response
  5302. // error from Do is the result of In-None-Match.
  5303. func (c *MapsGetCall) IfNoneMatch(entityTag string) *MapsGetCall {
  5304. c.ifNoneMatch_ = entityTag
  5305. return c
  5306. }
  5307. // Context sets the context to be used in this call's Do method. Any
  5308. // pending HTTP request will be aborted if the provided context is
  5309. // canceled.
  5310. func (c *MapsGetCall) Context(ctx context.Context) *MapsGetCall {
  5311. c.ctx_ = ctx
  5312. return c
  5313. }
  5314. func (c *MapsGetCall) doRequest(alt string) (*http.Response, error) {
  5315. var body io.Reader = nil
  5316. c.urlParams_.Set("alt", alt)
  5317. urls := googleapi.ResolveRelative(c.s.BasePath, "maps/{id}")
  5318. urls += "?" + c.urlParams_.Encode()
  5319. req, _ := http.NewRequest("GET", urls, body)
  5320. googleapi.Expand(req.URL, map[string]string{
  5321. "id": c.id,
  5322. })
  5323. req.Header.Set("User-Agent", c.s.userAgent())
  5324. if c.ifNoneMatch_ != "" {
  5325. req.Header.Set("If-None-Match", c.ifNoneMatch_)
  5326. }
  5327. if c.ctx_ != nil {
  5328. return ctxhttp.Do(c.ctx_, c.s.client, req)
  5329. }
  5330. return c.s.client.Do(req)
  5331. }
  5332. // Do executes the "mapsengine.maps.get" call.
  5333. // Exactly one of *Map or error will be non-nil. Any non-2xx status code
  5334. // is an error. Response headers are in either
  5335. // *Map.ServerResponse.Header or (if a response was returned at all) in
  5336. // error.(*googleapi.Error).Header. Use googleapi.IsNotModified to check
  5337. // whether the returned error was because http.StatusNotModified was
  5338. // returned.
  5339. func (c *MapsGetCall) Do(opts ...googleapi.CallOption) (*Map, error) {
  5340. gensupport.SetOptions(c.urlParams_, opts...)
  5341. res, err := c.doRequest("json")
  5342. if res != nil && res.StatusCode == http.StatusNotModified {
  5343. if res.Body != nil {
  5344. res.Body.Close()
  5345. }
  5346. return nil, &googleapi.Error{
  5347. Code: res.StatusCode,
  5348. Header: res.Header,
  5349. }
  5350. }
  5351. if err != nil {
  5352. return nil, err
  5353. }
  5354. defer googleapi.CloseBody(res)
  5355. if err := googleapi.CheckResponse(res); err != nil {
  5356. return nil, err
  5357. }
  5358. ret := &Map{
  5359. ServerResponse: googleapi.ServerResponse{
  5360. Header: res.Header,
  5361. HTTPStatusCode: res.StatusCode,
  5362. },
  5363. }
  5364. if err := json.NewDecoder(res.Body).Decode(&ret); err != nil {
  5365. return nil, err
  5366. }
  5367. return ret, nil
  5368. // {
  5369. // "description": "Return metadata for a particular map.",
  5370. // "httpMethod": "GET",
  5371. // "id": "mapsengine.maps.get",
  5372. // "parameterOrder": [
  5373. // "id"
  5374. // ],
  5375. // "parameters": {
  5376. // "id": {
  5377. // "description": "The ID of the map.",
  5378. // "location": "path",
  5379. // "required": true,
  5380. // "type": "string"
  5381. // },
  5382. // "version": {
  5383. // "description": "Deprecated: The version parameter indicates which version of the map should be returned. When version is set to published, the published version of the map will be returned. Please use the maps.getPublished endpoint instead.",
  5384. // "enum": [
  5385. // "draft",
  5386. // "published"
  5387. // ],
  5388. // "enumDescriptions": [
  5389. // "The draft version.",
  5390. // "The published version."
  5391. // ],
  5392. // "location": "query",
  5393. // "type": "string"
  5394. // }
  5395. // },
  5396. // "path": "maps/{id}",
  5397. // "response": {
  5398. // "$ref": "Map"
  5399. // },
  5400. // "scopes": [
  5401. // "https://www.googleapis.com/auth/mapsengine",
  5402. // "https://www.googleapis.com/auth/mapsengine.readonly"
  5403. // ]
  5404. // }
  5405. }
  5406. // method id "mapsengine.maps.getPublished":
  5407. type MapsGetPublishedCall struct {
  5408. s *Service
  5409. id string
  5410. urlParams_ gensupport.URLParams
  5411. ifNoneMatch_ string
  5412. ctx_ context.Context
  5413. }
  5414. // GetPublished: Return the published metadata for a particular map.
  5415. func (r *MapsService) GetPublished(id string) *MapsGetPublishedCall {
  5416. c := &MapsGetPublishedCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  5417. c.id = id
  5418. return c
  5419. }
  5420. // Fields allows partial responses to be retrieved. See
  5421. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  5422. // for more information.
  5423. func (c *MapsGetPublishedCall) Fields(s ...googleapi.Field) *MapsGetPublishedCall {
  5424. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  5425. return c
  5426. }
  5427. // IfNoneMatch sets the optional parameter which makes the operation
  5428. // fail if the object's ETag matches the given value. This is useful for
  5429. // getting updates only after the object has changed since the last
  5430. // request. Use googleapi.IsNotModified to check whether the response
  5431. // error from Do is the result of In-None-Match.
  5432. func (c *MapsGetPublishedCall) IfNoneMatch(entityTag string) *MapsGetPublishedCall {
  5433. c.ifNoneMatch_ = entityTag
  5434. return c
  5435. }
  5436. // Context sets the context to be used in this call's Do method. Any
  5437. // pending HTTP request will be aborted if the provided context is
  5438. // canceled.
  5439. func (c *MapsGetPublishedCall) Context(ctx context.Context) *MapsGetPublishedCall {
  5440. c.ctx_ = ctx
  5441. return c
  5442. }
  5443. func (c *MapsGetPublishedCall) doRequest(alt string) (*http.Response, error) {
  5444. var body io.Reader = nil
  5445. c.urlParams_.Set("alt", alt)
  5446. urls := googleapi.ResolveRelative(c.s.BasePath, "maps/{id}/published")
  5447. urls += "?" + c.urlParams_.Encode()
  5448. req, _ := http.NewRequest("GET", urls, body)
  5449. googleapi.Expand(req.URL, map[string]string{
  5450. "id": c.id,
  5451. })
  5452. req.Header.Set("User-Agent", c.s.userAgent())
  5453. if c.ifNoneMatch_ != "" {
  5454. req.Header.Set("If-None-Match", c.ifNoneMatch_)
  5455. }
  5456. if c.ctx_ != nil {
  5457. return ctxhttp.Do(c.ctx_, c.s.client, req)
  5458. }
  5459. return c.s.client.Do(req)
  5460. }
  5461. // Do executes the "mapsengine.maps.getPublished" call.
  5462. // Exactly one of *PublishedMap or error will be non-nil. Any non-2xx
  5463. // status code is an error. Response headers are in either
  5464. // *PublishedMap.ServerResponse.Header or (if a response was returned at
  5465. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  5466. // to check whether the returned error was because
  5467. // http.StatusNotModified was returned.
  5468. func (c *MapsGetPublishedCall) Do(opts ...googleapi.CallOption) (*PublishedMap, error) {
  5469. gensupport.SetOptions(c.urlParams_, opts...)
  5470. res, err := c.doRequest("json")
  5471. if res != nil && res.StatusCode == http.StatusNotModified {
  5472. if res.Body != nil {
  5473. res.Body.Close()
  5474. }
  5475. return nil, &googleapi.Error{
  5476. Code: res.StatusCode,
  5477. Header: res.Header,
  5478. }
  5479. }
  5480. if err != nil {
  5481. return nil, err
  5482. }
  5483. defer googleapi.CloseBody(res)
  5484. if err := googleapi.CheckResponse(res); err != nil {
  5485. return nil, err
  5486. }
  5487. ret := &PublishedMap{
  5488. ServerResponse: googleapi.ServerResponse{
  5489. Header: res.Header,
  5490. HTTPStatusCode: res.StatusCode,
  5491. },
  5492. }
  5493. if err := json.NewDecoder(res.Body).Decode(&ret); err != nil {
  5494. return nil, err
  5495. }
  5496. return ret, nil
  5497. // {
  5498. // "description": "Return the published metadata for a particular map.",
  5499. // "httpMethod": "GET",
  5500. // "id": "mapsengine.maps.getPublished",
  5501. // "parameterOrder": [
  5502. // "id"
  5503. // ],
  5504. // "parameters": {
  5505. // "id": {
  5506. // "description": "The ID of the map.",
  5507. // "location": "path",
  5508. // "required": true,
  5509. // "type": "string"
  5510. // }
  5511. // },
  5512. // "path": "maps/{id}/published",
  5513. // "response": {
  5514. // "$ref": "PublishedMap"
  5515. // },
  5516. // "scopes": [
  5517. // "https://www.googleapis.com/auth/mapsengine",
  5518. // "https://www.googleapis.com/auth/mapsengine.readonly"
  5519. // ]
  5520. // }
  5521. }
  5522. // method id "mapsengine.maps.list":
  5523. type MapsListCall struct {
  5524. s *Service
  5525. urlParams_ gensupport.URLParams
  5526. ifNoneMatch_ string
  5527. ctx_ context.Context
  5528. }
  5529. // List: Return all maps readable by the current user.
  5530. func (r *MapsService) List() *MapsListCall {
  5531. c := &MapsListCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  5532. return c
  5533. }
  5534. // Bbox sets the optional parameter "bbox": A bounding box, expressed as
  5535. // "west,south,east,north". If set, only assets which intersect this
  5536. // bounding box will be returned.
  5537. func (c *MapsListCall) Bbox(bbox string) *MapsListCall {
  5538. c.urlParams_.Set("bbox", bbox)
  5539. return c
  5540. }
  5541. // CreatedAfter sets the optional parameter "createdAfter": An RFC 3339
  5542. // formatted date-time value (e.g. 1970-01-01T00:00:00Z). Returned
  5543. // assets will have been created at or after this time.
  5544. func (c *MapsListCall) CreatedAfter(createdAfter string) *MapsListCall {
  5545. c.urlParams_.Set("createdAfter", createdAfter)
  5546. return c
  5547. }
  5548. // CreatedBefore sets the optional parameter "createdBefore": An RFC
  5549. // 3339 formatted date-time value (e.g. 1970-01-01T00:00:00Z). Returned
  5550. // assets will have been created at or before this time.
  5551. func (c *MapsListCall) CreatedBefore(createdBefore string) *MapsListCall {
  5552. c.urlParams_.Set("createdBefore", createdBefore)
  5553. return c
  5554. }
  5555. // CreatorEmail sets the optional parameter "creatorEmail": An email
  5556. // address representing a user. Returned assets that have been created
  5557. // by the user associated with the provided email address.
  5558. func (c *MapsListCall) CreatorEmail(creatorEmail string) *MapsListCall {
  5559. c.urlParams_.Set("creatorEmail", creatorEmail)
  5560. return c
  5561. }
  5562. // MaxResults sets the optional parameter "maxResults": The maximum
  5563. // number of items to include in a single response page. The maximum
  5564. // supported value is 100.
  5565. func (c *MapsListCall) MaxResults(maxResults int64) *MapsListCall {
  5566. c.urlParams_.Set("maxResults", fmt.Sprint(maxResults))
  5567. return c
  5568. }
  5569. // ModifiedAfter sets the optional parameter "modifiedAfter": An RFC
  5570. // 3339 formatted date-time value (e.g. 1970-01-01T00:00:00Z). Returned
  5571. // assets will have been modified at or after this time.
  5572. func (c *MapsListCall) ModifiedAfter(modifiedAfter string) *MapsListCall {
  5573. c.urlParams_.Set("modifiedAfter", modifiedAfter)
  5574. return c
  5575. }
  5576. // ModifiedBefore sets the optional parameter "modifiedBefore": An RFC
  5577. // 3339 formatted date-time value (e.g. 1970-01-01T00:00:00Z). Returned
  5578. // assets will have been modified at or before this time.
  5579. func (c *MapsListCall) ModifiedBefore(modifiedBefore string) *MapsListCall {
  5580. c.urlParams_.Set("modifiedBefore", modifiedBefore)
  5581. return c
  5582. }
  5583. // PageToken sets the optional parameter "pageToken": The continuation
  5584. // token, used to page through large result sets. To get the next page
  5585. // of results, set this parameter to the value of nextPageToken from the
  5586. // previous response.
  5587. func (c *MapsListCall) PageToken(pageToken string) *MapsListCall {
  5588. c.urlParams_.Set("pageToken", pageToken)
  5589. return c
  5590. }
  5591. // ProcessingStatus sets the optional parameter "processingStatus":
  5592. //
  5593. // Possible values:
  5594. // "complete" - The map has completed processing.
  5595. // "failed" - The map has failed processing.
  5596. // "notReady" - The map is not ready for processing.
  5597. // "processing" - The map is processing.
  5598. func (c *MapsListCall) ProcessingStatus(processingStatus string) *MapsListCall {
  5599. c.urlParams_.Set("processingStatus", processingStatus)
  5600. return c
  5601. }
  5602. // ProjectId sets the optional parameter "projectId": The ID of a Maps
  5603. // Engine project, used to filter the response. To list all available
  5604. // projects with their IDs, send a Projects: list request. You can also
  5605. // find your project ID as the value of the DashboardPlace:cid URL
  5606. // parameter when signed in to mapsengine.google.com.
  5607. func (c *MapsListCall) ProjectId(projectId string) *MapsListCall {
  5608. c.urlParams_.Set("projectId", projectId)
  5609. return c
  5610. }
  5611. // Role sets the optional parameter "role": The role parameter indicates
  5612. // that the response should only contain assets where the current user
  5613. // has the specified level of access.
  5614. //
  5615. // Possible values:
  5616. // "owner" - The user can read, write and administer the asset.
  5617. // "reader" - The user can read the asset.
  5618. // "writer" - The user can read and write the asset.
  5619. func (c *MapsListCall) Role(role string) *MapsListCall {
  5620. c.urlParams_.Set("role", role)
  5621. return c
  5622. }
  5623. // Search sets the optional parameter "search": An unstructured search
  5624. // string used to filter the set of results based on asset metadata.
  5625. func (c *MapsListCall) Search(search string) *MapsListCall {
  5626. c.urlParams_.Set("search", search)
  5627. return c
  5628. }
  5629. // Tags sets the optional parameter "tags": A comma separated list of
  5630. // tags. Returned assets will contain all the tags from the list.
  5631. func (c *MapsListCall) Tags(tags string) *MapsListCall {
  5632. c.urlParams_.Set("tags", tags)
  5633. return c
  5634. }
  5635. // Fields allows partial responses to be retrieved. See
  5636. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  5637. // for more information.
  5638. func (c *MapsListCall) Fields(s ...googleapi.Field) *MapsListCall {
  5639. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  5640. return c
  5641. }
  5642. // IfNoneMatch sets the optional parameter which makes the operation
  5643. // fail if the object's ETag matches the given value. This is useful for
  5644. // getting updates only after the object has changed since the last
  5645. // request. Use googleapi.IsNotModified to check whether the response
  5646. // error from Do is the result of In-None-Match.
  5647. func (c *MapsListCall) IfNoneMatch(entityTag string) *MapsListCall {
  5648. c.ifNoneMatch_ = entityTag
  5649. return c
  5650. }
  5651. // Context sets the context to be used in this call's Do method. Any
  5652. // pending HTTP request will be aborted if the provided context is
  5653. // canceled.
  5654. func (c *MapsListCall) Context(ctx context.Context) *MapsListCall {
  5655. c.ctx_ = ctx
  5656. return c
  5657. }
  5658. func (c *MapsListCall) doRequest(alt string) (*http.Response, error) {
  5659. var body io.Reader = nil
  5660. c.urlParams_.Set("alt", alt)
  5661. urls := googleapi.ResolveRelative(c.s.BasePath, "maps")
  5662. urls += "?" + c.urlParams_.Encode()
  5663. req, _ := http.NewRequest("GET", urls, body)
  5664. googleapi.SetOpaque(req.URL)
  5665. req.Header.Set("User-Agent", c.s.userAgent())
  5666. if c.ifNoneMatch_ != "" {
  5667. req.Header.Set("If-None-Match", c.ifNoneMatch_)
  5668. }
  5669. if c.ctx_ != nil {
  5670. return ctxhttp.Do(c.ctx_, c.s.client, req)
  5671. }
  5672. return c.s.client.Do(req)
  5673. }
  5674. // Do executes the "mapsengine.maps.list" call.
  5675. // Exactly one of *MapsListResponse or error will be non-nil. Any
  5676. // non-2xx status code is an error. Response headers are in either
  5677. // *MapsListResponse.ServerResponse.Header or (if a response was
  5678. // returned at all) in error.(*googleapi.Error).Header. Use
  5679. // googleapi.IsNotModified to check whether the returned error was
  5680. // because http.StatusNotModified was returned.
  5681. func (c *MapsListCall) Do(opts ...googleapi.CallOption) (*MapsListResponse, error) {
  5682. gensupport.SetOptions(c.urlParams_, opts...)
  5683. res, err := c.doRequest("json")
  5684. if res != nil && res.StatusCode == http.StatusNotModified {
  5685. if res.Body != nil {
  5686. res.Body.Close()
  5687. }
  5688. return nil, &googleapi.Error{
  5689. Code: res.StatusCode,
  5690. Header: res.Header,
  5691. }
  5692. }
  5693. if err != nil {
  5694. return nil, err
  5695. }
  5696. defer googleapi.CloseBody(res)
  5697. if err := googleapi.CheckResponse(res); err != nil {
  5698. return nil, err
  5699. }
  5700. ret := &MapsListResponse{
  5701. ServerResponse: googleapi.ServerResponse{
  5702. Header: res.Header,
  5703. HTTPStatusCode: res.StatusCode,
  5704. },
  5705. }
  5706. if err := json.NewDecoder(res.Body).Decode(&ret); err != nil {
  5707. return nil, err
  5708. }
  5709. return ret, nil
  5710. // {
  5711. // "description": "Return all maps readable by the current user.",
  5712. // "httpMethod": "GET",
  5713. // "id": "mapsengine.maps.list",
  5714. // "parameters": {
  5715. // "bbox": {
  5716. // "description": "A bounding box, expressed as \"west,south,east,north\". If set, only assets which intersect this bounding box will be returned.",
  5717. // "location": "query",
  5718. // "type": "string"
  5719. // },
  5720. // "createdAfter": {
  5721. // "description": "An RFC 3339 formatted date-time value (e.g. 1970-01-01T00:00:00Z). Returned assets will have been created at or after this time.",
  5722. // "format": "date-time",
  5723. // "location": "query",
  5724. // "type": "string"
  5725. // },
  5726. // "createdBefore": {
  5727. // "description": "An RFC 3339 formatted date-time value (e.g. 1970-01-01T00:00:00Z). Returned assets will have been created at or before this time.",
  5728. // "format": "date-time",
  5729. // "location": "query",
  5730. // "type": "string"
  5731. // },
  5732. // "creatorEmail": {
  5733. // "description": "An email address representing a user. Returned assets that have been created by the user associated with the provided email address.",
  5734. // "location": "query",
  5735. // "type": "string"
  5736. // },
  5737. // "maxResults": {
  5738. // "description": "The maximum number of items to include in a single response page. The maximum supported value is 100.",
  5739. // "format": "uint32",
  5740. // "location": "query",
  5741. // "type": "integer"
  5742. // },
  5743. // "modifiedAfter": {
  5744. // "description": "An RFC 3339 formatted date-time value (e.g. 1970-01-01T00:00:00Z). Returned assets will have been modified at or after this time.",
  5745. // "format": "date-time",
  5746. // "location": "query",
  5747. // "type": "string"
  5748. // },
  5749. // "modifiedBefore": {
  5750. // "description": "An RFC 3339 formatted date-time value (e.g. 1970-01-01T00:00:00Z). Returned assets will have been modified at or before this time.",
  5751. // "format": "date-time",
  5752. // "location": "query",
  5753. // "type": "string"
  5754. // },
  5755. // "pageToken": {
  5756. // "description": "The continuation token, used to page through large result sets. To get the next page of results, set this parameter to the value of nextPageToken from the previous response.",
  5757. // "location": "query",
  5758. // "type": "string"
  5759. // },
  5760. // "processingStatus": {
  5761. // "enum": [
  5762. // "complete",
  5763. // "failed",
  5764. // "notReady",
  5765. // "processing"
  5766. // ],
  5767. // "enumDescriptions": [
  5768. // "The map has completed processing.",
  5769. // "The map has failed processing.",
  5770. // "The map is not ready for processing.",
  5771. // "The map is processing."
  5772. // ],
  5773. // "location": "query",
  5774. // "type": "string"
  5775. // },
  5776. // "projectId": {
  5777. // "description": "The ID of a Maps Engine project, used to filter the response. To list all available projects with their IDs, send a Projects: list request. You can also find your project ID as the value of the DashboardPlace:cid URL parameter when signed in to mapsengine.google.com.",
  5778. // "location": "query",
  5779. // "type": "string"
  5780. // },
  5781. // "role": {
  5782. // "description": "The role parameter indicates that the response should only contain assets where the current user has the specified level of access.",
  5783. // "enum": [
  5784. // "owner",
  5785. // "reader",
  5786. // "writer"
  5787. // ],
  5788. // "enumDescriptions": [
  5789. // "The user can read, write and administer the asset.",
  5790. // "The user can read the asset.",
  5791. // "The user can read and write the asset."
  5792. // ],
  5793. // "location": "query",
  5794. // "type": "string"
  5795. // },
  5796. // "search": {
  5797. // "description": "An unstructured search string used to filter the set of results based on asset metadata.",
  5798. // "location": "query",
  5799. // "type": "string"
  5800. // },
  5801. // "tags": {
  5802. // "description": "A comma separated list of tags. Returned assets will contain all the tags from the list.",
  5803. // "location": "query",
  5804. // "type": "string"
  5805. // }
  5806. // },
  5807. // "path": "maps",
  5808. // "response": {
  5809. // "$ref": "MapsListResponse"
  5810. // },
  5811. // "scopes": [
  5812. // "https://www.googleapis.com/auth/mapsengine",
  5813. // "https://www.googleapis.com/auth/mapsengine.readonly"
  5814. // ]
  5815. // }
  5816. }
  5817. // Pages invokes f for each page of results.
  5818. // A non-nil error returned from f will halt the iteration.
  5819. // The provided context supersedes any context provided to the Context method.
  5820. func (c *MapsListCall) Pages(ctx context.Context, f func(*MapsListResponse) error) error {
  5821. c.ctx_ = ctx
  5822. defer c.PageToken(c.urlParams_.Get("pageToken")) // reset paging to original point
  5823. for {
  5824. x, err := c.Do()
  5825. if err != nil {
  5826. return err
  5827. }
  5828. if err := f(x); err != nil {
  5829. return err
  5830. }
  5831. if x.NextPageToken == "" {
  5832. return nil
  5833. }
  5834. c.PageToken(x.NextPageToken)
  5835. }
  5836. }
  5837. // method id "mapsengine.maps.listPublished":
  5838. type MapsListPublishedCall struct {
  5839. s *Service
  5840. urlParams_ gensupport.URLParams
  5841. ifNoneMatch_ string
  5842. ctx_ context.Context
  5843. }
  5844. // ListPublished: Return all published maps readable by the current
  5845. // user.
  5846. func (r *MapsService) ListPublished() *MapsListPublishedCall {
  5847. c := &MapsListPublishedCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  5848. return c
  5849. }
  5850. // MaxResults sets the optional parameter "maxResults": The maximum
  5851. // number of items to include in a single response page. The maximum
  5852. // supported value is 100.
  5853. func (c *MapsListPublishedCall) MaxResults(maxResults int64) *MapsListPublishedCall {
  5854. c.urlParams_.Set("maxResults", fmt.Sprint(maxResults))
  5855. return c
  5856. }
  5857. // PageToken sets the optional parameter "pageToken": The continuation
  5858. // token, used to page through large result sets. To get the next page
  5859. // of results, set this parameter to the value of nextPageToken from the
  5860. // previous response.
  5861. func (c *MapsListPublishedCall) PageToken(pageToken string) *MapsListPublishedCall {
  5862. c.urlParams_.Set("pageToken", pageToken)
  5863. return c
  5864. }
  5865. // ProjectId sets the optional parameter "projectId": The ID of a Maps
  5866. // Engine project, used to filter the response. To list all available
  5867. // projects with their IDs, send a Projects: list request. You can also
  5868. // find your project ID as the value of the DashboardPlace:cid URL
  5869. // parameter when signed in to mapsengine.google.com.
  5870. func (c *MapsListPublishedCall) ProjectId(projectId string) *MapsListPublishedCall {
  5871. c.urlParams_.Set("projectId", projectId)
  5872. return c
  5873. }
  5874. // Fields allows partial responses to be retrieved. See
  5875. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  5876. // for more information.
  5877. func (c *MapsListPublishedCall) Fields(s ...googleapi.Field) *MapsListPublishedCall {
  5878. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  5879. return c
  5880. }
  5881. // IfNoneMatch sets the optional parameter which makes the operation
  5882. // fail if the object's ETag matches the given value. This is useful for
  5883. // getting updates only after the object has changed since the last
  5884. // request. Use googleapi.IsNotModified to check whether the response
  5885. // error from Do is the result of In-None-Match.
  5886. func (c *MapsListPublishedCall) IfNoneMatch(entityTag string) *MapsListPublishedCall {
  5887. c.ifNoneMatch_ = entityTag
  5888. return c
  5889. }
  5890. // Context sets the context to be used in this call's Do method. Any
  5891. // pending HTTP request will be aborted if the provided context is
  5892. // canceled.
  5893. func (c *MapsListPublishedCall) Context(ctx context.Context) *MapsListPublishedCall {
  5894. c.ctx_ = ctx
  5895. return c
  5896. }
  5897. func (c *MapsListPublishedCall) doRequest(alt string) (*http.Response, error) {
  5898. var body io.Reader = nil
  5899. c.urlParams_.Set("alt", alt)
  5900. urls := googleapi.ResolveRelative(c.s.BasePath, "maps/published")
  5901. urls += "?" + c.urlParams_.Encode()
  5902. req, _ := http.NewRequest("GET", urls, body)
  5903. googleapi.SetOpaque(req.URL)
  5904. req.Header.Set("User-Agent", c.s.userAgent())
  5905. if c.ifNoneMatch_ != "" {
  5906. req.Header.Set("If-None-Match", c.ifNoneMatch_)
  5907. }
  5908. if c.ctx_ != nil {
  5909. return ctxhttp.Do(c.ctx_, c.s.client, req)
  5910. }
  5911. return c.s.client.Do(req)
  5912. }
  5913. // Do executes the "mapsengine.maps.listPublished" call.
  5914. // Exactly one of *PublishedMapsListResponse or error will be non-nil.
  5915. // Any non-2xx status code is an error. Response headers are in either
  5916. // *PublishedMapsListResponse.ServerResponse.Header or (if a response
  5917. // was returned at all) in error.(*googleapi.Error).Header. Use
  5918. // googleapi.IsNotModified to check whether the returned error was
  5919. // because http.StatusNotModified was returned.
  5920. func (c *MapsListPublishedCall) Do(opts ...googleapi.CallOption) (*PublishedMapsListResponse, error) {
  5921. gensupport.SetOptions(c.urlParams_, opts...)
  5922. res, err := c.doRequest("json")
  5923. if res != nil && res.StatusCode == http.StatusNotModified {
  5924. if res.Body != nil {
  5925. res.Body.Close()
  5926. }
  5927. return nil, &googleapi.Error{
  5928. Code: res.StatusCode,
  5929. Header: res.Header,
  5930. }
  5931. }
  5932. if err != nil {
  5933. return nil, err
  5934. }
  5935. defer googleapi.CloseBody(res)
  5936. if err := googleapi.CheckResponse(res); err != nil {
  5937. return nil, err
  5938. }
  5939. ret := &PublishedMapsListResponse{
  5940. ServerResponse: googleapi.ServerResponse{
  5941. Header: res.Header,
  5942. HTTPStatusCode: res.StatusCode,
  5943. },
  5944. }
  5945. if err := json.NewDecoder(res.Body).Decode(&ret); err != nil {
  5946. return nil, err
  5947. }
  5948. return ret, nil
  5949. // {
  5950. // "description": "Return all published maps readable by the current user.",
  5951. // "httpMethod": "GET",
  5952. // "id": "mapsengine.maps.listPublished",
  5953. // "parameters": {
  5954. // "maxResults": {
  5955. // "description": "The maximum number of items to include in a single response page. The maximum supported value is 100.",
  5956. // "format": "uint32",
  5957. // "location": "query",
  5958. // "type": "integer"
  5959. // },
  5960. // "pageToken": {
  5961. // "description": "The continuation token, used to page through large result sets. To get the next page of results, set this parameter to the value of nextPageToken from the previous response.",
  5962. // "location": "query",
  5963. // "type": "string"
  5964. // },
  5965. // "projectId": {
  5966. // "description": "The ID of a Maps Engine project, used to filter the response. To list all available projects with their IDs, send a Projects: list request. You can also find your project ID as the value of the DashboardPlace:cid URL parameter when signed in to mapsengine.google.com.",
  5967. // "location": "query",
  5968. // "type": "string"
  5969. // }
  5970. // },
  5971. // "path": "maps/published",
  5972. // "response": {
  5973. // "$ref": "PublishedMapsListResponse"
  5974. // },
  5975. // "scopes": [
  5976. // "https://www.googleapis.com/auth/mapsengine",
  5977. // "https://www.googleapis.com/auth/mapsengine.readonly"
  5978. // ]
  5979. // }
  5980. }
  5981. // Pages invokes f for each page of results.
  5982. // A non-nil error returned from f will halt the iteration.
  5983. // The provided context supersedes any context provided to the Context method.
  5984. func (c *MapsListPublishedCall) Pages(ctx context.Context, f func(*PublishedMapsListResponse) error) error {
  5985. c.ctx_ = ctx
  5986. defer c.PageToken(c.urlParams_.Get("pageToken")) // reset paging to original point
  5987. for {
  5988. x, err := c.Do()
  5989. if err != nil {
  5990. return err
  5991. }
  5992. if err := f(x); err != nil {
  5993. return err
  5994. }
  5995. if x.NextPageToken == "" {
  5996. return nil
  5997. }
  5998. c.PageToken(x.NextPageToken)
  5999. }
  6000. }
  6001. // method id "mapsengine.maps.patch":
  6002. type MapsPatchCall struct {
  6003. s *Service
  6004. id string
  6005. map_ *Map
  6006. urlParams_ gensupport.URLParams
  6007. ctx_ context.Context
  6008. }
  6009. // Patch: Mutate a map asset.
  6010. func (r *MapsService) Patch(id string, map_ *Map) *MapsPatchCall {
  6011. c := &MapsPatchCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  6012. c.id = id
  6013. c.map_ = map_
  6014. return c
  6015. }
  6016. // Fields allows partial responses to be retrieved. See
  6017. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  6018. // for more information.
  6019. func (c *MapsPatchCall) Fields(s ...googleapi.Field) *MapsPatchCall {
  6020. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  6021. return c
  6022. }
  6023. // Context sets the context to be used in this call's Do method. Any
  6024. // pending HTTP request will be aborted if the provided context is
  6025. // canceled.
  6026. func (c *MapsPatchCall) Context(ctx context.Context) *MapsPatchCall {
  6027. c.ctx_ = ctx
  6028. return c
  6029. }
  6030. func (c *MapsPatchCall) doRequest(alt string) (*http.Response, error) {
  6031. var body io.Reader = nil
  6032. body, err := googleapi.WithoutDataWrapper.JSONReader(c.map_)
  6033. if err != nil {
  6034. return nil, err
  6035. }
  6036. ctype := "application/json"
  6037. c.urlParams_.Set("alt", alt)
  6038. urls := googleapi.ResolveRelative(c.s.BasePath, "maps/{id}")
  6039. urls += "?" + c.urlParams_.Encode()
  6040. req, _ := http.NewRequest("PATCH", urls, body)
  6041. googleapi.Expand(req.URL, map[string]string{
  6042. "id": c.id,
  6043. })
  6044. req.Header.Set("Content-Type", ctype)
  6045. req.Header.Set("User-Agent", c.s.userAgent())
  6046. if c.ctx_ != nil {
  6047. return ctxhttp.Do(c.ctx_, c.s.client, req)
  6048. }
  6049. return c.s.client.Do(req)
  6050. }
  6051. // Do executes the "mapsengine.maps.patch" call.
  6052. func (c *MapsPatchCall) Do(opts ...googleapi.CallOption) error {
  6053. gensupport.SetOptions(c.urlParams_, opts...)
  6054. res, err := c.doRequest("json")
  6055. if err != nil {
  6056. return err
  6057. }
  6058. defer googleapi.CloseBody(res)
  6059. if err := googleapi.CheckResponse(res); err != nil {
  6060. return err
  6061. }
  6062. return nil
  6063. // {
  6064. // "description": "Mutate a map asset.",
  6065. // "httpMethod": "PATCH",
  6066. // "id": "mapsengine.maps.patch",
  6067. // "parameterOrder": [
  6068. // "id"
  6069. // ],
  6070. // "parameters": {
  6071. // "id": {
  6072. // "description": "The ID of the map.",
  6073. // "location": "path",
  6074. // "required": true,
  6075. // "type": "string"
  6076. // }
  6077. // },
  6078. // "path": "maps/{id}",
  6079. // "request": {
  6080. // "$ref": "Map"
  6081. // },
  6082. // "scopes": [
  6083. // "https://www.googleapis.com/auth/mapsengine"
  6084. // ]
  6085. // }
  6086. }
  6087. // method id "mapsengine.maps.publish":
  6088. type MapsPublishCall struct {
  6089. s *Service
  6090. id string
  6091. urlParams_ gensupport.URLParams
  6092. ctx_ context.Context
  6093. }
  6094. // Publish: Publish a map asset.
  6095. func (r *MapsService) Publish(id string) *MapsPublishCall {
  6096. c := &MapsPublishCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  6097. c.id = id
  6098. return c
  6099. }
  6100. // Force sets the optional parameter "force": If set to true, the API
  6101. // will allow publication of the map even if it's out of date. If false,
  6102. // the map must have a processingStatus of complete before publishing.
  6103. func (c *MapsPublishCall) Force(force bool) *MapsPublishCall {
  6104. c.urlParams_.Set("force", fmt.Sprint(force))
  6105. return c
  6106. }
  6107. // Fields allows partial responses to be retrieved. See
  6108. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  6109. // for more information.
  6110. func (c *MapsPublishCall) Fields(s ...googleapi.Field) *MapsPublishCall {
  6111. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  6112. return c
  6113. }
  6114. // Context sets the context to be used in this call's Do method. Any
  6115. // pending HTTP request will be aborted if the provided context is
  6116. // canceled.
  6117. func (c *MapsPublishCall) Context(ctx context.Context) *MapsPublishCall {
  6118. c.ctx_ = ctx
  6119. return c
  6120. }
  6121. func (c *MapsPublishCall) doRequest(alt string) (*http.Response, error) {
  6122. var body io.Reader = nil
  6123. c.urlParams_.Set("alt", alt)
  6124. urls := googleapi.ResolveRelative(c.s.BasePath, "maps/{id}/publish")
  6125. urls += "?" + c.urlParams_.Encode()
  6126. req, _ := http.NewRequest("POST", urls, body)
  6127. googleapi.Expand(req.URL, map[string]string{
  6128. "id": c.id,
  6129. })
  6130. req.Header.Set("User-Agent", c.s.userAgent())
  6131. if c.ctx_ != nil {
  6132. return ctxhttp.Do(c.ctx_, c.s.client, req)
  6133. }
  6134. return c.s.client.Do(req)
  6135. }
  6136. // Do executes the "mapsengine.maps.publish" call.
  6137. // Exactly one of *PublishResponse or error will be non-nil. Any non-2xx
  6138. // status code is an error. Response headers are in either
  6139. // *PublishResponse.ServerResponse.Header or (if a response was returned
  6140. // at all) in error.(*googleapi.Error).Header. Use
  6141. // googleapi.IsNotModified to check whether the returned error was
  6142. // because http.StatusNotModified was returned.
  6143. func (c *MapsPublishCall) Do(opts ...googleapi.CallOption) (*PublishResponse, error) {
  6144. gensupport.SetOptions(c.urlParams_, opts...)
  6145. res, err := c.doRequest("json")
  6146. if res != nil && res.StatusCode == http.StatusNotModified {
  6147. if res.Body != nil {
  6148. res.Body.Close()
  6149. }
  6150. return nil, &googleapi.Error{
  6151. Code: res.StatusCode,
  6152. Header: res.Header,
  6153. }
  6154. }
  6155. if err != nil {
  6156. return nil, err
  6157. }
  6158. defer googleapi.CloseBody(res)
  6159. if err := googleapi.CheckResponse(res); err != nil {
  6160. return nil, err
  6161. }
  6162. ret := &PublishResponse{
  6163. ServerResponse: googleapi.ServerResponse{
  6164. Header: res.Header,
  6165. HTTPStatusCode: res.StatusCode,
  6166. },
  6167. }
  6168. if err := json.NewDecoder(res.Body).Decode(&ret); err != nil {
  6169. return nil, err
  6170. }
  6171. return ret, nil
  6172. // {
  6173. // "description": "Publish a map asset.",
  6174. // "httpMethod": "POST",
  6175. // "id": "mapsengine.maps.publish",
  6176. // "parameterOrder": [
  6177. // "id"
  6178. // ],
  6179. // "parameters": {
  6180. // "force": {
  6181. // "description": "If set to true, the API will allow publication of the map even if it's out of date. If false, the map must have a processingStatus of complete before publishing.",
  6182. // "location": "query",
  6183. // "type": "boolean"
  6184. // },
  6185. // "id": {
  6186. // "description": "The ID of the map.",
  6187. // "location": "path",
  6188. // "required": true,
  6189. // "type": "string"
  6190. // }
  6191. // },
  6192. // "path": "maps/{id}/publish",
  6193. // "response": {
  6194. // "$ref": "PublishResponse"
  6195. // },
  6196. // "scopes": [
  6197. // "https://www.googleapis.com/auth/mapsengine"
  6198. // ]
  6199. // }
  6200. }
  6201. // method id "mapsengine.maps.unpublish":
  6202. type MapsUnpublishCall struct {
  6203. s *Service
  6204. id string
  6205. urlParams_ gensupport.URLParams
  6206. ctx_ context.Context
  6207. }
  6208. // Unpublish: Unpublish a map asset.
  6209. func (r *MapsService) Unpublish(id string) *MapsUnpublishCall {
  6210. c := &MapsUnpublishCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  6211. c.id = id
  6212. return c
  6213. }
  6214. // Fields allows partial responses to be retrieved. See
  6215. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  6216. // for more information.
  6217. func (c *MapsUnpublishCall) Fields(s ...googleapi.Field) *MapsUnpublishCall {
  6218. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  6219. return c
  6220. }
  6221. // Context sets the context to be used in this call's Do method. Any
  6222. // pending HTTP request will be aborted if the provided context is
  6223. // canceled.
  6224. func (c *MapsUnpublishCall) Context(ctx context.Context) *MapsUnpublishCall {
  6225. c.ctx_ = ctx
  6226. return c
  6227. }
  6228. func (c *MapsUnpublishCall) doRequest(alt string) (*http.Response, error) {
  6229. var body io.Reader = nil
  6230. c.urlParams_.Set("alt", alt)
  6231. urls := googleapi.ResolveRelative(c.s.BasePath, "maps/{id}/unpublish")
  6232. urls += "?" + c.urlParams_.Encode()
  6233. req, _ := http.NewRequest("POST", urls, body)
  6234. googleapi.Expand(req.URL, map[string]string{
  6235. "id": c.id,
  6236. })
  6237. req.Header.Set("User-Agent", c.s.userAgent())
  6238. if c.ctx_ != nil {
  6239. return ctxhttp.Do(c.ctx_, c.s.client, req)
  6240. }
  6241. return c.s.client.Do(req)
  6242. }
  6243. // Do executes the "mapsengine.maps.unpublish" call.
  6244. // Exactly one of *PublishResponse or error will be non-nil. Any non-2xx
  6245. // status code is an error. Response headers are in either
  6246. // *PublishResponse.ServerResponse.Header or (if a response was returned
  6247. // at all) in error.(*googleapi.Error).Header. Use
  6248. // googleapi.IsNotModified to check whether the returned error was
  6249. // because http.StatusNotModified was returned.
  6250. func (c *MapsUnpublishCall) Do(opts ...googleapi.CallOption) (*PublishResponse, error) {
  6251. gensupport.SetOptions(c.urlParams_, opts...)
  6252. res, err := c.doRequest("json")
  6253. if res != nil && res.StatusCode == http.StatusNotModified {
  6254. if res.Body != nil {
  6255. res.Body.Close()
  6256. }
  6257. return nil, &googleapi.Error{
  6258. Code: res.StatusCode,
  6259. Header: res.Header,
  6260. }
  6261. }
  6262. if err != nil {
  6263. return nil, err
  6264. }
  6265. defer googleapi.CloseBody(res)
  6266. if err := googleapi.CheckResponse(res); err != nil {
  6267. return nil, err
  6268. }
  6269. ret := &PublishResponse{
  6270. ServerResponse: googleapi.ServerResponse{
  6271. Header: res.Header,
  6272. HTTPStatusCode: res.StatusCode,
  6273. },
  6274. }
  6275. if err := json.NewDecoder(res.Body).Decode(&ret); err != nil {
  6276. return nil, err
  6277. }
  6278. return ret, nil
  6279. // {
  6280. // "description": "Unpublish a map asset.",
  6281. // "httpMethod": "POST",
  6282. // "id": "mapsengine.maps.unpublish",
  6283. // "parameterOrder": [
  6284. // "id"
  6285. // ],
  6286. // "parameters": {
  6287. // "id": {
  6288. // "description": "The ID of the map.",
  6289. // "location": "path",
  6290. // "required": true,
  6291. // "type": "string"
  6292. // }
  6293. // },
  6294. // "path": "maps/{id}/unpublish",
  6295. // "response": {
  6296. // "$ref": "PublishResponse"
  6297. // },
  6298. // "scopes": [
  6299. // "https://www.googleapis.com/auth/mapsengine"
  6300. // ]
  6301. // }
  6302. }
  6303. // method id "mapsengine.maps.permissions.batchDelete":
  6304. type MapsPermissionsBatchDeleteCall struct {
  6305. s *Service
  6306. id string
  6307. permissionsbatchdeleterequest *PermissionsBatchDeleteRequest
  6308. urlParams_ gensupport.URLParams
  6309. ctx_ context.Context
  6310. }
  6311. // BatchDelete: Remove permission entries from an already existing
  6312. // asset.
  6313. func (r *MapsPermissionsService) BatchDelete(id string, permissionsbatchdeleterequest *PermissionsBatchDeleteRequest) *MapsPermissionsBatchDeleteCall {
  6314. c := &MapsPermissionsBatchDeleteCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  6315. c.id = id
  6316. c.permissionsbatchdeleterequest = permissionsbatchdeleterequest
  6317. return c
  6318. }
  6319. // Fields allows partial responses to be retrieved. See
  6320. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  6321. // for more information.
  6322. func (c *MapsPermissionsBatchDeleteCall) Fields(s ...googleapi.Field) *MapsPermissionsBatchDeleteCall {
  6323. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  6324. return c
  6325. }
  6326. // Context sets the context to be used in this call's Do method. Any
  6327. // pending HTTP request will be aborted if the provided context is
  6328. // canceled.
  6329. func (c *MapsPermissionsBatchDeleteCall) Context(ctx context.Context) *MapsPermissionsBatchDeleteCall {
  6330. c.ctx_ = ctx
  6331. return c
  6332. }
  6333. func (c *MapsPermissionsBatchDeleteCall) doRequest(alt string) (*http.Response, error) {
  6334. var body io.Reader = nil
  6335. body, err := googleapi.WithoutDataWrapper.JSONReader(c.permissionsbatchdeleterequest)
  6336. if err != nil {
  6337. return nil, err
  6338. }
  6339. ctype := "application/json"
  6340. c.urlParams_.Set("alt", alt)
  6341. urls := googleapi.ResolveRelative(c.s.BasePath, "maps/{id}/permissions/batchDelete")
  6342. urls += "?" + c.urlParams_.Encode()
  6343. req, _ := http.NewRequest("POST", urls, body)
  6344. googleapi.Expand(req.URL, map[string]string{
  6345. "id": c.id,
  6346. })
  6347. req.Header.Set("Content-Type", ctype)
  6348. req.Header.Set("User-Agent", c.s.userAgent())
  6349. if c.ctx_ != nil {
  6350. return ctxhttp.Do(c.ctx_, c.s.client, req)
  6351. }
  6352. return c.s.client.Do(req)
  6353. }
  6354. // Do executes the "mapsengine.maps.permissions.batchDelete" call.
  6355. // Exactly one of *PermissionsBatchDeleteResponse or error will be
  6356. // non-nil. Any non-2xx status code is an error. Response headers are in
  6357. // either *PermissionsBatchDeleteResponse.ServerResponse.Header or (if a
  6358. // response was returned at all) in error.(*googleapi.Error).Header. Use
  6359. // googleapi.IsNotModified to check whether the returned error was
  6360. // because http.StatusNotModified was returned.
  6361. func (c *MapsPermissionsBatchDeleteCall) Do(opts ...googleapi.CallOption) (*PermissionsBatchDeleteResponse, error) {
  6362. gensupport.SetOptions(c.urlParams_, opts...)
  6363. res, err := c.doRequest("json")
  6364. if res != nil && res.StatusCode == http.StatusNotModified {
  6365. if res.Body != nil {
  6366. res.Body.Close()
  6367. }
  6368. return nil, &googleapi.Error{
  6369. Code: res.StatusCode,
  6370. Header: res.Header,
  6371. }
  6372. }
  6373. if err != nil {
  6374. return nil, err
  6375. }
  6376. defer googleapi.CloseBody(res)
  6377. if err := googleapi.CheckResponse(res); err != nil {
  6378. return nil, err
  6379. }
  6380. ret := &PermissionsBatchDeleteResponse{
  6381. ServerResponse: googleapi.ServerResponse{
  6382. Header: res.Header,
  6383. HTTPStatusCode: res.StatusCode,
  6384. },
  6385. }
  6386. if err := json.NewDecoder(res.Body).Decode(&ret); err != nil {
  6387. return nil, err
  6388. }
  6389. return ret, nil
  6390. // {
  6391. // "description": "Remove permission entries from an already existing asset.",
  6392. // "httpMethod": "POST",
  6393. // "id": "mapsengine.maps.permissions.batchDelete",
  6394. // "parameterOrder": [
  6395. // "id"
  6396. // ],
  6397. // "parameters": {
  6398. // "id": {
  6399. // "description": "The ID of the asset from which permissions will be removed.",
  6400. // "location": "path",
  6401. // "required": true,
  6402. // "type": "string"
  6403. // }
  6404. // },
  6405. // "path": "maps/{id}/permissions/batchDelete",
  6406. // "request": {
  6407. // "$ref": "PermissionsBatchDeleteRequest"
  6408. // },
  6409. // "response": {
  6410. // "$ref": "PermissionsBatchDeleteResponse"
  6411. // },
  6412. // "scopes": [
  6413. // "https://www.googleapis.com/auth/mapsengine"
  6414. // ]
  6415. // }
  6416. }
  6417. // method id "mapsengine.maps.permissions.batchUpdate":
  6418. type MapsPermissionsBatchUpdateCall struct {
  6419. s *Service
  6420. id string
  6421. permissionsbatchupdaterequest *PermissionsBatchUpdateRequest
  6422. urlParams_ gensupport.URLParams
  6423. ctx_ context.Context
  6424. }
  6425. // BatchUpdate: Add or update permission entries to an already existing
  6426. // asset.
  6427. //
  6428. // An asset can hold up to 20 different permission entries. Each
  6429. // batchInsert request is atomic.
  6430. func (r *MapsPermissionsService) BatchUpdate(id string, permissionsbatchupdaterequest *PermissionsBatchUpdateRequest) *MapsPermissionsBatchUpdateCall {
  6431. c := &MapsPermissionsBatchUpdateCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  6432. c.id = id
  6433. c.permissionsbatchupdaterequest = permissionsbatchupdaterequest
  6434. return c
  6435. }
  6436. // Fields allows partial responses to be retrieved. See
  6437. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  6438. // for more information.
  6439. func (c *MapsPermissionsBatchUpdateCall) Fields(s ...googleapi.Field) *MapsPermissionsBatchUpdateCall {
  6440. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  6441. return c
  6442. }
  6443. // Context sets the context to be used in this call's Do method. Any
  6444. // pending HTTP request will be aborted if the provided context is
  6445. // canceled.
  6446. func (c *MapsPermissionsBatchUpdateCall) Context(ctx context.Context) *MapsPermissionsBatchUpdateCall {
  6447. c.ctx_ = ctx
  6448. return c
  6449. }
  6450. func (c *MapsPermissionsBatchUpdateCall) doRequest(alt string) (*http.Response, error) {
  6451. var body io.Reader = nil
  6452. body, err := googleapi.WithoutDataWrapper.JSONReader(c.permissionsbatchupdaterequest)
  6453. if err != nil {
  6454. return nil, err
  6455. }
  6456. ctype := "application/json"
  6457. c.urlParams_.Set("alt", alt)
  6458. urls := googleapi.ResolveRelative(c.s.BasePath, "maps/{id}/permissions/batchUpdate")
  6459. urls += "?" + c.urlParams_.Encode()
  6460. req, _ := http.NewRequest("POST", urls, body)
  6461. googleapi.Expand(req.URL, map[string]string{
  6462. "id": c.id,
  6463. })
  6464. req.Header.Set("Content-Type", ctype)
  6465. req.Header.Set("User-Agent", c.s.userAgent())
  6466. if c.ctx_ != nil {
  6467. return ctxhttp.Do(c.ctx_, c.s.client, req)
  6468. }
  6469. return c.s.client.Do(req)
  6470. }
  6471. // Do executes the "mapsengine.maps.permissions.batchUpdate" call.
  6472. // Exactly one of *PermissionsBatchUpdateResponse or error will be
  6473. // non-nil. Any non-2xx status code is an error. Response headers are in
  6474. // either *PermissionsBatchUpdateResponse.ServerResponse.Header or (if a
  6475. // response was returned at all) in error.(*googleapi.Error).Header. Use
  6476. // googleapi.IsNotModified to check whether the returned error was
  6477. // because http.StatusNotModified was returned.
  6478. func (c *MapsPermissionsBatchUpdateCall) Do(opts ...googleapi.CallOption) (*PermissionsBatchUpdateResponse, error) {
  6479. gensupport.SetOptions(c.urlParams_, opts...)
  6480. res, err := c.doRequest("json")
  6481. if res != nil && res.StatusCode == http.StatusNotModified {
  6482. if res.Body != nil {
  6483. res.Body.Close()
  6484. }
  6485. return nil, &googleapi.Error{
  6486. Code: res.StatusCode,
  6487. Header: res.Header,
  6488. }
  6489. }
  6490. if err != nil {
  6491. return nil, err
  6492. }
  6493. defer googleapi.CloseBody(res)
  6494. if err := googleapi.CheckResponse(res); err != nil {
  6495. return nil, err
  6496. }
  6497. ret := &PermissionsBatchUpdateResponse{
  6498. ServerResponse: googleapi.ServerResponse{
  6499. Header: res.Header,
  6500. HTTPStatusCode: res.StatusCode,
  6501. },
  6502. }
  6503. if err := json.NewDecoder(res.Body).Decode(&ret); err != nil {
  6504. return nil, err
  6505. }
  6506. return ret, nil
  6507. // {
  6508. // "description": "Add or update permission entries to an already existing asset.\n\nAn asset can hold up to 20 different permission entries. Each batchInsert request is atomic.",
  6509. // "httpMethod": "POST",
  6510. // "id": "mapsengine.maps.permissions.batchUpdate",
  6511. // "parameterOrder": [
  6512. // "id"
  6513. // ],
  6514. // "parameters": {
  6515. // "id": {
  6516. // "description": "The ID of the asset to which permissions will be added.",
  6517. // "location": "path",
  6518. // "required": true,
  6519. // "type": "string"
  6520. // }
  6521. // },
  6522. // "path": "maps/{id}/permissions/batchUpdate",
  6523. // "request": {
  6524. // "$ref": "PermissionsBatchUpdateRequest"
  6525. // },
  6526. // "response": {
  6527. // "$ref": "PermissionsBatchUpdateResponse"
  6528. // },
  6529. // "scopes": [
  6530. // "https://www.googleapis.com/auth/mapsengine"
  6531. // ]
  6532. // }
  6533. }
  6534. // method id "mapsengine.maps.permissions.list":
  6535. type MapsPermissionsListCall struct {
  6536. s *Service
  6537. id string
  6538. urlParams_ gensupport.URLParams
  6539. ifNoneMatch_ string
  6540. ctx_ context.Context
  6541. }
  6542. // List: Return all of the permissions for the specified asset.
  6543. func (r *MapsPermissionsService) List(id string) *MapsPermissionsListCall {
  6544. c := &MapsPermissionsListCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  6545. c.id = id
  6546. return c
  6547. }
  6548. // Fields allows partial responses to be retrieved. See
  6549. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  6550. // for more information.
  6551. func (c *MapsPermissionsListCall) Fields(s ...googleapi.Field) *MapsPermissionsListCall {
  6552. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  6553. return c
  6554. }
  6555. // IfNoneMatch sets the optional parameter which makes the operation
  6556. // fail if the object's ETag matches the given value. This is useful for
  6557. // getting updates only after the object has changed since the last
  6558. // request. Use googleapi.IsNotModified to check whether the response
  6559. // error from Do is the result of In-None-Match.
  6560. func (c *MapsPermissionsListCall) IfNoneMatch(entityTag string) *MapsPermissionsListCall {
  6561. c.ifNoneMatch_ = entityTag
  6562. return c
  6563. }
  6564. // Context sets the context to be used in this call's Do method. Any
  6565. // pending HTTP request will be aborted if the provided context is
  6566. // canceled.
  6567. func (c *MapsPermissionsListCall) Context(ctx context.Context) *MapsPermissionsListCall {
  6568. c.ctx_ = ctx
  6569. return c
  6570. }
  6571. func (c *MapsPermissionsListCall) doRequest(alt string) (*http.Response, error) {
  6572. var body io.Reader = nil
  6573. c.urlParams_.Set("alt", alt)
  6574. urls := googleapi.ResolveRelative(c.s.BasePath, "maps/{id}/permissions")
  6575. urls += "?" + c.urlParams_.Encode()
  6576. req, _ := http.NewRequest("GET", urls, body)
  6577. googleapi.Expand(req.URL, map[string]string{
  6578. "id": c.id,
  6579. })
  6580. req.Header.Set("User-Agent", c.s.userAgent())
  6581. if c.ifNoneMatch_ != "" {
  6582. req.Header.Set("If-None-Match", c.ifNoneMatch_)
  6583. }
  6584. if c.ctx_ != nil {
  6585. return ctxhttp.Do(c.ctx_, c.s.client, req)
  6586. }
  6587. return c.s.client.Do(req)
  6588. }
  6589. // Do executes the "mapsengine.maps.permissions.list" call.
  6590. // Exactly one of *PermissionsListResponse or error will be non-nil. Any
  6591. // non-2xx status code is an error. Response headers are in either
  6592. // *PermissionsListResponse.ServerResponse.Header or (if a response was
  6593. // returned at all) in error.(*googleapi.Error).Header. Use
  6594. // googleapi.IsNotModified to check whether the returned error was
  6595. // because http.StatusNotModified was returned.
  6596. func (c *MapsPermissionsListCall) Do(opts ...googleapi.CallOption) (*PermissionsListResponse, error) {
  6597. gensupport.SetOptions(c.urlParams_, opts...)
  6598. res, err := c.doRequest("json")
  6599. if res != nil && res.StatusCode == http.StatusNotModified {
  6600. if res.Body != nil {
  6601. res.Body.Close()
  6602. }
  6603. return nil, &googleapi.Error{
  6604. Code: res.StatusCode,
  6605. Header: res.Header,
  6606. }
  6607. }
  6608. if err != nil {
  6609. return nil, err
  6610. }
  6611. defer googleapi.CloseBody(res)
  6612. if err := googleapi.CheckResponse(res); err != nil {
  6613. return nil, err
  6614. }
  6615. ret := &PermissionsListResponse{
  6616. ServerResponse: googleapi.ServerResponse{
  6617. Header: res.Header,
  6618. HTTPStatusCode: res.StatusCode,
  6619. },
  6620. }
  6621. if err := json.NewDecoder(res.Body).Decode(&ret); err != nil {
  6622. return nil, err
  6623. }
  6624. return ret, nil
  6625. // {
  6626. // "description": "Return all of the permissions for the specified asset.",
  6627. // "httpMethod": "GET",
  6628. // "id": "mapsengine.maps.permissions.list",
  6629. // "parameterOrder": [
  6630. // "id"
  6631. // ],
  6632. // "parameters": {
  6633. // "id": {
  6634. // "description": "The ID of the asset whose permissions will be listed.",
  6635. // "location": "path",
  6636. // "required": true,
  6637. // "type": "string"
  6638. // }
  6639. // },
  6640. // "path": "maps/{id}/permissions",
  6641. // "response": {
  6642. // "$ref": "PermissionsListResponse"
  6643. // },
  6644. // "scopes": [
  6645. // "https://www.googleapis.com/auth/mapsengine",
  6646. // "https://www.googleapis.com/auth/mapsengine.readonly"
  6647. // ]
  6648. // }
  6649. }
  6650. // method id "mapsengine.projects.list":
  6651. type ProjectsListCall struct {
  6652. s *Service
  6653. urlParams_ gensupport.URLParams
  6654. ifNoneMatch_ string
  6655. ctx_ context.Context
  6656. }
  6657. // List: Return all projects readable by the current user.
  6658. func (r *ProjectsService) List() *ProjectsListCall {
  6659. c := &ProjectsListCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  6660. return c
  6661. }
  6662. // Fields allows partial responses to be retrieved. See
  6663. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  6664. // for more information.
  6665. func (c *ProjectsListCall) Fields(s ...googleapi.Field) *ProjectsListCall {
  6666. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  6667. return c
  6668. }
  6669. // IfNoneMatch sets the optional parameter which makes the operation
  6670. // fail if the object's ETag matches the given value. This is useful for
  6671. // getting updates only after the object has changed since the last
  6672. // request. Use googleapi.IsNotModified to check whether the response
  6673. // error from Do is the result of In-None-Match.
  6674. func (c *ProjectsListCall) IfNoneMatch(entityTag string) *ProjectsListCall {
  6675. c.ifNoneMatch_ = entityTag
  6676. return c
  6677. }
  6678. // Context sets the context to be used in this call's Do method. Any
  6679. // pending HTTP request will be aborted if the provided context is
  6680. // canceled.
  6681. func (c *ProjectsListCall) Context(ctx context.Context) *ProjectsListCall {
  6682. c.ctx_ = ctx
  6683. return c
  6684. }
  6685. func (c *ProjectsListCall) doRequest(alt string) (*http.Response, error) {
  6686. var body io.Reader = nil
  6687. c.urlParams_.Set("alt", alt)
  6688. urls := googleapi.ResolveRelative(c.s.BasePath, "projects")
  6689. urls += "?" + c.urlParams_.Encode()
  6690. req, _ := http.NewRequest("GET", urls, body)
  6691. googleapi.SetOpaque(req.URL)
  6692. req.Header.Set("User-Agent", c.s.userAgent())
  6693. if c.ifNoneMatch_ != "" {
  6694. req.Header.Set("If-None-Match", c.ifNoneMatch_)
  6695. }
  6696. if c.ctx_ != nil {
  6697. return ctxhttp.Do(c.ctx_, c.s.client, req)
  6698. }
  6699. return c.s.client.Do(req)
  6700. }
  6701. // Do executes the "mapsengine.projects.list" call.
  6702. // Exactly one of *ProjectsListResponse or error will be non-nil. Any
  6703. // non-2xx status code is an error. Response headers are in either
  6704. // *ProjectsListResponse.ServerResponse.Header or (if a response was
  6705. // returned at all) in error.(*googleapi.Error).Header. Use
  6706. // googleapi.IsNotModified to check whether the returned error was
  6707. // because http.StatusNotModified was returned.
  6708. func (c *ProjectsListCall) Do(opts ...googleapi.CallOption) (*ProjectsListResponse, error) {
  6709. gensupport.SetOptions(c.urlParams_, opts...)
  6710. res, err := c.doRequest("json")
  6711. if res != nil && res.StatusCode == http.StatusNotModified {
  6712. if res.Body != nil {
  6713. res.Body.Close()
  6714. }
  6715. return nil, &googleapi.Error{
  6716. Code: res.StatusCode,
  6717. Header: res.Header,
  6718. }
  6719. }
  6720. if err != nil {
  6721. return nil, err
  6722. }
  6723. defer googleapi.CloseBody(res)
  6724. if err := googleapi.CheckResponse(res); err != nil {
  6725. return nil, err
  6726. }
  6727. ret := &ProjectsListResponse{
  6728. ServerResponse: googleapi.ServerResponse{
  6729. Header: res.Header,
  6730. HTTPStatusCode: res.StatusCode,
  6731. },
  6732. }
  6733. if err := json.NewDecoder(res.Body).Decode(&ret); err != nil {
  6734. return nil, err
  6735. }
  6736. return ret, nil
  6737. // {
  6738. // "description": "Return all projects readable by the current user.",
  6739. // "httpMethod": "GET",
  6740. // "id": "mapsengine.projects.list",
  6741. // "path": "projects",
  6742. // "response": {
  6743. // "$ref": "ProjectsListResponse"
  6744. // },
  6745. // "scopes": [
  6746. // "https://www.googleapis.com/auth/mapsengine",
  6747. // "https://www.googleapis.com/auth/mapsengine.readonly"
  6748. // ]
  6749. // }
  6750. }
  6751. // method id "mapsengine.projects.icons.create":
  6752. type ProjectsIconsCreateCall struct {
  6753. s *Service
  6754. projectId string
  6755. icon *Icon
  6756. urlParams_ gensupport.URLParams
  6757. media_ io.Reader
  6758. resumableBuffer_ *gensupport.ResumableBuffer
  6759. mediaType_ string
  6760. mediaSize_ int64 // mediaSize, if known. Used only for calls to progressUpdater_.
  6761. progressUpdater_ googleapi.ProgressUpdater
  6762. ctx_ context.Context
  6763. }
  6764. // Create: Create an icon.
  6765. func (r *ProjectsIconsService) Create(projectId string, icon *Icon) *ProjectsIconsCreateCall {
  6766. c := &ProjectsIconsCreateCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  6767. c.projectId = projectId
  6768. c.icon = icon
  6769. return c
  6770. }
  6771. // Media specifies the media to upload in one or more chunks. The chunk
  6772. // size may be controlled by supplying a MediaOption generated by
  6773. // googleapi.ChunkSize. The chunk size defaults to
  6774. // googleapi.DefaultUploadChunkSize.
  6775. // At most one of Media and ResumableMedia may be set.
  6776. func (c *ProjectsIconsCreateCall) Media(r io.Reader, options ...googleapi.MediaOption) *ProjectsIconsCreateCall {
  6777. opts := googleapi.ProcessMediaOptions(options)
  6778. chunkSize := opts.ChunkSize
  6779. r, c.mediaType_ = gensupport.DetermineContentType(r, opts.ContentType)
  6780. c.media_, c.resumableBuffer_ = gensupport.PrepareUpload(r, chunkSize)
  6781. return c
  6782. }
  6783. // ResumableMedia specifies the media to upload in chunks and can be
  6784. // canceled with ctx.
  6785. //
  6786. // Deprecated: use Media instead.
  6787. //
  6788. // At most one of Media and ResumableMedia may be set. mediaType
  6789. // identifies the MIME media type of the upload, such as "image/png". If
  6790. // mediaType is "", it will be auto-detected. The provided ctx will
  6791. // supersede any context previously provided to the Context method.
  6792. func (c *ProjectsIconsCreateCall) ResumableMedia(ctx context.Context, r io.ReaderAt, size int64, mediaType string) *ProjectsIconsCreateCall {
  6793. c.ctx_ = ctx
  6794. rdr := gensupport.ReaderAtToReader(r, size)
  6795. rdr, c.mediaType_ = gensupport.DetermineContentType(rdr, mediaType)
  6796. c.resumableBuffer_ = gensupport.NewResumableBuffer(rdr, googleapi.DefaultUploadChunkSize)
  6797. c.media_ = nil
  6798. c.mediaSize_ = size
  6799. return c
  6800. }
  6801. // ProgressUpdater provides a callback function that will be called
  6802. // after every chunk. It should be a low-latency function in order to
  6803. // not slow down the upload operation. This should only be called when
  6804. // using ResumableMedia (as opposed to Media).
  6805. func (c *ProjectsIconsCreateCall) ProgressUpdater(pu googleapi.ProgressUpdater) *ProjectsIconsCreateCall {
  6806. c.progressUpdater_ = pu
  6807. return c
  6808. }
  6809. // Fields allows partial responses to be retrieved. See
  6810. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  6811. // for more information.
  6812. func (c *ProjectsIconsCreateCall) Fields(s ...googleapi.Field) *ProjectsIconsCreateCall {
  6813. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  6814. return c
  6815. }
  6816. // Context sets the context to be used in this call's Do method. Any
  6817. // pending HTTP request will be aborted if the provided context is
  6818. // canceled.
  6819. // This context will supersede any context previously provided to the
  6820. // ResumableMedia method.
  6821. func (c *ProjectsIconsCreateCall) Context(ctx context.Context) *ProjectsIconsCreateCall {
  6822. c.ctx_ = ctx
  6823. return c
  6824. }
  6825. func (c *ProjectsIconsCreateCall) doRequest(alt string) (*http.Response, error) {
  6826. var body io.Reader = nil
  6827. body, err := googleapi.WithoutDataWrapper.JSONReader(c.icon)
  6828. if err != nil {
  6829. return nil, err
  6830. }
  6831. ctype := "application/json"
  6832. c.urlParams_.Set("alt", alt)
  6833. urls := googleapi.ResolveRelative(c.s.BasePath, "projects/{projectId}/icons")
  6834. if c.media_ != nil || c.resumableBuffer_ != nil {
  6835. urls = strings.Replace(urls, "https://www.googleapis.com/", "https://www.googleapis.com/upload/", 1)
  6836. protocol := "multipart"
  6837. if c.resumableBuffer_ != nil {
  6838. protocol = "resumable"
  6839. }
  6840. c.urlParams_.Set("uploadType", protocol)
  6841. }
  6842. urls += "?" + c.urlParams_.Encode()
  6843. if c.media_ != nil {
  6844. var combined io.ReadCloser
  6845. combined, ctype = gensupport.CombineBodyMedia(body, ctype, c.media_, c.mediaType_)
  6846. defer combined.Close()
  6847. body = combined
  6848. }
  6849. req, _ := http.NewRequest("POST", urls, body)
  6850. googleapi.Expand(req.URL, map[string]string{
  6851. "projectId": c.projectId,
  6852. })
  6853. if c.resumableBuffer_ != nil {
  6854. req.Header.Set("X-Upload-Content-Type", c.mediaType_)
  6855. }
  6856. req.Header.Set("Content-Type", ctype)
  6857. req.Header.Set("User-Agent", c.s.userAgent())
  6858. if c.ctx_ != nil {
  6859. return ctxhttp.Do(c.ctx_, c.s.client, req)
  6860. }
  6861. return c.s.client.Do(req)
  6862. }
  6863. // Do executes the "mapsengine.projects.icons.create" call.
  6864. // Exactly one of *Icon or error will be non-nil. Any non-2xx status
  6865. // code is an error. Response headers are in either
  6866. // *Icon.ServerResponse.Header or (if a response was returned at all) in
  6867. // error.(*googleapi.Error).Header. Use googleapi.IsNotModified to check
  6868. // whether the returned error was because http.StatusNotModified was
  6869. // returned.
  6870. func (c *ProjectsIconsCreateCall) Do(opts ...googleapi.CallOption) (*Icon, error) {
  6871. gensupport.SetOptions(c.urlParams_, opts...)
  6872. res, err := gensupport.Retry(c.ctx_, func() (*http.Response, error) {
  6873. return c.doRequest("json")
  6874. }, gensupport.DefaultBackoffStrategy())
  6875. if res != nil && res.StatusCode == http.StatusNotModified {
  6876. if res.Body != nil {
  6877. res.Body.Close()
  6878. }
  6879. return nil, &googleapi.Error{
  6880. Code: res.StatusCode,
  6881. Header: res.Header,
  6882. }
  6883. }
  6884. if err != nil {
  6885. return nil, err
  6886. }
  6887. defer googleapi.CloseBody(res)
  6888. if err := googleapi.CheckResponse(res); err != nil {
  6889. return nil, err
  6890. }
  6891. if c.resumableBuffer_ != nil {
  6892. loc := res.Header.Get("Location")
  6893. rx := &gensupport.ResumableUpload{
  6894. Client: c.s.client,
  6895. UserAgent: c.s.userAgent(),
  6896. URI: loc,
  6897. Media: c.resumableBuffer_,
  6898. MediaType: c.mediaType_,
  6899. Callback: func(curr int64) {
  6900. if c.progressUpdater_ != nil {
  6901. c.progressUpdater_(curr, c.mediaSize_)
  6902. }
  6903. },
  6904. }
  6905. ctx := c.ctx_
  6906. if ctx == nil {
  6907. ctx = context.TODO()
  6908. }
  6909. res, err = rx.Upload(ctx)
  6910. if err != nil {
  6911. return nil, err
  6912. }
  6913. defer res.Body.Close()
  6914. if err := googleapi.CheckResponse(res); err != nil {
  6915. return nil, err
  6916. }
  6917. }
  6918. ret := &Icon{
  6919. ServerResponse: googleapi.ServerResponse{
  6920. Header: res.Header,
  6921. HTTPStatusCode: res.StatusCode,
  6922. },
  6923. }
  6924. if err := json.NewDecoder(res.Body).Decode(&ret); err != nil {
  6925. return nil, err
  6926. }
  6927. return ret, nil
  6928. // {
  6929. // "description": "Create an icon.",
  6930. // "httpMethod": "POST",
  6931. // "id": "mapsengine.projects.icons.create",
  6932. // "mediaUpload": {
  6933. // "accept": [
  6934. // "*/*"
  6935. // ],
  6936. // "maxSize": "100KB",
  6937. // "protocols": {
  6938. // "resumable": {
  6939. // "multipart": true,
  6940. // "path": "/resumable/upload/mapsengine/v1/projects/{projectId}/icons"
  6941. // },
  6942. // "simple": {
  6943. // "multipart": true,
  6944. // "path": "/upload/mapsengine/v1/projects/{projectId}/icons"
  6945. // }
  6946. // }
  6947. // },
  6948. // "parameterOrder": [
  6949. // "projectId"
  6950. // ],
  6951. // "parameters": {
  6952. // "projectId": {
  6953. // "description": "The ID of the project.",
  6954. // "location": "path",
  6955. // "required": true,
  6956. // "type": "string"
  6957. // }
  6958. // },
  6959. // "path": "projects/{projectId}/icons",
  6960. // "request": {
  6961. // "$ref": "Icon"
  6962. // },
  6963. // "response": {
  6964. // "$ref": "Icon"
  6965. // },
  6966. // "scopes": [
  6967. // "https://www.googleapis.com/auth/mapsengine"
  6968. // ],
  6969. // "supportsMediaUpload": true
  6970. // }
  6971. }
  6972. // method id "mapsengine.projects.icons.get":
  6973. type ProjectsIconsGetCall struct {
  6974. s *Service
  6975. projectId string
  6976. id string
  6977. urlParams_ gensupport.URLParams
  6978. ifNoneMatch_ string
  6979. ctx_ context.Context
  6980. }
  6981. // Get: Return an icon or its associated metadata
  6982. func (r *ProjectsIconsService) Get(projectId string, id string) *ProjectsIconsGetCall {
  6983. c := &ProjectsIconsGetCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  6984. c.projectId = projectId
  6985. c.id = id
  6986. return c
  6987. }
  6988. // Fields allows partial responses to be retrieved. See
  6989. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  6990. // for more information.
  6991. func (c *ProjectsIconsGetCall) Fields(s ...googleapi.Field) *ProjectsIconsGetCall {
  6992. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  6993. return c
  6994. }
  6995. // IfNoneMatch sets the optional parameter which makes the operation
  6996. // fail if the object's ETag matches the given value. This is useful for
  6997. // getting updates only after the object has changed since the last
  6998. // request. Use googleapi.IsNotModified to check whether the response
  6999. // error from Do is the result of In-None-Match.
  7000. func (c *ProjectsIconsGetCall) IfNoneMatch(entityTag string) *ProjectsIconsGetCall {
  7001. c.ifNoneMatch_ = entityTag
  7002. return c
  7003. }
  7004. // Context sets the context to be used in this call's Do and Download
  7005. // methods. Any pending HTTP request will be aborted if the provided
  7006. // context is canceled.
  7007. func (c *ProjectsIconsGetCall) Context(ctx context.Context) *ProjectsIconsGetCall {
  7008. c.ctx_ = ctx
  7009. return c
  7010. }
  7011. func (c *ProjectsIconsGetCall) doRequest(alt string) (*http.Response, error) {
  7012. var body io.Reader = nil
  7013. c.urlParams_.Set("alt", alt)
  7014. urls := googleapi.ResolveRelative(c.s.BasePath, "projects/{projectId}/icons/{id}")
  7015. urls += "?" + c.urlParams_.Encode()
  7016. req, _ := http.NewRequest("GET", urls, body)
  7017. googleapi.Expand(req.URL, map[string]string{
  7018. "projectId": c.projectId,
  7019. "id": c.id,
  7020. })
  7021. req.Header.Set("User-Agent", c.s.userAgent())
  7022. if c.ifNoneMatch_ != "" {
  7023. req.Header.Set("If-None-Match", c.ifNoneMatch_)
  7024. }
  7025. if c.ctx_ != nil {
  7026. return ctxhttp.Do(c.ctx_, c.s.client, req)
  7027. }
  7028. return c.s.client.Do(req)
  7029. }
  7030. // Download fetches the API endpoint's "media" value, instead of the normal
  7031. // API response value. If the returned error is nil, the Response is guaranteed to
  7032. // have a 2xx status code. Callers must close the Response.Body as usual.
  7033. func (c *ProjectsIconsGetCall) Download(opts ...googleapi.CallOption) (*http.Response, error) {
  7034. gensupport.SetOptions(c.urlParams_, opts...)
  7035. res, err := c.doRequest("media")
  7036. if err != nil {
  7037. return nil, err
  7038. }
  7039. if err := googleapi.CheckMediaResponse(res); err != nil {
  7040. res.Body.Close()
  7041. return nil, err
  7042. }
  7043. return res, nil
  7044. }
  7045. // Do executes the "mapsengine.projects.icons.get" call.
  7046. // Exactly one of *Icon or error will be non-nil. Any non-2xx status
  7047. // code is an error. Response headers are in either
  7048. // *Icon.ServerResponse.Header or (if a response was returned at all) in
  7049. // error.(*googleapi.Error).Header. Use googleapi.IsNotModified to check
  7050. // whether the returned error was because http.StatusNotModified was
  7051. // returned.
  7052. func (c *ProjectsIconsGetCall) Do(opts ...googleapi.CallOption) (*Icon, error) {
  7053. gensupport.SetOptions(c.urlParams_, opts...)
  7054. res, err := c.doRequest("json")
  7055. if res != nil && res.StatusCode == http.StatusNotModified {
  7056. if res.Body != nil {
  7057. res.Body.Close()
  7058. }
  7059. return nil, &googleapi.Error{
  7060. Code: res.StatusCode,
  7061. Header: res.Header,
  7062. }
  7063. }
  7064. if err != nil {
  7065. return nil, err
  7066. }
  7067. defer googleapi.CloseBody(res)
  7068. if err := googleapi.CheckResponse(res); err != nil {
  7069. return nil, err
  7070. }
  7071. ret := &Icon{
  7072. ServerResponse: googleapi.ServerResponse{
  7073. Header: res.Header,
  7074. HTTPStatusCode: res.StatusCode,
  7075. },
  7076. }
  7077. if err := json.NewDecoder(res.Body).Decode(&ret); err != nil {
  7078. return nil, err
  7079. }
  7080. return ret, nil
  7081. // {
  7082. // "description": "Return an icon or its associated metadata",
  7083. // "httpMethod": "GET",
  7084. // "id": "mapsengine.projects.icons.get",
  7085. // "parameterOrder": [
  7086. // "projectId",
  7087. // "id"
  7088. // ],
  7089. // "parameters": {
  7090. // "id": {
  7091. // "description": "The ID of the icon.",
  7092. // "location": "path",
  7093. // "required": true,
  7094. // "type": "string"
  7095. // },
  7096. // "projectId": {
  7097. // "description": "The ID of the project.",
  7098. // "location": "path",
  7099. // "required": true,
  7100. // "type": "string"
  7101. // }
  7102. // },
  7103. // "path": "projects/{projectId}/icons/{id}",
  7104. // "response": {
  7105. // "$ref": "Icon"
  7106. // },
  7107. // "scopes": [
  7108. // "https://www.googleapis.com/auth/mapsengine",
  7109. // "https://www.googleapis.com/auth/mapsengine.readonly"
  7110. // ],
  7111. // "supportsMediaDownload": true
  7112. // }
  7113. }
  7114. // method id "mapsengine.projects.icons.list":
  7115. type ProjectsIconsListCall struct {
  7116. s *Service
  7117. projectId string
  7118. urlParams_ gensupport.URLParams
  7119. ifNoneMatch_ string
  7120. ctx_ context.Context
  7121. }
  7122. // List: Return all icons in the current project
  7123. func (r *ProjectsIconsService) List(projectId string) *ProjectsIconsListCall {
  7124. c := &ProjectsIconsListCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  7125. c.projectId = projectId
  7126. return c
  7127. }
  7128. // MaxResults sets the optional parameter "maxResults": The maximum
  7129. // number of items to include in a single response page. The maximum
  7130. // supported value is 50.
  7131. func (c *ProjectsIconsListCall) MaxResults(maxResults int64) *ProjectsIconsListCall {
  7132. c.urlParams_.Set("maxResults", fmt.Sprint(maxResults))
  7133. return c
  7134. }
  7135. // PageToken sets the optional parameter "pageToken": The continuation
  7136. // token, used to page through large result sets. To get the next page
  7137. // of results, set this parameter to the value of nextPageToken from the
  7138. // previous response.
  7139. func (c *ProjectsIconsListCall) PageToken(pageToken string) *ProjectsIconsListCall {
  7140. c.urlParams_.Set("pageToken", pageToken)
  7141. return c
  7142. }
  7143. // Fields allows partial responses to be retrieved. See
  7144. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  7145. // for more information.
  7146. func (c *ProjectsIconsListCall) Fields(s ...googleapi.Field) *ProjectsIconsListCall {
  7147. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  7148. return c
  7149. }
  7150. // IfNoneMatch sets the optional parameter which makes the operation
  7151. // fail if the object's ETag matches the given value. This is useful for
  7152. // getting updates only after the object has changed since the last
  7153. // request. Use googleapi.IsNotModified to check whether the response
  7154. // error from Do is the result of In-None-Match.
  7155. func (c *ProjectsIconsListCall) IfNoneMatch(entityTag string) *ProjectsIconsListCall {
  7156. c.ifNoneMatch_ = entityTag
  7157. return c
  7158. }
  7159. // Context sets the context to be used in this call's Do method. Any
  7160. // pending HTTP request will be aborted if the provided context is
  7161. // canceled.
  7162. func (c *ProjectsIconsListCall) Context(ctx context.Context) *ProjectsIconsListCall {
  7163. c.ctx_ = ctx
  7164. return c
  7165. }
  7166. func (c *ProjectsIconsListCall) doRequest(alt string) (*http.Response, error) {
  7167. var body io.Reader = nil
  7168. c.urlParams_.Set("alt", alt)
  7169. urls := googleapi.ResolveRelative(c.s.BasePath, "projects/{projectId}/icons")
  7170. urls += "?" + c.urlParams_.Encode()
  7171. req, _ := http.NewRequest("GET", urls, body)
  7172. googleapi.Expand(req.URL, map[string]string{
  7173. "projectId": c.projectId,
  7174. })
  7175. req.Header.Set("User-Agent", c.s.userAgent())
  7176. if c.ifNoneMatch_ != "" {
  7177. req.Header.Set("If-None-Match", c.ifNoneMatch_)
  7178. }
  7179. if c.ctx_ != nil {
  7180. return ctxhttp.Do(c.ctx_, c.s.client, req)
  7181. }
  7182. return c.s.client.Do(req)
  7183. }
  7184. // Do executes the "mapsengine.projects.icons.list" call.
  7185. // Exactly one of *IconsListResponse or error will be non-nil. Any
  7186. // non-2xx status code is an error. Response headers are in either
  7187. // *IconsListResponse.ServerResponse.Header or (if a response was
  7188. // returned at all) in error.(*googleapi.Error).Header. Use
  7189. // googleapi.IsNotModified to check whether the returned error was
  7190. // because http.StatusNotModified was returned.
  7191. func (c *ProjectsIconsListCall) Do(opts ...googleapi.CallOption) (*IconsListResponse, error) {
  7192. gensupport.SetOptions(c.urlParams_, opts...)
  7193. res, err := c.doRequest("json")
  7194. if res != nil && res.StatusCode == http.StatusNotModified {
  7195. if res.Body != nil {
  7196. res.Body.Close()
  7197. }
  7198. return nil, &googleapi.Error{
  7199. Code: res.StatusCode,
  7200. Header: res.Header,
  7201. }
  7202. }
  7203. if err != nil {
  7204. return nil, err
  7205. }
  7206. defer googleapi.CloseBody(res)
  7207. if err := googleapi.CheckResponse(res); err != nil {
  7208. return nil, err
  7209. }
  7210. ret := &IconsListResponse{
  7211. ServerResponse: googleapi.ServerResponse{
  7212. Header: res.Header,
  7213. HTTPStatusCode: res.StatusCode,
  7214. },
  7215. }
  7216. if err := json.NewDecoder(res.Body).Decode(&ret); err != nil {
  7217. return nil, err
  7218. }
  7219. return ret, nil
  7220. // {
  7221. // "description": "Return all icons in the current project",
  7222. // "httpMethod": "GET",
  7223. // "id": "mapsengine.projects.icons.list",
  7224. // "parameterOrder": [
  7225. // "projectId"
  7226. // ],
  7227. // "parameters": {
  7228. // "maxResults": {
  7229. // "description": "The maximum number of items to include in a single response page. The maximum supported value is 50.",
  7230. // "format": "uint32",
  7231. // "location": "query",
  7232. // "type": "integer"
  7233. // },
  7234. // "pageToken": {
  7235. // "description": "The continuation token, used to page through large result sets. To get the next page of results, set this parameter to the value of nextPageToken from the previous response.",
  7236. // "location": "query",
  7237. // "type": "string"
  7238. // },
  7239. // "projectId": {
  7240. // "description": "The ID of the project.",
  7241. // "location": "path",
  7242. // "required": true,
  7243. // "type": "string"
  7244. // }
  7245. // },
  7246. // "path": "projects/{projectId}/icons",
  7247. // "response": {
  7248. // "$ref": "IconsListResponse"
  7249. // },
  7250. // "scopes": [
  7251. // "https://www.googleapis.com/auth/mapsengine",
  7252. // "https://www.googleapis.com/auth/mapsengine.readonly"
  7253. // ]
  7254. // }
  7255. }
  7256. // Pages invokes f for each page of results.
  7257. // A non-nil error returned from f will halt the iteration.
  7258. // The provided context supersedes any context provided to the Context method.
  7259. func (c *ProjectsIconsListCall) Pages(ctx context.Context, f func(*IconsListResponse) error) error {
  7260. c.ctx_ = ctx
  7261. defer c.PageToken(c.urlParams_.Get("pageToken")) // reset paging to original point
  7262. for {
  7263. x, err := c.Do()
  7264. if err != nil {
  7265. return err
  7266. }
  7267. if err := f(x); err != nil {
  7268. return err
  7269. }
  7270. if x.NextPageToken == "" {
  7271. return nil
  7272. }
  7273. c.PageToken(x.NextPageToken)
  7274. }
  7275. }
  7276. // method id "mapsengine.rasterCollections.cancelProcessing":
  7277. type RasterCollectionsCancelProcessingCall struct {
  7278. s *Service
  7279. id string
  7280. urlParams_ gensupport.URLParams
  7281. ctx_ context.Context
  7282. }
  7283. // CancelProcessing: Cancel processing on a raster collection asset.
  7284. func (r *RasterCollectionsService) CancelProcessing(id string) *RasterCollectionsCancelProcessingCall {
  7285. c := &RasterCollectionsCancelProcessingCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  7286. c.id = id
  7287. return c
  7288. }
  7289. // Fields allows partial responses to be retrieved. See
  7290. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  7291. // for more information.
  7292. func (c *RasterCollectionsCancelProcessingCall) Fields(s ...googleapi.Field) *RasterCollectionsCancelProcessingCall {
  7293. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  7294. return c
  7295. }
  7296. // Context sets the context to be used in this call's Do method. Any
  7297. // pending HTTP request will be aborted if the provided context is
  7298. // canceled.
  7299. func (c *RasterCollectionsCancelProcessingCall) Context(ctx context.Context) *RasterCollectionsCancelProcessingCall {
  7300. c.ctx_ = ctx
  7301. return c
  7302. }
  7303. func (c *RasterCollectionsCancelProcessingCall) doRequest(alt string) (*http.Response, error) {
  7304. var body io.Reader = nil
  7305. c.urlParams_.Set("alt", alt)
  7306. urls := googleapi.ResolveRelative(c.s.BasePath, "rasterCollections/{id}/cancelProcessing")
  7307. urls += "?" + c.urlParams_.Encode()
  7308. req, _ := http.NewRequest("POST", urls, body)
  7309. googleapi.Expand(req.URL, map[string]string{
  7310. "id": c.id,
  7311. })
  7312. req.Header.Set("User-Agent", c.s.userAgent())
  7313. if c.ctx_ != nil {
  7314. return ctxhttp.Do(c.ctx_, c.s.client, req)
  7315. }
  7316. return c.s.client.Do(req)
  7317. }
  7318. // Do executes the "mapsengine.rasterCollections.cancelProcessing" call.
  7319. // Exactly one of *ProcessResponse or error will be non-nil. Any non-2xx
  7320. // status code is an error. Response headers are in either
  7321. // *ProcessResponse.ServerResponse.Header or (if a response was returned
  7322. // at all) in error.(*googleapi.Error).Header. Use
  7323. // googleapi.IsNotModified to check whether the returned error was
  7324. // because http.StatusNotModified was returned.
  7325. func (c *RasterCollectionsCancelProcessingCall) Do(opts ...googleapi.CallOption) (*ProcessResponse, error) {
  7326. gensupport.SetOptions(c.urlParams_, opts...)
  7327. res, err := c.doRequest("json")
  7328. if res != nil && res.StatusCode == http.StatusNotModified {
  7329. if res.Body != nil {
  7330. res.Body.Close()
  7331. }
  7332. return nil, &googleapi.Error{
  7333. Code: res.StatusCode,
  7334. Header: res.Header,
  7335. }
  7336. }
  7337. if err != nil {
  7338. return nil, err
  7339. }
  7340. defer googleapi.CloseBody(res)
  7341. if err := googleapi.CheckResponse(res); err != nil {
  7342. return nil, err
  7343. }
  7344. ret := &ProcessResponse{
  7345. ServerResponse: googleapi.ServerResponse{
  7346. Header: res.Header,
  7347. HTTPStatusCode: res.StatusCode,
  7348. },
  7349. }
  7350. if err := json.NewDecoder(res.Body).Decode(&ret); err != nil {
  7351. return nil, err
  7352. }
  7353. return ret, nil
  7354. // {
  7355. // "description": "Cancel processing on a raster collection asset.",
  7356. // "httpMethod": "POST",
  7357. // "id": "mapsengine.rasterCollections.cancelProcessing",
  7358. // "parameterOrder": [
  7359. // "id"
  7360. // ],
  7361. // "parameters": {
  7362. // "id": {
  7363. // "description": "The ID of the raster collection.",
  7364. // "location": "path",
  7365. // "required": true,
  7366. // "type": "string"
  7367. // }
  7368. // },
  7369. // "path": "rasterCollections/{id}/cancelProcessing",
  7370. // "response": {
  7371. // "$ref": "ProcessResponse"
  7372. // },
  7373. // "scopes": [
  7374. // "https://www.googleapis.com/auth/mapsengine"
  7375. // ]
  7376. // }
  7377. }
  7378. // method id "mapsengine.rasterCollections.create":
  7379. type RasterCollectionsCreateCall struct {
  7380. s *Service
  7381. rastercollection *RasterCollection
  7382. urlParams_ gensupport.URLParams
  7383. ctx_ context.Context
  7384. }
  7385. // Create: Create a raster collection asset.
  7386. func (r *RasterCollectionsService) Create(rastercollection *RasterCollection) *RasterCollectionsCreateCall {
  7387. c := &RasterCollectionsCreateCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  7388. c.rastercollection = rastercollection
  7389. return c
  7390. }
  7391. // Fields allows partial responses to be retrieved. See
  7392. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  7393. // for more information.
  7394. func (c *RasterCollectionsCreateCall) Fields(s ...googleapi.Field) *RasterCollectionsCreateCall {
  7395. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  7396. return c
  7397. }
  7398. // Context sets the context to be used in this call's Do method. Any
  7399. // pending HTTP request will be aborted if the provided context is
  7400. // canceled.
  7401. func (c *RasterCollectionsCreateCall) Context(ctx context.Context) *RasterCollectionsCreateCall {
  7402. c.ctx_ = ctx
  7403. return c
  7404. }
  7405. func (c *RasterCollectionsCreateCall) doRequest(alt string) (*http.Response, error) {
  7406. var body io.Reader = nil
  7407. body, err := googleapi.WithoutDataWrapper.JSONReader(c.rastercollection)
  7408. if err != nil {
  7409. return nil, err
  7410. }
  7411. ctype := "application/json"
  7412. c.urlParams_.Set("alt", alt)
  7413. urls := googleapi.ResolveRelative(c.s.BasePath, "rasterCollections")
  7414. urls += "?" + c.urlParams_.Encode()
  7415. req, _ := http.NewRequest("POST", urls, body)
  7416. googleapi.SetOpaque(req.URL)
  7417. req.Header.Set("Content-Type", ctype)
  7418. req.Header.Set("User-Agent", c.s.userAgent())
  7419. if c.ctx_ != nil {
  7420. return ctxhttp.Do(c.ctx_, c.s.client, req)
  7421. }
  7422. return c.s.client.Do(req)
  7423. }
  7424. // Do executes the "mapsengine.rasterCollections.create" call.
  7425. // Exactly one of *RasterCollection or error will be non-nil. Any
  7426. // non-2xx status code is an error. Response headers are in either
  7427. // *RasterCollection.ServerResponse.Header or (if a response was
  7428. // returned at all) in error.(*googleapi.Error).Header. Use
  7429. // googleapi.IsNotModified to check whether the returned error was
  7430. // because http.StatusNotModified was returned.
  7431. func (c *RasterCollectionsCreateCall) Do(opts ...googleapi.CallOption) (*RasterCollection, error) {
  7432. gensupport.SetOptions(c.urlParams_, opts...)
  7433. res, err := c.doRequest("json")
  7434. if res != nil && res.StatusCode == http.StatusNotModified {
  7435. if res.Body != nil {
  7436. res.Body.Close()
  7437. }
  7438. return nil, &googleapi.Error{
  7439. Code: res.StatusCode,
  7440. Header: res.Header,
  7441. }
  7442. }
  7443. if err != nil {
  7444. return nil, err
  7445. }
  7446. defer googleapi.CloseBody(res)
  7447. if err := googleapi.CheckResponse(res); err != nil {
  7448. return nil, err
  7449. }
  7450. ret := &RasterCollection{
  7451. ServerResponse: googleapi.ServerResponse{
  7452. Header: res.Header,
  7453. HTTPStatusCode: res.StatusCode,
  7454. },
  7455. }
  7456. if err := json.NewDecoder(res.Body).Decode(&ret); err != nil {
  7457. return nil, err
  7458. }
  7459. return ret, nil
  7460. // {
  7461. // "description": "Create a raster collection asset.",
  7462. // "httpMethod": "POST",
  7463. // "id": "mapsengine.rasterCollections.create",
  7464. // "path": "rasterCollections",
  7465. // "request": {
  7466. // "$ref": "RasterCollection"
  7467. // },
  7468. // "response": {
  7469. // "$ref": "RasterCollection"
  7470. // },
  7471. // "scopes": [
  7472. // "https://www.googleapis.com/auth/mapsengine"
  7473. // ]
  7474. // }
  7475. }
  7476. // method id "mapsengine.rasterCollections.delete":
  7477. type RasterCollectionsDeleteCall struct {
  7478. s *Service
  7479. id string
  7480. urlParams_ gensupport.URLParams
  7481. ctx_ context.Context
  7482. }
  7483. // Delete: Delete a raster collection.
  7484. func (r *RasterCollectionsService) Delete(id string) *RasterCollectionsDeleteCall {
  7485. c := &RasterCollectionsDeleteCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  7486. c.id = id
  7487. return c
  7488. }
  7489. // Fields allows partial responses to be retrieved. See
  7490. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  7491. // for more information.
  7492. func (c *RasterCollectionsDeleteCall) Fields(s ...googleapi.Field) *RasterCollectionsDeleteCall {
  7493. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  7494. return c
  7495. }
  7496. // Context sets the context to be used in this call's Do method. Any
  7497. // pending HTTP request will be aborted if the provided context is
  7498. // canceled.
  7499. func (c *RasterCollectionsDeleteCall) Context(ctx context.Context) *RasterCollectionsDeleteCall {
  7500. c.ctx_ = ctx
  7501. return c
  7502. }
  7503. func (c *RasterCollectionsDeleteCall) doRequest(alt string) (*http.Response, error) {
  7504. var body io.Reader = nil
  7505. c.urlParams_.Set("alt", alt)
  7506. urls := googleapi.ResolveRelative(c.s.BasePath, "rasterCollections/{id}")
  7507. urls += "?" + c.urlParams_.Encode()
  7508. req, _ := http.NewRequest("DELETE", urls, body)
  7509. googleapi.Expand(req.URL, map[string]string{
  7510. "id": c.id,
  7511. })
  7512. req.Header.Set("User-Agent", c.s.userAgent())
  7513. if c.ctx_ != nil {
  7514. return ctxhttp.Do(c.ctx_, c.s.client, req)
  7515. }
  7516. return c.s.client.Do(req)
  7517. }
  7518. // Do executes the "mapsengine.rasterCollections.delete" call.
  7519. func (c *RasterCollectionsDeleteCall) Do(opts ...googleapi.CallOption) error {
  7520. gensupport.SetOptions(c.urlParams_, opts...)
  7521. res, err := c.doRequest("json")
  7522. if err != nil {
  7523. return err
  7524. }
  7525. defer googleapi.CloseBody(res)
  7526. if err := googleapi.CheckResponse(res); err != nil {
  7527. return err
  7528. }
  7529. return nil
  7530. // {
  7531. // "description": "Delete a raster collection.",
  7532. // "httpMethod": "DELETE",
  7533. // "id": "mapsengine.rasterCollections.delete",
  7534. // "parameterOrder": [
  7535. // "id"
  7536. // ],
  7537. // "parameters": {
  7538. // "id": {
  7539. // "description": "The ID of the raster collection. Only the raster collection creator or project owner are permitted to delete. If the rastor collection is included in a layer, the request will fail. Remove the raster collection from all layers prior to deleting.",
  7540. // "location": "path",
  7541. // "required": true,
  7542. // "type": "string"
  7543. // }
  7544. // },
  7545. // "path": "rasterCollections/{id}",
  7546. // "scopes": [
  7547. // "https://www.googleapis.com/auth/mapsengine"
  7548. // ]
  7549. // }
  7550. }
  7551. // method id "mapsengine.rasterCollections.get":
  7552. type RasterCollectionsGetCall struct {
  7553. s *Service
  7554. id string
  7555. urlParams_ gensupport.URLParams
  7556. ifNoneMatch_ string
  7557. ctx_ context.Context
  7558. }
  7559. // Get: Return metadata for a particular raster collection.
  7560. func (r *RasterCollectionsService) Get(id string) *RasterCollectionsGetCall {
  7561. c := &RasterCollectionsGetCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  7562. c.id = id
  7563. return c
  7564. }
  7565. // Fields allows partial responses to be retrieved. See
  7566. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  7567. // for more information.
  7568. func (c *RasterCollectionsGetCall) Fields(s ...googleapi.Field) *RasterCollectionsGetCall {
  7569. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  7570. return c
  7571. }
  7572. // IfNoneMatch sets the optional parameter which makes the operation
  7573. // fail if the object's ETag matches the given value. This is useful for
  7574. // getting updates only after the object has changed since the last
  7575. // request. Use googleapi.IsNotModified to check whether the response
  7576. // error from Do is the result of In-None-Match.
  7577. func (c *RasterCollectionsGetCall) IfNoneMatch(entityTag string) *RasterCollectionsGetCall {
  7578. c.ifNoneMatch_ = entityTag
  7579. return c
  7580. }
  7581. // Context sets the context to be used in this call's Do method. Any
  7582. // pending HTTP request will be aborted if the provided context is
  7583. // canceled.
  7584. func (c *RasterCollectionsGetCall) Context(ctx context.Context) *RasterCollectionsGetCall {
  7585. c.ctx_ = ctx
  7586. return c
  7587. }
  7588. func (c *RasterCollectionsGetCall) doRequest(alt string) (*http.Response, error) {
  7589. var body io.Reader = nil
  7590. c.urlParams_.Set("alt", alt)
  7591. urls := googleapi.ResolveRelative(c.s.BasePath, "rasterCollections/{id}")
  7592. urls += "?" + c.urlParams_.Encode()
  7593. req, _ := http.NewRequest("GET", urls, body)
  7594. googleapi.Expand(req.URL, map[string]string{
  7595. "id": c.id,
  7596. })
  7597. req.Header.Set("User-Agent", c.s.userAgent())
  7598. if c.ifNoneMatch_ != "" {
  7599. req.Header.Set("If-None-Match", c.ifNoneMatch_)
  7600. }
  7601. if c.ctx_ != nil {
  7602. return ctxhttp.Do(c.ctx_, c.s.client, req)
  7603. }
  7604. return c.s.client.Do(req)
  7605. }
  7606. // Do executes the "mapsengine.rasterCollections.get" call.
  7607. // Exactly one of *RasterCollection or error will be non-nil. Any
  7608. // non-2xx status code is an error. Response headers are in either
  7609. // *RasterCollection.ServerResponse.Header or (if a response was
  7610. // returned at all) in error.(*googleapi.Error).Header. Use
  7611. // googleapi.IsNotModified to check whether the returned error was
  7612. // because http.StatusNotModified was returned.
  7613. func (c *RasterCollectionsGetCall) Do(opts ...googleapi.CallOption) (*RasterCollection, error) {
  7614. gensupport.SetOptions(c.urlParams_, opts...)
  7615. res, err := c.doRequest("json")
  7616. if res != nil && res.StatusCode == http.StatusNotModified {
  7617. if res.Body != nil {
  7618. res.Body.Close()
  7619. }
  7620. return nil, &googleapi.Error{
  7621. Code: res.StatusCode,
  7622. Header: res.Header,
  7623. }
  7624. }
  7625. if err != nil {
  7626. return nil, err
  7627. }
  7628. defer googleapi.CloseBody(res)
  7629. if err := googleapi.CheckResponse(res); err != nil {
  7630. return nil, err
  7631. }
  7632. ret := &RasterCollection{
  7633. ServerResponse: googleapi.ServerResponse{
  7634. Header: res.Header,
  7635. HTTPStatusCode: res.StatusCode,
  7636. },
  7637. }
  7638. if err := json.NewDecoder(res.Body).Decode(&ret); err != nil {
  7639. return nil, err
  7640. }
  7641. return ret, nil
  7642. // {
  7643. // "description": "Return metadata for a particular raster collection.",
  7644. // "httpMethod": "GET",
  7645. // "id": "mapsengine.rasterCollections.get",
  7646. // "parameterOrder": [
  7647. // "id"
  7648. // ],
  7649. // "parameters": {
  7650. // "id": {
  7651. // "description": "The ID of the raster collection.",
  7652. // "location": "path",
  7653. // "required": true,
  7654. // "type": "string"
  7655. // }
  7656. // },
  7657. // "path": "rasterCollections/{id}",
  7658. // "response": {
  7659. // "$ref": "RasterCollection"
  7660. // },
  7661. // "scopes": [
  7662. // "https://www.googleapis.com/auth/mapsengine",
  7663. // "https://www.googleapis.com/auth/mapsengine.readonly"
  7664. // ]
  7665. // }
  7666. }
  7667. // method id "mapsengine.rasterCollections.list":
  7668. type RasterCollectionsListCall struct {
  7669. s *Service
  7670. urlParams_ gensupport.URLParams
  7671. ifNoneMatch_ string
  7672. ctx_ context.Context
  7673. }
  7674. // List: Return all raster collections readable by the current user.
  7675. func (r *RasterCollectionsService) List() *RasterCollectionsListCall {
  7676. c := &RasterCollectionsListCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  7677. return c
  7678. }
  7679. // Bbox sets the optional parameter "bbox": A bounding box, expressed as
  7680. // "west,south,east,north". If set, only assets which intersect this
  7681. // bounding box will be returned.
  7682. func (c *RasterCollectionsListCall) Bbox(bbox string) *RasterCollectionsListCall {
  7683. c.urlParams_.Set("bbox", bbox)
  7684. return c
  7685. }
  7686. // CreatedAfter sets the optional parameter "createdAfter": An RFC 3339
  7687. // formatted date-time value (e.g. 1970-01-01T00:00:00Z). Returned
  7688. // assets will have been created at or after this time.
  7689. func (c *RasterCollectionsListCall) CreatedAfter(createdAfter string) *RasterCollectionsListCall {
  7690. c.urlParams_.Set("createdAfter", createdAfter)
  7691. return c
  7692. }
  7693. // CreatedBefore sets the optional parameter "createdBefore": An RFC
  7694. // 3339 formatted date-time value (e.g. 1970-01-01T00:00:00Z). Returned
  7695. // assets will have been created at or before this time.
  7696. func (c *RasterCollectionsListCall) CreatedBefore(createdBefore string) *RasterCollectionsListCall {
  7697. c.urlParams_.Set("createdBefore", createdBefore)
  7698. return c
  7699. }
  7700. // CreatorEmail sets the optional parameter "creatorEmail": An email
  7701. // address representing a user. Returned assets that have been created
  7702. // by the user associated with the provided email address.
  7703. func (c *RasterCollectionsListCall) CreatorEmail(creatorEmail string) *RasterCollectionsListCall {
  7704. c.urlParams_.Set("creatorEmail", creatorEmail)
  7705. return c
  7706. }
  7707. // MaxResults sets the optional parameter "maxResults": The maximum
  7708. // number of items to include in a single response page. The maximum
  7709. // supported value is 100.
  7710. func (c *RasterCollectionsListCall) MaxResults(maxResults int64) *RasterCollectionsListCall {
  7711. c.urlParams_.Set("maxResults", fmt.Sprint(maxResults))
  7712. return c
  7713. }
  7714. // ModifiedAfter sets the optional parameter "modifiedAfter": An RFC
  7715. // 3339 formatted date-time value (e.g. 1970-01-01T00:00:00Z). Returned
  7716. // assets will have been modified at or after this time.
  7717. func (c *RasterCollectionsListCall) ModifiedAfter(modifiedAfter string) *RasterCollectionsListCall {
  7718. c.urlParams_.Set("modifiedAfter", modifiedAfter)
  7719. return c
  7720. }
  7721. // ModifiedBefore sets the optional parameter "modifiedBefore": An RFC
  7722. // 3339 formatted date-time value (e.g. 1970-01-01T00:00:00Z). Returned
  7723. // assets will have been modified at or before this time.
  7724. func (c *RasterCollectionsListCall) ModifiedBefore(modifiedBefore string) *RasterCollectionsListCall {
  7725. c.urlParams_.Set("modifiedBefore", modifiedBefore)
  7726. return c
  7727. }
  7728. // PageToken sets the optional parameter "pageToken": The continuation
  7729. // token, used to page through large result sets. To get the next page
  7730. // of results, set this parameter to the value of nextPageToken from the
  7731. // previous response.
  7732. func (c *RasterCollectionsListCall) PageToken(pageToken string) *RasterCollectionsListCall {
  7733. c.urlParams_.Set("pageToken", pageToken)
  7734. return c
  7735. }
  7736. // ProcessingStatus sets the optional parameter "processingStatus":
  7737. //
  7738. // Possible values:
  7739. // "complete" - The raster collection has completed processing.
  7740. // "failed" - The raster collection has failed processing.
  7741. // "notReady" - The raster collection is not ready for processing.
  7742. // "processing" - The raster collection is processing.
  7743. // "ready" - The raster collection is ready for processing.
  7744. func (c *RasterCollectionsListCall) ProcessingStatus(processingStatus string) *RasterCollectionsListCall {
  7745. c.urlParams_.Set("processingStatus", processingStatus)
  7746. return c
  7747. }
  7748. // ProjectId sets the optional parameter "projectId": The ID of a Maps
  7749. // Engine project, used to filter the response. To list all available
  7750. // projects with their IDs, send a Projects: list request. You can also
  7751. // find your project ID as the value of the DashboardPlace:cid URL
  7752. // parameter when signed in to mapsengine.google.com.
  7753. func (c *RasterCollectionsListCall) ProjectId(projectId string) *RasterCollectionsListCall {
  7754. c.urlParams_.Set("projectId", projectId)
  7755. return c
  7756. }
  7757. // Role sets the optional parameter "role": The role parameter indicates
  7758. // that the response should only contain assets where the current user
  7759. // has the specified level of access.
  7760. //
  7761. // Possible values:
  7762. // "owner" - The user can read, write and administer the asset.
  7763. // "reader" - The user can read the asset.
  7764. // "writer" - The user can read and write the asset.
  7765. func (c *RasterCollectionsListCall) Role(role string) *RasterCollectionsListCall {
  7766. c.urlParams_.Set("role", role)
  7767. return c
  7768. }
  7769. // Search sets the optional parameter "search": An unstructured search
  7770. // string used to filter the set of results based on asset metadata.
  7771. func (c *RasterCollectionsListCall) Search(search string) *RasterCollectionsListCall {
  7772. c.urlParams_.Set("search", search)
  7773. return c
  7774. }
  7775. // Tags sets the optional parameter "tags": A comma separated list of
  7776. // tags. Returned assets will contain all the tags from the list.
  7777. func (c *RasterCollectionsListCall) Tags(tags string) *RasterCollectionsListCall {
  7778. c.urlParams_.Set("tags", tags)
  7779. return c
  7780. }
  7781. // Fields allows partial responses to be retrieved. See
  7782. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  7783. // for more information.
  7784. func (c *RasterCollectionsListCall) Fields(s ...googleapi.Field) *RasterCollectionsListCall {
  7785. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  7786. return c
  7787. }
  7788. // IfNoneMatch sets the optional parameter which makes the operation
  7789. // fail if the object's ETag matches the given value. This is useful for
  7790. // getting updates only after the object has changed since the last
  7791. // request. Use googleapi.IsNotModified to check whether the response
  7792. // error from Do is the result of In-None-Match.
  7793. func (c *RasterCollectionsListCall) IfNoneMatch(entityTag string) *RasterCollectionsListCall {
  7794. c.ifNoneMatch_ = entityTag
  7795. return c
  7796. }
  7797. // Context sets the context to be used in this call's Do method. Any
  7798. // pending HTTP request will be aborted if the provided context is
  7799. // canceled.
  7800. func (c *RasterCollectionsListCall) Context(ctx context.Context) *RasterCollectionsListCall {
  7801. c.ctx_ = ctx
  7802. return c
  7803. }
  7804. func (c *RasterCollectionsListCall) doRequest(alt string) (*http.Response, error) {
  7805. var body io.Reader = nil
  7806. c.urlParams_.Set("alt", alt)
  7807. urls := googleapi.ResolveRelative(c.s.BasePath, "rasterCollections")
  7808. urls += "?" + c.urlParams_.Encode()
  7809. req, _ := http.NewRequest("GET", urls, body)
  7810. googleapi.SetOpaque(req.URL)
  7811. req.Header.Set("User-Agent", c.s.userAgent())
  7812. if c.ifNoneMatch_ != "" {
  7813. req.Header.Set("If-None-Match", c.ifNoneMatch_)
  7814. }
  7815. if c.ctx_ != nil {
  7816. return ctxhttp.Do(c.ctx_, c.s.client, req)
  7817. }
  7818. return c.s.client.Do(req)
  7819. }
  7820. // Do executes the "mapsengine.rasterCollections.list" call.
  7821. // Exactly one of *RasterCollectionsListResponse or error will be
  7822. // non-nil. Any non-2xx status code is an error. Response headers are in
  7823. // either *RasterCollectionsListResponse.ServerResponse.Header or (if a
  7824. // response was returned at all) in error.(*googleapi.Error).Header. Use
  7825. // googleapi.IsNotModified to check whether the returned error was
  7826. // because http.StatusNotModified was returned.
  7827. func (c *RasterCollectionsListCall) Do(opts ...googleapi.CallOption) (*RasterCollectionsListResponse, error) {
  7828. gensupport.SetOptions(c.urlParams_, opts...)
  7829. res, err := c.doRequest("json")
  7830. if res != nil && res.StatusCode == http.StatusNotModified {
  7831. if res.Body != nil {
  7832. res.Body.Close()
  7833. }
  7834. return nil, &googleapi.Error{
  7835. Code: res.StatusCode,
  7836. Header: res.Header,
  7837. }
  7838. }
  7839. if err != nil {
  7840. return nil, err
  7841. }
  7842. defer googleapi.CloseBody(res)
  7843. if err := googleapi.CheckResponse(res); err != nil {
  7844. return nil, err
  7845. }
  7846. ret := &RasterCollectionsListResponse{
  7847. ServerResponse: googleapi.ServerResponse{
  7848. Header: res.Header,
  7849. HTTPStatusCode: res.StatusCode,
  7850. },
  7851. }
  7852. if err := json.NewDecoder(res.Body).Decode(&ret); err != nil {
  7853. return nil, err
  7854. }
  7855. return ret, nil
  7856. // {
  7857. // "description": "Return all raster collections readable by the current user.",
  7858. // "httpMethod": "GET",
  7859. // "id": "mapsengine.rasterCollections.list",
  7860. // "parameters": {
  7861. // "bbox": {
  7862. // "description": "A bounding box, expressed as \"west,south,east,north\". If set, only assets which intersect this bounding box will be returned.",
  7863. // "location": "query",
  7864. // "type": "string"
  7865. // },
  7866. // "createdAfter": {
  7867. // "description": "An RFC 3339 formatted date-time value (e.g. 1970-01-01T00:00:00Z). Returned assets will have been created at or after this time.",
  7868. // "format": "date-time",
  7869. // "location": "query",
  7870. // "type": "string"
  7871. // },
  7872. // "createdBefore": {
  7873. // "description": "An RFC 3339 formatted date-time value (e.g. 1970-01-01T00:00:00Z). Returned assets will have been created at or before this time.",
  7874. // "format": "date-time",
  7875. // "location": "query",
  7876. // "type": "string"
  7877. // },
  7878. // "creatorEmail": {
  7879. // "description": "An email address representing a user. Returned assets that have been created by the user associated with the provided email address.",
  7880. // "location": "query",
  7881. // "type": "string"
  7882. // },
  7883. // "maxResults": {
  7884. // "description": "The maximum number of items to include in a single response page. The maximum supported value is 100.",
  7885. // "format": "uint32",
  7886. // "location": "query",
  7887. // "type": "integer"
  7888. // },
  7889. // "modifiedAfter": {
  7890. // "description": "An RFC 3339 formatted date-time value (e.g. 1970-01-01T00:00:00Z). Returned assets will have been modified at or after this time.",
  7891. // "format": "date-time",
  7892. // "location": "query",
  7893. // "type": "string"
  7894. // },
  7895. // "modifiedBefore": {
  7896. // "description": "An RFC 3339 formatted date-time value (e.g. 1970-01-01T00:00:00Z). Returned assets will have been modified at or before this time.",
  7897. // "format": "date-time",
  7898. // "location": "query",
  7899. // "type": "string"
  7900. // },
  7901. // "pageToken": {
  7902. // "description": "The continuation token, used to page through large result sets. To get the next page of results, set this parameter to the value of nextPageToken from the previous response.",
  7903. // "location": "query",
  7904. // "type": "string"
  7905. // },
  7906. // "processingStatus": {
  7907. // "enum": [
  7908. // "complete",
  7909. // "failed",
  7910. // "notReady",
  7911. // "processing",
  7912. // "ready"
  7913. // ],
  7914. // "enumDescriptions": [
  7915. // "The raster collection has completed processing.",
  7916. // "The raster collection has failed processing.",
  7917. // "The raster collection is not ready for processing.",
  7918. // "The raster collection is processing.",
  7919. // "The raster collection is ready for processing."
  7920. // ],
  7921. // "location": "query",
  7922. // "type": "string"
  7923. // },
  7924. // "projectId": {
  7925. // "description": "The ID of a Maps Engine project, used to filter the response. To list all available projects with their IDs, send a Projects: list request. You can also find your project ID as the value of the DashboardPlace:cid URL parameter when signed in to mapsengine.google.com.",
  7926. // "location": "query",
  7927. // "type": "string"
  7928. // },
  7929. // "role": {
  7930. // "description": "The role parameter indicates that the response should only contain assets where the current user has the specified level of access.",
  7931. // "enum": [
  7932. // "owner",
  7933. // "reader",
  7934. // "writer"
  7935. // ],
  7936. // "enumDescriptions": [
  7937. // "The user can read, write and administer the asset.",
  7938. // "The user can read the asset.",
  7939. // "The user can read and write the asset."
  7940. // ],
  7941. // "location": "query",
  7942. // "type": "string"
  7943. // },
  7944. // "search": {
  7945. // "description": "An unstructured search string used to filter the set of results based on asset metadata.",
  7946. // "location": "query",
  7947. // "type": "string"
  7948. // },
  7949. // "tags": {
  7950. // "description": "A comma separated list of tags. Returned assets will contain all the tags from the list.",
  7951. // "location": "query",
  7952. // "type": "string"
  7953. // }
  7954. // },
  7955. // "path": "rasterCollections",
  7956. // "response": {
  7957. // "$ref": "RasterCollectionsListResponse"
  7958. // },
  7959. // "scopes": [
  7960. // "https://www.googleapis.com/auth/mapsengine",
  7961. // "https://www.googleapis.com/auth/mapsengine.readonly"
  7962. // ]
  7963. // }
  7964. }
  7965. // Pages invokes f for each page of results.
  7966. // A non-nil error returned from f will halt the iteration.
  7967. // The provided context supersedes any context provided to the Context method.
  7968. func (c *RasterCollectionsListCall) Pages(ctx context.Context, f func(*RasterCollectionsListResponse) error) error {
  7969. c.ctx_ = ctx
  7970. defer c.PageToken(c.urlParams_.Get("pageToken")) // reset paging to original point
  7971. for {
  7972. x, err := c.Do()
  7973. if err != nil {
  7974. return err
  7975. }
  7976. if err := f(x); err != nil {
  7977. return err
  7978. }
  7979. if x.NextPageToken == "" {
  7980. return nil
  7981. }
  7982. c.PageToken(x.NextPageToken)
  7983. }
  7984. }
  7985. // method id "mapsengine.rasterCollections.patch":
  7986. type RasterCollectionsPatchCall struct {
  7987. s *Service
  7988. id string
  7989. rastercollection *RasterCollection
  7990. urlParams_ gensupport.URLParams
  7991. ctx_ context.Context
  7992. }
  7993. // Patch: Mutate a raster collection asset.
  7994. func (r *RasterCollectionsService) Patch(id string, rastercollection *RasterCollection) *RasterCollectionsPatchCall {
  7995. c := &RasterCollectionsPatchCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  7996. c.id = id
  7997. c.rastercollection = rastercollection
  7998. return c
  7999. }
  8000. // Fields allows partial responses to be retrieved. See
  8001. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  8002. // for more information.
  8003. func (c *RasterCollectionsPatchCall) Fields(s ...googleapi.Field) *RasterCollectionsPatchCall {
  8004. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  8005. return c
  8006. }
  8007. // Context sets the context to be used in this call's Do method. Any
  8008. // pending HTTP request will be aborted if the provided context is
  8009. // canceled.
  8010. func (c *RasterCollectionsPatchCall) Context(ctx context.Context) *RasterCollectionsPatchCall {
  8011. c.ctx_ = ctx
  8012. return c
  8013. }
  8014. func (c *RasterCollectionsPatchCall) doRequest(alt string) (*http.Response, error) {
  8015. var body io.Reader = nil
  8016. body, err := googleapi.WithoutDataWrapper.JSONReader(c.rastercollection)
  8017. if err != nil {
  8018. return nil, err
  8019. }
  8020. ctype := "application/json"
  8021. c.urlParams_.Set("alt", alt)
  8022. urls := googleapi.ResolveRelative(c.s.BasePath, "rasterCollections/{id}")
  8023. urls += "?" + c.urlParams_.Encode()
  8024. req, _ := http.NewRequest("PATCH", urls, body)
  8025. googleapi.Expand(req.URL, map[string]string{
  8026. "id": c.id,
  8027. })
  8028. req.Header.Set("Content-Type", ctype)
  8029. req.Header.Set("User-Agent", c.s.userAgent())
  8030. if c.ctx_ != nil {
  8031. return ctxhttp.Do(c.ctx_, c.s.client, req)
  8032. }
  8033. return c.s.client.Do(req)
  8034. }
  8035. // Do executes the "mapsengine.rasterCollections.patch" call.
  8036. func (c *RasterCollectionsPatchCall) Do(opts ...googleapi.CallOption) error {
  8037. gensupport.SetOptions(c.urlParams_, opts...)
  8038. res, err := c.doRequest("json")
  8039. if err != nil {
  8040. return err
  8041. }
  8042. defer googleapi.CloseBody(res)
  8043. if err := googleapi.CheckResponse(res); err != nil {
  8044. return err
  8045. }
  8046. return nil
  8047. // {
  8048. // "description": "Mutate a raster collection asset.",
  8049. // "httpMethod": "PATCH",
  8050. // "id": "mapsengine.rasterCollections.patch",
  8051. // "parameterOrder": [
  8052. // "id"
  8053. // ],
  8054. // "parameters": {
  8055. // "id": {
  8056. // "description": "The ID of the raster collection.",
  8057. // "location": "path",
  8058. // "required": true,
  8059. // "type": "string"
  8060. // }
  8061. // },
  8062. // "path": "rasterCollections/{id}",
  8063. // "request": {
  8064. // "$ref": "RasterCollection"
  8065. // },
  8066. // "scopes": [
  8067. // "https://www.googleapis.com/auth/mapsengine"
  8068. // ]
  8069. // }
  8070. }
  8071. // method id "mapsengine.rasterCollections.process":
  8072. type RasterCollectionsProcessCall struct {
  8073. s *Service
  8074. id string
  8075. urlParams_ gensupport.URLParams
  8076. ctx_ context.Context
  8077. }
  8078. // Process: Process a raster collection asset.
  8079. func (r *RasterCollectionsService) Process(id string) *RasterCollectionsProcessCall {
  8080. c := &RasterCollectionsProcessCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  8081. c.id = id
  8082. return c
  8083. }
  8084. // Fields allows partial responses to be retrieved. See
  8085. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  8086. // for more information.
  8087. func (c *RasterCollectionsProcessCall) Fields(s ...googleapi.Field) *RasterCollectionsProcessCall {
  8088. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  8089. return c
  8090. }
  8091. // Context sets the context to be used in this call's Do method. Any
  8092. // pending HTTP request will be aborted if the provided context is
  8093. // canceled.
  8094. func (c *RasterCollectionsProcessCall) Context(ctx context.Context) *RasterCollectionsProcessCall {
  8095. c.ctx_ = ctx
  8096. return c
  8097. }
  8098. func (c *RasterCollectionsProcessCall) doRequest(alt string) (*http.Response, error) {
  8099. var body io.Reader = nil
  8100. c.urlParams_.Set("alt", alt)
  8101. urls := googleapi.ResolveRelative(c.s.BasePath, "rasterCollections/{id}/process")
  8102. urls += "?" + c.urlParams_.Encode()
  8103. req, _ := http.NewRequest("POST", urls, body)
  8104. googleapi.Expand(req.URL, map[string]string{
  8105. "id": c.id,
  8106. })
  8107. req.Header.Set("User-Agent", c.s.userAgent())
  8108. if c.ctx_ != nil {
  8109. return ctxhttp.Do(c.ctx_, c.s.client, req)
  8110. }
  8111. return c.s.client.Do(req)
  8112. }
  8113. // Do executes the "mapsengine.rasterCollections.process" call.
  8114. // Exactly one of *ProcessResponse or error will be non-nil. Any non-2xx
  8115. // status code is an error. Response headers are in either
  8116. // *ProcessResponse.ServerResponse.Header or (if a response was returned
  8117. // at all) in error.(*googleapi.Error).Header. Use
  8118. // googleapi.IsNotModified to check whether the returned error was
  8119. // because http.StatusNotModified was returned.
  8120. func (c *RasterCollectionsProcessCall) Do(opts ...googleapi.CallOption) (*ProcessResponse, error) {
  8121. gensupport.SetOptions(c.urlParams_, opts...)
  8122. res, err := c.doRequest("json")
  8123. if res != nil && res.StatusCode == http.StatusNotModified {
  8124. if res.Body != nil {
  8125. res.Body.Close()
  8126. }
  8127. return nil, &googleapi.Error{
  8128. Code: res.StatusCode,
  8129. Header: res.Header,
  8130. }
  8131. }
  8132. if err != nil {
  8133. return nil, err
  8134. }
  8135. defer googleapi.CloseBody(res)
  8136. if err := googleapi.CheckResponse(res); err != nil {
  8137. return nil, err
  8138. }
  8139. ret := &ProcessResponse{
  8140. ServerResponse: googleapi.ServerResponse{
  8141. Header: res.Header,
  8142. HTTPStatusCode: res.StatusCode,
  8143. },
  8144. }
  8145. if err := json.NewDecoder(res.Body).Decode(&ret); err != nil {
  8146. return nil, err
  8147. }
  8148. return ret, nil
  8149. // {
  8150. // "description": "Process a raster collection asset.",
  8151. // "httpMethod": "POST",
  8152. // "id": "mapsengine.rasterCollections.process",
  8153. // "parameterOrder": [
  8154. // "id"
  8155. // ],
  8156. // "parameters": {
  8157. // "id": {
  8158. // "description": "The ID of the raster collection.",
  8159. // "location": "path",
  8160. // "required": true,
  8161. // "type": "string"
  8162. // }
  8163. // },
  8164. // "path": "rasterCollections/{id}/process",
  8165. // "response": {
  8166. // "$ref": "ProcessResponse"
  8167. // },
  8168. // "scopes": [
  8169. // "https://www.googleapis.com/auth/mapsengine"
  8170. // ]
  8171. // }
  8172. }
  8173. // method id "mapsengine.rasterCollections.parents.list":
  8174. type RasterCollectionsParentsListCall struct {
  8175. s *Service
  8176. id string
  8177. urlParams_ gensupport.URLParams
  8178. ifNoneMatch_ string
  8179. ctx_ context.Context
  8180. }
  8181. // List: Return all parent ids of the specified raster collection.
  8182. func (r *RasterCollectionsParentsService) List(id string) *RasterCollectionsParentsListCall {
  8183. c := &RasterCollectionsParentsListCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  8184. c.id = id
  8185. return c
  8186. }
  8187. // MaxResults sets the optional parameter "maxResults": The maximum
  8188. // number of items to include in a single response page. The maximum
  8189. // supported value is 50.
  8190. func (c *RasterCollectionsParentsListCall) MaxResults(maxResults int64) *RasterCollectionsParentsListCall {
  8191. c.urlParams_.Set("maxResults", fmt.Sprint(maxResults))
  8192. return c
  8193. }
  8194. // PageToken sets the optional parameter "pageToken": The continuation
  8195. // token, used to page through large result sets. To get the next page
  8196. // of results, set this parameter to the value of nextPageToken from the
  8197. // previous response.
  8198. func (c *RasterCollectionsParentsListCall) PageToken(pageToken string) *RasterCollectionsParentsListCall {
  8199. c.urlParams_.Set("pageToken", pageToken)
  8200. return c
  8201. }
  8202. // Fields allows partial responses to be retrieved. See
  8203. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  8204. // for more information.
  8205. func (c *RasterCollectionsParentsListCall) Fields(s ...googleapi.Field) *RasterCollectionsParentsListCall {
  8206. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  8207. return c
  8208. }
  8209. // IfNoneMatch sets the optional parameter which makes the operation
  8210. // fail if the object's ETag matches the given value. This is useful for
  8211. // getting updates only after the object has changed since the last
  8212. // request. Use googleapi.IsNotModified to check whether the response
  8213. // error from Do is the result of In-None-Match.
  8214. func (c *RasterCollectionsParentsListCall) IfNoneMatch(entityTag string) *RasterCollectionsParentsListCall {
  8215. c.ifNoneMatch_ = entityTag
  8216. return c
  8217. }
  8218. // Context sets the context to be used in this call's Do method. Any
  8219. // pending HTTP request will be aborted if the provided context is
  8220. // canceled.
  8221. func (c *RasterCollectionsParentsListCall) Context(ctx context.Context) *RasterCollectionsParentsListCall {
  8222. c.ctx_ = ctx
  8223. return c
  8224. }
  8225. func (c *RasterCollectionsParentsListCall) doRequest(alt string) (*http.Response, error) {
  8226. var body io.Reader = nil
  8227. c.urlParams_.Set("alt", alt)
  8228. urls := googleapi.ResolveRelative(c.s.BasePath, "rasterCollections/{id}/parents")
  8229. urls += "?" + c.urlParams_.Encode()
  8230. req, _ := http.NewRequest("GET", urls, body)
  8231. googleapi.Expand(req.URL, map[string]string{
  8232. "id": c.id,
  8233. })
  8234. req.Header.Set("User-Agent", c.s.userAgent())
  8235. if c.ifNoneMatch_ != "" {
  8236. req.Header.Set("If-None-Match", c.ifNoneMatch_)
  8237. }
  8238. if c.ctx_ != nil {
  8239. return ctxhttp.Do(c.ctx_, c.s.client, req)
  8240. }
  8241. return c.s.client.Do(req)
  8242. }
  8243. // Do executes the "mapsengine.rasterCollections.parents.list" call.
  8244. // Exactly one of *ParentsListResponse or error will be non-nil. Any
  8245. // non-2xx status code is an error. Response headers are in either
  8246. // *ParentsListResponse.ServerResponse.Header or (if a response was
  8247. // returned at all) in error.(*googleapi.Error).Header. Use
  8248. // googleapi.IsNotModified to check whether the returned error was
  8249. // because http.StatusNotModified was returned.
  8250. func (c *RasterCollectionsParentsListCall) Do(opts ...googleapi.CallOption) (*ParentsListResponse, error) {
  8251. gensupport.SetOptions(c.urlParams_, opts...)
  8252. res, err := c.doRequest("json")
  8253. if res != nil && res.StatusCode == http.StatusNotModified {
  8254. if res.Body != nil {
  8255. res.Body.Close()
  8256. }
  8257. return nil, &googleapi.Error{
  8258. Code: res.StatusCode,
  8259. Header: res.Header,
  8260. }
  8261. }
  8262. if err != nil {
  8263. return nil, err
  8264. }
  8265. defer googleapi.CloseBody(res)
  8266. if err := googleapi.CheckResponse(res); err != nil {
  8267. return nil, err
  8268. }
  8269. ret := &ParentsListResponse{
  8270. ServerResponse: googleapi.ServerResponse{
  8271. Header: res.Header,
  8272. HTTPStatusCode: res.StatusCode,
  8273. },
  8274. }
  8275. if err := json.NewDecoder(res.Body).Decode(&ret); err != nil {
  8276. return nil, err
  8277. }
  8278. return ret, nil
  8279. // {
  8280. // "description": "Return all parent ids of the specified raster collection.",
  8281. // "httpMethod": "GET",
  8282. // "id": "mapsengine.rasterCollections.parents.list",
  8283. // "parameterOrder": [
  8284. // "id"
  8285. // ],
  8286. // "parameters": {
  8287. // "id": {
  8288. // "description": "The ID of the raster collection whose parents will be listed.",
  8289. // "location": "path",
  8290. // "required": true,
  8291. // "type": "string"
  8292. // },
  8293. // "maxResults": {
  8294. // "description": "The maximum number of items to include in a single response page. The maximum supported value is 50.",
  8295. // "format": "uint32",
  8296. // "location": "query",
  8297. // "type": "integer"
  8298. // },
  8299. // "pageToken": {
  8300. // "description": "The continuation token, used to page through large result sets. To get the next page of results, set this parameter to the value of nextPageToken from the previous response.",
  8301. // "location": "query",
  8302. // "type": "string"
  8303. // }
  8304. // },
  8305. // "path": "rasterCollections/{id}/parents",
  8306. // "response": {
  8307. // "$ref": "ParentsListResponse"
  8308. // },
  8309. // "scopes": [
  8310. // "https://www.googleapis.com/auth/mapsengine",
  8311. // "https://www.googleapis.com/auth/mapsengine.readonly"
  8312. // ]
  8313. // }
  8314. }
  8315. // Pages invokes f for each page of results.
  8316. // A non-nil error returned from f will halt the iteration.
  8317. // The provided context supersedes any context provided to the Context method.
  8318. func (c *RasterCollectionsParentsListCall) Pages(ctx context.Context, f func(*ParentsListResponse) error) error {
  8319. c.ctx_ = ctx
  8320. defer c.PageToken(c.urlParams_.Get("pageToken")) // reset paging to original point
  8321. for {
  8322. x, err := c.Do()
  8323. if err != nil {
  8324. return err
  8325. }
  8326. if err := f(x); err != nil {
  8327. return err
  8328. }
  8329. if x.NextPageToken == "" {
  8330. return nil
  8331. }
  8332. c.PageToken(x.NextPageToken)
  8333. }
  8334. }
  8335. // method id "mapsengine.rasterCollections.permissions.batchDelete":
  8336. type RasterCollectionsPermissionsBatchDeleteCall struct {
  8337. s *Service
  8338. id string
  8339. permissionsbatchdeleterequest *PermissionsBatchDeleteRequest
  8340. urlParams_ gensupport.URLParams
  8341. ctx_ context.Context
  8342. }
  8343. // BatchDelete: Remove permission entries from an already existing
  8344. // asset.
  8345. func (r *RasterCollectionsPermissionsService) BatchDelete(id string, permissionsbatchdeleterequest *PermissionsBatchDeleteRequest) *RasterCollectionsPermissionsBatchDeleteCall {
  8346. c := &RasterCollectionsPermissionsBatchDeleteCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  8347. c.id = id
  8348. c.permissionsbatchdeleterequest = permissionsbatchdeleterequest
  8349. return c
  8350. }
  8351. // Fields allows partial responses to be retrieved. See
  8352. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  8353. // for more information.
  8354. func (c *RasterCollectionsPermissionsBatchDeleteCall) Fields(s ...googleapi.Field) *RasterCollectionsPermissionsBatchDeleteCall {
  8355. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  8356. return c
  8357. }
  8358. // Context sets the context to be used in this call's Do method. Any
  8359. // pending HTTP request will be aborted if the provided context is
  8360. // canceled.
  8361. func (c *RasterCollectionsPermissionsBatchDeleteCall) Context(ctx context.Context) *RasterCollectionsPermissionsBatchDeleteCall {
  8362. c.ctx_ = ctx
  8363. return c
  8364. }
  8365. func (c *RasterCollectionsPermissionsBatchDeleteCall) doRequest(alt string) (*http.Response, error) {
  8366. var body io.Reader = nil
  8367. body, err := googleapi.WithoutDataWrapper.JSONReader(c.permissionsbatchdeleterequest)
  8368. if err != nil {
  8369. return nil, err
  8370. }
  8371. ctype := "application/json"
  8372. c.urlParams_.Set("alt", alt)
  8373. urls := googleapi.ResolveRelative(c.s.BasePath, "rasterCollections/{id}/permissions/batchDelete")
  8374. urls += "?" + c.urlParams_.Encode()
  8375. req, _ := http.NewRequest("POST", urls, body)
  8376. googleapi.Expand(req.URL, map[string]string{
  8377. "id": c.id,
  8378. })
  8379. req.Header.Set("Content-Type", ctype)
  8380. req.Header.Set("User-Agent", c.s.userAgent())
  8381. if c.ctx_ != nil {
  8382. return ctxhttp.Do(c.ctx_, c.s.client, req)
  8383. }
  8384. return c.s.client.Do(req)
  8385. }
  8386. // Do executes the "mapsengine.rasterCollections.permissions.batchDelete" call.
  8387. // Exactly one of *PermissionsBatchDeleteResponse or error will be
  8388. // non-nil. Any non-2xx status code is an error. Response headers are in
  8389. // either *PermissionsBatchDeleteResponse.ServerResponse.Header or (if a
  8390. // response was returned at all) in error.(*googleapi.Error).Header. Use
  8391. // googleapi.IsNotModified to check whether the returned error was
  8392. // because http.StatusNotModified was returned.
  8393. func (c *RasterCollectionsPermissionsBatchDeleteCall) Do(opts ...googleapi.CallOption) (*PermissionsBatchDeleteResponse, error) {
  8394. gensupport.SetOptions(c.urlParams_, opts...)
  8395. res, err := c.doRequest("json")
  8396. if res != nil && res.StatusCode == http.StatusNotModified {
  8397. if res.Body != nil {
  8398. res.Body.Close()
  8399. }
  8400. return nil, &googleapi.Error{
  8401. Code: res.StatusCode,
  8402. Header: res.Header,
  8403. }
  8404. }
  8405. if err != nil {
  8406. return nil, err
  8407. }
  8408. defer googleapi.CloseBody(res)
  8409. if err := googleapi.CheckResponse(res); err != nil {
  8410. return nil, err
  8411. }
  8412. ret := &PermissionsBatchDeleteResponse{
  8413. ServerResponse: googleapi.ServerResponse{
  8414. Header: res.Header,
  8415. HTTPStatusCode: res.StatusCode,
  8416. },
  8417. }
  8418. if err := json.NewDecoder(res.Body).Decode(&ret); err != nil {
  8419. return nil, err
  8420. }
  8421. return ret, nil
  8422. // {
  8423. // "description": "Remove permission entries from an already existing asset.",
  8424. // "httpMethod": "POST",
  8425. // "id": "mapsengine.rasterCollections.permissions.batchDelete",
  8426. // "parameterOrder": [
  8427. // "id"
  8428. // ],
  8429. // "parameters": {
  8430. // "id": {
  8431. // "description": "The ID of the asset from which permissions will be removed.",
  8432. // "location": "path",
  8433. // "required": true,
  8434. // "type": "string"
  8435. // }
  8436. // },
  8437. // "path": "rasterCollections/{id}/permissions/batchDelete",
  8438. // "request": {
  8439. // "$ref": "PermissionsBatchDeleteRequest"
  8440. // },
  8441. // "response": {
  8442. // "$ref": "PermissionsBatchDeleteResponse"
  8443. // },
  8444. // "scopes": [
  8445. // "https://www.googleapis.com/auth/mapsengine"
  8446. // ]
  8447. // }
  8448. }
  8449. // method id "mapsengine.rasterCollections.permissions.batchUpdate":
  8450. type RasterCollectionsPermissionsBatchUpdateCall struct {
  8451. s *Service
  8452. id string
  8453. permissionsbatchupdaterequest *PermissionsBatchUpdateRequest
  8454. urlParams_ gensupport.URLParams
  8455. ctx_ context.Context
  8456. }
  8457. // BatchUpdate: Add or update permission entries to an already existing
  8458. // asset.
  8459. //
  8460. // An asset can hold up to 20 different permission entries. Each
  8461. // batchInsert request is atomic.
  8462. func (r *RasterCollectionsPermissionsService) BatchUpdate(id string, permissionsbatchupdaterequest *PermissionsBatchUpdateRequest) *RasterCollectionsPermissionsBatchUpdateCall {
  8463. c := &RasterCollectionsPermissionsBatchUpdateCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  8464. c.id = id
  8465. c.permissionsbatchupdaterequest = permissionsbatchupdaterequest
  8466. return c
  8467. }
  8468. // Fields allows partial responses to be retrieved. See
  8469. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  8470. // for more information.
  8471. func (c *RasterCollectionsPermissionsBatchUpdateCall) Fields(s ...googleapi.Field) *RasterCollectionsPermissionsBatchUpdateCall {
  8472. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  8473. return c
  8474. }
  8475. // Context sets the context to be used in this call's Do method. Any
  8476. // pending HTTP request will be aborted if the provided context is
  8477. // canceled.
  8478. func (c *RasterCollectionsPermissionsBatchUpdateCall) Context(ctx context.Context) *RasterCollectionsPermissionsBatchUpdateCall {
  8479. c.ctx_ = ctx
  8480. return c
  8481. }
  8482. func (c *RasterCollectionsPermissionsBatchUpdateCall) doRequest(alt string) (*http.Response, error) {
  8483. var body io.Reader = nil
  8484. body, err := googleapi.WithoutDataWrapper.JSONReader(c.permissionsbatchupdaterequest)
  8485. if err != nil {
  8486. return nil, err
  8487. }
  8488. ctype := "application/json"
  8489. c.urlParams_.Set("alt", alt)
  8490. urls := googleapi.ResolveRelative(c.s.BasePath, "rasterCollections/{id}/permissions/batchUpdate")
  8491. urls += "?" + c.urlParams_.Encode()
  8492. req, _ := http.NewRequest("POST", urls, body)
  8493. googleapi.Expand(req.URL, map[string]string{
  8494. "id": c.id,
  8495. })
  8496. req.Header.Set("Content-Type", ctype)
  8497. req.Header.Set("User-Agent", c.s.userAgent())
  8498. if c.ctx_ != nil {
  8499. return ctxhttp.Do(c.ctx_, c.s.client, req)
  8500. }
  8501. return c.s.client.Do(req)
  8502. }
  8503. // Do executes the "mapsengine.rasterCollections.permissions.batchUpdate" call.
  8504. // Exactly one of *PermissionsBatchUpdateResponse or error will be
  8505. // non-nil. Any non-2xx status code is an error. Response headers are in
  8506. // either *PermissionsBatchUpdateResponse.ServerResponse.Header or (if a
  8507. // response was returned at all) in error.(*googleapi.Error).Header. Use
  8508. // googleapi.IsNotModified to check whether the returned error was
  8509. // because http.StatusNotModified was returned.
  8510. func (c *RasterCollectionsPermissionsBatchUpdateCall) Do(opts ...googleapi.CallOption) (*PermissionsBatchUpdateResponse, error) {
  8511. gensupport.SetOptions(c.urlParams_, opts...)
  8512. res, err := c.doRequest("json")
  8513. if res != nil && res.StatusCode == http.StatusNotModified {
  8514. if res.Body != nil {
  8515. res.Body.Close()
  8516. }
  8517. return nil, &googleapi.Error{
  8518. Code: res.StatusCode,
  8519. Header: res.Header,
  8520. }
  8521. }
  8522. if err != nil {
  8523. return nil, err
  8524. }
  8525. defer googleapi.CloseBody(res)
  8526. if err := googleapi.CheckResponse(res); err != nil {
  8527. return nil, err
  8528. }
  8529. ret := &PermissionsBatchUpdateResponse{
  8530. ServerResponse: googleapi.ServerResponse{
  8531. Header: res.Header,
  8532. HTTPStatusCode: res.StatusCode,
  8533. },
  8534. }
  8535. if err := json.NewDecoder(res.Body).Decode(&ret); err != nil {
  8536. return nil, err
  8537. }
  8538. return ret, nil
  8539. // {
  8540. // "description": "Add or update permission entries to an already existing asset.\n\nAn asset can hold up to 20 different permission entries. Each batchInsert request is atomic.",
  8541. // "httpMethod": "POST",
  8542. // "id": "mapsengine.rasterCollections.permissions.batchUpdate",
  8543. // "parameterOrder": [
  8544. // "id"
  8545. // ],
  8546. // "parameters": {
  8547. // "id": {
  8548. // "description": "The ID of the asset to which permissions will be added.",
  8549. // "location": "path",
  8550. // "required": true,
  8551. // "type": "string"
  8552. // }
  8553. // },
  8554. // "path": "rasterCollections/{id}/permissions/batchUpdate",
  8555. // "request": {
  8556. // "$ref": "PermissionsBatchUpdateRequest"
  8557. // },
  8558. // "response": {
  8559. // "$ref": "PermissionsBatchUpdateResponse"
  8560. // },
  8561. // "scopes": [
  8562. // "https://www.googleapis.com/auth/mapsengine"
  8563. // ]
  8564. // }
  8565. }
  8566. // method id "mapsengine.rasterCollections.permissions.list":
  8567. type RasterCollectionsPermissionsListCall struct {
  8568. s *Service
  8569. id string
  8570. urlParams_ gensupport.URLParams
  8571. ifNoneMatch_ string
  8572. ctx_ context.Context
  8573. }
  8574. // List: Return all of the permissions for the specified asset.
  8575. func (r *RasterCollectionsPermissionsService) List(id string) *RasterCollectionsPermissionsListCall {
  8576. c := &RasterCollectionsPermissionsListCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  8577. c.id = id
  8578. return c
  8579. }
  8580. // Fields allows partial responses to be retrieved. See
  8581. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  8582. // for more information.
  8583. func (c *RasterCollectionsPermissionsListCall) Fields(s ...googleapi.Field) *RasterCollectionsPermissionsListCall {
  8584. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  8585. return c
  8586. }
  8587. // IfNoneMatch sets the optional parameter which makes the operation
  8588. // fail if the object's ETag matches the given value. This is useful for
  8589. // getting updates only after the object has changed since the last
  8590. // request. Use googleapi.IsNotModified to check whether the response
  8591. // error from Do is the result of In-None-Match.
  8592. func (c *RasterCollectionsPermissionsListCall) IfNoneMatch(entityTag string) *RasterCollectionsPermissionsListCall {
  8593. c.ifNoneMatch_ = entityTag
  8594. return c
  8595. }
  8596. // Context sets the context to be used in this call's Do method. Any
  8597. // pending HTTP request will be aborted if the provided context is
  8598. // canceled.
  8599. func (c *RasterCollectionsPermissionsListCall) Context(ctx context.Context) *RasterCollectionsPermissionsListCall {
  8600. c.ctx_ = ctx
  8601. return c
  8602. }
  8603. func (c *RasterCollectionsPermissionsListCall) doRequest(alt string) (*http.Response, error) {
  8604. var body io.Reader = nil
  8605. c.urlParams_.Set("alt", alt)
  8606. urls := googleapi.ResolveRelative(c.s.BasePath, "rasterCollections/{id}/permissions")
  8607. urls += "?" + c.urlParams_.Encode()
  8608. req, _ := http.NewRequest("GET", urls, body)
  8609. googleapi.Expand(req.URL, map[string]string{
  8610. "id": c.id,
  8611. })
  8612. req.Header.Set("User-Agent", c.s.userAgent())
  8613. if c.ifNoneMatch_ != "" {
  8614. req.Header.Set("If-None-Match", c.ifNoneMatch_)
  8615. }
  8616. if c.ctx_ != nil {
  8617. return ctxhttp.Do(c.ctx_, c.s.client, req)
  8618. }
  8619. return c.s.client.Do(req)
  8620. }
  8621. // Do executes the "mapsengine.rasterCollections.permissions.list" call.
  8622. // Exactly one of *PermissionsListResponse or error will be non-nil. Any
  8623. // non-2xx status code is an error. Response headers are in either
  8624. // *PermissionsListResponse.ServerResponse.Header or (if a response was
  8625. // returned at all) in error.(*googleapi.Error).Header. Use
  8626. // googleapi.IsNotModified to check whether the returned error was
  8627. // because http.StatusNotModified was returned.
  8628. func (c *RasterCollectionsPermissionsListCall) Do(opts ...googleapi.CallOption) (*PermissionsListResponse, error) {
  8629. gensupport.SetOptions(c.urlParams_, opts...)
  8630. res, err := c.doRequest("json")
  8631. if res != nil && res.StatusCode == http.StatusNotModified {
  8632. if res.Body != nil {
  8633. res.Body.Close()
  8634. }
  8635. return nil, &googleapi.Error{
  8636. Code: res.StatusCode,
  8637. Header: res.Header,
  8638. }
  8639. }
  8640. if err != nil {
  8641. return nil, err
  8642. }
  8643. defer googleapi.CloseBody(res)
  8644. if err := googleapi.CheckResponse(res); err != nil {
  8645. return nil, err
  8646. }
  8647. ret := &PermissionsListResponse{
  8648. ServerResponse: googleapi.ServerResponse{
  8649. Header: res.Header,
  8650. HTTPStatusCode: res.StatusCode,
  8651. },
  8652. }
  8653. if err := json.NewDecoder(res.Body).Decode(&ret); err != nil {
  8654. return nil, err
  8655. }
  8656. return ret, nil
  8657. // {
  8658. // "description": "Return all of the permissions for the specified asset.",
  8659. // "httpMethod": "GET",
  8660. // "id": "mapsengine.rasterCollections.permissions.list",
  8661. // "parameterOrder": [
  8662. // "id"
  8663. // ],
  8664. // "parameters": {
  8665. // "id": {
  8666. // "description": "The ID of the asset whose permissions will be listed.",
  8667. // "location": "path",
  8668. // "required": true,
  8669. // "type": "string"
  8670. // }
  8671. // },
  8672. // "path": "rasterCollections/{id}/permissions",
  8673. // "response": {
  8674. // "$ref": "PermissionsListResponse"
  8675. // },
  8676. // "scopes": [
  8677. // "https://www.googleapis.com/auth/mapsengine",
  8678. // "https://www.googleapis.com/auth/mapsengine.readonly"
  8679. // ]
  8680. // }
  8681. }
  8682. // method id "mapsengine.rasterCollections.rasters.batchDelete":
  8683. type RasterCollectionsRastersBatchDeleteCall struct {
  8684. s *Service
  8685. id string
  8686. rastercollectionsrasterbatchdeleterequest *RasterCollectionsRasterBatchDeleteRequest
  8687. urlParams_ gensupport.URLParams
  8688. ctx_ context.Context
  8689. }
  8690. // BatchDelete: Remove rasters from an existing raster collection.
  8691. //
  8692. // Up to 50 rasters can be included in a single batchDelete request.
  8693. // Each batchDelete request is atomic.
  8694. func (r *RasterCollectionsRastersService) BatchDelete(id string, rastercollectionsrasterbatchdeleterequest *RasterCollectionsRasterBatchDeleteRequest) *RasterCollectionsRastersBatchDeleteCall {
  8695. c := &RasterCollectionsRastersBatchDeleteCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  8696. c.id = id
  8697. c.rastercollectionsrasterbatchdeleterequest = rastercollectionsrasterbatchdeleterequest
  8698. return c
  8699. }
  8700. // Fields allows partial responses to be retrieved. See
  8701. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  8702. // for more information.
  8703. func (c *RasterCollectionsRastersBatchDeleteCall) Fields(s ...googleapi.Field) *RasterCollectionsRastersBatchDeleteCall {
  8704. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  8705. return c
  8706. }
  8707. // Context sets the context to be used in this call's Do method. Any
  8708. // pending HTTP request will be aborted if the provided context is
  8709. // canceled.
  8710. func (c *RasterCollectionsRastersBatchDeleteCall) Context(ctx context.Context) *RasterCollectionsRastersBatchDeleteCall {
  8711. c.ctx_ = ctx
  8712. return c
  8713. }
  8714. func (c *RasterCollectionsRastersBatchDeleteCall) doRequest(alt string) (*http.Response, error) {
  8715. var body io.Reader = nil
  8716. body, err := googleapi.WithoutDataWrapper.JSONReader(c.rastercollectionsrasterbatchdeleterequest)
  8717. if err != nil {
  8718. return nil, err
  8719. }
  8720. ctype := "application/json"
  8721. c.urlParams_.Set("alt", alt)
  8722. urls := googleapi.ResolveRelative(c.s.BasePath, "rasterCollections/{id}/rasters/batchDelete")
  8723. urls += "?" + c.urlParams_.Encode()
  8724. req, _ := http.NewRequest("POST", urls, body)
  8725. googleapi.Expand(req.URL, map[string]string{
  8726. "id": c.id,
  8727. })
  8728. req.Header.Set("Content-Type", ctype)
  8729. req.Header.Set("User-Agent", c.s.userAgent())
  8730. if c.ctx_ != nil {
  8731. return ctxhttp.Do(c.ctx_, c.s.client, req)
  8732. }
  8733. return c.s.client.Do(req)
  8734. }
  8735. // Do executes the "mapsengine.rasterCollections.rasters.batchDelete" call.
  8736. // Exactly one of *RasterCollectionsRastersBatchDeleteResponse or error
  8737. // will be non-nil. Any non-2xx status code is an error. Response
  8738. // headers are in either
  8739. // *RasterCollectionsRastersBatchDeleteResponse.ServerResponse.Header or
  8740. // (if a response was returned at all) in
  8741. // error.(*googleapi.Error).Header. Use googleapi.IsNotModified to check
  8742. // whether the returned error was because http.StatusNotModified was
  8743. // returned.
  8744. func (c *RasterCollectionsRastersBatchDeleteCall) Do(opts ...googleapi.CallOption) (*RasterCollectionsRastersBatchDeleteResponse, error) {
  8745. gensupport.SetOptions(c.urlParams_, opts...)
  8746. res, err := c.doRequest("json")
  8747. if res != nil && res.StatusCode == http.StatusNotModified {
  8748. if res.Body != nil {
  8749. res.Body.Close()
  8750. }
  8751. return nil, &googleapi.Error{
  8752. Code: res.StatusCode,
  8753. Header: res.Header,
  8754. }
  8755. }
  8756. if err != nil {
  8757. return nil, err
  8758. }
  8759. defer googleapi.CloseBody(res)
  8760. if err := googleapi.CheckResponse(res); err != nil {
  8761. return nil, err
  8762. }
  8763. ret := &RasterCollectionsRastersBatchDeleteResponse{
  8764. ServerResponse: googleapi.ServerResponse{
  8765. Header: res.Header,
  8766. HTTPStatusCode: res.StatusCode,
  8767. },
  8768. }
  8769. if err := json.NewDecoder(res.Body).Decode(&ret); err != nil {
  8770. return nil, err
  8771. }
  8772. return ret, nil
  8773. // {
  8774. // "description": "Remove rasters from an existing raster collection.\n\nUp to 50 rasters can be included in a single batchDelete request. Each batchDelete request is atomic.",
  8775. // "httpMethod": "POST",
  8776. // "id": "mapsengine.rasterCollections.rasters.batchDelete",
  8777. // "parameterOrder": [
  8778. // "id"
  8779. // ],
  8780. // "parameters": {
  8781. // "id": {
  8782. // "description": "The ID of the raster collection to which these rasters belong.",
  8783. // "location": "path",
  8784. // "required": true,
  8785. // "type": "string"
  8786. // }
  8787. // },
  8788. // "path": "rasterCollections/{id}/rasters/batchDelete",
  8789. // "request": {
  8790. // "$ref": "RasterCollectionsRasterBatchDeleteRequest"
  8791. // },
  8792. // "response": {
  8793. // "$ref": "RasterCollectionsRastersBatchDeleteResponse"
  8794. // },
  8795. // "scopes": [
  8796. // "https://www.googleapis.com/auth/mapsengine"
  8797. // ]
  8798. // }
  8799. }
  8800. // method id "mapsengine.rasterCollections.rasters.batchInsert":
  8801. type RasterCollectionsRastersBatchInsertCall struct {
  8802. s *Service
  8803. id string
  8804. rastercollectionsrastersbatchinsertrequest *RasterCollectionsRastersBatchInsertRequest
  8805. urlParams_ gensupport.URLParams
  8806. ctx_ context.Context
  8807. }
  8808. // BatchInsert: Add rasters to an existing raster collection. Rasters
  8809. // must be successfully processed in order to be added to a raster
  8810. // collection.
  8811. //
  8812. // Up to 50 rasters can be included in a single batchInsert request.
  8813. // Each batchInsert request is atomic.
  8814. func (r *RasterCollectionsRastersService) BatchInsert(id string, rastercollectionsrastersbatchinsertrequest *RasterCollectionsRastersBatchInsertRequest) *RasterCollectionsRastersBatchInsertCall {
  8815. c := &RasterCollectionsRastersBatchInsertCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  8816. c.id = id
  8817. c.rastercollectionsrastersbatchinsertrequest = rastercollectionsrastersbatchinsertrequest
  8818. return c
  8819. }
  8820. // Fields allows partial responses to be retrieved. See
  8821. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  8822. // for more information.
  8823. func (c *RasterCollectionsRastersBatchInsertCall) Fields(s ...googleapi.Field) *RasterCollectionsRastersBatchInsertCall {
  8824. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  8825. return c
  8826. }
  8827. // Context sets the context to be used in this call's Do method. Any
  8828. // pending HTTP request will be aborted if the provided context is
  8829. // canceled.
  8830. func (c *RasterCollectionsRastersBatchInsertCall) Context(ctx context.Context) *RasterCollectionsRastersBatchInsertCall {
  8831. c.ctx_ = ctx
  8832. return c
  8833. }
  8834. func (c *RasterCollectionsRastersBatchInsertCall) doRequest(alt string) (*http.Response, error) {
  8835. var body io.Reader = nil
  8836. body, err := googleapi.WithoutDataWrapper.JSONReader(c.rastercollectionsrastersbatchinsertrequest)
  8837. if err != nil {
  8838. return nil, err
  8839. }
  8840. ctype := "application/json"
  8841. c.urlParams_.Set("alt", alt)
  8842. urls := googleapi.ResolveRelative(c.s.BasePath, "rasterCollections/{id}/rasters/batchInsert")
  8843. urls += "?" + c.urlParams_.Encode()
  8844. req, _ := http.NewRequest("POST", urls, body)
  8845. googleapi.Expand(req.URL, map[string]string{
  8846. "id": c.id,
  8847. })
  8848. req.Header.Set("Content-Type", ctype)
  8849. req.Header.Set("User-Agent", c.s.userAgent())
  8850. if c.ctx_ != nil {
  8851. return ctxhttp.Do(c.ctx_, c.s.client, req)
  8852. }
  8853. return c.s.client.Do(req)
  8854. }
  8855. // Do executes the "mapsengine.rasterCollections.rasters.batchInsert" call.
  8856. // Exactly one of *RasterCollectionsRastersBatchInsertResponse or error
  8857. // will be non-nil. Any non-2xx status code is an error. Response
  8858. // headers are in either
  8859. // *RasterCollectionsRastersBatchInsertResponse.ServerResponse.Header or
  8860. // (if a response was returned at all) in
  8861. // error.(*googleapi.Error).Header. Use googleapi.IsNotModified to check
  8862. // whether the returned error was because http.StatusNotModified was
  8863. // returned.
  8864. func (c *RasterCollectionsRastersBatchInsertCall) Do(opts ...googleapi.CallOption) (*RasterCollectionsRastersBatchInsertResponse, error) {
  8865. gensupport.SetOptions(c.urlParams_, opts...)
  8866. res, err := c.doRequest("json")
  8867. if res != nil && res.StatusCode == http.StatusNotModified {
  8868. if res.Body != nil {
  8869. res.Body.Close()
  8870. }
  8871. return nil, &googleapi.Error{
  8872. Code: res.StatusCode,
  8873. Header: res.Header,
  8874. }
  8875. }
  8876. if err != nil {
  8877. return nil, err
  8878. }
  8879. defer googleapi.CloseBody(res)
  8880. if err := googleapi.CheckResponse(res); err != nil {
  8881. return nil, err
  8882. }
  8883. ret := &RasterCollectionsRastersBatchInsertResponse{
  8884. ServerResponse: googleapi.ServerResponse{
  8885. Header: res.Header,
  8886. HTTPStatusCode: res.StatusCode,
  8887. },
  8888. }
  8889. if err := json.NewDecoder(res.Body).Decode(&ret); err != nil {
  8890. return nil, err
  8891. }
  8892. return ret, nil
  8893. // {
  8894. // "description": "Add rasters to an existing raster collection. Rasters must be successfully processed in order to be added to a raster collection.\n\nUp to 50 rasters can be included in a single batchInsert request. Each batchInsert request is atomic.",
  8895. // "httpMethod": "POST",
  8896. // "id": "mapsengine.rasterCollections.rasters.batchInsert",
  8897. // "parameterOrder": [
  8898. // "id"
  8899. // ],
  8900. // "parameters": {
  8901. // "id": {
  8902. // "description": "The ID of the raster collection to which these rasters belong.",
  8903. // "location": "path",
  8904. // "required": true,
  8905. // "type": "string"
  8906. // }
  8907. // },
  8908. // "path": "rasterCollections/{id}/rasters/batchInsert",
  8909. // "request": {
  8910. // "$ref": "RasterCollectionsRastersBatchInsertRequest"
  8911. // },
  8912. // "response": {
  8913. // "$ref": "RasterCollectionsRastersBatchInsertResponse"
  8914. // },
  8915. // "scopes": [
  8916. // "https://www.googleapis.com/auth/mapsengine"
  8917. // ]
  8918. // }
  8919. }
  8920. // method id "mapsengine.rasterCollections.rasters.list":
  8921. type RasterCollectionsRastersListCall struct {
  8922. s *Service
  8923. id string
  8924. urlParams_ gensupport.URLParams
  8925. ifNoneMatch_ string
  8926. ctx_ context.Context
  8927. }
  8928. // List: Return all rasters within a raster collection.
  8929. func (r *RasterCollectionsRastersService) List(id string) *RasterCollectionsRastersListCall {
  8930. c := &RasterCollectionsRastersListCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  8931. c.id = id
  8932. return c
  8933. }
  8934. // Bbox sets the optional parameter "bbox": A bounding box, expressed as
  8935. // "west,south,east,north". If set, only assets which intersect this
  8936. // bounding box will be returned.
  8937. func (c *RasterCollectionsRastersListCall) Bbox(bbox string) *RasterCollectionsRastersListCall {
  8938. c.urlParams_.Set("bbox", bbox)
  8939. return c
  8940. }
  8941. // CreatedAfter sets the optional parameter "createdAfter": An RFC 3339
  8942. // formatted date-time value (e.g. 1970-01-01T00:00:00Z). Returned
  8943. // assets will have been created at or after this time.
  8944. func (c *RasterCollectionsRastersListCall) CreatedAfter(createdAfter string) *RasterCollectionsRastersListCall {
  8945. c.urlParams_.Set("createdAfter", createdAfter)
  8946. return c
  8947. }
  8948. // CreatedBefore sets the optional parameter "createdBefore": An RFC
  8949. // 3339 formatted date-time value (e.g. 1970-01-01T00:00:00Z). Returned
  8950. // assets will have been created at or before this time.
  8951. func (c *RasterCollectionsRastersListCall) CreatedBefore(createdBefore string) *RasterCollectionsRastersListCall {
  8952. c.urlParams_.Set("createdBefore", createdBefore)
  8953. return c
  8954. }
  8955. // CreatorEmail sets the optional parameter "creatorEmail": An email
  8956. // address representing a user. Returned assets that have been created
  8957. // by the user associated with the provided email address.
  8958. func (c *RasterCollectionsRastersListCall) CreatorEmail(creatorEmail string) *RasterCollectionsRastersListCall {
  8959. c.urlParams_.Set("creatorEmail", creatorEmail)
  8960. return c
  8961. }
  8962. // MaxResults sets the optional parameter "maxResults": The maximum
  8963. // number of items to include in a single response page. The maximum
  8964. // supported value is 100.
  8965. func (c *RasterCollectionsRastersListCall) MaxResults(maxResults int64) *RasterCollectionsRastersListCall {
  8966. c.urlParams_.Set("maxResults", fmt.Sprint(maxResults))
  8967. return c
  8968. }
  8969. // ModifiedAfter sets the optional parameter "modifiedAfter": An RFC
  8970. // 3339 formatted date-time value (e.g. 1970-01-01T00:00:00Z). Returned
  8971. // assets will have been modified at or after this time.
  8972. func (c *RasterCollectionsRastersListCall) ModifiedAfter(modifiedAfter string) *RasterCollectionsRastersListCall {
  8973. c.urlParams_.Set("modifiedAfter", modifiedAfter)
  8974. return c
  8975. }
  8976. // ModifiedBefore sets the optional parameter "modifiedBefore": An RFC
  8977. // 3339 formatted date-time value (e.g. 1970-01-01T00:00:00Z). Returned
  8978. // assets will have been modified at or before this time.
  8979. func (c *RasterCollectionsRastersListCall) ModifiedBefore(modifiedBefore string) *RasterCollectionsRastersListCall {
  8980. c.urlParams_.Set("modifiedBefore", modifiedBefore)
  8981. return c
  8982. }
  8983. // PageToken sets the optional parameter "pageToken": The continuation
  8984. // token, used to page through large result sets. To get the next page
  8985. // of results, set this parameter to the value of nextPageToken from the
  8986. // previous response.
  8987. func (c *RasterCollectionsRastersListCall) PageToken(pageToken string) *RasterCollectionsRastersListCall {
  8988. c.urlParams_.Set("pageToken", pageToken)
  8989. return c
  8990. }
  8991. // Role sets the optional parameter "role": The role parameter indicates
  8992. // that the response should only contain assets where the current user
  8993. // has the specified level of access.
  8994. //
  8995. // Possible values:
  8996. // "owner" - The user can read, write and administer the asset.
  8997. // "reader" - The user can read the asset.
  8998. // "writer" - The user can read and write the asset.
  8999. func (c *RasterCollectionsRastersListCall) Role(role string) *RasterCollectionsRastersListCall {
  9000. c.urlParams_.Set("role", role)
  9001. return c
  9002. }
  9003. // Search sets the optional parameter "search": An unstructured search
  9004. // string used to filter the set of results based on asset metadata.
  9005. func (c *RasterCollectionsRastersListCall) Search(search string) *RasterCollectionsRastersListCall {
  9006. c.urlParams_.Set("search", search)
  9007. return c
  9008. }
  9009. // Tags sets the optional parameter "tags": A comma separated list of
  9010. // tags. Returned assets will contain all the tags from the list.
  9011. func (c *RasterCollectionsRastersListCall) Tags(tags string) *RasterCollectionsRastersListCall {
  9012. c.urlParams_.Set("tags", tags)
  9013. return c
  9014. }
  9015. // Fields allows partial responses to be retrieved. See
  9016. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  9017. // for more information.
  9018. func (c *RasterCollectionsRastersListCall) Fields(s ...googleapi.Field) *RasterCollectionsRastersListCall {
  9019. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  9020. return c
  9021. }
  9022. // IfNoneMatch sets the optional parameter which makes the operation
  9023. // fail if the object's ETag matches the given value. This is useful for
  9024. // getting updates only after the object has changed since the last
  9025. // request. Use googleapi.IsNotModified to check whether the response
  9026. // error from Do is the result of In-None-Match.
  9027. func (c *RasterCollectionsRastersListCall) IfNoneMatch(entityTag string) *RasterCollectionsRastersListCall {
  9028. c.ifNoneMatch_ = entityTag
  9029. return c
  9030. }
  9031. // Context sets the context to be used in this call's Do method. Any
  9032. // pending HTTP request will be aborted if the provided context is
  9033. // canceled.
  9034. func (c *RasterCollectionsRastersListCall) Context(ctx context.Context) *RasterCollectionsRastersListCall {
  9035. c.ctx_ = ctx
  9036. return c
  9037. }
  9038. func (c *RasterCollectionsRastersListCall) doRequest(alt string) (*http.Response, error) {
  9039. var body io.Reader = nil
  9040. c.urlParams_.Set("alt", alt)
  9041. urls := googleapi.ResolveRelative(c.s.BasePath, "rasterCollections/{id}/rasters")
  9042. urls += "?" + c.urlParams_.Encode()
  9043. req, _ := http.NewRequest("GET", urls, body)
  9044. googleapi.Expand(req.URL, map[string]string{
  9045. "id": c.id,
  9046. })
  9047. req.Header.Set("User-Agent", c.s.userAgent())
  9048. if c.ifNoneMatch_ != "" {
  9049. req.Header.Set("If-None-Match", c.ifNoneMatch_)
  9050. }
  9051. if c.ctx_ != nil {
  9052. return ctxhttp.Do(c.ctx_, c.s.client, req)
  9053. }
  9054. return c.s.client.Do(req)
  9055. }
  9056. // Do executes the "mapsengine.rasterCollections.rasters.list" call.
  9057. // Exactly one of *RasterCollectionsRastersListResponse or error will be
  9058. // non-nil. Any non-2xx status code is an error. Response headers are in
  9059. // either *RasterCollectionsRastersListResponse.ServerResponse.Header or
  9060. // (if a response was returned at all) in
  9061. // error.(*googleapi.Error).Header. Use googleapi.IsNotModified to check
  9062. // whether the returned error was because http.StatusNotModified was
  9063. // returned.
  9064. func (c *RasterCollectionsRastersListCall) Do(opts ...googleapi.CallOption) (*RasterCollectionsRastersListResponse, error) {
  9065. gensupport.SetOptions(c.urlParams_, opts...)
  9066. res, err := c.doRequest("json")
  9067. if res != nil && res.StatusCode == http.StatusNotModified {
  9068. if res.Body != nil {
  9069. res.Body.Close()
  9070. }
  9071. return nil, &googleapi.Error{
  9072. Code: res.StatusCode,
  9073. Header: res.Header,
  9074. }
  9075. }
  9076. if err != nil {
  9077. return nil, err
  9078. }
  9079. defer googleapi.CloseBody(res)
  9080. if err := googleapi.CheckResponse(res); err != nil {
  9081. return nil, err
  9082. }
  9083. ret := &RasterCollectionsRastersListResponse{
  9084. ServerResponse: googleapi.ServerResponse{
  9085. Header: res.Header,
  9086. HTTPStatusCode: res.StatusCode,
  9087. },
  9088. }
  9089. if err := json.NewDecoder(res.Body).Decode(&ret); err != nil {
  9090. return nil, err
  9091. }
  9092. return ret, nil
  9093. // {
  9094. // "description": "Return all rasters within a raster collection.",
  9095. // "httpMethod": "GET",
  9096. // "id": "mapsengine.rasterCollections.rasters.list",
  9097. // "parameterOrder": [
  9098. // "id"
  9099. // ],
  9100. // "parameters": {
  9101. // "bbox": {
  9102. // "description": "A bounding box, expressed as \"west,south,east,north\". If set, only assets which intersect this bounding box will be returned.",
  9103. // "location": "query",
  9104. // "type": "string"
  9105. // },
  9106. // "createdAfter": {
  9107. // "description": "An RFC 3339 formatted date-time value (e.g. 1970-01-01T00:00:00Z). Returned assets will have been created at or after this time.",
  9108. // "format": "date-time",
  9109. // "location": "query",
  9110. // "type": "string"
  9111. // },
  9112. // "createdBefore": {
  9113. // "description": "An RFC 3339 formatted date-time value (e.g. 1970-01-01T00:00:00Z). Returned assets will have been created at or before this time.",
  9114. // "format": "date-time",
  9115. // "location": "query",
  9116. // "type": "string"
  9117. // },
  9118. // "creatorEmail": {
  9119. // "description": "An email address representing a user. Returned assets that have been created by the user associated with the provided email address.",
  9120. // "location": "query",
  9121. // "type": "string"
  9122. // },
  9123. // "id": {
  9124. // "description": "The ID of the raster collection to which these rasters belong.",
  9125. // "location": "path",
  9126. // "required": true,
  9127. // "type": "string"
  9128. // },
  9129. // "maxResults": {
  9130. // "description": "The maximum number of items to include in a single response page. The maximum supported value is 100.",
  9131. // "format": "uint32",
  9132. // "location": "query",
  9133. // "type": "integer"
  9134. // },
  9135. // "modifiedAfter": {
  9136. // "description": "An RFC 3339 formatted date-time value (e.g. 1970-01-01T00:00:00Z). Returned assets will have been modified at or after this time.",
  9137. // "format": "date-time",
  9138. // "location": "query",
  9139. // "type": "string"
  9140. // },
  9141. // "modifiedBefore": {
  9142. // "description": "An RFC 3339 formatted date-time value (e.g. 1970-01-01T00:00:00Z). Returned assets will have been modified at or before this time.",
  9143. // "format": "date-time",
  9144. // "location": "query",
  9145. // "type": "string"
  9146. // },
  9147. // "pageToken": {
  9148. // "description": "The continuation token, used to page through large result sets. To get the next page of results, set this parameter to the value of nextPageToken from the previous response.",
  9149. // "location": "query",
  9150. // "type": "string"
  9151. // },
  9152. // "role": {
  9153. // "description": "The role parameter indicates that the response should only contain assets where the current user has the specified level of access.",
  9154. // "enum": [
  9155. // "owner",
  9156. // "reader",
  9157. // "writer"
  9158. // ],
  9159. // "enumDescriptions": [
  9160. // "The user can read, write and administer the asset.",
  9161. // "The user can read the asset.",
  9162. // "The user can read and write the asset."
  9163. // ],
  9164. // "location": "query",
  9165. // "type": "string"
  9166. // },
  9167. // "search": {
  9168. // "description": "An unstructured search string used to filter the set of results based on asset metadata.",
  9169. // "location": "query",
  9170. // "type": "string"
  9171. // },
  9172. // "tags": {
  9173. // "description": "A comma separated list of tags. Returned assets will contain all the tags from the list.",
  9174. // "location": "query",
  9175. // "type": "string"
  9176. // }
  9177. // },
  9178. // "path": "rasterCollections/{id}/rasters",
  9179. // "response": {
  9180. // "$ref": "RasterCollectionsRastersListResponse"
  9181. // },
  9182. // "scopes": [
  9183. // "https://www.googleapis.com/auth/mapsengine",
  9184. // "https://www.googleapis.com/auth/mapsengine.readonly"
  9185. // ]
  9186. // }
  9187. }
  9188. // Pages invokes f for each page of results.
  9189. // A non-nil error returned from f will halt the iteration.
  9190. // The provided context supersedes any context provided to the Context method.
  9191. func (c *RasterCollectionsRastersListCall) Pages(ctx context.Context, f func(*RasterCollectionsRastersListResponse) error) error {
  9192. c.ctx_ = ctx
  9193. defer c.PageToken(c.urlParams_.Get("pageToken")) // reset paging to original point
  9194. for {
  9195. x, err := c.Do()
  9196. if err != nil {
  9197. return err
  9198. }
  9199. if err := f(x); err != nil {
  9200. return err
  9201. }
  9202. if x.NextPageToken == "" {
  9203. return nil
  9204. }
  9205. c.PageToken(x.NextPageToken)
  9206. }
  9207. }
  9208. // method id "mapsengine.rasters.delete":
  9209. type RastersDeleteCall struct {
  9210. s *Service
  9211. id string
  9212. urlParams_ gensupport.URLParams
  9213. ctx_ context.Context
  9214. }
  9215. // Delete: Delete a raster.
  9216. func (r *RastersService) Delete(id string) *RastersDeleteCall {
  9217. c := &RastersDeleteCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  9218. c.id = id
  9219. return c
  9220. }
  9221. // Fields allows partial responses to be retrieved. See
  9222. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  9223. // for more information.
  9224. func (c *RastersDeleteCall) Fields(s ...googleapi.Field) *RastersDeleteCall {
  9225. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  9226. return c
  9227. }
  9228. // Context sets the context to be used in this call's Do method. Any
  9229. // pending HTTP request will be aborted if the provided context is
  9230. // canceled.
  9231. func (c *RastersDeleteCall) Context(ctx context.Context) *RastersDeleteCall {
  9232. c.ctx_ = ctx
  9233. return c
  9234. }
  9235. func (c *RastersDeleteCall) doRequest(alt string) (*http.Response, error) {
  9236. var body io.Reader = nil
  9237. c.urlParams_.Set("alt", alt)
  9238. urls := googleapi.ResolveRelative(c.s.BasePath, "rasters/{id}")
  9239. urls += "?" + c.urlParams_.Encode()
  9240. req, _ := http.NewRequest("DELETE", urls, body)
  9241. googleapi.Expand(req.URL, map[string]string{
  9242. "id": c.id,
  9243. })
  9244. req.Header.Set("User-Agent", c.s.userAgent())
  9245. if c.ctx_ != nil {
  9246. return ctxhttp.Do(c.ctx_, c.s.client, req)
  9247. }
  9248. return c.s.client.Do(req)
  9249. }
  9250. // Do executes the "mapsengine.rasters.delete" call.
  9251. func (c *RastersDeleteCall) Do(opts ...googleapi.CallOption) error {
  9252. gensupport.SetOptions(c.urlParams_, opts...)
  9253. res, err := c.doRequest("json")
  9254. if err != nil {
  9255. return err
  9256. }
  9257. defer googleapi.CloseBody(res)
  9258. if err := googleapi.CheckResponse(res); err != nil {
  9259. return err
  9260. }
  9261. return nil
  9262. // {
  9263. // "description": "Delete a raster.",
  9264. // "httpMethod": "DELETE",
  9265. // "id": "mapsengine.rasters.delete",
  9266. // "parameterOrder": [
  9267. // "id"
  9268. // ],
  9269. // "parameters": {
  9270. // "id": {
  9271. // "description": "The ID of the raster. Only the raster creator or project owner are permitted to delete. If the raster is included in a layer or mosaic, the request will fail. Remove it from all parents prior to deleting.",
  9272. // "location": "path",
  9273. // "required": true,
  9274. // "type": "string"
  9275. // }
  9276. // },
  9277. // "path": "rasters/{id}",
  9278. // "scopes": [
  9279. // "https://www.googleapis.com/auth/mapsengine"
  9280. // ]
  9281. // }
  9282. }
  9283. // method id "mapsengine.rasters.get":
  9284. type RastersGetCall struct {
  9285. s *Service
  9286. id string
  9287. urlParams_ gensupport.URLParams
  9288. ifNoneMatch_ string
  9289. ctx_ context.Context
  9290. }
  9291. // Get: Return metadata for a single raster.
  9292. func (r *RastersService) Get(id string) *RastersGetCall {
  9293. c := &RastersGetCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  9294. c.id = id
  9295. return c
  9296. }
  9297. // Fields allows partial responses to be retrieved. See
  9298. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  9299. // for more information.
  9300. func (c *RastersGetCall) Fields(s ...googleapi.Field) *RastersGetCall {
  9301. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  9302. return c
  9303. }
  9304. // IfNoneMatch sets the optional parameter which makes the operation
  9305. // fail if the object's ETag matches the given value. This is useful for
  9306. // getting updates only after the object has changed since the last
  9307. // request. Use googleapi.IsNotModified to check whether the response
  9308. // error from Do is the result of In-None-Match.
  9309. func (c *RastersGetCall) IfNoneMatch(entityTag string) *RastersGetCall {
  9310. c.ifNoneMatch_ = entityTag
  9311. return c
  9312. }
  9313. // Context sets the context to be used in this call's Do method. Any
  9314. // pending HTTP request will be aborted if the provided context is
  9315. // canceled.
  9316. func (c *RastersGetCall) Context(ctx context.Context) *RastersGetCall {
  9317. c.ctx_ = ctx
  9318. return c
  9319. }
  9320. func (c *RastersGetCall) doRequest(alt string) (*http.Response, error) {
  9321. var body io.Reader = nil
  9322. c.urlParams_.Set("alt", alt)
  9323. urls := googleapi.ResolveRelative(c.s.BasePath, "rasters/{id}")
  9324. urls += "?" + c.urlParams_.Encode()
  9325. req, _ := http.NewRequest("GET", urls, body)
  9326. googleapi.Expand(req.URL, map[string]string{
  9327. "id": c.id,
  9328. })
  9329. req.Header.Set("User-Agent", c.s.userAgent())
  9330. if c.ifNoneMatch_ != "" {
  9331. req.Header.Set("If-None-Match", c.ifNoneMatch_)
  9332. }
  9333. if c.ctx_ != nil {
  9334. return ctxhttp.Do(c.ctx_, c.s.client, req)
  9335. }
  9336. return c.s.client.Do(req)
  9337. }
  9338. // Do executes the "mapsengine.rasters.get" call.
  9339. // Exactly one of *Raster or error will be non-nil. Any non-2xx status
  9340. // code is an error. Response headers are in either
  9341. // *Raster.ServerResponse.Header or (if a response was returned at all)
  9342. // in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to
  9343. // check whether the returned error was because http.StatusNotModified
  9344. // was returned.
  9345. func (c *RastersGetCall) Do(opts ...googleapi.CallOption) (*Raster, error) {
  9346. gensupport.SetOptions(c.urlParams_, opts...)
  9347. res, err := c.doRequest("json")
  9348. if res != nil && res.StatusCode == http.StatusNotModified {
  9349. if res.Body != nil {
  9350. res.Body.Close()
  9351. }
  9352. return nil, &googleapi.Error{
  9353. Code: res.StatusCode,
  9354. Header: res.Header,
  9355. }
  9356. }
  9357. if err != nil {
  9358. return nil, err
  9359. }
  9360. defer googleapi.CloseBody(res)
  9361. if err := googleapi.CheckResponse(res); err != nil {
  9362. return nil, err
  9363. }
  9364. ret := &Raster{
  9365. ServerResponse: googleapi.ServerResponse{
  9366. Header: res.Header,
  9367. HTTPStatusCode: res.StatusCode,
  9368. },
  9369. }
  9370. if err := json.NewDecoder(res.Body).Decode(&ret); err != nil {
  9371. return nil, err
  9372. }
  9373. return ret, nil
  9374. // {
  9375. // "description": "Return metadata for a single raster.",
  9376. // "httpMethod": "GET",
  9377. // "id": "mapsengine.rasters.get",
  9378. // "parameterOrder": [
  9379. // "id"
  9380. // ],
  9381. // "parameters": {
  9382. // "id": {
  9383. // "description": "The ID of the raster.",
  9384. // "location": "path",
  9385. // "required": true,
  9386. // "type": "string"
  9387. // }
  9388. // },
  9389. // "path": "rasters/{id}",
  9390. // "response": {
  9391. // "$ref": "Raster"
  9392. // },
  9393. // "scopes": [
  9394. // "https://www.googleapis.com/auth/mapsengine",
  9395. // "https://www.googleapis.com/auth/mapsengine.readonly"
  9396. // ]
  9397. // }
  9398. }
  9399. // method id "mapsengine.rasters.list":
  9400. type RastersListCall struct {
  9401. s *Service
  9402. urlParams_ gensupport.URLParams
  9403. ifNoneMatch_ string
  9404. ctx_ context.Context
  9405. }
  9406. // List: Return all rasters readable by the current user.
  9407. func (r *RastersService) List(projectId string) *RastersListCall {
  9408. c := &RastersListCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  9409. c.urlParams_.Set("projectId", projectId)
  9410. return c
  9411. }
  9412. // Bbox sets the optional parameter "bbox": A bounding box, expressed as
  9413. // "west,south,east,north". If set, only assets which intersect this
  9414. // bounding box will be returned.
  9415. func (c *RastersListCall) Bbox(bbox string) *RastersListCall {
  9416. c.urlParams_.Set("bbox", bbox)
  9417. return c
  9418. }
  9419. // CreatedAfter sets the optional parameter "createdAfter": An RFC 3339
  9420. // formatted date-time value (e.g. 1970-01-01T00:00:00Z). Returned
  9421. // assets will have been created at or after this time.
  9422. func (c *RastersListCall) CreatedAfter(createdAfter string) *RastersListCall {
  9423. c.urlParams_.Set("createdAfter", createdAfter)
  9424. return c
  9425. }
  9426. // CreatedBefore sets the optional parameter "createdBefore": An RFC
  9427. // 3339 formatted date-time value (e.g. 1970-01-01T00:00:00Z). Returned
  9428. // assets will have been created at or before this time.
  9429. func (c *RastersListCall) CreatedBefore(createdBefore string) *RastersListCall {
  9430. c.urlParams_.Set("createdBefore", createdBefore)
  9431. return c
  9432. }
  9433. // CreatorEmail sets the optional parameter "creatorEmail": An email
  9434. // address representing a user. Returned assets that have been created
  9435. // by the user associated with the provided email address.
  9436. func (c *RastersListCall) CreatorEmail(creatorEmail string) *RastersListCall {
  9437. c.urlParams_.Set("creatorEmail", creatorEmail)
  9438. return c
  9439. }
  9440. // MaxResults sets the optional parameter "maxResults": The maximum
  9441. // number of items to include in a single response page. The maximum
  9442. // supported value is 100.
  9443. func (c *RastersListCall) MaxResults(maxResults int64) *RastersListCall {
  9444. c.urlParams_.Set("maxResults", fmt.Sprint(maxResults))
  9445. return c
  9446. }
  9447. // ModifiedAfter sets the optional parameter "modifiedAfter": An RFC
  9448. // 3339 formatted date-time value (e.g. 1970-01-01T00:00:00Z). Returned
  9449. // assets will have been modified at or after this time.
  9450. func (c *RastersListCall) ModifiedAfter(modifiedAfter string) *RastersListCall {
  9451. c.urlParams_.Set("modifiedAfter", modifiedAfter)
  9452. return c
  9453. }
  9454. // ModifiedBefore sets the optional parameter "modifiedBefore": An RFC
  9455. // 3339 formatted date-time value (e.g. 1970-01-01T00:00:00Z). Returned
  9456. // assets will have been modified at or before this time.
  9457. func (c *RastersListCall) ModifiedBefore(modifiedBefore string) *RastersListCall {
  9458. c.urlParams_.Set("modifiedBefore", modifiedBefore)
  9459. return c
  9460. }
  9461. // PageToken sets the optional parameter "pageToken": The continuation
  9462. // token, used to page through large result sets. To get the next page
  9463. // of results, set this parameter to the value of nextPageToken from the
  9464. // previous response.
  9465. func (c *RastersListCall) PageToken(pageToken string) *RastersListCall {
  9466. c.urlParams_.Set("pageToken", pageToken)
  9467. return c
  9468. }
  9469. // ProcessingStatus sets the optional parameter "processingStatus":
  9470. //
  9471. // Possible values:
  9472. // "complete" - The raster has completed processing.
  9473. // "failed" - The raster has failed processing.
  9474. // "notReady" - The raster is not ready for processing.
  9475. // "processing" - The raster is processing.
  9476. // "ready" - The raster is ready for processing.
  9477. func (c *RastersListCall) ProcessingStatus(processingStatus string) *RastersListCall {
  9478. c.urlParams_.Set("processingStatus", processingStatus)
  9479. return c
  9480. }
  9481. // Role sets the optional parameter "role": The role parameter indicates
  9482. // that the response should only contain assets where the current user
  9483. // has the specified level of access.
  9484. //
  9485. // Possible values:
  9486. // "owner" - The user can read, write and administer the asset.
  9487. // "reader" - The user can read the asset.
  9488. // "writer" - The user can read and write the asset.
  9489. func (c *RastersListCall) Role(role string) *RastersListCall {
  9490. c.urlParams_.Set("role", role)
  9491. return c
  9492. }
  9493. // Search sets the optional parameter "search": An unstructured search
  9494. // string used to filter the set of results based on asset metadata.
  9495. func (c *RastersListCall) Search(search string) *RastersListCall {
  9496. c.urlParams_.Set("search", search)
  9497. return c
  9498. }
  9499. // Tags sets the optional parameter "tags": A comma separated list of
  9500. // tags. Returned assets will contain all the tags from the list.
  9501. func (c *RastersListCall) Tags(tags string) *RastersListCall {
  9502. c.urlParams_.Set("tags", tags)
  9503. return c
  9504. }
  9505. // Fields allows partial responses to be retrieved. See
  9506. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  9507. // for more information.
  9508. func (c *RastersListCall) Fields(s ...googleapi.Field) *RastersListCall {
  9509. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  9510. return c
  9511. }
  9512. // IfNoneMatch sets the optional parameter which makes the operation
  9513. // fail if the object's ETag matches the given value. This is useful for
  9514. // getting updates only after the object has changed since the last
  9515. // request. Use googleapi.IsNotModified to check whether the response
  9516. // error from Do is the result of In-None-Match.
  9517. func (c *RastersListCall) IfNoneMatch(entityTag string) *RastersListCall {
  9518. c.ifNoneMatch_ = entityTag
  9519. return c
  9520. }
  9521. // Context sets the context to be used in this call's Do method. Any
  9522. // pending HTTP request will be aborted if the provided context is
  9523. // canceled.
  9524. func (c *RastersListCall) Context(ctx context.Context) *RastersListCall {
  9525. c.ctx_ = ctx
  9526. return c
  9527. }
  9528. func (c *RastersListCall) doRequest(alt string) (*http.Response, error) {
  9529. var body io.Reader = nil
  9530. c.urlParams_.Set("alt", alt)
  9531. urls := googleapi.ResolveRelative(c.s.BasePath, "rasters")
  9532. urls += "?" + c.urlParams_.Encode()
  9533. req, _ := http.NewRequest("GET", urls, body)
  9534. googleapi.SetOpaque(req.URL)
  9535. req.Header.Set("User-Agent", c.s.userAgent())
  9536. if c.ifNoneMatch_ != "" {
  9537. req.Header.Set("If-None-Match", c.ifNoneMatch_)
  9538. }
  9539. if c.ctx_ != nil {
  9540. return ctxhttp.Do(c.ctx_, c.s.client, req)
  9541. }
  9542. return c.s.client.Do(req)
  9543. }
  9544. // Do executes the "mapsengine.rasters.list" call.
  9545. // Exactly one of *RastersListResponse or error will be non-nil. Any
  9546. // non-2xx status code is an error. Response headers are in either
  9547. // *RastersListResponse.ServerResponse.Header or (if a response was
  9548. // returned at all) in error.(*googleapi.Error).Header. Use
  9549. // googleapi.IsNotModified to check whether the returned error was
  9550. // because http.StatusNotModified was returned.
  9551. func (c *RastersListCall) Do(opts ...googleapi.CallOption) (*RastersListResponse, error) {
  9552. gensupport.SetOptions(c.urlParams_, opts...)
  9553. res, err := c.doRequest("json")
  9554. if res != nil && res.StatusCode == http.StatusNotModified {
  9555. if res.Body != nil {
  9556. res.Body.Close()
  9557. }
  9558. return nil, &googleapi.Error{
  9559. Code: res.StatusCode,
  9560. Header: res.Header,
  9561. }
  9562. }
  9563. if err != nil {
  9564. return nil, err
  9565. }
  9566. defer googleapi.CloseBody(res)
  9567. if err := googleapi.CheckResponse(res); err != nil {
  9568. return nil, err
  9569. }
  9570. ret := &RastersListResponse{
  9571. ServerResponse: googleapi.ServerResponse{
  9572. Header: res.Header,
  9573. HTTPStatusCode: res.StatusCode,
  9574. },
  9575. }
  9576. if err := json.NewDecoder(res.Body).Decode(&ret); err != nil {
  9577. return nil, err
  9578. }
  9579. return ret, nil
  9580. // {
  9581. // "description": "Return all rasters readable by the current user.",
  9582. // "httpMethod": "GET",
  9583. // "id": "mapsengine.rasters.list",
  9584. // "parameterOrder": [
  9585. // "projectId"
  9586. // ],
  9587. // "parameters": {
  9588. // "bbox": {
  9589. // "description": "A bounding box, expressed as \"west,south,east,north\". If set, only assets which intersect this bounding box will be returned.",
  9590. // "location": "query",
  9591. // "type": "string"
  9592. // },
  9593. // "createdAfter": {
  9594. // "description": "An RFC 3339 formatted date-time value (e.g. 1970-01-01T00:00:00Z). Returned assets will have been created at or after this time.",
  9595. // "format": "date-time",
  9596. // "location": "query",
  9597. // "type": "string"
  9598. // },
  9599. // "createdBefore": {
  9600. // "description": "An RFC 3339 formatted date-time value (e.g. 1970-01-01T00:00:00Z). Returned assets will have been created at or before this time.",
  9601. // "format": "date-time",
  9602. // "location": "query",
  9603. // "type": "string"
  9604. // },
  9605. // "creatorEmail": {
  9606. // "description": "An email address representing a user. Returned assets that have been created by the user associated with the provided email address.",
  9607. // "location": "query",
  9608. // "type": "string"
  9609. // },
  9610. // "maxResults": {
  9611. // "description": "The maximum number of items to include in a single response page. The maximum supported value is 100.",
  9612. // "format": "uint32",
  9613. // "location": "query",
  9614. // "type": "integer"
  9615. // },
  9616. // "modifiedAfter": {
  9617. // "description": "An RFC 3339 formatted date-time value (e.g. 1970-01-01T00:00:00Z). Returned assets will have been modified at or after this time.",
  9618. // "format": "date-time",
  9619. // "location": "query",
  9620. // "type": "string"
  9621. // },
  9622. // "modifiedBefore": {
  9623. // "description": "An RFC 3339 formatted date-time value (e.g. 1970-01-01T00:00:00Z). Returned assets will have been modified at or before this time.",
  9624. // "format": "date-time",
  9625. // "location": "query",
  9626. // "type": "string"
  9627. // },
  9628. // "pageToken": {
  9629. // "description": "The continuation token, used to page through large result sets. To get the next page of results, set this parameter to the value of nextPageToken from the previous response.",
  9630. // "location": "query",
  9631. // "type": "string"
  9632. // },
  9633. // "processingStatus": {
  9634. // "enum": [
  9635. // "complete",
  9636. // "failed",
  9637. // "notReady",
  9638. // "processing",
  9639. // "ready"
  9640. // ],
  9641. // "enumDescriptions": [
  9642. // "The raster has completed processing.",
  9643. // "The raster has failed processing.",
  9644. // "The raster is not ready for processing.",
  9645. // "The raster is processing.",
  9646. // "The raster is ready for processing."
  9647. // ],
  9648. // "location": "query",
  9649. // "type": "string"
  9650. // },
  9651. // "projectId": {
  9652. // "description": "The ID of a Maps Engine project, used to filter the response. To list all available projects with their IDs, send a Projects: list request. You can also find your project ID as the value of the DashboardPlace:cid URL parameter when signed in to mapsengine.google.com.",
  9653. // "location": "query",
  9654. // "required": true,
  9655. // "type": "string"
  9656. // },
  9657. // "role": {
  9658. // "description": "The role parameter indicates that the response should only contain assets where the current user has the specified level of access.",
  9659. // "enum": [
  9660. // "owner",
  9661. // "reader",
  9662. // "writer"
  9663. // ],
  9664. // "enumDescriptions": [
  9665. // "The user can read, write and administer the asset.",
  9666. // "The user can read the asset.",
  9667. // "The user can read and write the asset."
  9668. // ],
  9669. // "location": "query",
  9670. // "type": "string"
  9671. // },
  9672. // "search": {
  9673. // "description": "An unstructured search string used to filter the set of results based on asset metadata.",
  9674. // "location": "query",
  9675. // "type": "string"
  9676. // },
  9677. // "tags": {
  9678. // "description": "A comma separated list of tags. Returned assets will contain all the tags from the list.",
  9679. // "location": "query",
  9680. // "type": "string"
  9681. // }
  9682. // },
  9683. // "path": "rasters",
  9684. // "response": {
  9685. // "$ref": "RastersListResponse"
  9686. // },
  9687. // "scopes": [
  9688. // "https://www.googleapis.com/auth/mapsengine",
  9689. // "https://www.googleapis.com/auth/mapsengine.readonly"
  9690. // ]
  9691. // }
  9692. }
  9693. // Pages invokes f for each page of results.
  9694. // A non-nil error returned from f will halt the iteration.
  9695. // The provided context supersedes any context provided to the Context method.
  9696. func (c *RastersListCall) Pages(ctx context.Context, f func(*RastersListResponse) error) error {
  9697. c.ctx_ = ctx
  9698. defer c.PageToken(c.urlParams_.Get("pageToken")) // reset paging to original point
  9699. for {
  9700. x, err := c.Do()
  9701. if err != nil {
  9702. return err
  9703. }
  9704. if err := f(x); err != nil {
  9705. return err
  9706. }
  9707. if x.NextPageToken == "" {
  9708. return nil
  9709. }
  9710. c.PageToken(x.NextPageToken)
  9711. }
  9712. }
  9713. // method id "mapsengine.rasters.patch":
  9714. type RastersPatchCall struct {
  9715. s *Service
  9716. id string
  9717. raster *Raster
  9718. urlParams_ gensupport.URLParams
  9719. ctx_ context.Context
  9720. }
  9721. // Patch: Mutate a raster asset.
  9722. func (r *RastersService) Patch(id string, raster *Raster) *RastersPatchCall {
  9723. c := &RastersPatchCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  9724. c.id = id
  9725. c.raster = raster
  9726. return c
  9727. }
  9728. // Fields allows partial responses to be retrieved. See
  9729. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  9730. // for more information.
  9731. func (c *RastersPatchCall) Fields(s ...googleapi.Field) *RastersPatchCall {
  9732. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  9733. return c
  9734. }
  9735. // Context sets the context to be used in this call's Do method. Any
  9736. // pending HTTP request will be aborted if the provided context is
  9737. // canceled.
  9738. func (c *RastersPatchCall) Context(ctx context.Context) *RastersPatchCall {
  9739. c.ctx_ = ctx
  9740. return c
  9741. }
  9742. func (c *RastersPatchCall) doRequest(alt string) (*http.Response, error) {
  9743. var body io.Reader = nil
  9744. body, err := googleapi.WithoutDataWrapper.JSONReader(c.raster)
  9745. if err != nil {
  9746. return nil, err
  9747. }
  9748. ctype := "application/json"
  9749. c.urlParams_.Set("alt", alt)
  9750. urls := googleapi.ResolveRelative(c.s.BasePath, "rasters/{id}")
  9751. urls += "?" + c.urlParams_.Encode()
  9752. req, _ := http.NewRequest("PATCH", urls, body)
  9753. googleapi.Expand(req.URL, map[string]string{
  9754. "id": c.id,
  9755. })
  9756. req.Header.Set("Content-Type", ctype)
  9757. req.Header.Set("User-Agent", c.s.userAgent())
  9758. if c.ctx_ != nil {
  9759. return ctxhttp.Do(c.ctx_, c.s.client, req)
  9760. }
  9761. return c.s.client.Do(req)
  9762. }
  9763. // Do executes the "mapsengine.rasters.patch" call.
  9764. func (c *RastersPatchCall) Do(opts ...googleapi.CallOption) error {
  9765. gensupport.SetOptions(c.urlParams_, opts...)
  9766. res, err := c.doRequest("json")
  9767. if err != nil {
  9768. return err
  9769. }
  9770. defer googleapi.CloseBody(res)
  9771. if err := googleapi.CheckResponse(res); err != nil {
  9772. return err
  9773. }
  9774. return nil
  9775. // {
  9776. // "description": "Mutate a raster asset.",
  9777. // "httpMethod": "PATCH",
  9778. // "id": "mapsengine.rasters.patch",
  9779. // "parameterOrder": [
  9780. // "id"
  9781. // ],
  9782. // "parameters": {
  9783. // "id": {
  9784. // "description": "The ID of the raster.",
  9785. // "location": "path",
  9786. // "required": true,
  9787. // "type": "string"
  9788. // }
  9789. // },
  9790. // "path": "rasters/{id}",
  9791. // "request": {
  9792. // "$ref": "Raster"
  9793. // },
  9794. // "scopes": [
  9795. // "https://www.googleapis.com/auth/mapsengine"
  9796. // ]
  9797. // }
  9798. }
  9799. // method id "mapsengine.rasters.process":
  9800. type RastersProcessCall struct {
  9801. s *Service
  9802. id string
  9803. urlParams_ gensupport.URLParams
  9804. ctx_ context.Context
  9805. }
  9806. // Process: Process a raster asset.
  9807. func (r *RastersService) Process(id string) *RastersProcessCall {
  9808. c := &RastersProcessCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  9809. c.id = id
  9810. return c
  9811. }
  9812. // Fields allows partial responses to be retrieved. See
  9813. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  9814. // for more information.
  9815. func (c *RastersProcessCall) Fields(s ...googleapi.Field) *RastersProcessCall {
  9816. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  9817. return c
  9818. }
  9819. // Context sets the context to be used in this call's Do method. Any
  9820. // pending HTTP request will be aborted if the provided context is
  9821. // canceled.
  9822. func (c *RastersProcessCall) Context(ctx context.Context) *RastersProcessCall {
  9823. c.ctx_ = ctx
  9824. return c
  9825. }
  9826. func (c *RastersProcessCall) doRequest(alt string) (*http.Response, error) {
  9827. var body io.Reader = nil
  9828. c.urlParams_.Set("alt", alt)
  9829. urls := googleapi.ResolveRelative(c.s.BasePath, "rasters/{id}/process")
  9830. urls += "?" + c.urlParams_.Encode()
  9831. req, _ := http.NewRequest("POST", urls, body)
  9832. googleapi.Expand(req.URL, map[string]string{
  9833. "id": c.id,
  9834. })
  9835. req.Header.Set("User-Agent", c.s.userAgent())
  9836. if c.ctx_ != nil {
  9837. return ctxhttp.Do(c.ctx_, c.s.client, req)
  9838. }
  9839. return c.s.client.Do(req)
  9840. }
  9841. // Do executes the "mapsengine.rasters.process" call.
  9842. // Exactly one of *ProcessResponse or error will be non-nil. Any non-2xx
  9843. // status code is an error. Response headers are in either
  9844. // *ProcessResponse.ServerResponse.Header or (if a response was returned
  9845. // at all) in error.(*googleapi.Error).Header. Use
  9846. // googleapi.IsNotModified to check whether the returned error was
  9847. // because http.StatusNotModified was returned.
  9848. func (c *RastersProcessCall) Do(opts ...googleapi.CallOption) (*ProcessResponse, error) {
  9849. gensupport.SetOptions(c.urlParams_, opts...)
  9850. res, err := c.doRequest("json")
  9851. if res != nil && res.StatusCode == http.StatusNotModified {
  9852. if res.Body != nil {
  9853. res.Body.Close()
  9854. }
  9855. return nil, &googleapi.Error{
  9856. Code: res.StatusCode,
  9857. Header: res.Header,
  9858. }
  9859. }
  9860. if err != nil {
  9861. return nil, err
  9862. }
  9863. defer googleapi.CloseBody(res)
  9864. if err := googleapi.CheckResponse(res); err != nil {
  9865. return nil, err
  9866. }
  9867. ret := &ProcessResponse{
  9868. ServerResponse: googleapi.ServerResponse{
  9869. Header: res.Header,
  9870. HTTPStatusCode: res.StatusCode,
  9871. },
  9872. }
  9873. if err := json.NewDecoder(res.Body).Decode(&ret); err != nil {
  9874. return nil, err
  9875. }
  9876. return ret, nil
  9877. // {
  9878. // "description": "Process a raster asset.",
  9879. // "httpMethod": "POST",
  9880. // "id": "mapsengine.rasters.process",
  9881. // "parameterOrder": [
  9882. // "id"
  9883. // ],
  9884. // "parameters": {
  9885. // "id": {
  9886. // "description": "The ID of the raster.",
  9887. // "location": "path",
  9888. // "required": true,
  9889. // "type": "string"
  9890. // }
  9891. // },
  9892. // "path": "rasters/{id}/process",
  9893. // "response": {
  9894. // "$ref": "ProcessResponse"
  9895. // },
  9896. // "scopes": [
  9897. // "https://www.googleapis.com/auth/mapsengine"
  9898. // ]
  9899. // }
  9900. }
  9901. // method id "mapsengine.rasters.upload":
  9902. type RastersUploadCall struct {
  9903. s *Service
  9904. raster *Raster
  9905. urlParams_ gensupport.URLParams
  9906. ctx_ context.Context
  9907. }
  9908. // Upload: Create a skeleton raster asset for upload.
  9909. func (r *RastersService) Upload(raster *Raster) *RastersUploadCall {
  9910. c := &RastersUploadCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  9911. c.raster = raster
  9912. return c
  9913. }
  9914. // Fields allows partial responses to be retrieved. See
  9915. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  9916. // for more information.
  9917. func (c *RastersUploadCall) Fields(s ...googleapi.Field) *RastersUploadCall {
  9918. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  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 *RastersUploadCall) Context(ctx context.Context) *RastersUploadCall {
  9925. c.ctx_ = ctx
  9926. return c
  9927. }
  9928. func (c *RastersUploadCall) doRequest(alt string) (*http.Response, error) {
  9929. var body io.Reader = nil
  9930. body, err := googleapi.WithoutDataWrapper.JSONReader(c.raster)
  9931. if err != nil {
  9932. return nil, err
  9933. }
  9934. ctype := "application/json"
  9935. c.urlParams_.Set("alt", alt)
  9936. urls := googleapi.ResolveRelative(c.s.BasePath, "rasters/upload")
  9937. urls += "?" + c.urlParams_.Encode()
  9938. req, _ := http.NewRequest("POST", urls, body)
  9939. googleapi.SetOpaque(req.URL)
  9940. req.Header.Set("Content-Type", ctype)
  9941. req.Header.Set("User-Agent", c.s.userAgent())
  9942. if c.ctx_ != nil {
  9943. return ctxhttp.Do(c.ctx_, c.s.client, req)
  9944. }
  9945. return c.s.client.Do(req)
  9946. }
  9947. // Do executes the "mapsengine.rasters.upload" call.
  9948. // Exactly one of *Raster or error will be non-nil. Any non-2xx status
  9949. // code is an error. Response headers are in either
  9950. // *Raster.ServerResponse.Header or (if a response was returned at all)
  9951. // in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to
  9952. // check whether the returned error was because http.StatusNotModified
  9953. // was returned.
  9954. func (c *RastersUploadCall) Do(opts ...googleapi.CallOption) (*Raster, error) {
  9955. gensupport.SetOptions(c.urlParams_, opts...)
  9956. res, err := c.doRequest("json")
  9957. if res != nil && res.StatusCode == http.StatusNotModified {
  9958. if res.Body != nil {
  9959. res.Body.Close()
  9960. }
  9961. return nil, &googleapi.Error{
  9962. Code: res.StatusCode,
  9963. Header: res.Header,
  9964. }
  9965. }
  9966. if err != nil {
  9967. return nil, err
  9968. }
  9969. defer googleapi.CloseBody(res)
  9970. if err := googleapi.CheckResponse(res); err != nil {
  9971. return nil, err
  9972. }
  9973. ret := &Raster{
  9974. ServerResponse: googleapi.ServerResponse{
  9975. Header: res.Header,
  9976. HTTPStatusCode: res.StatusCode,
  9977. },
  9978. }
  9979. if err := json.NewDecoder(res.Body).Decode(&ret); err != nil {
  9980. return nil, err
  9981. }
  9982. return ret, nil
  9983. // {
  9984. // "description": "Create a skeleton raster asset for upload.",
  9985. // "httpMethod": "POST",
  9986. // "id": "mapsengine.rasters.upload",
  9987. // "path": "rasters/upload",
  9988. // "request": {
  9989. // "$ref": "Raster"
  9990. // },
  9991. // "response": {
  9992. // "$ref": "Raster"
  9993. // },
  9994. // "scopes": [
  9995. // "https://www.googleapis.com/auth/mapsengine"
  9996. // ]
  9997. // }
  9998. }
  9999. // method id "mapsengine.rasters.files.insert":
  10000. type RastersFilesInsertCall struct {
  10001. s *Service
  10002. id string
  10003. urlParams_ gensupport.URLParams
  10004. media_ io.Reader
  10005. resumableBuffer_ *gensupport.ResumableBuffer
  10006. mediaType_ string
  10007. mediaSize_ int64 // mediaSize, if known. Used only for calls to progressUpdater_.
  10008. progressUpdater_ googleapi.ProgressUpdater
  10009. ctx_ context.Context
  10010. }
  10011. // Insert: Upload a file to a raster asset.
  10012. func (r *RastersFilesService) Insert(id string, filename string) *RastersFilesInsertCall {
  10013. c := &RastersFilesInsertCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  10014. c.id = id
  10015. c.urlParams_.Set("filename", filename)
  10016. return c
  10017. }
  10018. // Media specifies the media to upload in one or more chunks. The chunk
  10019. // size may be controlled by supplying a MediaOption generated by
  10020. // googleapi.ChunkSize. The chunk size defaults to
  10021. // googleapi.DefaultUploadChunkSize.
  10022. // At most one of Media and ResumableMedia may be set.
  10023. func (c *RastersFilesInsertCall) Media(r io.Reader, options ...googleapi.MediaOption) *RastersFilesInsertCall {
  10024. opts := googleapi.ProcessMediaOptions(options)
  10025. chunkSize := opts.ChunkSize
  10026. r, c.mediaType_ = gensupport.DetermineContentType(r, opts.ContentType)
  10027. c.media_, c.resumableBuffer_ = gensupport.PrepareUpload(r, chunkSize)
  10028. return c
  10029. }
  10030. // ResumableMedia specifies the media to upload in chunks and can be
  10031. // canceled with ctx.
  10032. //
  10033. // Deprecated: use Media instead.
  10034. //
  10035. // At most one of Media and ResumableMedia may be set. mediaType
  10036. // identifies the MIME media type of the upload, such as "image/png". If
  10037. // mediaType is "", it will be auto-detected. The provided ctx will
  10038. // supersede any context previously provided to the Context method.
  10039. func (c *RastersFilesInsertCall) ResumableMedia(ctx context.Context, r io.ReaderAt, size int64, mediaType string) *RastersFilesInsertCall {
  10040. c.ctx_ = ctx
  10041. rdr := gensupport.ReaderAtToReader(r, size)
  10042. rdr, c.mediaType_ = gensupport.DetermineContentType(rdr, mediaType)
  10043. c.resumableBuffer_ = gensupport.NewResumableBuffer(rdr, googleapi.DefaultUploadChunkSize)
  10044. c.media_ = nil
  10045. c.mediaSize_ = size
  10046. return c
  10047. }
  10048. // ProgressUpdater provides a callback function that will be called
  10049. // after every chunk. It should be a low-latency function in order to
  10050. // not slow down the upload operation. This should only be called when
  10051. // using ResumableMedia (as opposed to Media).
  10052. func (c *RastersFilesInsertCall) ProgressUpdater(pu googleapi.ProgressUpdater) *RastersFilesInsertCall {
  10053. c.progressUpdater_ = pu
  10054. return c
  10055. }
  10056. // Fields allows partial responses to be retrieved. See
  10057. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  10058. // for more information.
  10059. func (c *RastersFilesInsertCall) Fields(s ...googleapi.Field) *RastersFilesInsertCall {
  10060. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  10061. return c
  10062. }
  10063. // Context sets the context to be used in this call's Do method. Any
  10064. // pending HTTP request will be aborted if the provided context is
  10065. // canceled.
  10066. // This context will supersede any context previously provided to the
  10067. // ResumableMedia method.
  10068. func (c *RastersFilesInsertCall) Context(ctx context.Context) *RastersFilesInsertCall {
  10069. c.ctx_ = ctx
  10070. return c
  10071. }
  10072. func (c *RastersFilesInsertCall) doRequest(alt string) (*http.Response, error) {
  10073. var body io.Reader = nil
  10074. c.urlParams_.Set("alt", alt)
  10075. urls := googleapi.ResolveRelative(c.s.BasePath, "rasters/{id}/files")
  10076. if c.media_ != nil || c.resumableBuffer_ != nil {
  10077. urls = strings.Replace(urls, "https://www.googleapis.com/", "https://www.googleapis.com/upload/", 1)
  10078. protocol := "multipart"
  10079. if c.resumableBuffer_ != nil {
  10080. protocol = "resumable"
  10081. }
  10082. c.urlParams_.Set("uploadType", protocol)
  10083. }
  10084. urls += "?" + c.urlParams_.Encode()
  10085. body = new(bytes.Buffer)
  10086. ctype := "application/json"
  10087. if c.media_ != nil {
  10088. var combined io.ReadCloser
  10089. combined, ctype = gensupport.CombineBodyMedia(body, ctype, c.media_, c.mediaType_)
  10090. defer combined.Close()
  10091. body = combined
  10092. }
  10093. req, _ := http.NewRequest("POST", urls, body)
  10094. googleapi.Expand(req.URL, map[string]string{
  10095. "id": c.id,
  10096. })
  10097. if c.resumableBuffer_ != nil {
  10098. req.Header.Set("X-Upload-Content-Type", c.mediaType_)
  10099. }
  10100. req.Header.Set("Content-Type", ctype)
  10101. req.Header.Set("User-Agent", c.s.userAgent())
  10102. if c.ctx_ != nil {
  10103. return ctxhttp.Do(c.ctx_, c.s.client, req)
  10104. }
  10105. return c.s.client.Do(req)
  10106. }
  10107. // Do executes the "mapsengine.rasters.files.insert" call.
  10108. func (c *RastersFilesInsertCall) Do(opts ...googleapi.CallOption) error {
  10109. gensupport.SetOptions(c.urlParams_, opts...)
  10110. res, err := gensupport.Retry(c.ctx_, func() (*http.Response, error) {
  10111. return c.doRequest("json")
  10112. }, gensupport.DefaultBackoffStrategy())
  10113. if err != nil {
  10114. return err
  10115. }
  10116. defer googleapi.CloseBody(res)
  10117. if err := googleapi.CheckResponse(res); err != nil {
  10118. return err
  10119. }
  10120. if c.resumableBuffer_ != nil {
  10121. loc := res.Header.Get("Location")
  10122. rx := &gensupport.ResumableUpload{
  10123. Client: c.s.client,
  10124. UserAgent: c.s.userAgent(),
  10125. URI: loc,
  10126. Media: c.resumableBuffer_,
  10127. MediaType: c.mediaType_,
  10128. Callback: func(curr int64) {
  10129. if c.progressUpdater_ != nil {
  10130. c.progressUpdater_(curr, c.mediaSize_)
  10131. }
  10132. },
  10133. }
  10134. ctx := c.ctx_
  10135. if ctx == nil {
  10136. ctx = context.TODO()
  10137. }
  10138. res, err = rx.Upload(ctx)
  10139. if err != nil {
  10140. return err
  10141. }
  10142. defer res.Body.Close()
  10143. if err := googleapi.CheckResponse(res); err != nil {
  10144. return err
  10145. }
  10146. }
  10147. return nil
  10148. // {
  10149. // "description": "Upload a file to a raster asset.",
  10150. // "httpMethod": "POST",
  10151. // "id": "mapsengine.rasters.files.insert",
  10152. // "mediaUpload": {
  10153. // "accept": [
  10154. // "*/*"
  10155. // ],
  10156. // "maxSize": "10GB",
  10157. // "protocols": {
  10158. // "resumable": {
  10159. // "multipart": true,
  10160. // "path": "/resumable/upload/mapsengine/v1/rasters/{id}/files"
  10161. // },
  10162. // "simple": {
  10163. // "multipart": true,
  10164. // "path": "/upload/mapsengine/v1/rasters/{id}/files"
  10165. // }
  10166. // }
  10167. // },
  10168. // "parameterOrder": [
  10169. // "id",
  10170. // "filename"
  10171. // ],
  10172. // "parameters": {
  10173. // "filename": {
  10174. // "description": "The file name of this uploaded file.",
  10175. // "location": "query",
  10176. // "required": true,
  10177. // "type": "string"
  10178. // },
  10179. // "id": {
  10180. // "description": "The ID of the raster asset.",
  10181. // "location": "path",
  10182. // "required": true,
  10183. // "type": "string"
  10184. // }
  10185. // },
  10186. // "path": "rasters/{id}/files",
  10187. // "scopes": [
  10188. // "https://www.googleapis.com/auth/mapsengine"
  10189. // ],
  10190. // "supportsMediaUpload": true
  10191. // }
  10192. }
  10193. // method id "mapsengine.rasters.parents.list":
  10194. type RastersParentsListCall struct {
  10195. s *Service
  10196. id string
  10197. urlParams_ gensupport.URLParams
  10198. ifNoneMatch_ string
  10199. ctx_ context.Context
  10200. }
  10201. // List: Return all parent ids of the specified rasters.
  10202. func (r *RastersParentsService) List(id string) *RastersParentsListCall {
  10203. c := &RastersParentsListCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  10204. c.id = id
  10205. return c
  10206. }
  10207. // MaxResults sets the optional parameter "maxResults": The maximum
  10208. // number of items to include in a single response page. The maximum
  10209. // supported value is 50.
  10210. func (c *RastersParentsListCall) MaxResults(maxResults int64) *RastersParentsListCall {
  10211. c.urlParams_.Set("maxResults", fmt.Sprint(maxResults))
  10212. return c
  10213. }
  10214. // PageToken sets the optional parameter "pageToken": The continuation
  10215. // token, used to page through large result sets. To get the next page
  10216. // of results, set this parameter to the value of nextPageToken from the
  10217. // previous response.
  10218. func (c *RastersParentsListCall) PageToken(pageToken string) *RastersParentsListCall {
  10219. c.urlParams_.Set("pageToken", pageToken)
  10220. return c
  10221. }
  10222. // Fields allows partial responses to be retrieved. See
  10223. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  10224. // for more information.
  10225. func (c *RastersParentsListCall) Fields(s ...googleapi.Field) *RastersParentsListCall {
  10226. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  10227. return c
  10228. }
  10229. // IfNoneMatch sets the optional parameter which makes the operation
  10230. // fail if the object's ETag matches the given value. This is useful for
  10231. // getting updates only after the object has changed since the last
  10232. // request. Use googleapi.IsNotModified to check whether the response
  10233. // error from Do is the result of In-None-Match.
  10234. func (c *RastersParentsListCall) IfNoneMatch(entityTag string) *RastersParentsListCall {
  10235. c.ifNoneMatch_ = entityTag
  10236. return c
  10237. }
  10238. // Context sets the context to be used in this call's Do method. Any
  10239. // pending HTTP request will be aborted if the provided context is
  10240. // canceled.
  10241. func (c *RastersParentsListCall) Context(ctx context.Context) *RastersParentsListCall {
  10242. c.ctx_ = ctx
  10243. return c
  10244. }
  10245. func (c *RastersParentsListCall) doRequest(alt string) (*http.Response, error) {
  10246. var body io.Reader = nil
  10247. c.urlParams_.Set("alt", alt)
  10248. urls := googleapi.ResolveRelative(c.s.BasePath, "rasters/{id}/parents")
  10249. urls += "?" + c.urlParams_.Encode()
  10250. req, _ := http.NewRequest("GET", urls, body)
  10251. googleapi.Expand(req.URL, map[string]string{
  10252. "id": c.id,
  10253. })
  10254. req.Header.Set("User-Agent", c.s.userAgent())
  10255. if c.ifNoneMatch_ != "" {
  10256. req.Header.Set("If-None-Match", c.ifNoneMatch_)
  10257. }
  10258. if c.ctx_ != nil {
  10259. return ctxhttp.Do(c.ctx_, c.s.client, req)
  10260. }
  10261. return c.s.client.Do(req)
  10262. }
  10263. // Do executes the "mapsengine.rasters.parents.list" call.
  10264. // Exactly one of *ParentsListResponse or error will be non-nil. Any
  10265. // non-2xx status code is an error. Response headers are in either
  10266. // *ParentsListResponse.ServerResponse.Header or (if a response was
  10267. // returned at all) in error.(*googleapi.Error).Header. Use
  10268. // googleapi.IsNotModified to check whether the returned error was
  10269. // because http.StatusNotModified was returned.
  10270. func (c *RastersParentsListCall) Do(opts ...googleapi.CallOption) (*ParentsListResponse, error) {
  10271. gensupport.SetOptions(c.urlParams_, opts...)
  10272. res, err := c.doRequest("json")
  10273. if res != nil && res.StatusCode == http.StatusNotModified {
  10274. if res.Body != nil {
  10275. res.Body.Close()
  10276. }
  10277. return nil, &googleapi.Error{
  10278. Code: res.StatusCode,
  10279. Header: res.Header,
  10280. }
  10281. }
  10282. if err != nil {
  10283. return nil, err
  10284. }
  10285. defer googleapi.CloseBody(res)
  10286. if err := googleapi.CheckResponse(res); err != nil {
  10287. return nil, err
  10288. }
  10289. ret := &ParentsListResponse{
  10290. ServerResponse: googleapi.ServerResponse{
  10291. Header: res.Header,
  10292. HTTPStatusCode: res.StatusCode,
  10293. },
  10294. }
  10295. if err := json.NewDecoder(res.Body).Decode(&ret); err != nil {
  10296. return nil, err
  10297. }
  10298. return ret, nil
  10299. // {
  10300. // "description": "Return all parent ids of the specified rasters.",
  10301. // "httpMethod": "GET",
  10302. // "id": "mapsengine.rasters.parents.list",
  10303. // "parameterOrder": [
  10304. // "id"
  10305. // ],
  10306. // "parameters": {
  10307. // "id": {
  10308. // "description": "The ID of the rasters whose parents will be listed.",
  10309. // "location": "path",
  10310. // "required": true,
  10311. // "type": "string"
  10312. // },
  10313. // "maxResults": {
  10314. // "description": "The maximum number of items to include in a single response page. The maximum supported value is 50.",
  10315. // "format": "uint32",
  10316. // "location": "query",
  10317. // "type": "integer"
  10318. // },
  10319. // "pageToken": {
  10320. // "description": "The continuation token, used to page through large result sets. To get the next page of results, set this parameter to the value of nextPageToken from the previous response.",
  10321. // "location": "query",
  10322. // "type": "string"
  10323. // }
  10324. // },
  10325. // "path": "rasters/{id}/parents",
  10326. // "response": {
  10327. // "$ref": "ParentsListResponse"
  10328. // },
  10329. // "scopes": [
  10330. // "https://www.googleapis.com/auth/mapsengine",
  10331. // "https://www.googleapis.com/auth/mapsengine.readonly"
  10332. // ]
  10333. // }
  10334. }
  10335. // Pages invokes f for each page of results.
  10336. // A non-nil error returned from f will halt the iteration.
  10337. // The provided context supersedes any context provided to the Context method.
  10338. func (c *RastersParentsListCall) Pages(ctx context.Context, f func(*ParentsListResponse) error) error {
  10339. c.ctx_ = ctx
  10340. defer c.PageToken(c.urlParams_.Get("pageToken")) // reset paging to original point
  10341. for {
  10342. x, err := c.Do()
  10343. if err != nil {
  10344. return err
  10345. }
  10346. if err := f(x); err != nil {
  10347. return err
  10348. }
  10349. if x.NextPageToken == "" {
  10350. return nil
  10351. }
  10352. c.PageToken(x.NextPageToken)
  10353. }
  10354. }
  10355. // method id "mapsengine.rasters.permissions.batchDelete":
  10356. type RastersPermissionsBatchDeleteCall struct {
  10357. s *Service
  10358. id string
  10359. permissionsbatchdeleterequest *PermissionsBatchDeleteRequest
  10360. urlParams_ gensupport.URLParams
  10361. ctx_ context.Context
  10362. }
  10363. // BatchDelete: Remove permission entries from an already existing
  10364. // asset.
  10365. func (r *RastersPermissionsService) BatchDelete(id string, permissionsbatchdeleterequest *PermissionsBatchDeleteRequest) *RastersPermissionsBatchDeleteCall {
  10366. c := &RastersPermissionsBatchDeleteCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  10367. c.id = id
  10368. c.permissionsbatchdeleterequest = permissionsbatchdeleterequest
  10369. return c
  10370. }
  10371. // Fields allows partial responses to be retrieved. See
  10372. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  10373. // for more information.
  10374. func (c *RastersPermissionsBatchDeleteCall) Fields(s ...googleapi.Field) *RastersPermissionsBatchDeleteCall {
  10375. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  10376. return c
  10377. }
  10378. // Context sets the context to be used in this call's Do method. Any
  10379. // pending HTTP request will be aborted if the provided context is
  10380. // canceled.
  10381. func (c *RastersPermissionsBatchDeleteCall) Context(ctx context.Context) *RastersPermissionsBatchDeleteCall {
  10382. c.ctx_ = ctx
  10383. return c
  10384. }
  10385. func (c *RastersPermissionsBatchDeleteCall) doRequest(alt string) (*http.Response, error) {
  10386. var body io.Reader = nil
  10387. body, err := googleapi.WithoutDataWrapper.JSONReader(c.permissionsbatchdeleterequest)
  10388. if err != nil {
  10389. return nil, err
  10390. }
  10391. ctype := "application/json"
  10392. c.urlParams_.Set("alt", alt)
  10393. urls := googleapi.ResolveRelative(c.s.BasePath, "rasters/{id}/permissions/batchDelete")
  10394. urls += "?" + c.urlParams_.Encode()
  10395. req, _ := http.NewRequest("POST", urls, body)
  10396. googleapi.Expand(req.URL, map[string]string{
  10397. "id": c.id,
  10398. })
  10399. req.Header.Set("Content-Type", ctype)
  10400. req.Header.Set("User-Agent", c.s.userAgent())
  10401. if c.ctx_ != nil {
  10402. return ctxhttp.Do(c.ctx_, c.s.client, req)
  10403. }
  10404. return c.s.client.Do(req)
  10405. }
  10406. // Do executes the "mapsengine.rasters.permissions.batchDelete" call.
  10407. // Exactly one of *PermissionsBatchDeleteResponse or error will be
  10408. // non-nil. Any non-2xx status code is an error. Response headers are in
  10409. // either *PermissionsBatchDeleteResponse.ServerResponse.Header or (if a
  10410. // response was returned at all) in error.(*googleapi.Error).Header. Use
  10411. // googleapi.IsNotModified to check whether the returned error was
  10412. // because http.StatusNotModified was returned.
  10413. func (c *RastersPermissionsBatchDeleteCall) Do(opts ...googleapi.CallOption) (*PermissionsBatchDeleteResponse, error) {
  10414. gensupport.SetOptions(c.urlParams_, opts...)
  10415. res, err := c.doRequest("json")
  10416. if res != nil && res.StatusCode == http.StatusNotModified {
  10417. if res.Body != nil {
  10418. res.Body.Close()
  10419. }
  10420. return nil, &googleapi.Error{
  10421. Code: res.StatusCode,
  10422. Header: res.Header,
  10423. }
  10424. }
  10425. if err != nil {
  10426. return nil, err
  10427. }
  10428. defer googleapi.CloseBody(res)
  10429. if err := googleapi.CheckResponse(res); err != nil {
  10430. return nil, err
  10431. }
  10432. ret := &PermissionsBatchDeleteResponse{
  10433. ServerResponse: googleapi.ServerResponse{
  10434. Header: res.Header,
  10435. HTTPStatusCode: res.StatusCode,
  10436. },
  10437. }
  10438. if err := json.NewDecoder(res.Body).Decode(&ret); err != nil {
  10439. return nil, err
  10440. }
  10441. return ret, nil
  10442. // {
  10443. // "description": "Remove permission entries from an already existing asset.",
  10444. // "httpMethod": "POST",
  10445. // "id": "mapsengine.rasters.permissions.batchDelete",
  10446. // "parameterOrder": [
  10447. // "id"
  10448. // ],
  10449. // "parameters": {
  10450. // "id": {
  10451. // "description": "The ID of the asset from which permissions will be removed.",
  10452. // "location": "path",
  10453. // "required": true,
  10454. // "type": "string"
  10455. // }
  10456. // },
  10457. // "path": "rasters/{id}/permissions/batchDelete",
  10458. // "request": {
  10459. // "$ref": "PermissionsBatchDeleteRequest"
  10460. // },
  10461. // "response": {
  10462. // "$ref": "PermissionsBatchDeleteResponse"
  10463. // },
  10464. // "scopes": [
  10465. // "https://www.googleapis.com/auth/mapsengine"
  10466. // ]
  10467. // }
  10468. }
  10469. // method id "mapsengine.rasters.permissions.batchUpdate":
  10470. type RastersPermissionsBatchUpdateCall struct {
  10471. s *Service
  10472. id string
  10473. permissionsbatchupdaterequest *PermissionsBatchUpdateRequest
  10474. urlParams_ gensupport.URLParams
  10475. ctx_ context.Context
  10476. }
  10477. // BatchUpdate: Add or update permission entries to an already existing
  10478. // asset.
  10479. //
  10480. // An asset can hold up to 20 different permission entries. Each
  10481. // batchInsert request is atomic.
  10482. func (r *RastersPermissionsService) BatchUpdate(id string, permissionsbatchupdaterequest *PermissionsBatchUpdateRequest) *RastersPermissionsBatchUpdateCall {
  10483. c := &RastersPermissionsBatchUpdateCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  10484. c.id = id
  10485. c.permissionsbatchupdaterequest = permissionsbatchupdaterequest
  10486. return c
  10487. }
  10488. // Fields allows partial responses to be retrieved. See
  10489. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  10490. // for more information.
  10491. func (c *RastersPermissionsBatchUpdateCall) Fields(s ...googleapi.Field) *RastersPermissionsBatchUpdateCall {
  10492. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  10493. return c
  10494. }
  10495. // Context sets the context to be used in this call's Do method. Any
  10496. // pending HTTP request will be aborted if the provided context is
  10497. // canceled.
  10498. func (c *RastersPermissionsBatchUpdateCall) Context(ctx context.Context) *RastersPermissionsBatchUpdateCall {
  10499. c.ctx_ = ctx
  10500. return c
  10501. }
  10502. func (c *RastersPermissionsBatchUpdateCall) doRequest(alt string) (*http.Response, error) {
  10503. var body io.Reader = nil
  10504. body, err := googleapi.WithoutDataWrapper.JSONReader(c.permissionsbatchupdaterequest)
  10505. if err != nil {
  10506. return nil, err
  10507. }
  10508. ctype := "application/json"
  10509. c.urlParams_.Set("alt", alt)
  10510. urls := googleapi.ResolveRelative(c.s.BasePath, "rasters/{id}/permissions/batchUpdate")
  10511. urls += "?" + c.urlParams_.Encode()
  10512. req, _ := http.NewRequest("POST", urls, body)
  10513. googleapi.Expand(req.URL, map[string]string{
  10514. "id": c.id,
  10515. })
  10516. req.Header.Set("Content-Type", ctype)
  10517. req.Header.Set("User-Agent", c.s.userAgent())
  10518. if c.ctx_ != nil {
  10519. return ctxhttp.Do(c.ctx_, c.s.client, req)
  10520. }
  10521. return c.s.client.Do(req)
  10522. }
  10523. // Do executes the "mapsengine.rasters.permissions.batchUpdate" call.
  10524. // Exactly one of *PermissionsBatchUpdateResponse or error will be
  10525. // non-nil. Any non-2xx status code is an error. Response headers are in
  10526. // either *PermissionsBatchUpdateResponse.ServerResponse.Header or (if a
  10527. // response was returned at all) in error.(*googleapi.Error).Header. Use
  10528. // googleapi.IsNotModified to check whether the returned error was
  10529. // because http.StatusNotModified was returned.
  10530. func (c *RastersPermissionsBatchUpdateCall) Do(opts ...googleapi.CallOption) (*PermissionsBatchUpdateResponse, error) {
  10531. gensupport.SetOptions(c.urlParams_, opts...)
  10532. res, err := c.doRequest("json")
  10533. if res != nil && res.StatusCode == http.StatusNotModified {
  10534. if res.Body != nil {
  10535. res.Body.Close()
  10536. }
  10537. return nil, &googleapi.Error{
  10538. Code: res.StatusCode,
  10539. Header: res.Header,
  10540. }
  10541. }
  10542. if err != nil {
  10543. return nil, err
  10544. }
  10545. defer googleapi.CloseBody(res)
  10546. if err := googleapi.CheckResponse(res); err != nil {
  10547. return nil, err
  10548. }
  10549. ret := &PermissionsBatchUpdateResponse{
  10550. ServerResponse: googleapi.ServerResponse{
  10551. Header: res.Header,
  10552. HTTPStatusCode: res.StatusCode,
  10553. },
  10554. }
  10555. if err := json.NewDecoder(res.Body).Decode(&ret); err != nil {
  10556. return nil, err
  10557. }
  10558. return ret, nil
  10559. // {
  10560. // "description": "Add or update permission entries to an already existing asset.\n\nAn asset can hold up to 20 different permission entries. Each batchInsert request is atomic.",
  10561. // "httpMethod": "POST",
  10562. // "id": "mapsengine.rasters.permissions.batchUpdate",
  10563. // "parameterOrder": [
  10564. // "id"
  10565. // ],
  10566. // "parameters": {
  10567. // "id": {
  10568. // "description": "The ID of the asset to which permissions will be added.",
  10569. // "location": "path",
  10570. // "required": true,
  10571. // "type": "string"
  10572. // }
  10573. // },
  10574. // "path": "rasters/{id}/permissions/batchUpdate",
  10575. // "request": {
  10576. // "$ref": "PermissionsBatchUpdateRequest"
  10577. // },
  10578. // "response": {
  10579. // "$ref": "PermissionsBatchUpdateResponse"
  10580. // },
  10581. // "scopes": [
  10582. // "https://www.googleapis.com/auth/mapsengine"
  10583. // ]
  10584. // }
  10585. }
  10586. // method id "mapsengine.rasters.permissions.list":
  10587. type RastersPermissionsListCall struct {
  10588. s *Service
  10589. id string
  10590. urlParams_ gensupport.URLParams
  10591. ifNoneMatch_ string
  10592. ctx_ context.Context
  10593. }
  10594. // List: Return all of the permissions for the specified asset.
  10595. func (r *RastersPermissionsService) List(id string) *RastersPermissionsListCall {
  10596. c := &RastersPermissionsListCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  10597. c.id = id
  10598. return c
  10599. }
  10600. // Fields allows partial responses to be retrieved. See
  10601. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  10602. // for more information.
  10603. func (c *RastersPermissionsListCall) Fields(s ...googleapi.Field) *RastersPermissionsListCall {
  10604. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  10605. return c
  10606. }
  10607. // IfNoneMatch sets the optional parameter which makes the operation
  10608. // fail if the object's ETag matches the given value. This is useful for
  10609. // getting updates only after the object has changed since the last
  10610. // request. Use googleapi.IsNotModified to check whether the response
  10611. // error from Do is the result of In-None-Match.
  10612. func (c *RastersPermissionsListCall) IfNoneMatch(entityTag string) *RastersPermissionsListCall {
  10613. c.ifNoneMatch_ = entityTag
  10614. return c
  10615. }
  10616. // Context sets the context to be used in this call's Do method. Any
  10617. // pending HTTP request will be aborted if the provided context is
  10618. // canceled.
  10619. func (c *RastersPermissionsListCall) Context(ctx context.Context) *RastersPermissionsListCall {
  10620. c.ctx_ = ctx
  10621. return c
  10622. }
  10623. func (c *RastersPermissionsListCall) doRequest(alt string) (*http.Response, error) {
  10624. var body io.Reader = nil
  10625. c.urlParams_.Set("alt", alt)
  10626. urls := googleapi.ResolveRelative(c.s.BasePath, "rasters/{id}/permissions")
  10627. urls += "?" + c.urlParams_.Encode()
  10628. req, _ := http.NewRequest("GET", urls, body)
  10629. googleapi.Expand(req.URL, map[string]string{
  10630. "id": c.id,
  10631. })
  10632. req.Header.Set("User-Agent", c.s.userAgent())
  10633. if c.ifNoneMatch_ != "" {
  10634. req.Header.Set("If-None-Match", c.ifNoneMatch_)
  10635. }
  10636. if c.ctx_ != nil {
  10637. return ctxhttp.Do(c.ctx_, c.s.client, req)
  10638. }
  10639. return c.s.client.Do(req)
  10640. }
  10641. // Do executes the "mapsengine.rasters.permissions.list" call.
  10642. // Exactly one of *PermissionsListResponse or error will be non-nil. Any
  10643. // non-2xx status code is an error. Response headers are in either
  10644. // *PermissionsListResponse.ServerResponse.Header or (if a response was
  10645. // returned at all) in error.(*googleapi.Error).Header. Use
  10646. // googleapi.IsNotModified to check whether the returned error was
  10647. // because http.StatusNotModified was returned.
  10648. func (c *RastersPermissionsListCall) Do(opts ...googleapi.CallOption) (*PermissionsListResponse, error) {
  10649. gensupport.SetOptions(c.urlParams_, opts...)
  10650. res, err := c.doRequest("json")
  10651. if res != nil && res.StatusCode == http.StatusNotModified {
  10652. if res.Body != nil {
  10653. res.Body.Close()
  10654. }
  10655. return nil, &googleapi.Error{
  10656. Code: res.StatusCode,
  10657. Header: res.Header,
  10658. }
  10659. }
  10660. if err != nil {
  10661. return nil, err
  10662. }
  10663. defer googleapi.CloseBody(res)
  10664. if err := googleapi.CheckResponse(res); err != nil {
  10665. return nil, err
  10666. }
  10667. ret := &PermissionsListResponse{
  10668. ServerResponse: googleapi.ServerResponse{
  10669. Header: res.Header,
  10670. HTTPStatusCode: res.StatusCode,
  10671. },
  10672. }
  10673. if err := json.NewDecoder(res.Body).Decode(&ret); err != nil {
  10674. return nil, err
  10675. }
  10676. return ret, nil
  10677. // {
  10678. // "description": "Return all of the permissions for the specified asset.",
  10679. // "httpMethod": "GET",
  10680. // "id": "mapsengine.rasters.permissions.list",
  10681. // "parameterOrder": [
  10682. // "id"
  10683. // ],
  10684. // "parameters": {
  10685. // "id": {
  10686. // "description": "The ID of the asset whose permissions will be listed.",
  10687. // "location": "path",
  10688. // "required": true,
  10689. // "type": "string"
  10690. // }
  10691. // },
  10692. // "path": "rasters/{id}/permissions",
  10693. // "response": {
  10694. // "$ref": "PermissionsListResponse"
  10695. // },
  10696. // "scopes": [
  10697. // "https://www.googleapis.com/auth/mapsengine",
  10698. // "https://www.googleapis.com/auth/mapsengine.readonly"
  10699. // ]
  10700. // }
  10701. }
  10702. // method id "mapsengine.tables.create":
  10703. type TablesCreateCall struct {
  10704. s *Service
  10705. table *Table
  10706. urlParams_ gensupport.URLParams
  10707. ctx_ context.Context
  10708. }
  10709. // Create: Create a table asset.
  10710. func (r *TablesService) Create(table *Table) *TablesCreateCall {
  10711. c := &TablesCreateCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  10712. c.table = table
  10713. return c
  10714. }
  10715. // Fields allows partial responses to be retrieved. See
  10716. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  10717. // for more information.
  10718. func (c *TablesCreateCall) Fields(s ...googleapi.Field) *TablesCreateCall {
  10719. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  10720. return c
  10721. }
  10722. // Context sets the context to be used in this call's Do method. Any
  10723. // pending HTTP request will be aborted if the provided context is
  10724. // canceled.
  10725. func (c *TablesCreateCall) Context(ctx context.Context) *TablesCreateCall {
  10726. c.ctx_ = ctx
  10727. return c
  10728. }
  10729. func (c *TablesCreateCall) doRequest(alt string) (*http.Response, error) {
  10730. var body io.Reader = nil
  10731. body, err := googleapi.WithoutDataWrapper.JSONReader(c.table)
  10732. if err != nil {
  10733. return nil, err
  10734. }
  10735. ctype := "application/json"
  10736. c.urlParams_.Set("alt", alt)
  10737. urls := googleapi.ResolveRelative(c.s.BasePath, "tables")
  10738. urls += "?" + c.urlParams_.Encode()
  10739. req, _ := http.NewRequest("POST", urls, body)
  10740. googleapi.SetOpaque(req.URL)
  10741. req.Header.Set("Content-Type", ctype)
  10742. req.Header.Set("User-Agent", c.s.userAgent())
  10743. if c.ctx_ != nil {
  10744. return ctxhttp.Do(c.ctx_, c.s.client, req)
  10745. }
  10746. return c.s.client.Do(req)
  10747. }
  10748. // Do executes the "mapsengine.tables.create" call.
  10749. // Exactly one of *Table or error will be non-nil. Any non-2xx status
  10750. // code is an error. Response headers are in either
  10751. // *Table.ServerResponse.Header or (if a response was returned at all)
  10752. // in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to
  10753. // check whether the returned error was because http.StatusNotModified
  10754. // was returned.
  10755. func (c *TablesCreateCall) Do(opts ...googleapi.CallOption) (*Table, error) {
  10756. gensupport.SetOptions(c.urlParams_, opts...)
  10757. res, err := c.doRequest("json")
  10758. if res != nil && res.StatusCode == http.StatusNotModified {
  10759. if res.Body != nil {
  10760. res.Body.Close()
  10761. }
  10762. return nil, &googleapi.Error{
  10763. Code: res.StatusCode,
  10764. Header: res.Header,
  10765. }
  10766. }
  10767. if err != nil {
  10768. return nil, err
  10769. }
  10770. defer googleapi.CloseBody(res)
  10771. if err := googleapi.CheckResponse(res); err != nil {
  10772. return nil, err
  10773. }
  10774. ret := &Table{
  10775. ServerResponse: googleapi.ServerResponse{
  10776. Header: res.Header,
  10777. HTTPStatusCode: res.StatusCode,
  10778. },
  10779. }
  10780. if err := json.NewDecoder(res.Body).Decode(&ret); err != nil {
  10781. return nil, err
  10782. }
  10783. return ret, nil
  10784. // {
  10785. // "description": "Create a table asset.",
  10786. // "httpMethod": "POST",
  10787. // "id": "mapsengine.tables.create",
  10788. // "path": "tables",
  10789. // "request": {
  10790. // "$ref": "Table"
  10791. // },
  10792. // "response": {
  10793. // "$ref": "Table"
  10794. // },
  10795. // "scopes": [
  10796. // "https://www.googleapis.com/auth/mapsengine"
  10797. // ]
  10798. // }
  10799. }
  10800. // method id "mapsengine.tables.delete":
  10801. type TablesDeleteCall struct {
  10802. s *Service
  10803. id string
  10804. urlParams_ gensupport.URLParams
  10805. ctx_ context.Context
  10806. }
  10807. // Delete: Delete a table.
  10808. func (r *TablesService) Delete(id string) *TablesDeleteCall {
  10809. c := &TablesDeleteCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  10810. c.id = id
  10811. return c
  10812. }
  10813. // Fields allows partial responses to be retrieved. See
  10814. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  10815. // for more information.
  10816. func (c *TablesDeleteCall) Fields(s ...googleapi.Field) *TablesDeleteCall {
  10817. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  10818. return c
  10819. }
  10820. // Context sets the context to be used in this call's Do method. Any
  10821. // pending HTTP request will be aborted if the provided context is
  10822. // canceled.
  10823. func (c *TablesDeleteCall) Context(ctx context.Context) *TablesDeleteCall {
  10824. c.ctx_ = ctx
  10825. return c
  10826. }
  10827. func (c *TablesDeleteCall) doRequest(alt string) (*http.Response, error) {
  10828. var body io.Reader = nil
  10829. c.urlParams_.Set("alt", alt)
  10830. urls := googleapi.ResolveRelative(c.s.BasePath, "tables/{id}")
  10831. urls += "?" + c.urlParams_.Encode()
  10832. req, _ := http.NewRequest("DELETE", urls, body)
  10833. googleapi.Expand(req.URL, map[string]string{
  10834. "id": c.id,
  10835. })
  10836. req.Header.Set("User-Agent", c.s.userAgent())
  10837. if c.ctx_ != nil {
  10838. return ctxhttp.Do(c.ctx_, c.s.client, req)
  10839. }
  10840. return c.s.client.Do(req)
  10841. }
  10842. // Do executes the "mapsengine.tables.delete" call.
  10843. func (c *TablesDeleteCall) Do(opts ...googleapi.CallOption) error {
  10844. gensupport.SetOptions(c.urlParams_, opts...)
  10845. res, err := c.doRequest("json")
  10846. if err != nil {
  10847. return err
  10848. }
  10849. defer googleapi.CloseBody(res)
  10850. if err := googleapi.CheckResponse(res); err != nil {
  10851. return err
  10852. }
  10853. return nil
  10854. // {
  10855. // "description": "Delete a table.",
  10856. // "httpMethod": "DELETE",
  10857. // "id": "mapsengine.tables.delete",
  10858. // "parameterOrder": [
  10859. // "id"
  10860. // ],
  10861. // "parameters": {
  10862. // "id": {
  10863. // "description": "The ID of the table. Only the table creator or project owner are permitted to delete. If the table is included in a layer, the request will fail. Remove it from all layers prior to deleting.",
  10864. // "location": "path",
  10865. // "required": true,
  10866. // "type": "string"
  10867. // }
  10868. // },
  10869. // "path": "tables/{id}",
  10870. // "scopes": [
  10871. // "https://www.googleapis.com/auth/mapsengine"
  10872. // ]
  10873. // }
  10874. }
  10875. // method id "mapsengine.tables.get":
  10876. type TablesGetCall struct {
  10877. s *Service
  10878. id string
  10879. urlParams_ gensupport.URLParams
  10880. ifNoneMatch_ string
  10881. ctx_ context.Context
  10882. }
  10883. // Get: Return metadata for a particular table, including the schema.
  10884. func (r *TablesService) Get(id string) *TablesGetCall {
  10885. c := &TablesGetCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  10886. c.id = id
  10887. return c
  10888. }
  10889. // Version sets the optional parameter "version":
  10890. //
  10891. // Possible values:
  10892. // "draft" - The draft version.
  10893. // "published" - The published version.
  10894. func (c *TablesGetCall) Version(version string) *TablesGetCall {
  10895. c.urlParams_.Set("version", version)
  10896. return c
  10897. }
  10898. // Fields allows partial responses to be retrieved. See
  10899. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  10900. // for more information.
  10901. func (c *TablesGetCall) Fields(s ...googleapi.Field) *TablesGetCall {
  10902. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  10903. return c
  10904. }
  10905. // IfNoneMatch sets the optional parameter which makes the operation
  10906. // fail if the object's ETag matches the given value. This is useful for
  10907. // getting updates only after the object has changed since the last
  10908. // request. Use googleapi.IsNotModified to check whether the response
  10909. // error from Do is the result of In-None-Match.
  10910. func (c *TablesGetCall) IfNoneMatch(entityTag string) *TablesGetCall {
  10911. c.ifNoneMatch_ = entityTag
  10912. return c
  10913. }
  10914. // Context sets the context to be used in this call's Do method. Any
  10915. // pending HTTP request will be aborted if the provided context is
  10916. // canceled.
  10917. func (c *TablesGetCall) Context(ctx context.Context) *TablesGetCall {
  10918. c.ctx_ = ctx
  10919. return c
  10920. }
  10921. func (c *TablesGetCall) doRequest(alt string) (*http.Response, error) {
  10922. var body io.Reader = nil
  10923. c.urlParams_.Set("alt", alt)
  10924. urls := googleapi.ResolveRelative(c.s.BasePath, "tables/{id}")
  10925. urls += "?" + c.urlParams_.Encode()
  10926. req, _ := http.NewRequest("GET", urls, body)
  10927. googleapi.Expand(req.URL, map[string]string{
  10928. "id": c.id,
  10929. })
  10930. req.Header.Set("User-Agent", c.s.userAgent())
  10931. if c.ifNoneMatch_ != "" {
  10932. req.Header.Set("If-None-Match", c.ifNoneMatch_)
  10933. }
  10934. if c.ctx_ != nil {
  10935. return ctxhttp.Do(c.ctx_, c.s.client, req)
  10936. }
  10937. return c.s.client.Do(req)
  10938. }
  10939. // Do executes the "mapsengine.tables.get" call.
  10940. // Exactly one of *Table or error will be non-nil. Any non-2xx status
  10941. // code is an error. Response headers are in either
  10942. // *Table.ServerResponse.Header or (if a response was returned at all)
  10943. // in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to
  10944. // check whether the returned error was because http.StatusNotModified
  10945. // was returned.
  10946. func (c *TablesGetCall) Do(opts ...googleapi.CallOption) (*Table, error) {
  10947. gensupport.SetOptions(c.urlParams_, opts...)
  10948. res, err := c.doRequest("json")
  10949. if res != nil && res.StatusCode == http.StatusNotModified {
  10950. if res.Body != nil {
  10951. res.Body.Close()
  10952. }
  10953. return nil, &googleapi.Error{
  10954. Code: res.StatusCode,
  10955. Header: res.Header,
  10956. }
  10957. }
  10958. if err != nil {
  10959. return nil, err
  10960. }
  10961. defer googleapi.CloseBody(res)
  10962. if err := googleapi.CheckResponse(res); err != nil {
  10963. return nil, err
  10964. }
  10965. ret := &Table{
  10966. ServerResponse: googleapi.ServerResponse{
  10967. Header: res.Header,
  10968. HTTPStatusCode: res.StatusCode,
  10969. },
  10970. }
  10971. if err := json.NewDecoder(res.Body).Decode(&ret); err != nil {
  10972. return nil, err
  10973. }
  10974. return ret, nil
  10975. // {
  10976. // "description": "Return metadata for a particular table, including the schema.",
  10977. // "httpMethod": "GET",
  10978. // "id": "mapsengine.tables.get",
  10979. // "parameterOrder": [
  10980. // "id"
  10981. // ],
  10982. // "parameters": {
  10983. // "id": {
  10984. // "description": "The ID of the table.",
  10985. // "location": "path",
  10986. // "required": true,
  10987. // "type": "string"
  10988. // },
  10989. // "version": {
  10990. // "enum": [
  10991. // "draft",
  10992. // "published"
  10993. // ],
  10994. // "enumDescriptions": [
  10995. // "The draft version.",
  10996. // "The published version."
  10997. // ],
  10998. // "location": "query",
  10999. // "type": "string"
  11000. // }
  11001. // },
  11002. // "path": "tables/{id}",
  11003. // "response": {
  11004. // "$ref": "Table"
  11005. // },
  11006. // "scopes": [
  11007. // "https://www.googleapis.com/auth/mapsengine",
  11008. // "https://www.googleapis.com/auth/mapsengine.readonly"
  11009. // ]
  11010. // }
  11011. }
  11012. // method id "mapsengine.tables.list":
  11013. type TablesListCall struct {
  11014. s *Service
  11015. urlParams_ gensupport.URLParams
  11016. ifNoneMatch_ string
  11017. ctx_ context.Context
  11018. }
  11019. // List: Return all tables readable by the current user.
  11020. func (r *TablesService) List() *TablesListCall {
  11021. c := &TablesListCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  11022. return c
  11023. }
  11024. // Bbox sets the optional parameter "bbox": A bounding box, expressed as
  11025. // "west,south,east,north". If set, only assets which intersect this
  11026. // bounding box will be returned.
  11027. func (c *TablesListCall) Bbox(bbox string) *TablesListCall {
  11028. c.urlParams_.Set("bbox", bbox)
  11029. return c
  11030. }
  11031. // CreatedAfter sets the optional parameter "createdAfter": An RFC 3339
  11032. // formatted date-time value (e.g. 1970-01-01T00:00:00Z). Returned
  11033. // assets will have been created at or after this time.
  11034. func (c *TablesListCall) CreatedAfter(createdAfter string) *TablesListCall {
  11035. c.urlParams_.Set("createdAfter", createdAfter)
  11036. return c
  11037. }
  11038. // CreatedBefore sets the optional parameter "createdBefore": An RFC
  11039. // 3339 formatted date-time value (e.g. 1970-01-01T00:00:00Z). Returned
  11040. // assets will have been created at or before this time.
  11041. func (c *TablesListCall) CreatedBefore(createdBefore string) *TablesListCall {
  11042. c.urlParams_.Set("createdBefore", createdBefore)
  11043. return c
  11044. }
  11045. // CreatorEmail sets the optional parameter "creatorEmail": An email
  11046. // address representing a user. Returned assets that have been created
  11047. // by the user associated with the provided email address.
  11048. func (c *TablesListCall) CreatorEmail(creatorEmail string) *TablesListCall {
  11049. c.urlParams_.Set("creatorEmail", creatorEmail)
  11050. return c
  11051. }
  11052. // MaxResults sets the optional parameter "maxResults": The maximum
  11053. // number of items to include in a single response page. The maximum
  11054. // supported value is 100.
  11055. func (c *TablesListCall) MaxResults(maxResults int64) *TablesListCall {
  11056. c.urlParams_.Set("maxResults", fmt.Sprint(maxResults))
  11057. return c
  11058. }
  11059. // ModifiedAfter sets the optional parameter "modifiedAfter": An RFC
  11060. // 3339 formatted date-time value (e.g. 1970-01-01T00:00:00Z). Returned
  11061. // assets will have been modified at or after this time.
  11062. func (c *TablesListCall) ModifiedAfter(modifiedAfter string) *TablesListCall {
  11063. c.urlParams_.Set("modifiedAfter", modifiedAfter)
  11064. return c
  11065. }
  11066. // ModifiedBefore sets the optional parameter "modifiedBefore": An RFC
  11067. // 3339 formatted date-time value (e.g. 1970-01-01T00:00:00Z). Returned
  11068. // assets will have been modified at or before this time.
  11069. func (c *TablesListCall) ModifiedBefore(modifiedBefore string) *TablesListCall {
  11070. c.urlParams_.Set("modifiedBefore", modifiedBefore)
  11071. return c
  11072. }
  11073. // PageToken sets the optional parameter "pageToken": The continuation
  11074. // token, used to page through large result sets. To get the next page
  11075. // of results, set this parameter to the value of nextPageToken from the
  11076. // previous response.
  11077. func (c *TablesListCall) PageToken(pageToken string) *TablesListCall {
  11078. c.urlParams_.Set("pageToken", pageToken)
  11079. return c
  11080. }
  11081. // ProcessingStatus sets the optional parameter "processingStatus":
  11082. //
  11083. // Possible values:
  11084. // "complete" - The table has completed processing.
  11085. // "failed" - The table has failed processing.
  11086. // "notReady" - The table is not ready for processing.
  11087. // "processing" - The table is processing.
  11088. // "ready" - The table is ready for processing.
  11089. func (c *TablesListCall) ProcessingStatus(processingStatus string) *TablesListCall {
  11090. c.urlParams_.Set("processingStatus", processingStatus)
  11091. return c
  11092. }
  11093. // ProjectId sets the optional parameter "projectId": The ID of a Maps
  11094. // Engine project, used to filter the response. To list all available
  11095. // projects with their IDs, send a Projects: list request. You can also
  11096. // find your project ID as the value of the DashboardPlace:cid URL
  11097. // parameter when signed in to mapsengine.google.com.
  11098. func (c *TablesListCall) ProjectId(projectId string) *TablesListCall {
  11099. c.urlParams_.Set("projectId", projectId)
  11100. return c
  11101. }
  11102. // Role sets the optional parameter "role": The role parameter indicates
  11103. // that the response should only contain assets where the current user
  11104. // has the specified level of access.
  11105. //
  11106. // Possible values:
  11107. // "owner" - The user can read, write and administer the asset.
  11108. // "reader" - The user can read the asset.
  11109. // "writer" - The user can read and write the asset.
  11110. func (c *TablesListCall) Role(role string) *TablesListCall {
  11111. c.urlParams_.Set("role", role)
  11112. return c
  11113. }
  11114. // Search sets the optional parameter "search": An unstructured search
  11115. // string used to filter the set of results based on asset metadata.
  11116. func (c *TablesListCall) Search(search string) *TablesListCall {
  11117. c.urlParams_.Set("search", search)
  11118. return c
  11119. }
  11120. // Tags sets the optional parameter "tags": A comma separated list of
  11121. // tags. Returned assets will contain all the tags from the list.
  11122. func (c *TablesListCall) Tags(tags string) *TablesListCall {
  11123. c.urlParams_.Set("tags", tags)
  11124. return c
  11125. }
  11126. // Fields allows partial responses to be retrieved. See
  11127. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  11128. // for more information.
  11129. func (c *TablesListCall) Fields(s ...googleapi.Field) *TablesListCall {
  11130. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  11131. return c
  11132. }
  11133. // IfNoneMatch sets the optional parameter which makes the operation
  11134. // fail if the object's ETag matches the given value. This is useful for
  11135. // getting updates only after the object has changed since the last
  11136. // request. Use googleapi.IsNotModified to check whether the response
  11137. // error from Do is the result of In-None-Match.
  11138. func (c *TablesListCall) IfNoneMatch(entityTag string) *TablesListCall {
  11139. c.ifNoneMatch_ = entityTag
  11140. return c
  11141. }
  11142. // Context sets the context to be used in this call's Do method. Any
  11143. // pending HTTP request will be aborted if the provided context is
  11144. // canceled.
  11145. func (c *TablesListCall) Context(ctx context.Context) *TablesListCall {
  11146. c.ctx_ = ctx
  11147. return c
  11148. }
  11149. func (c *TablesListCall) doRequest(alt string) (*http.Response, error) {
  11150. var body io.Reader = nil
  11151. c.urlParams_.Set("alt", alt)
  11152. urls := googleapi.ResolveRelative(c.s.BasePath, "tables")
  11153. urls += "?" + c.urlParams_.Encode()
  11154. req, _ := http.NewRequest("GET", urls, body)
  11155. googleapi.SetOpaque(req.URL)
  11156. req.Header.Set("User-Agent", c.s.userAgent())
  11157. if c.ifNoneMatch_ != "" {
  11158. req.Header.Set("If-None-Match", c.ifNoneMatch_)
  11159. }
  11160. if c.ctx_ != nil {
  11161. return ctxhttp.Do(c.ctx_, c.s.client, req)
  11162. }
  11163. return c.s.client.Do(req)
  11164. }
  11165. // Do executes the "mapsengine.tables.list" call.
  11166. // Exactly one of *TablesListResponse or error will be non-nil. Any
  11167. // non-2xx status code is an error. Response headers are in either
  11168. // *TablesListResponse.ServerResponse.Header or (if a response was
  11169. // returned at all) in error.(*googleapi.Error).Header. Use
  11170. // googleapi.IsNotModified to check whether the returned error was
  11171. // because http.StatusNotModified was returned.
  11172. func (c *TablesListCall) Do(opts ...googleapi.CallOption) (*TablesListResponse, error) {
  11173. gensupport.SetOptions(c.urlParams_, opts...)
  11174. res, err := c.doRequest("json")
  11175. if res != nil && res.StatusCode == http.StatusNotModified {
  11176. if res.Body != nil {
  11177. res.Body.Close()
  11178. }
  11179. return nil, &googleapi.Error{
  11180. Code: res.StatusCode,
  11181. Header: res.Header,
  11182. }
  11183. }
  11184. if err != nil {
  11185. return nil, err
  11186. }
  11187. defer googleapi.CloseBody(res)
  11188. if err := googleapi.CheckResponse(res); err != nil {
  11189. return nil, err
  11190. }
  11191. ret := &TablesListResponse{
  11192. ServerResponse: googleapi.ServerResponse{
  11193. Header: res.Header,
  11194. HTTPStatusCode: res.StatusCode,
  11195. },
  11196. }
  11197. if err := json.NewDecoder(res.Body).Decode(&ret); err != nil {
  11198. return nil, err
  11199. }
  11200. return ret, nil
  11201. // {
  11202. // "description": "Return all tables readable by the current user.",
  11203. // "httpMethod": "GET",
  11204. // "id": "mapsengine.tables.list",
  11205. // "parameters": {
  11206. // "bbox": {
  11207. // "description": "A bounding box, expressed as \"west,south,east,north\". If set, only assets which intersect this bounding box will be returned.",
  11208. // "location": "query",
  11209. // "type": "string"
  11210. // },
  11211. // "createdAfter": {
  11212. // "description": "An RFC 3339 formatted date-time value (e.g. 1970-01-01T00:00:00Z). Returned assets will have been created at or after this time.",
  11213. // "format": "date-time",
  11214. // "location": "query",
  11215. // "type": "string"
  11216. // },
  11217. // "createdBefore": {
  11218. // "description": "An RFC 3339 formatted date-time value (e.g. 1970-01-01T00:00:00Z). Returned assets will have been created at or before this time.",
  11219. // "format": "date-time",
  11220. // "location": "query",
  11221. // "type": "string"
  11222. // },
  11223. // "creatorEmail": {
  11224. // "description": "An email address representing a user. Returned assets that have been created by the user associated with the provided email address.",
  11225. // "location": "query",
  11226. // "type": "string"
  11227. // },
  11228. // "maxResults": {
  11229. // "description": "The maximum number of items to include in a single response page. The maximum supported value is 100.",
  11230. // "format": "uint32",
  11231. // "location": "query",
  11232. // "type": "integer"
  11233. // },
  11234. // "modifiedAfter": {
  11235. // "description": "An RFC 3339 formatted date-time value (e.g. 1970-01-01T00:00:00Z). Returned assets will have been modified at or after this time.",
  11236. // "format": "date-time",
  11237. // "location": "query",
  11238. // "type": "string"
  11239. // },
  11240. // "modifiedBefore": {
  11241. // "description": "An RFC 3339 formatted date-time value (e.g. 1970-01-01T00:00:00Z). Returned assets will have been modified at or before this time.",
  11242. // "format": "date-time",
  11243. // "location": "query",
  11244. // "type": "string"
  11245. // },
  11246. // "pageToken": {
  11247. // "description": "The continuation token, used to page through large result sets. To get the next page of results, set this parameter to the value of nextPageToken from the previous response.",
  11248. // "location": "query",
  11249. // "type": "string"
  11250. // },
  11251. // "processingStatus": {
  11252. // "enum": [
  11253. // "complete",
  11254. // "failed",
  11255. // "notReady",
  11256. // "processing",
  11257. // "ready"
  11258. // ],
  11259. // "enumDescriptions": [
  11260. // "The table has completed processing.",
  11261. // "The table has failed processing.",
  11262. // "The table is not ready for processing.",
  11263. // "The table is processing.",
  11264. // "The table is ready for processing."
  11265. // ],
  11266. // "location": "query",
  11267. // "type": "string"
  11268. // },
  11269. // "projectId": {
  11270. // "description": "The ID of a Maps Engine project, used to filter the response. To list all available projects with their IDs, send a Projects: list request. You can also find your project ID as the value of the DashboardPlace:cid URL parameter when signed in to mapsengine.google.com.",
  11271. // "location": "query",
  11272. // "type": "string"
  11273. // },
  11274. // "role": {
  11275. // "description": "The role parameter indicates that the response should only contain assets where the current user has the specified level of access.",
  11276. // "enum": [
  11277. // "owner",
  11278. // "reader",
  11279. // "writer"
  11280. // ],
  11281. // "enumDescriptions": [
  11282. // "The user can read, write and administer the asset.",
  11283. // "The user can read the asset.",
  11284. // "The user can read and write the asset."
  11285. // ],
  11286. // "location": "query",
  11287. // "type": "string"
  11288. // },
  11289. // "search": {
  11290. // "description": "An unstructured search string used to filter the set of results based on asset metadata.",
  11291. // "location": "query",
  11292. // "type": "string"
  11293. // },
  11294. // "tags": {
  11295. // "description": "A comma separated list of tags. Returned assets will contain all the tags from the list.",
  11296. // "location": "query",
  11297. // "type": "string"
  11298. // }
  11299. // },
  11300. // "path": "tables",
  11301. // "response": {
  11302. // "$ref": "TablesListResponse"
  11303. // },
  11304. // "scopes": [
  11305. // "https://www.googleapis.com/auth/mapsengine",
  11306. // "https://www.googleapis.com/auth/mapsengine.readonly"
  11307. // ]
  11308. // }
  11309. }
  11310. // Pages invokes f for each page of results.
  11311. // A non-nil error returned from f will halt the iteration.
  11312. // The provided context supersedes any context provided to the Context method.
  11313. func (c *TablesListCall) Pages(ctx context.Context, f func(*TablesListResponse) error) error {
  11314. c.ctx_ = ctx
  11315. defer c.PageToken(c.urlParams_.Get("pageToken")) // reset paging to original point
  11316. for {
  11317. x, err := c.Do()
  11318. if err != nil {
  11319. return err
  11320. }
  11321. if err := f(x); err != nil {
  11322. return err
  11323. }
  11324. if x.NextPageToken == "" {
  11325. return nil
  11326. }
  11327. c.PageToken(x.NextPageToken)
  11328. }
  11329. }
  11330. // method id "mapsengine.tables.patch":
  11331. type TablesPatchCall struct {
  11332. s *Service
  11333. id string
  11334. table *Table
  11335. urlParams_ gensupport.URLParams
  11336. ctx_ context.Context
  11337. }
  11338. // Patch: Mutate a table asset.
  11339. func (r *TablesService) Patch(id string, table *Table) *TablesPatchCall {
  11340. c := &TablesPatchCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  11341. c.id = id
  11342. c.table = table
  11343. return c
  11344. }
  11345. // Fields allows partial responses to be retrieved. See
  11346. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  11347. // for more information.
  11348. func (c *TablesPatchCall) Fields(s ...googleapi.Field) *TablesPatchCall {
  11349. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  11350. return c
  11351. }
  11352. // Context sets the context to be used in this call's Do method. Any
  11353. // pending HTTP request will be aborted if the provided context is
  11354. // canceled.
  11355. func (c *TablesPatchCall) Context(ctx context.Context) *TablesPatchCall {
  11356. c.ctx_ = ctx
  11357. return c
  11358. }
  11359. func (c *TablesPatchCall) doRequest(alt string) (*http.Response, error) {
  11360. var body io.Reader = nil
  11361. body, err := googleapi.WithoutDataWrapper.JSONReader(c.table)
  11362. if err != nil {
  11363. return nil, err
  11364. }
  11365. ctype := "application/json"
  11366. c.urlParams_.Set("alt", alt)
  11367. urls := googleapi.ResolveRelative(c.s.BasePath, "tables/{id}")
  11368. urls += "?" + c.urlParams_.Encode()
  11369. req, _ := http.NewRequest("PATCH", urls, body)
  11370. googleapi.Expand(req.URL, map[string]string{
  11371. "id": c.id,
  11372. })
  11373. req.Header.Set("Content-Type", ctype)
  11374. req.Header.Set("User-Agent", c.s.userAgent())
  11375. if c.ctx_ != nil {
  11376. return ctxhttp.Do(c.ctx_, c.s.client, req)
  11377. }
  11378. return c.s.client.Do(req)
  11379. }
  11380. // Do executes the "mapsengine.tables.patch" call.
  11381. func (c *TablesPatchCall) Do(opts ...googleapi.CallOption) error {
  11382. gensupport.SetOptions(c.urlParams_, opts...)
  11383. res, err := c.doRequest("json")
  11384. if err != nil {
  11385. return err
  11386. }
  11387. defer googleapi.CloseBody(res)
  11388. if err := googleapi.CheckResponse(res); err != nil {
  11389. return err
  11390. }
  11391. return nil
  11392. // {
  11393. // "description": "Mutate a table asset.",
  11394. // "httpMethod": "PATCH",
  11395. // "id": "mapsengine.tables.patch",
  11396. // "parameterOrder": [
  11397. // "id"
  11398. // ],
  11399. // "parameters": {
  11400. // "id": {
  11401. // "description": "The ID of the table.",
  11402. // "location": "path",
  11403. // "required": true,
  11404. // "type": "string"
  11405. // }
  11406. // },
  11407. // "path": "tables/{id}",
  11408. // "request": {
  11409. // "$ref": "Table"
  11410. // },
  11411. // "scopes": [
  11412. // "https://www.googleapis.com/auth/mapsengine"
  11413. // ]
  11414. // }
  11415. }
  11416. // method id "mapsengine.tables.process":
  11417. type TablesProcessCall struct {
  11418. s *Service
  11419. id string
  11420. urlParams_ gensupport.URLParams
  11421. ctx_ context.Context
  11422. }
  11423. // Process: Process a table asset.
  11424. func (r *TablesService) Process(id string) *TablesProcessCall {
  11425. c := &TablesProcessCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  11426. c.id = id
  11427. return c
  11428. }
  11429. // Fields allows partial responses to be retrieved. See
  11430. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  11431. // for more information.
  11432. func (c *TablesProcessCall) Fields(s ...googleapi.Field) *TablesProcessCall {
  11433. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  11434. return c
  11435. }
  11436. // Context sets the context to be used in this call's Do method. Any
  11437. // pending HTTP request will be aborted if the provided context is
  11438. // canceled.
  11439. func (c *TablesProcessCall) Context(ctx context.Context) *TablesProcessCall {
  11440. c.ctx_ = ctx
  11441. return c
  11442. }
  11443. func (c *TablesProcessCall) doRequest(alt string) (*http.Response, error) {
  11444. var body io.Reader = nil
  11445. c.urlParams_.Set("alt", alt)
  11446. urls := googleapi.ResolveRelative(c.s.BasePath, "tables/{id}/process")
  11447. urls += "?" + c.urlParams_.Encode()
  11448. req, _ := http.NewRequest("POST", urls, body)
  11449. googleapi.Expand(req.URL, map[string]string{
  11450. "id": c.id,
  11451. })
  11452. req.Header.Set("User-Agent", c.s.userAgent())
  11453. if c.ctx_ != nil {
  11454. return ctxhttp.Do(c.ctx_, c.s.client, req)
  11455. }
  11456. return c.s.client.Do(req)
  11457. }
  11458. // Do executes the "mapsengine.tables.process" call.
  11459. // Exactly one of *ProcessResponse or error will be non-nil. Any non-2xx
  11460. // status code is an error. Response headers are in either
  11461. // *ProcessResponse.ServerResponse.Header or (if a response was returned
  11462. // at all) in error.(*googleapi.Error).Header. Use
  11463. // googleapi.IsNotModified to check whether the returned error was
  11464. // because http.StatusNotModified was returned.
  11465. func (c *TablesProcessCall) Do(opts ...googleapi.CallOption) (*ProcessResponse, error) {
  11466. gensupport.SetOptions(c.urlParams_, opts...)
  11467. res, err := c.doRequest("json")
  11468. if res != nil && res.StatusCode == http.StatusNotModified {
  11469. if res.Body != nil {
  11470. res.Body.Close()
  11471. }
  11472. return nil, &googleapi.Error{
  11473. Code: res.StatusCode,
  11474. Header: res.Header,
  11475. }
  11476. }
  11477. if err != nil {
  11478. return nil, err
  11479. }
  11480. defer googleapi.CloseBody(res)
  11481. if err := googleapi.CheckResponse(res); err != nil {
  11482. return nil, err
  11483. }
  11484. ret := &ProcessResponse{
  11485. ServerResponse: googleapi.ServerResponse{
  11486. Header: res.Header,
  11487. HTTPStatusCode: res.StatusCode,
  11488. },
  11489. }
  11490. if err := json.NewDecoder(res.Body).Decode(&ret); err != nil {
  11491. return nil, err
  11492. }
  11493. return ret, nil
  11494. // {
  11495. // "description": "Process a table asset.",
  11496. // "httpMethod": "POST",
  11497. // "id": "mapsengine.tables.process",
  11498. // "parameterOrder": [
  11499. // "id"
  11500. // ],
  11501. // "parameters": {
  11502. // "id": {
  11503. // "description": "The ID of the table.",
  11504. // "location": "path",
  11505. // "required": true,
  11506. // "type": "string"
  11507. // }
  11508. // },
  11509. // "path": "tables/{id}/process",
  11510. // "response": {
  11511. // "$ref": "ProcessResponse"
  11512. // },
  11513. // "scopes": [
  11514. // "https://www.googleapis.com/auth/mapsengine"
  11515. // ]
  11516. // }
  11517. }
  11518. // method id "mapsengine.tables.upload":
  11519. type TablesUploadCall struct {
  11520. s *Service
  11521. table *Table
  11522. urlParams_ gensupport.URLParams
  11523. ctx_ context.Context
  11524. }
  11525. // Upload: Create a placeholder table asset to which table files can be
  11526. // uploaded.
  11527. // Once the placeholder has been created, files are uploaded to the
  11528. // https://www.googleapis.com/upload/mapsengine/v1/tables/table_id/files
  11529. // endpoint.
  11530. // See Table Upload in the Developer's Guide or Table.files: insert in
  11531. // the reference documentation for more information.
  11532. func (r *TablesService) Upload(table *Table) *TablesUploadCall {
  11533. c := &TablesUploadCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  11534. c.table = table
  11535. return c
  11536. }
  11537. // Fields allows partial responses to be retrieved. See
  11538. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  11539. // for more information.
  11540. func (c *TablesUploadCall) Fields(s ...googleapi.Field) *TablesUploadCall {
  11541. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  11542. return c
  11543. }
  11544. // Context sets the context to be used in this call's Do method. Any
  11545. // pending HTTP request will be aborted if the provided context is
  11546. // canceled.
  11547. func (c *TablesUploadCall) Context(ctx context.Context) *TablesUploadCall {
  11548. c.ctx_ = ctx
  11549. return c
  11550. }
  11551. func (c *TablesUploadCall) doRequest(alt string) (*http.Response, error) {
  11552. var body io.Reader = nil
  11553. body, err := googleapi.WithoutDataWrapper.JSONReader(c.table)
  11554. if err != nil {
  11555. return nil, err
  11556. }
  11557. ctype := "application/json"
  11558. c.urlParams_.Set("alt", alt)
  11559. urls := googleapi.ResolveRelative(c.s.BasePath, "tables/upload")
  11560. urls += "?" + c.urlParams_.Encode()
  11561. req, _ := http.NewRequest("POST", urls, body)
  11562. googleapi.SetOpaque(req.URL)
  11563. req.Header.Set("Content-Type", ctype)
  11564. req.Header.Set("User-Agent", c.s.userAgent())
  11565. if c.ctx_ != nil {
  11566. return ctxhttp.Do(c.ctx_, c.s.client, req)
  11567. }
  11568. return c.s.client.Do(req)
  11569. }
  11570. // Do executes the "mapsengine.tables.upload" call.
  11571. // Exactly one of *Table or error will be non-nil. Any non-2xx status
  11572. // code is an error. Response headers are in either
  11573. // *Table.ServerResponse.Header or (if a response was returned at all)
  11574. // in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to
  11575. // check whether the returned error was because http.StatusNotModified
  11576. // was returned.
  11577. func (c *TablesUploadCall) Do(opts ...googleapi.CallOption) (*Table, error) {
  11578. gensupport.SetOptions(c.urlParams_, opts...)
  11579. res, err := c.doRequest("json")
  11580. if res != nil && res.StatusCode == http.StatusNotModified {
  11581. if res.Body != nil {
  11582. res.Body.Close()
  11583. }
  11584. return nil, &googleapi.Error{
  11585. Code: res.StatusCode,
  11586. Header: res.Header,
  11587. }
  11588. }
  11589. if err != nil {
  11590. return nil, err
  11591. }
  11592. defer googleapi.CloseBody(res)
  11593. if err := googleapi.CheckResponse(res); err != nil {
  11594. return nil, err
  11595. }
  11596. ret := &Table{
  11597. ServerResponse: googleapi.ServerResponse{
  11598. Header: res.Header,
  11599. HTTPStatusCode: res.StatusCode,
  11600. },
  11601. }
  11602. if err := json.NewDecoder(res.Body).Decode(&ret); err != nil {
  11603. return nil, err
  11604. }
  11605. return ret, nil
  11606. // {
  11607. // "description": "Create a placeholder table asset to which table files can be uploaded.\nOnce the placeholder has been created, files are uploaded to the https://www.googleapis.com/upload/mapsengine/v1/tables/table_id/files endpoint.\nSee Table Upload in the Developer's Guide or Table.files: insert in the reference documentation for more information.",
  11608. // "httpMethod": "POST",
  11609. // "id": "mapsengine.tables.upload",
  11610. // "path": "tables/upload",
  11611. // "request": {
  11612. // "$ref": "Table"
  11613. // },
  11614. // "response": {
  11615. // "$ref": "Table"
  11616. // },
  11617. // "scopes": [
  11618. // "https://www.googleapis.com/auth/mapsengine"
  11619. // ]
  11620. // }
  11621. }
  11622. // method id "mapsengine.tables.features.batchDelete":
  11623. type TablesFeaturesBatchDeleteCall struct {
  11624. s *Service
  11625. id string
  11626. featuresbatchdeleterequest *FeaturesBatchDeleteRequest
  11627. urlParams_ gensupport.URLParams
  11628. ctx_ context.Context
  11629. }
  11630. // BatchDelete: Delete all features matching the given IDs.
  11631. func (r *TablesFeaturesService) BatchDelete(id string, featuresbatchdeleterequest *FeaturesBatchDeleteRequest) *TablesFeaturesBatchDeleteCall {
  11632. c := &TablesFeaturesBatchDeleteCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  11633. c.id = id
  11634. c.featuresbatchdeleterequest = featuresbatchdeleterequest
  11635. return c
  11636. }
  11637. // Fields allows partial responses to be retrieved. See
  11638. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  11639. // for more information.
  11640. func (c *TablesFeaturesBatchDeleteCall) Fields(s ...googleapi.Field) *TablesFeaturesBatchDeleteCall {
  11641. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  11642. return c
  11643. }
  11644. // Context sets the context to be used in this call's Do method. Any
  11645. // pending HTTP request will be aborted if the provided context is
  11646. // canceled.
  11647. func (c *TablesFeaturesBatchDeleteCall) Context(ctx context.Context) *TablesFeaturesBatchDeleteCall {
  11648. c.ctx_ = ctx
  11649. return c
  11650. }
  11651. func (c *TablesFeaturesBatchDeleteCall) doRequest(alt string) (*http.Response, error) {
  11652. var body io.Reader = nil
  11653. body, err := googleapi.WithoutDataWrapper.JSONReader(c.featuresbatchdeleterequest)
  11654. if err != nil {
  11655. return nil, err
  11656. }
  11657. ctype := "application/json"
  11658. c.urlParams_.Set("alt", alt)
  11659. urls := googleapi.ResolveRelative(c.s.BasePath, "tables/{id}/features/batchDelete")
  11660. urls += "?" + c.urlParams_.Encode()
  11661. req, _ := http.NewRequest("POST", urls, body)
  11662. googleapi.Expand(req.URL, map[string]string{
  11663. "id": c.id,
  11664. })
  11665. req.Header.Set("Content-Type", ctype)
  11666. req.Header.Set("User-Agent", c.s.userAgent())
  11667. if c.ctx_ != nil {
  11668. return ctxhttp.Do(c.ctx_, c.s.client, req)
  11669. }
  11670. return c.s.client.Do(req)
  11671. }
  11672. // Do executes the "mapsengine.tables.features.batchDelete" call.
  11673. func (c *TablesFeaturesBatchDeleteCall) Do(opts ...googleapi.CallOption) error {
  11674. gensupport.SetOptions(c.urlParams_, opts...)
  11675. res, err := c.doRequest("json")
  11676. if err != nil {
  11677. return err
  11678. }
  11679. defer googleapi.CloseBody(res)
  11680. if err := googleapi.CheckResponse(res); err != nil {
  11681. return err
  11682. }
  11683. return nil
  11684. // {
  11685. // "description": "Delete all features matching the given IDs.",
  11686. // "httpMethod": "POST",
  11687. // "id": "mapsengine.tables.features.batchDelete",
  11688. // "parameterOrder": [
  11689. // "id"
  11690. // ],
  11691. // "parameters": {
  11692. // "id": {
  11693. // "description": "The ID of the table that contains the features to be deleted.",
  11694. // "location": "path",
  11695. // "required": true,
  11696. // "type": "string"
  11697. // }
  11698. // },
  11699. // "path": "tables/{id}/features/batchDelete",
  11700. // "request": {
  11701. // "$ref": "FeaturesBatchDeleteRequest"
  11702. // },
  11703. // "scopes": [
  11704. // "https://www.googleapis.com/auth/mapsengine"
  11705. // ]
  11706. // }
  11707. }
  11708. // method id "mapsengine.tables.features.batchInsert":
  11709. type TablesFeaturesBatchInsertCall struct {
  11710. s *Service
  11711. id string
  11712. featuresbatchinsertrequest *FeaturesBatchInsertRequest
  11713. urlParams_ gensupport.URLParams
  11714. ctx_ context.Context
  11715. }
  11716. // BatchInsert: Append features to an existing table.
  11717. //
  11718. // A single batchInsert request can create:
  11719. //
  11720. // - Up to 50 features.
  11721. // - A combined total of 10 000 vertices.
  11722. // Feature limits are documented in the Supported data formats and
  11723. // limits article of the Google Maps Engine help center. Note that free
  11724. // and paid accounts have different limits.
  11725. //
  11726. // For more information about inserting features, read Creating features
  11727. // in the Google Maps Engine developer's guide.
  11728. func (r *TablesFeaturesService) BatchInsert(id string, featuresbatchinsertrequest *FeaturesBatchInsertRequest) *TablesFeaturesBatchInsertCall {
  11729. c := &TablesFeaturesBatchInsertCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  11730. c.id = id
  11731. c.featuresbatchinsertrequest = featuresbatchinsertrequest
  11732. return c
  11733. }
  11734. // Fields allows partial responses to be retrieved. See
  11735. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  11736. // for more information.
  11737. func (c *TablesFeaturesBatchInsertCall) Fields(s ...googleapi.Field) *TablesFeaturesBatchInsertCall {
  11738. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  11739. return c
  11740. }
  11741. // Context sets the context to be used in this call's Do method. Any
  11742. // pending HTTP request will be aborted if the provided context is
  11743. // canceled.
  11744. func (c *TablesFeaturesBatchInsertCall) Context(ctx context.Context) *TablesFeaturesBatchInsertCall {
  11745. c.ctx_ = ctx
  11746. return c
  11747. }
  11748. func (c *TablesFeaturesBatchInsertCall) doRequest(alt string) (*http.Response, error) {
  11749. var body io.Reader = nil
  11750. body, err := googleapi.WithoutDataWrapper.JSONReader(c.featuresbatchinsertrequest)
  11751. if err != nil {
  11752. return nil, err
  11753. }
  11754. ctype := "application/json"
  11755. c.urlParams_.Set("alt", alt)
  11756. urls := googleapi.ResolveRelative(c.s.BasePath, "tables/{id}/features/batchInsert")
  11757. urls += "?" + c.urlParams_.Encode()
  11758. req, _ := http.NewRequest("POST", urls, body)
  11759. googleapi.Expand(req.URL, map[string]string{
  11760. "id": c.id,
  11761. })
  11762. req.Header.Set("Content-Type", ctype)
  11763. req.Header.Set("User-Agent", c.s.userAgent())
  11764. if c.ctx_ != nil {
  11765. return ctxhttp.Do(c.ctx_, c.s.client, req)
  11766. }
  11767. return c.s.client.Do(req)
  11768. }
  11769. // Do executes the "mapsengine.tables.features.batchInsert" call.
  11770. func (c *TablesFeaturesBatchInsertCall) Do(opts ...googleapi.CallOption) error {
  11771. gensupport.SetOptions(c.urlParams_, opts...)
  11772. res, err := c.doRequest("json")
  11773. if err != nil {
  11774. return err
  11775. }
  11776. defer googleapi.CloseBody(res)
  11777. if err := googleapi.CheckResponse(res); err != nil {
  11778. return err
  11779. }
  11780. return nil
  11781. // {
  11782. // "description": "Append features to an existing table.\n\nA single batchInsert request can create:\n\n- Up to 50 features.\n- A combined total of 10 000 vertices.\nFeature limits are documented in the Supported data formats and limits article of the Google Maps Engine help center. Note that free and paid accounts have different limits.\n\nFor more information about inserting features, read Creating features in the Google Maps Engine developer's guide.",
  11783. // "httpMethod": "POST",
  11784. // "id": "mapsengine.tables.features.batchInsert",
  11785. // "parameterOrder": [
  11786. // "id"
  11787. // ],
  11788. // "parameters": {
  11789. // "id": {
  11790. // "description": "The ID of the table to append the features to.",
  11791. // "location": "path",
  11792. // "required": true,
  11793. // "type": "string"
  11794. // }
  11795. // },
  11796. // "path": "tables/{id}/features/batchInsert",
  11797. // "request": {
  11798. // "$ref": "FeaturesBatchInsertRequest"
  11799. // },
  11800. // "scopes": [
  11801. // "https://www.googleapis.com/auth/mapsengine"
  11802. // ]
  11803. // }
  11804. }
  11805. // method id "mapsengine.tables.features.batchPatch":
  11806. type TablesFeaturesBatchPatchCall struct {
  11807. s *Service
  11808. id string
  11809. featuresbatchpatchrequest *FeaturesBatchPatchRequest
  11810. urlParams_ gensupport.URLParams
  11811. ctx_ context.Context
  11812. }
  11813. // BatchPatch: Update the supplied features.
  11814. //
  11815. // A single batchPatch request can update:
  11816. //
  11817. // - Up to 50 features.
  11818. // - A combined total of 10 000 vertices.
  11819. // Feature limits are documented in the Supported data formats and
  11820. // limits article of the Google Maps Engine help center. Note that free
  11821. // and paid accounts have different limits.
  11822. //
  11823. // Feature updates use HTTP PATCH semantics:
  11824. //
  11825. // - A supplied value replaces an existing value (if any) in that
  11826. // field.
  11827. // - Omitted fields remain unchanged.
  11828. // - Complex values in geometries and properties must be replaced as
  11829. // atomic units. For example, providing just the coordinates of a
  11830. // geometry is not allowed; the complete geometry, including type, must
  11831. // be supplied.
  11832. // - Setting a property's value to null deletes that property.
  11833. // For more information about updating features, read Updating features
  11834. // in the Google Maps Engine developer's guide.
  11835. func (r *TablesFeaturesService) BatchPatch(id string, featuresbatchpatchrequest *FeaturesBatchPatchRequest) *TablesFeaturesBatchPatchCall {
  11836. c := &TablesFeaturesBatchPatchCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  11837. c.id = id
  11838. c.featuresbatchpatchrequest = featuresbatchpatchrequest
  11839. return c
  11840. }
  11841. // Fields allows partial responses to be retrieved. See
  11842. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  11843. // for more information.
  11844. func (c *TablesFeaturesBatchPatchCall) Fields(s ...googleapi.Field) *TablesFeaturesBatchPatchCall {
  11845. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  11846. return c
  11847. }
  11848. // Context sets the context to be used in this call's Do method. Any
  11849. // pending HTTP request will be aborted if the provided context is
  11850. // canceled.
  11851. func (c *TablesFeaturesBatchPatchCall) Context(ctx context.Context) *TablesFeaturesBatchPatchCall {
  11852. c.ctx_ = ctx
  11853. return c
  11854. }
  11855. func (c *TablesFeaturesBatchPatchCall) doRequest(alt string) (*http.Response, error) {
  11856. var body io.Reader = nil
  11857. body, err := googleapi.WithoutDataWrapper.JSONReader(c.featuresbatchpatchrequest)
  11858. if err != nil {
  11859. return nil, err
  11860. }
  11861. ctype := "application/json"
  11862. c.urlParams_.Set("alt", alt)
  11863. urls := googleapi.ResolveRelative(c.s.BasePath, "tables/{id}/features/batchPatch")
  11864. urls += "?" + c.urlParams_.Encode()
  11865. req, _ := http.NewRequest("POST", urls, body)
  11866. googleapi.Expand(req.URL, map[string]string{
  11867. "id": c.id,
  11868. })
  11869. req.Header.Set("Content-Type", ctype)
  11870. req.Header.Set("User-Agent", c.s.userAgent())
  11871. if c.ctx_ != nil {
  11872. return ctxhttp.Do(c.ctx_, c.s.client, req)
  11873. }
  11874. return c.s.client.Do(req)
  11875. }
  11876. // Do executes the "mapsengine.tables.features.batchPatch" call.
  11877. func (c *TablesFeaturesBatchPatchCall) Do(opts ...googleapi.CallOption) error {
  11878. gensupport.SetOptions(c.urlParams_, opts...)
  11879. res, err := c.doRequest("json")
  11880. if err != nil {
  11881. return err
  11882. }
  11883. defer googleapi.CloseBody(res)
  11884. if err := googleapi.CheckResponse(res); err != nil {
  11885. return err
  11886. }
  11887. return nil
  11888. // {
  11889. // "description": "Update the supplied features.\n\nA single batchPatch request can update:\n\n- Up to 50 features.\n- A combined total of 10 000 vertices.\nFeature limits are documented in the Supported data formats and limits article of the Google Maps Engine help center. Note that free and paid accounts have different limits.\n\nFeature updates use HTTP PATCH semantics:\n\n- A supplied value replaces an existing value (if any) in that field.\n- Omitted fields remain unchanged.\n- Complex values in geometries and properties must be replaced as atomic units. For example, providing just the coordinates of a geometry is not allowed; the complete geometry, including type, must be supplied.\n- Setting a property's value to null deletes that property.\nFor more information about updating features, read Updating features in the Google Maps Engine developer's guide.",
  11890. // "httpMethod": "POST",
  11891. // "id": "mapsengine.tables.features.batchPatch",
  11892. // "parameterOrder": [
  11893. // "id"
  11894. // ],
  11895. // "parameters": {
  11896. // "id": {
  11897. // "description": "The ID of the table containing the features to be patched.",
  11898. // "location": "path",
  11899. // "required": true,
  11900. // "type": "string"
  11901. // }
  11902. // },
  11903. // "path": "tables/{id}/features/batchPatch",
  11904. // "request": {
  11905. // "$ref": "FeaturesBatchPatchRequest"
  11906. // },
  11907. // "scopes": [
  11908. // "https://www.googleapis.com/auth/mapsengine"
  11909. // ]
  11910. // }
  11911. }
  11912. // method id "mapsengine.tables.features.get":
  11913. type TablesFeaturesGetCall struct {
  11914. s *Service
  11915. tableId string
  11916. id string
  11917. urlParams_ gensupport.URLParams
  11918. ifNoneMatch_ string
  11919. ctx_ context.Context
  11920. }
  11921. // Get: Return a single feature, given its ID.
  11922. func (r *TablesFeaturesService) Get(tableId string, id string) *TablesFeaturesGetCall {
  11923. c := &TablesFeaturesGetCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  11924. c.tableId = tableId
  11925. c.id = id
  11926. return c
  11927. }
  11928. // Select sets the optional parameter "select": A SQL-like projection
  11929. // clause used to specify returned properties. If this parameter is not
  11930. // included, all properties are returned.
  11931. func (c *TablesFeaturesGetCall) Select(select_ string) *TablesFeaturesGetCall {
  11932. c.urlParams_.Set("select", select_)
  11933. return c
  11934. }
  11935. // Version sets the optional parameter "version": The table version to
  11936. // access. See Accessing Public Data for information.
  11937. //
  11938. // Possible values:
  11939. // "draft" - The draft version.
  11940. // "published" - The published version.
  11941. func (c *TablesFeaturesGetCall) Version(version string) *TablesFeaturesGetCall {
  11942. c.urlParams_.Set("version", version)
  11943. return c
  11944. }
  11945. // Fields allows partial responses to be retrieved. See
  11946. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  11947. // for more information.
  11948. func (c *TablesFeaturesGetCall) Fields(s ...googleapi.Field) *TablesFeaturesGetCall {
  11949. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  11950. return c
  11951. }
  11952. // IfNoneMatch sets the optional parameter which makes the operation
  11953. // fail if the object's ETag matches the given value. This is useful for
  11954. // getting updates only after the object has changed since the last
  11955. // request. Use googleapi.IsNotModified to check whether the response
  11956. // error from Do is the result of In-None-Match.
  11957. func (c *TablesFeaturesGetCall) IfNoneMatch(entityTag string) *TablesFeaturesGetCall {
  11958. c.ifNoneMatch_ = entityTag
  11959. return c
  11960. }
  11961. // Context sets the context to be used in this call's Do method. Any
  11962. // pending HTTP request will be aborted if the provided context is
  11963. // canceled.
  11964. func (c *TablesFeaturesGetCall) Context(ctx context.Context) *TablesFeaturesGetCall {
  11965. c.ctx_ = ctx
  11966. return c
  11967. }
  11968. func (c *TablesFeaturesGetCall) doRequest(alt string) (*http.Response, error) {
  11969. var body io.Reader = nil
  11970. c.urlParams_.Set("alt", alt)
  11971. urls := googleapi.ResolveRelative(c.s.BasePath, "tables/{tableId}/features/{id}")
  11972. urls += "?" + c.urlParams_.Encode()
  11973. req, _ := http.NewRequest("GET", urls, body)
  11974. googleapi.Expand(req.URL, map[string]string{
  11975. "tableId": c.tableId,
  11976. "id": c.id,
  11977. })
  11978. req.Header.Set("User-Agent", c.s.userAgent())
  11979. if c.ifNoneMatch_ != "" {
  11980. req.Header.Set("If-None-Match", c.ifNoneMatch_)
  11981. }
  11982. if c.ctx_ != nil {
  11983. return ctxhttp.Do(c.ctx_, c.s.client, req)
  11984. }
  11985. return c.s.client.Do(req)
  11986. }
  11987. // Do executes the "mapsengine.tables.features.get" call.
  11988. // Exactly one of *Feature or error will be non-nil. Any non-2xx status
  11989. // code is an error. Response headers are in either
  11990. // *Feature.ServerResponse.Header or (if a response was returned at all)
  11991. // in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to
  11992. // check whether the returned error was because http.StatusNotModified
  11993. // was returned.
  11994. func (c *TablesFeaturesGetCall) Do(opts ...googleapi.CallOption) (*Feature, error) {
  11995. gensupport.SetOptions(c.urlParams_, opts...)
  11996. res, err := c.doRequest("json")
  11997. if res != nil && res.StatusCode == http.StatusNotModified {
  11998. if res.Body != nil {
  11999. res.Body.Close()
  12000. }
  12001. return nil, &googleapi.Error{
  12002. Code: res.StatusCode,
  12003. Header: res.Header,
  12004. }
  12005. }
  12006. if err != nil {
  12007. return nil, err
  12008. }
  12009. defer googleapi.CloseBody(res)
  12010. if err := googleapi.CheckResponse(res); err != nil {
  12011. return nil, err
  12012. }
  12013. ret := &Feature{
  12014. ServerResponse: googleapi.ServerResponse{
  12015. Header: res.Header,
  12016. HTTPStatusCode: res.StatusCode,
  12017. },
  12018. }
  12019. if err := json.NewDecoder(res.Body).Decode(&ret); err != nil {
  12020. return nil, err
  12021. }
  12022. return ret, nil
  12023. // {
  12024. // "description": "Return a single feature, given its ID.",
  12025. // "httpMethod": "GET",
  12026. // "id": "mapsengine.tables.features.get",
  12027. // "parameterOrder": [
  12028. // "tableId",
  12029. // "id"
  12030. // ],
  12031. // "parameters": {
  12032. // "id": {
  12033. // "description": "The ID of the feature to get.",
  12034. // "location": "path",
  12035. // "required": true,
  12036. // "type": "string"
  12037. // },
  12038. // "select": {
  12039. // "description": "A SQL-like projection clause used to specify returned properties. If this parameter is not included, all properties are returned.",
  12040. // "location": "query",
  12041. // "type": "string"
  12042. // },
  12043. // "tableId": {
  12044. // "description": "The ID of the table.",
  12045. // "location": "path",
  12046. // "required": true,
  12047. // "type": "string"
  12048. // },
  12049. // "version": {
  12050. // "description": "The table version to access. See Accessing Public Data for information.",
  12051. // "enum": [
  12052. // "draft",
  12053. // "published"
  12054. // ],
  12055. // "enumDescriptions": [
  12056. // "The draft version.",
  12057. // "The published version."
  12058. // ],
  12059. // "location": "query",
  12060. // "type": "string"
  12061. // }
  12062. // },
  12063. // "path": "tables/{tableId}/features/{id}",
  12064. // "response": {
  12065. // "$ref": "Feature"
  12066. // },
  12067. // "scopes": [
  12068. // "https://www.googleapis.com/auth/mapsengine",
  12069. // "https://www.googleapis.com/auth/mapsengine.readonly"
  12070. // ]
  12071. // }
  12072. }
  12073. // method id "mapsengine.tables.features.list":
  12074. type TablesFeaturesListCall struct {
  12075. s *Service
  12076. id string
  12077. urlParams_ gensupport.URLParams
  12078. ifNoneMatch_ string
  12079. ctx_ context.Context
  12080. }
  12081. // List: Return all features readable by the current user.
  12082. func (r *TablesFeaturesService) List(id string) *TablesFeaturesListCall {
  12083. c := &TablesFeaturesListCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  12084. c.id = id
  12085. return c
  12086. }
  12087. // Include sets the optional parameter "include": A comma separated list
  12088. // of optional data to include. Optional data available: schema.
  12089. func (c *TablesFeaturesListCall) Include(include string) *TablesFeaturesListCall {
  12090. c.urlParams_.Set("include", include)
  12091. return c
  12092. }
  12093. // Intersects sets the optional parameter "intersects": A geometry
  12094. // literal that specifies the spatial restriction of the query.
  12095. func (c *TablesFeaturesListCall) Intersects(intersects string) *TablesFeaturesListCall {
  12096. c.urlParams_.Set("intersects", intersects)
  12097. return c
  12098. }
  12099. // Limit sets the optional parameter "limit": The total number of
  12100. // features to return from the query, irrespective of the number of
  12101. // pages.
  12102. func (c *TablesFeaturesListCall) Limit(limit int64) *TablesFeaturesListCall {
  12103. c.urlParams_.Set("limit", fmt.Sprint(limit))
  12104. return c
  12105. }
  12106. // MaxResults sets the optional parameter "maxResults": The maximum
  12107. // number of items to include in the response, used for paging. The
  12108. // maximum supported value is 1000.
  12109. func (c *TablesFeaturesListCall) MaxResults(maxResults int64) *TablesFeaturesListCall {
  12110. c.urlParams_.Set("maxResults", fmt.Sprint(maxResults))
  12111. return c
  12112. }
  12113. // OrderBy sets the optional parameter "orderBy": An SQL-like order by
  12114. // clause used to sort results. If this parameter is not included, the
  12115. // order of features is undefined.
  12116. func (c *TablesFeaturesListCall) OrderBy(orderBy string) *TablesFeaturesListCall {
  12117. c.urlParams_.Set("orderBy", orderBy)
  12118. return c
  12119. }
  12120. // PageToken sets the optional parameter "pageToken": The continuation
  12121. // token, used to page through large result sets. To get the next page
  12122. // of results, set this parameter to the value of nextPageToken from the
  12123. // previous response.
  12124. func (c *TablesFeaturesListCall) PageToken(pageToken string) *TablesFeaturesListCall {
  12125. c.urlParams_.Set("pageToken", pageToken)
  12126. return c
  12127. }
  12128. // Select sets the optional parameter "select": A SQL-like projection
  12129. // clause used to specify returned properties. If this parameter is not
  12130. // included, all properties are returned.
  12131. func (c *TablesFeaturesListCall) Select(select_ string) *TablesFeaturesListCall {
  12132. c.urlParams_.Set("select", select_)
  12133. return c
  12134. }
  12135. // Version sets the optional parameter "version": The table version to
  12136. // access. See Accessing Public Data for information.
  12137. //
  12138. // Possible values:
  12139. // "draft" - The draft version.
  12140. // "published" - The published version.
  12141. func (c *TablesFeaturesListCall) Version(version string) *TablesFeaturesListCall {
  12142. c.urlParams_.Set("version", version)
  12143. return c
  12144. }
  12145. // Where sets the optional parameter "where": An SQL-like predicate used
  12146. // to filter results.
  12147. func (c *TablesFeaturesListCall) Where(where string) *TablesFeaturesListCall {
  12148. c.urlParams_.Set("where", where)
  12149. return c
  12150. }
  12151. // Fields allows partial responses to be retrieved. See
  12152. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  12153. // for more information.
  12154. func (c *TablesFeaturesListCall) Fields(s ...googleapi.Field) *TablesFeaturesListCall {
  12155. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  12156. return c
  12157. }
  12158. // IfNoneMatch sets the optional parameter which makes the operation
  12159. // fail if the object's ETag matches the given value. This is useful for
  12160. // getting updates only after the object has changed since the last
  12161. // request. Use googleapi.IsNotModified to check whether the response
  12162. // error from Do is the result of In-None-Match.
  12163. func (c *TablesFeaturesListCall) IfNoneMatch(entityTag string) *TablesFeaturesListCall {
  12164. c.ifNoneMatch_ = entityTag
  12165. return c
  12166. }
  12167. // Context sets the context to be used in this call's Do method. Any
  12168. // pending HTTP request will be aborted if the provided context is
  12169. // canceled.
  12170. func (c *TablesFeaturesListCall) Context(ctx context.Context) *TablesFeaturesListCall {
  12171. c.ctx_ = ctx
  12172. return c
  12173. }
  12174. func (c *TablesFeaturesListCall) doRequest(alt string) (*http.Response, error) {
  12175. var body io.Reader = nil
  12176. c.urlParams_.Set("alt", alt)
  12177. urls := googleapi.ResolveRelative(c.s.BasePath, "tables/{id}/features")
  12178. urls += "?" + c.urlParams_.Encode()
  12179. req, _ := http.NewRequest("GET", urls, body)
  12180. googleapi.Expand(req.URL, map[string]string{
  12181. "id": c.id,
  12182. })
  12183. req.Header.Set("User-Agent", c.s.userAgent())
  12184. if c.ifNoneMatch_ != "" {
  12185. req.Header.Set("If-None-Match", c.ifNoneMatch_)
  12186. }
  12187. if c.ctx_ != nil {
  12188. return ctxhttp.Do(c.ctx_, c.s.client, req)
  12189. }
  12190. return c.s.client.Do(req)
  12191. }
  12192. // Do executes the "mapsengine.tables.features.list" call.
  12193. // Exactly one of *FeaturesListResponse or error will be non-nil. Any
  12194. // non-2xx status code is an error. Response headers are in either
  12195. // *FeaturesListResponse.ServerResponse.Header or (if a response was
  12196. // returned at all) in error.(*googleapi.Error).Header. Use
  12197. // googleapi.IsNotModified to check whether the returned error was
  12198. // because http.StatusNotModified was returned.
  12199. func (c *TablesFeaturesListCall) Do(opts ...googleapi.CallOption) (*FeaturesListResponse, error) {
  12200. gensupport.SetOptions(c.urlParams_, opts...)
  12201. res, err := c.doRequest("json")
  12202. if res != nil && res.StatusCode == http.StatusNotModified {
  12203. if res.Body != nil {
  12204. res.Body.Close()
  12205. }
  12206. return nil, &googleapi.Error{
  12207. Code: res.StatusCode,
  12208. Header: res.Header,
  12209. }
  12210. }
  12211. if err != nil {
  12212. return nil, err
  12213. }
  12214. defer googleapi.CloseBody(res)
  12215. if err := googleapi.CheckResponse(res); err != nil {
  12216. return nil, err
  12217. }
  12218. ret := &FeaturesListResponse{
  12219. ServerResponse: googleapi.ServerResponse{
  12220. Header: res.Header,
  12221. HTTPStatusCode: res.StatusCode,
  12222. },
  12223. }
  12224. if err := json.NewDecoder(res.Body).Decode(&ret); err != nil {
  12225. return nil, err
  12226. }
  12227. return ret, nil
  12228. // {
  12229. // "description": "Return all features readable by the current user.",
  12230. // "httpMethod": "GET",
  12231. // "id": "mapsengine.tables.features.list",
  12232. // "parameterOrder": [
  12233. // "id"
  12234. // ],
  12235. // "parameters": {
  12236. // "id": {
  12237. // "description": "The ID of the table to which these features belong.",
  12238. // "location": "path",
  12239. // "required": true,
  12240. // "type": "string"
  12241. // },
  12242. // "include": {
  12243. // "description": "A comma separated list of optional data to include. Optional data available: schema.",
  12244. // "location": "query",
  12245. // "type": "string"
  12246. // },
  12247. // "intersects": {
  12248. // "description": "A geometry literal that specifies the spatial restriction of the query.",
  12249. // "location": "query",
  12250. // "type": "string"
  12251. // },
  12252. // "limit": {
  12253. // "description": "The total number of features to return from the query, irrespective of the number of pages.",
  12254. // "format": "uint32",
  12255. // "location": "query",
  12256. // "type": "integer"
  12257. // },
  12258. // "maxResults": {
  12259. // "description": "The maximum number of items to include in the response, used for paging. The maximum supported value is 1000.",
  12260. // "format": "uint32",
  12261. // "location": "query",
  12262. // "type": "integer"
  12263. // },
  12264. // "orderBy": {
  12265. // "description": "An SQL-like order by clause used to sort results. If this parameter is not included, the order of features is undefined.",
  12266. // "location": "query",
  12267. // "type": "string"
  12268. // },
  12269. // "pageToken": {
  12270. // "description": "The continuation token, used to page through large result sets. To get the next page of results, set this parameter to the value of nextPageToken from the previous response.",
  12271. // "location": "query",
  12272. // "type": "string"
  12273. // },
  12274. // "select": {
  12275. // "description": "A SQL-like projection clause used to specify returned properties. If this parameter is not included, all properties are returned.",
  12276. // "location": "query",
  12277. // "type": "string"
  12278. // },
  12279. // "version": {
  12280. // "description": "The table version to access. See Accessing Public Data for information.",
  12281. // "enum": [
  12282. // "draft",
  12283. // "published"
  12284. // ],
  12285. // "enumDescriptions": [
  12286. // "The draft version.",
  12287. // "The published version."
  12288. // ],
  12289. // "location": "query",
  12290. // "type": "string"
  12291. // },
  12292. // "where": {
  12293. // "description": "An SQL-like predicate used to filter results.",
  12294. // "location": "query",
  12295. // "type": "string"
  12296. // }
  12297. // },
  12298. // "path": "tables/{id}/features",
  12299. // "response": {
  12300. // "$ref": "FeaturesListResponse"
  12301. // },
  12302. // "scopes": [
  12303. // "https://www.googleapis.com/auth/mapsengine",
  12304. // "https://www.googleapis.com/auth/mapsengine.readonly"
  12305. // ]
  12306. // }
  12307. }
  12308. // Pages invokes f for each page of results.
  12309. // A non-nil error returned from f will halt the iteration.
  12310. // The provided context supersedes any context provided to the Context method.
  12311. func (c *TablesFeaturesListCall) Pages(ctx context.Context, f func(*FeaturesListResponse) error) error {
  12312. c.ctx_ = ctx
  12313. defer c.PageToken(c.urlParams_.Get("pageToken")) // reset paging to original point
  12314. for {
  12315. x, err := c.Do()
  12316. if err != nil {
  12317. return err
  12318. }
  12319. if err := f(x); err != nil {
  12320. return err
  12321. }
  12322. if x.NextPageToken == "" {
  12323. return nil
  12324. }
  12325. c.PageToken(x.NextPageToken)
  12326. }
  12327. }
  12328. // method id "mapsengine.tables.files.insert":
  12329. type TablesFilesInsertCall struct {
  12330. s *Service
  12331. id string
  12332. urlParams_ gensupport.URLParams
  12333. media_ io.Reader
  12334. resumableBuffer_ *gensupport.ResumableBuffer
  12335. mediaType_ string
  12336. mediaSize_ int64 // mediaSize, if known. Used only for calls to progressUpdater_.
  12337. progressUpdater_ googleapi.ProgressUpdater
  12338. ctx_ context.Context
  12339. }
  12340. // Insert: Upload a file to a placeholder table asset. See Table Upload
  12341. // in the Developer's Guide for more information.
  12342. // Supported file types are listed in the Supported data formats and
  12343. // limits article of the Google Maps Engine help center.
  12344. func (r *TablesFilesService) Insert(id string, filename string) *TablesFilesInsertCall {
  12345. c := &TablesFilesInsertCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  12346. c.id = id
  12347. c.urlParams_.Set("filename", filename)
  12348. return c
  12349. }
  12350. // Media specifies the media to upload in one or more chunks. The chunk
  12351. // size may be controlled by supplying a MediaOption generated by
  12352. // googleapi.ChunkSize. The chunk size defaults to
  12353. // googleapi.DefaultUploadChunkSize.
  12354. // At most one of Media and ResumableMedia may be set.
  12355. func (c *TablesFilesInsertCall) Media(r io.Reader, options ...googleapi.MediaOption) *TablesFilesInsertCall {
  12356. opts := googleapi.ProcessMediaOptions(options)
  12357. chunkSize := opts.ChunkSize
  12358. r, c.mediaType_ = gensupport.DetermineContentType(r, opts.ContentType)
  12359. c.media_, c.resumableBuffer_ = gensupport.PrepareUpload(r, chunkSize)
  12360. return c
  12361. }
  12362. // ResumableMedia specifies the media to upload in chunks and can be
  12363. // canceled with ctx.
  12364. //
  12365. // Deprecated: use Media instead.
  12366. //
  12367. // At most one of Media and ResumableMedia may be set. mediaType
  12368. // identifies the MIME media type of the upload, such as "image/png". If
  12369. // mediaType is "", it will be auto-detected. The provided ctx will
  12370. // supersede any context previously provided to the Context method.
  12371. func (c *TablesFilesInsertCall) ResumableMedia(ctx context.Context, r io.ReaderAt, size int64, mediaType string) *TablesFilesInsertCall {
  12372. c.ctx_ = ctx
  12373. rdr := gensupport.ReaderAtToReader(r, size)
  12374. rdr, c.mediaType_ = gensupport.DetermineContentType(rdr, mediaType)
  12375. c.resumableBuffer_ = gensupport.NewResumableBuffer(rdr, googleapi.DefaultUploadChunkSize)
  12376. c.media_ = nil
  12377. c.mediaSize_ = size
  12378. return c
  12379. }
  12380. // ProgressUpdater provides a callback function that will be called
  12381. // after every chunk. It should be a low-latency function in order to
  12382. // not slow down the upload operation. This should only be called when
  12383. // using ResumableMedia (as opposed to Media).
  12384. func (c *TablesFilesInsertCall) ProgressUpdater(pu googleapi.ProgressUpdater) *TablesFilesInsertCall {
  12385. c.progressUpdater_ = pu
  12386. return c
  12387. }
  12388. // Fields allows partial responses to be retrieved. See
  12389. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  12390. // for more information.
  12391. func (c *TablesFilesInsertCall) Fields(s ...googleapi.Field) *TablesFilesInsertCall {
  12392. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  12393. return c
  12394. }
  12395. // Context sets the context to be used in this call's Do method. Any
  12396. // pending HTTP request will be aborted if the provided context is
  12397. // canceled.
  12398. // This context will supersede any context previously provided to the
  12399. // ResumableMedia method.
  12400. func (c *TablesFilesInsertCall) Context(ctx context.Context) *TablesFilesInsertCall {
  12401. c.ctx_ = ctx
  12402. return c
  12403. }
  12404. func (c *TablesFilesInsertCall) doRequest(alt string) (*http.Response, error) {
  12405. var body io.Reader = nil
  12406. c.urlParams_.Set("alt", alt)
  12407. urls := googleapi.ResolveRelative(c.s.BasePath, "tables/{id}/files")
  12408. if c.media_ != nil || c.resumableBuffer_ != nil {
  12409. urls = strings.Replace(urls, "https://www.googleapis.com/", "https://www.googleapis.com/upload/", 1)
  12410. protocol := "multipart"
  12411. if c.resumableBuffer_ != nil {
  12412. protocol = "resumable"
  12413. }
  12414. c.urlParams_.Set("uploadType", protocol)
  12415. }
  12416. urls += "?" + c.urlParams_.Encode()
  12417. body = new(bytes.Buffer)
  12418. ctype := "application/json"
  12419. if c.media_ != nil {
  12420. var combined io.ReadCloser
  12421. combined, ctype = gensupport.CombineBodyMedia(body, ctype, c.media_, c.mediaType_)
  12422. defer combined.Close()
  12423. body = combined
  12424. }
  12425. req, _ := http.NewRequest("POST", urls, body)
  12426. googleapi.Expand(req.URL, map[string]string{
  12427. "id": c.id,
  12428. })
  12429. if c.resumableBuffer_ != nil {
  12430. req.Header.Set("X-Upload-Content-Type", c.mediaType_)
  12431. }
  12432. req.Header.Set("Content-Type", ctype)
  12433. req.Header.Set("User-Agent", c.s.userAgent())
  12434. if c.ctx_ != nil {
  12435. return ctxhttp.Do(c.ctx_, c.s.client, req)
  12436. }
  12437. return c.s.client.Do(req)
  12438. }
  12439. // Do executes the "mapsengine.tables.files.insert" call.
  12440. func (c *TablesFilesInsertCall) Do(opts ...googleapi.CallOption) error {
  12441. gensupport.SetOptions(c.urlParams_, opts...)
  12442. res, err := gensupport.Retry(c.ctx_, func() (*http.Response, error) {
  12443. return c.doRequest("json")
  12444. }, gensupport.DefaultBackoffStrategy())
  12445. if err != nil {
  12446. return err
  12447. }
  12448. defer googleapi.CloseBody(res)
  12449. if err := googleapi.CheckResponse(res); err != nil {
  12450. return err
  12451. }
  12452. if c.resumableBuffer_ != nil {
  12453. loc := res.Header.Get("Location")
  12454. rx := &gensupport.ResumableUpload{
  12455. Client: c.s.client,
  12456. UserAgent: c.s.userAgent(),
  12457. URI: loc,
  12458. Media: c.resumableBuffer_,
  12459. MediaType: c.mediaType_,
  12460. Callback: func(curr int64) {
  12461. if c.progressUpdater_ != nil {
  12462. c.progressUpdater_(curr, c.mediaSize_)
  12463. }
  12464. },
  12465. }
  12466. ctx := c.ctx_
  12467. if ctx == nil {
  12468. ctx = context.TODO()
  12469. }
  12470. res, err = rx.Upload(ctx)
  12471. if err != nil {
  12472. return err
  12473. }
  12474. defer res.Body.Close()
  12475. if err := googleapi.CheckResponse(res); err != nil {
  12476. return err
  12477. }
  12478. }
  12479. return nil
  12480. // {
  12481. // "description": "Upload a file to a placeholder table asset. See Table Upload in the Developer's Guide for more information.\nSupported file types are listed in the Supported data formats and limits article of the Google Maps Engine help center.",
  12482. // "httpMethod": "POST",
  12483. // "id": "mapsengine.tables.files.insert",
  12484. // "mediaUpload": {
  12485. // "accept": [
  12486. // "*/*"
  12487. // ],
  12488. // "maxSize": "1GB",
  12489. // "protocols": {
  12490. // "resumable": {
  12491. // "multipart": true,
  12492. // "path": "/resumable/upload/mapsengine/v1/tables/{id}/files"
  12493. // },
  12494. // "simple": {
  12495. // "multipart": true,
  12496. // "path": "/upload/mapsengine/v1/tables/{id}/files"
  12497. // }
  12498. // }
  12499. // },
  12500. // "parameterOrder": [
  12501. // "id",
  12502. // "filename"
  12503. // ],
  12504. // "parameters": {
  12505. // "filename": {
  12506. // "description": "The file name of this uploaded file.",
  12507. // "location": "query",
  12508. // "required": true,
  12509. // "type": "string"
  12510. // },
  12511. // "id": {
  12512. // "description": "The ID of the table asset.",
  12513. // "location": "path",
  12514. // "required": true,
  12515. // "type": "string"
  12516. // }
  12517. // },
  12518. // "path": "tables/{id}/files",
  12519. // "scopes": [
  12520. // "https://www.googleapis.com/auth/mapsengine"
  12521. // ],
  12522. // "supportsMediaUpload": true
  12523. // }
  12524. }
  12525. // method id "mapsengine.tables.parents.list":
  12526. type TablesParentsListCall struct {
  12527. s *Service
  12528. id string
  12529. urlParams_ gensupport.URLParams
  12530. ifNoneMatch_ string
  12531. ctx_ context.Context
  12532. }
  12533. // List: Return all parent ids of the specified table.
  12534. func (r *TablesParentsService) List(id string) *TablesParentsListCall {
  12535. c := &TablesParentsListCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  12536. c.id = id
  12537. return c
  12538. }
  12539. // MaxResults sets the optional parameter "maxResults": The maximum
  12540. // number of items to include in a single response page. The maximum
  12541. // supported value is 50.
  12542. func (c *TablesParentsListCall) MaxResults(maxResults int64) *TablesParentsListCall {
  12543. c.urlParams_.Set("maxResults", fmt.Sprint(maxResults))
  12544. return c
  12545. }
  12546. // PageToken sets the optional parameter "pageToken": The continuation
  12547. // token, used to page through large result sets. To get the next page
  12548. // of results, set this parameter to the value of nextPageToken from the
  12549. // previous response.
  12550. func (c *TablesParentsListCall) PageToken(pageToken string) *TablesParentsListCall {
  12551. c.urlParams_.Set("pageToken", pageToken)
  12552. return c
  12553. }
  12554. // Fields allows partial responses to be retrieved. See
  12555. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  12556. // for more information.
  12557. func (c *TablesParentsListCall) Fields(s ...googleapi.Field) *TablesParentsListCall {
  12558. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  12559. return c
  12560. }
  12561. // IfNoneMatch sets the optional parameter which makes the operation
  12562. // fail if the object's ETag matches the given value. This is useful for
  12563. // getting updates only after the object has changed since the last
  12564. // request. Use googleapi.IsNotModified to check whether the response
  12565. // error from Do is the result of In-None-Match.
  12566. func (c *TablesParentsListCall) IfNoneMatch(entityTag string) *TablesParentsListCall {
  12567. c.ifNoneMatch_ = entityTag
  12568. return c
  12569. }
  12570. // Context sets the context to be used in this call's Do method. Any
  12571. // pending HTTP request will be aborted if the provided context is
  12572. // canceled.
  12573. func (c *TablesParentsListCall) Context(ctx context.Context) *TablesParentsListCall {
  12574. c.ctx_ = ctx
  12575. return c
  12576. }
  12577. func (c *TablesParentsListCall) doRequest(alt string) (*http.Response, error) {
  12578. var body io.Reader = nil
  12579. c.urlParams_.Set("alt", alt)
  12580. urls := googleapi.ResolveRelative(c.s.BasePath, "tables/{id}/parents")
  12581. urls += "?" + c.urlParams_.Encode()
  12582. req, _ := http.NewRequest("GET", urls, body)
  12583. googleapi.Expand(req.URL, map[string]string{
  12584. "id": c.id,
  12585. })
  12586. req.Header.Set("User-Agent", c.s.userAgent())
  12587. if c.ifNoneMatch_ != "" {
  12588. req.Header.Set("If-None-Match", c.ifNoneMatch_)
  12589. }
  12590. if c.ctx_ != nil {
  12591. return ctxhttp.Do(c.ctx_, c.s.client, req)
  12592. }
  12593. return c.s.client.Do(req)
  12594. }
  12595. // Do executes the "mapsengine.tables.parents.list" call.
  12596. // Exactly one of *ParentsListResponse or error will be non-nil. Any
  12597. // non-2xx status code is an error. Response headers are in either
  12598. // *ParentsListResponse.ServerResponse.Header or (if a response was
  12599. // returned at all) in error.(*googleapi.Error).Header. Use
  12600. // googleapi.IsNotModified to check whether the returned error was
  12601. // because http.StatusNotModified was returned.
  12602. func (c *TablesParentsListCall) Do(opts ...googleapi.CallOption) (*ParentsListResponse, error) {
  12603. gensupport.SetOptions(c.urlParams_, opts...)
  12604. res, err := c.doRequest("json")
  12605. if res != nil && res.StatusCode == http.StatusNotModified {
  12606. if res.Body != nil {
  12607. res.Body.Close()
  12608. }
  12609. return nil, &googleapi.Error{
  12610. Code: res.StatusCode,
  12611. Header: res.Header,
  12612. }
  12613. }
  12614. if err != nil {
  12615. return nil, err
  12616. }
  12617. defer googleapi.CloseBody(res)
  12618. if err := googleapi.CheckResponse(res); err != nil {
  12619. return nil, err
  12620. }
  12621. ret := &ParentsListResponse{
  12622. ServerResponse: googleapi.ServerResponse{
  12623. Header: res.Header,
  12624. HTTPStatusCode: res.StatusCode,
  12625. },
  12626. }
  12627. if err := json.NewDecoder(res.Body).Decode(&ret); err != nil {
  12628. return nil, err
  12629. }
  12630. return ret, nil
  12631. // {
  12632. // "description": "Return all parent ids of the specified table.",
  12633. // "httpMethod": "GET",
  12634. // "id": "mapsengine.tables.parents.list",
  12635. // "parameterOrder": [
  12636. // "id"
  12637. // ],
  12638. // "parameters": {
  12639. // "id": {
  12640. // "description": "The ID of the table whose parents will be listed.",
  12641. // "location": "path",
  12642. // "required": true,
  12643. // "type": "string"
  12644. // },
  12645. // "maxResults": {
  12646. // "description": "The maximum number of items to include in a single response page. The maximum supported value is 50.",
  12647. // "format": "uint32",
  12648. // "location": "query",
  12649. // "type": "integer"
  12650. // },
  12651. // "pageToken": {
  12652. // "description": "The continuation token, used to page through large result sets. To get the next page of results, set this parameter to the value of nextPageToken from the previous response.",
  12653. // "location": "query",
  12654. // "type": "string"
  12655. // }
  12656. // },
  12657. // "path": "tables/{id}/parents",
  12658. // "response": {
  12659. // "$ref": "ParentsListResponse"
  12660. // },
  12661. // "scopes": [
  12662. // "https://www.googleapis.com/auth/mapsengine",
  12663. // "https://www.googleapis.com/auth/mapsengine.readonly"
  12664. // ]
  12665. // }
  12666. }
  12667. // Pages invokes f for each page of results.
  12668. // A non-nil error returned from f will halt the iteration.
  12669. // The provided context supersedes any context provided to the Context method.
  12670. func (c *TablesParentsListCall) Pages(ctx context.Context, f func(*ParentsListResponse) error) error {
  12671. c.ctx_ = ctx
  12672. defer c.PageToken(c.urlParams_.Get("pageToken")) // reset paging to original point
  12673. for {
  12674. x, err := c.Do()
  12675. if err != nil {
  12676. return err
  12677. }
  12678. if err := f(x); err != nil {
  12679. return err
  12680. }
  12681. if x.NextPageToken == "" {
  12682. return nil
  12683. }
  12684. c.PageToken(x.NextPageToken)
  12685. }
  12686. }
  12687. // method id "mapsengine.tables.permissions.batchDelete":
  12688. type TablesPermissionsBatchDeleteCall struct {
  12689. s *Service
  12690. id string
  12691. permissionsbatchdeleterequest *PermissionsBatchDeleteRequest
  12692. urlParams_ gensupport.URLParams
  12693. ctx_ context.Context
  12694. }
  12695. // BatchDelete: Remove permission entries from an already existing
  12696. // asset.
  12697. func (r *TablesPermissionsService) BatchDelete(id string, permissionsbatchdeleterequest *PermissionsBatchDeleteRequest) *TablesPermissionsBatchDeleteCall {
  12698. c := &TablesPermissionsBatchDeleteCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  12699. c.id = id
  12700. c.permissionsbatchdeleterequest = permissionsbatchdeleterequest
  12701. return c
  12702. }
  12703. // Fields allows partial responses to be retrieved. See
  12704. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  12705. // for more information.
  12706. func (c *TablesPermissionsBatchDeleteCall) Fields(s ...googleapi.Field) *TablesPermissionsBatchDeleteCall {
  12707. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  12708. return c
  12709. }
  12710. // Context sets the context to be used in this call's Do method. Any
  12711. // pending HTTP request will be aborted if the provided context is
  12712. // canceled.
  12713. func (c *TablesPermissionsBatchDeleteCall) Context(ctx context.Context) *TablesPermissionsBatchDeleteCall {
  12714. c.ctx_ = ctx
  12715. return c
  12716. }
  12717. func (c *TablesPermissionsBatchDeleteCall) doRequest(alt string) (*http.Response, error) {
  12718. var body io.Reader = nil
  12719. body, err := googleapi.WithoutDataWrapper.JSONReader(c.permissionsbatchdeleterequest)
  12720. if err != nil {
  12721. return nil, err
  12722. }
  12723. ctype := "application/json"
  12724. c.urlParams_.Set("alt", alt)
  12725. urls := googleapi.ResolveRelative(c.s.BasePath, "tables/{id}/permissions/batchDelete")
  12726. urls += "?" + c.urlParams_.Encode()
  12727. req, _ := http.NewRequest("POST", urls, body)
  12728. googleapi.Expand(req.URL, map[string]string{
  12729. "id": c.id,
  12730. })
  12731. req.Header.Set("Content-Type", ctype)
  12732. req.Header.Set("User-Agent", c.s.userAgent())
  12733. if c.ctx_ != nil {
  12734. return ctxhttp.Do(c.ctx_, c.s.client, req)
  12735. }
  12736. return c.s.client.Do(req)
  12737. }
  12738. // Do executes the "mapsengine.tables.permissions.batchDelete" call.
  12739. // Exactly one of *PermissionsBatchDeleteResponse or error will be
  12740. // non-nil. Any non-2xx status code is an error. Response headers are in
  12741. // either *PermissionsBatchDeleteResponse.ServerResponse.Header or (if a
  12742. // response was returned at all) in error.(*googleapi.Error).Header. Use
  12743. // googleapi.IsNotModified to check whether the returned error was
  12744. // because http.StatusNotModified was returned.
  12745. func (c *TablesPermissionsBatchDeleteCall) Do(opts ...googleapi.CallOption) (*PermissionsBatchDeleteResponse, error) {
  12746. gensupport.SetOptions(c.urlParams_, opts...)
  12747. res, err := c.doRequest("json")
  12748. if res != nil && res.StatusCode == http.StatusNotModified {
  12749. if res.Body != nil {
  12750. res.Body.Close()
  12751. }
  12752. return nil, &googleapi.Error{
  12753. Code: res.StatusCode,
  12754. Header: res.Header,
  12755. }
  12756. }
  12757. if err != nil {
  12758. return nil, err
  12759. }
  12760. defer googleapi.CloseBody(res)
  12761. if err := googleapi.CheckResponse(res); err != nil {
  12762. return nil, err
  12763. }
  12764. ret := &PermissionsBatchDeleteResponse{
  12765. ServerResponse: googleapi.ServerResponse{
  12766. Header: res.Header,
  12767. HTTPStatusCode: res.StatusCode,
  12768. },
  12769. }
  12770. if err := json.NewDecoder(res.Body).Decode(&ret); err != nil {
  12771. return nil, err
  12772. }
  12773. return ret, nil
  12774. // {
  12775. // "description": "Remove permission entries from an already existing asset.",
  12776. // "httpMethod": "POST",
  12777. // "id": "mapsengine.tables.permissions.batchDelete",
  12778. // "parameterOrder": [
  12779. // "id"
  12780. // ],
  12781. // "parameters": {
  12782. // "id": {
  12783. // "description": "The ID of the asset from which permissions will be removed.",
  12784. // "location": "path",
  12785. // "required": true,
  12786. // "type": "string"
  12787. // }
  12788. // },
  12789. // "path": "tables/{id}/permissions/batchDelete",
  12790. // "request": {
  12791. // "$ref": "PermissionsBatchDeleteRequest"
  12792. // },
  12793. // "response": {
  12794. // "$ref": "PermissionsBatchDeleteResponse"
  12795. // },
  12796. // "scopes": [
  12797. // "https://www.googleapis.com/auth/mapsengine"
  12798. // ]
  12799. // }
  12800. }
  12801. // method id "mapsengine.tables.permissions.batchUpdate":
  12802. type TablesPermissionsBatchUpdateCall struct {
  12803. s *Service
  12804. id string
  12805. permissionsbatchupdaterequest *PermissionsBatchUpdateRequest
  12806. urlParams_ gensupport.URLParams
  12807. ctx_ context.Context
  12808. }
  12809. // BatchUpdate: Add or update permission entries to an already existing
  12810. // asset.
  12811. //
  12812. // An asset can hold up to 20 different permission entries. Each
  12813. // batchInsert request is atomic.
  12814. func (r *TablesPermissionsService) BatchUpdate(id string, permissionsbatchupdaterequest *PermissionsBatchUpdateRequest) *TablesPermissionsBatchUpdateCall {
  12815. c := &TablesPermissionsBatchUpdateCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  12816. c.id = id
  12817. c.permissionsbatchupdaterequest = permissionsbatchupdaterequest
  12818. return c
  12819. }
  12820. // Fields allows partial responses to be retrieved. See
  12821. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  12822. // for more information.
  12823. func (c *TablesPermissionsBatchUpdateCall) Fields(s ...googleapi.Field) *TablesPermissionsBatchUpdateCall {
  12824. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  12825. return c
  12826. }
  12827. // Context sets the context to be used in this call's Do method. Any
  12828. // pending HTTP request will be aborted if the provided context is
  12829. // canceled.
  12830. func (c *TablesPermissionsBatchUpdateCall) Context(ctx context.Context) *TablesPermissionsBatchUpdateCall {
  12831. c.ctx_ = ctx
  12832. return c
  12833. }
  12834. func (c *TablesPermissionsBatchUpdateCall) doRequest(alt string) (*http.Response, error) {
  12835. var body io.Reader = nil
  12836. body, err := googleapi.WithoutDataWrapper.JSONReader(c.permissionsbatchupdaterequest)
  12837. if err != nil {
  12838. return nil, err
  12839. }
  12840. ctype := "application/json"
  12841. c.urlParams_.Set("alt", alt)
  12842. urls := googleapi.ResolveRelative(c.s.BasePath, "tables/{id}/permissions/batchUpdate")
  12843. urls += "?" + c.urlParams_.Encode()
  12844. req, _ := http.NewRequest("POST", urls, body)
  12845. googleapi.Expand(req.URL, map[string]string{
  12846. "id": c.id,
  12847. })
  12848. req.Header.Set("Content-Type", ctype)
  12849. req.Header.Set("User-Agent", c.s.userAgent())
  12850. if c.ctx_ != nil {
  12851. return ctxhttp.Do(c.ctx_, c.s.client, req)
  12852. }
  12853. return c.s.client.Do(req)
  12854. }
  12855. // Do executes the "mapsengine.tables.permissions.batchUpdate" call.
  12856. // Exactly one of *PermissionsBatchUpdateResponse or error will be
  12857. // non-nil. Any non-2xx status code is an error. Response headers are in
  12858. // either *PermissionsBatchUpdateResponse.ServerResponse.Header or (if a
  12859. // response was returned at all) in error.(*googleapi.Error).Header. Use
  12860. // googleapi.IsNotModified to check whether the returned error was
  12861. // because http.StatusNotModified was returned.
  12862. func (c *TablesPermissionsBatchUpdateCall) Do(opts ...googleapi.CallOption) (*PermissionsBatchUpdateResponse, error) {
  12863. gensupport.SetOptions(c.urlParams_, opts...)
  12864. res, err := c.doRequest("json")
  12865. if res != nil && res.StatusCode == http.StatusNotModified {
  12866. if res.Body != nil {
  12867. res.Body.Close()
  12868. }
  12869. return nil, &googleapi.Error{
  12870. Code: res.StatusCode,
  12871. Header: res.Header,
  12872. }
  12873. }
  12874. if err != nil {
  12875. return nil, err
  12876. }
  12877. defer googleapi.CloseBody(res)
  12878. if err := googleapi.CheckResponse(res); err != nil {
  12879. return nil, err
  12880. }
  12881. ret := &PermissionsBatchUpdateResponse{
  12882. ServerResponse: googleapi.ServerResponse{
  12883. Header: res.Header,
  12884. HTTPStatusCode: res.StatusCode,
  12885. },
  12886. }
  12887. if err := json.NewDecoder(res.Body).Decode(&ret); err != nil {
  12888. return nil, err
  12889. }
  12890. return ret, nil
  12891. // {
  12892. // "description": "Add or update permission entries to an already existing asset.\n\nAn asset can hold up to 20 different permission entries. Each batchInsert request is atomic.",
  12893. // "httpMethod": "POST",
  12894. // "id": "mapsengine.tables.permissions.batchUpdate",
  12895. // "parameterOrder": [
  12896. // "id"
  12897. // ],
  12898. // "parameters": {
  12899. // "id": {
  12900. // "description": "The ID of the asset to which permissions will be added.",
  12901. // "location": "path",
  12902. // "required": true,
  12903. // "type": "string"
  12904. // }
  12905. // },
  12906. // "path": "tables/{id}/permissions/batchUpdate",
  12907. // "request": {
  12908. // "$ref": "PermissionsBatchUpdateRequest"
  12909. // },
  12910. // "response": {
  12911. // "$ref": "PermissionsBatchUpdateResponse"
  12912. // },
  12913. // "scopes": [
  12914. // "https://www.googleapis.com/auth/mapsengine"
  12915. // ]
  12916. // }
  12917. }
  12918. // method id "mapsengine.tables.permissions.list":
  12919. type TablesPermissionsListCall struct {
  12920. s *Service
  12921. id string
  12922. urlParams_ gensupport.URLParams
  12923. ifNoneMatch_ string
  12924. ctx_ context.Context
  12925. }
  12926. // List: Return all of the permissions for the specified asset.
  12927. func (r *TablesPermissionsService) List(id string) *TablesPermissionsListCall {
  12928. c := &TablesPermissionsListCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  12929. c.id = id
  12930. return c
  12931. }
  12932. // Fields allows partial responses to be retrieved. See
  12933. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  12934. // for more information.
  12935. func (c *TablesPermissionsListCall) Fields(s ...googleapi.Field) *TablesPermissionsListCall {
  12936. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  12937. return c
  12938. }
  12939. // IfNoneMatch sets the optional parameter which makes the operation
  12940. // fail if the object's ETag matches the given value. This is useful for
  12941. // getting updates only after the object has changed since the last
  12942. // request. Use googleapi.IsNotModified to check whether the response
  12943. // error from Do is the result of In-None-Match.
  12944. func (c *TablesPermissionsListCall) IfNoneMatch(entityTag string) *TablesPermissionsListCall {
  12945. c.ifNoneMatch_ = entityTag
  12946. return c
  12947. }
  12948. // Context sets the context to be used in this call's Do method. Any
  12949. // pending HTTP request will be aborted if the provided context is
  12950. // canceled.
  12951. func (c *TablesPermissionsListCall) Context(ctx context.Context) *TablesPermissionsListCall {
  12952. c.ctx_ = ctx
  12953. return c
  12954. }
  12955. func (c *TablesPermissionsListCall) doRequest(alt string) (*http.Response, error) {
  12956. var body io.Reader = nil
  12957. c.urlParams_.Set("alt", alt)
  12958. urls := googleapi.ResolveRelative(c.s.BasePath, "tables/{id}/permissions")
  12959. urls += "?" + c.urlParams_.Encode()
  12960. req, _ := http.NewRequest("GET", urls, body)
  12961. googleapi.Expand(req.URL, map[string]string{
  12962. "id": c.id,
  12963. })
  12964. req.Header.Set("User-Agent", c.s.userAgent())
  12965. if c.ifNoneMatch_ != "" {
  12966. req.Header.Set("If-None-Match", c.ifNoneMatch_)
  12967. }
  12968. if c.ctx_ != nil {
  12969. return ctxhttp.Do(c.ctx_, c.s.client, req)
  12970. }
  12971. return c.s.client.Do(req)
  12972. }
  12973. // Do executes the "mapsengine.tables.permissions.list" call.
  12974. // Exactly one of *PermissionsListResponse or error will be non-nil. Any
  12975. // non-2xx status code is an error. Response headers are in either
  12976. // *PermissionsListResponse.ServerResponse.Header or (if a response was
  12977. // returned at all) in error.(*googleapi.Error).Header. Use
  12978. // googleapi.IsNotModified to check whether the returned error was
  12979. // because http.StatusNotModified was returned.
  12980. func (c *TablesPermissionsListCall) Do(opts ...googleapi.CallOption) (*PermissionsListResponse, error) {
  12981. gensupport.SetOptions(c.urlParams_, opts...)
  12982. res, err := c.doRequest("json")
  12983. if res != nil && res.StatusCode == http.StatusNotModified {
  12984. if res.Body != nil {
  12985. res.Body.Close()
  12986. }
  12987. return nil, &googleapi.Error{
  12988. Code: res.StatusCode,
  12989. Header: res.Header,
  12990. }
  12991. }
  12992. if err != nil {
  12993. return nil, err
  12994. }
  12995. defer googleapi.CloseBody(res)
  12996. if err := googleapi.CheckResponse(res); err != nil {
  12997. return nil, err
  12998. }
  12999. ret := &PermissionsListResponse{
  13000. ServerResponse: googleapi.ServerResponse{
  13001. Header: res.Header,
  13002. HTTPStatusCode: res.StatusCode,
  13003. },
  13004. }
  13005. if err := json.NewDecoder(res.Body).Decode(&ret); err != nil {
  13006. return nil, err
  13007. }
  13008. return ret, nil
  13009. // {
  13010. // "description": "Return all of the permissions for the specified asset.",
  13011. // "httpMethod": "GET",
  13012. // "id": "mapsengine.tables.permissions.list",
  13013. // "parameterOrder": [
  13014. // "id"
  13015. // ],
  13016. // "parameters": {
  13017. // "id": {
  13018. // "description": "The ID of the asset whose permissions will be listed.",
  13019. // "location": "path",
  13020. // "required": true,
  13021. // "type": "string"
  13022. // }
  13023. // },
  13024. // "path": "tables/{id}/permissions",
  13025. // "response": {
  13026. // "$ref": "PermissionsListResponse"
  13027. // },
  13028. // "scopes": [
  13029. // "https://www.googleapis.com/auth/mapsengine",
  13030. // "https://www.googleapis.com/auth/mapsengine.readonly"
  13031. // ]
  13032. // }
  13033. }