mapsengine-gen.go 477 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929930931932933934935936937938939940941942943944945946947948949950951952953954955956957958959960961962963964965966967968969970971972973974975976977978979980981982983984985986987988989990991992993994995996997998999100010011002100310041005100610071008100910101011101210131014101510161017101810191020102110221023102410251026102710281029103010311032103310341035103610371038103910401041104210431044104510461047104810491050105110521053105410551056105710581059106010611062106310641065106610671068106910701071107210731074107510761077107810791080108110821083108410851086108710881089109010911092109310941095109610971098109911001101110211031104110511061107110811091110111111121113111411151116111711181119112011211122112311241125112611271128112911301131113211331134113511361137113811391140114111421143114411451146114711481149115011511152115311541155115611571158115911601161116211631164116511661167116811691170117111721173117411751176117711781179118011811182118311841185118611871188118911901191119211931194119511961197119811991200120112021203120412051206120712081209121012111212121312141215121612171218121912201221122212231224122512261227122812291230123112321233123412351236123712381239124012411242124312441245124612471248124912501251125212531254125512561257125812591260126112621263126412651266126712681269127012711272127312741275127612771278127912801281128212831284128512861287128812891290129112921293129412951296129712981299130013011302130313041305130613071308130913101311131213131314131513161317131813191320132113221323132413251326132713281329133013311332133313341335133613371338133913401341134213431344134513461347134813491350135113521353135413551356135713581359136013611362136313641365136613671368136913701371137213731374137513761377137813791380138113821383138413851386138713881389139013911392139313941395139613971398139914001401140214031404140514061407140814091410141114121413141414151416141714181419142014211422142314241425142614271428142914301431143214331434143514361437143814391440144114421443144414451446144714481449145014511452145314541455145614571458145914601461146214631464146514661467146814691470147114721473147414751476147714781479148014811482148314841485148614871488148914901491149214931494149514961497149814991500150115021503150415051506150715081509151015111512151315141515151615171518151915201521152215231524152515261527152815291530153115321533153415351536153715381539154015411542154315441545154615471548154915501551155215531554155515561557155815591560156115621563156415651566156715681569157015711572157315741575157615771578157915801581158215831584158515861587158815891590159115921593159415951596159715981599160016011602160316041605160616071608160916101611161216131614161516161617161816191620162116221623162416251626162716281629163016311632163316341635163616371638163916401641164216431644164516461647164816491650165116521653165416551656165716581659166016611662166316641665166616671668166916701671167216731674167516761677167816791680168116821683168416851686168716881689169016911692169316941695169616971698169917001701170217031704170517061707170817091710171117121713171417151716171717181719172017211722172317241725172617271728172917301731173217331734173517361737173817391740174117421743174417451746174717481749175017511752175317541755175617571758175917601761176217631764176517661767176817691770177117721773177417751776177717781779178017811782178317841785178617871788178917901791179217931794179517961797179817991800180118021803180418051806180718081809181018111812181318141815181618171818181918201821182218231824182518261827182818291830183118321833183418351836183718381839184018411842184318441845184618471848184918501851185218531854185518561857185818591860186118621863186418651866186718681869187018711872187318741875187618771878187918801881188218831884188518861887188818891890189118921893189418951896189718981899190019011902190319041905190619071908190919101911191219131914191519161917191819191920192119221923192419251926192719281929193019311932193319341935193619371938193919401941194219431944194519461947194819491950195119521953195419551956195719581959196019611962196319641965196619671968196919701971197219731974197519761977197819791980198119821983198419851986198719881989199019911992199319941995199619971998199920002001200220032004200520062007200820092010201120122013201420152016201720182019202020212022202320242025202620272028202920302031203220332034203520362037203820392040204120422043204420452046204720482049205020512052205320542055205620572058205920602061206220632064206520662067206820692070207120722073207420752076207720782079208020812082208320842085208620872088208920902091209220932094209520962097209820992100210121022103210421052106210721082109211021112112211321142115211621172118211921202121212221232124212521262127212821292130213121322133213421352136213721382139214021412142214321442145214621472148214921502151215221532154215521562157215821592160216121622163216421652166216721682169217021712172217321742175217621772178217921802181218221832184218521862187218821892190219121922193219421952196219721982199220022012202220322042205220622072208220922102211221222132214221522162217221822192220222122222223222422252226222722282229223022312232223322342235223622372238223922402241224222432244224522462247224822492250225122522253225422552256225722582259226022612262226322642265226622672268226922702271227222732274227522762277227822792280228122822283228422852286228722882289229022912292229322942295229622972298229923002301230223032304230523062307230823092310231123122313231423152316231723182319232023212322232323242325232623272328232923302331233223332334233523362337233823392340234123422343234423452346234723482349235023512352235323542355235623572358235923602361236223632364236523662367236823692370237123722373237423752376237723782379238023812382238323842385238623872388238923902391239223932394239523962397239823992400240124022403240424052406240724082409241024112412241324142415241624172418241924202421242224232424242524262427242824292430243124322433243424352436243724382439244024412442244324442445244624472448244924502451245224532454245524562457245824592460246124622463246424652466246724682469247024712472247324742475247624772478247924802481248224832484248524862487248824892490249124922493249424952496249724982499250025012502250325042505250625072508250925102511251225132514251525162517251825192520252125222523252425252526252725282529253025312532253325342535253625372538253925402541254225432544254525462547254825492550255125522553255425552556255725582559256025612562256325642565256625672568256925702571257225732574257525762577257825792580258125822583258425852586258725882589259025912592259325942595259625972598259926002601260226032604260526062607260826092610261126122613261426152616261726182619262026212622262326242625262626272628262926302631263226332634263526362637263826392640264126422643264426452646264726482649265026512652265326542655265626572658265926602661266226632664266526662667266826692670267126722673267426752676267726782679268026812682268326842685268626872688268926902691269226932694269526962697269826992700270127022703270427052706270727082709271027112712271327142715271627172718271927202721272227232724272527262727272827292730273127322733273427352736273727382739274027412742274327442745274627472748274927502751275227532754275527562757275827592760276127622763276427652766276727682769277027712772277327742775277627772778277927802781278227832784278527862787278827892790279127922793279427952796279727982799280028012802280328042805280628072808280928102811281228132814281528162817281828192820282128222823282428252826282728282829283028312832283328342835283628372838283928402841284228432844284528462847284828492850285128522853285428552856285728582859286028612862286328642865286628672868286928702871287228732874287528762877287828792880288128822883288428852886288728882889289028912892289328942895289628972898289929002901290229032904290529062907290829092910291129122913291429152916291729182919292029212922292329242925292629272928292929302931293229332934293529362937293829392940294129422943294429452946294729482949295029512952295329542955295629572958295929602961296229632964296529662967296829692970297129722973297429752976297729782979298029812982298329842985298629872988298929902991299229932994299529962997299829993000300130023003300430053006300730083009301030113012301330143015301630173018301930203021302230233024302530263027302830293030303130323033303430353036303730383039304030413042304330443045304630473048304930503051305230533054305530563057305830593060306130623063306430653066306730683069307030713072307330743075307630773078307930803081308230833084308530863087308830893090309130923093309430953096309730983099310031013102310331043105310631073108310931103111311231133114311531163117311831193120312131223123312431253126312731283129313031313132313331343135313631373138313931403141314231433144314531463147314831493150315131523153315431553156315731583159316031613162316331643165316631673168316931703171317231733174317531763177317831793180318131823183318431853186318731883189319031913192319331943195319631973198319932003201320232033204320532063207320832093210321132123213321432153216321732183219322032213222322332243225322632273228322932303231323232333234323532363237323832393240324132423243324432453246324732483249325032513252325332543255325632573258325932603261326232633264326532663267326832693270327132723273327432753276327732783279328032813282328332843285328632873288328932903291329232933294329532963297329832993300330133023303330433053306330733083309331033113312331333143315331633173318331933203321332233233324332533263327332833293330333133323333333433353336333733383339334033413342334333443345334633473348334933503351335233533354335533563357335833593360336133623363336433653366336733683369337033713372337333743375337633773378337933803381338233833384338533863387338833893390339133923393339433953396339733983399340034013402340334043405340634073408340934103411341234133414341534163417341834193420342134223423342434253426342734283429343034313432343334343435343634373438343934403441344234433444344534463447344834493450345134523453345434553456345734583459346034613462346334643465346634673468346934703471347234733474347534763477347834793480348134823483348434853486348734883489349034913492349334943495349634973498349935003501350235033504350535063507350835093510351135123513351435153516351735183519352035213522352335243525352635273528352935303531353235333534353535363537353835393540354135423543354435453546354735483549355035513552355335543555355635573558355935603561356235633564356535663567356835693570357135723573357435753576357735783579358035813582358335843585358635873588358935903591359235933594359535963597359835993600360136023603360436053606360736083609361036113612361336143615361636173618361936203621362236233624362536263627362836293630363136323633363436353636363736383639364036413642364336443645364636473648364936503651365236533654365536563657365836593660366136623663366436653666366736683669367036713672367336743675367636773678367936803681368236833684368536863687368836893690369136923693369436953696369736983699370037013702370337043705370637073708370937103711371237133714371537163717371837193720372137223723372437253726372737283729373037313732373337343735373637373738373937403741374237433744374537463747374837493750375137523753375437553756375737583759376037613762376337643765376637673768376937703771377237733774377537763777377837793780378137823783378437853786378737883789379037913792379337943795379637973798379938003801380238033804380538063807380838093810381138123813381438153816381738183819382038213822382338243825382638273828382938303831383238333834383538363837383838393840384138423843384438453846384738483849385038513852385338543855385638573858385938603861386238633864386538663867386838693870387138723873387438753876387738783879388038813882388338843885388638873888388938903891389238933894389538963897389838993900390139023903390439053906390739083909391039113912391339143915391639173918391939203921392239233924392539263927392839293930393139323933393439353936393739383939394039413942394339443945394639473948394939503951395239533954395539563957395839593960396139623963396439653966396739683969397039713972397339743975397639773978397939803981398239833984398539863987398839893990399139923993399439953996399739983999400040014002400340044005400640074008400940104011401240134014401540164017401840194020402140224023402440254026402740284029403040314032403340344035403640374038403940404041404240434044404540464047404840494050405140524053405440554056405740584059406040614062406340644065406640674068406940704071407240734074407540764077407840794080408140824083408440854086408740884089409040914092409340944095409640974098409941004101410241034104410541064107410841094110411141124113411441154116411741184119412041214122412341244125412641274128412941304131413241334134413541364137413841394140414141424143414441454146414741484149415041514152415341544155415641574158415941604161416241634164416541664167416841694170417141724173417441754176417741784179418041814182418341844185418641874188418941904191419241934194419541964197419841994200420142024203420442054206420742084209421042114212421342144215421642174218421942204221422242234224422542264227422842294230423142324233423442354236423742384239424042414242424342444245424642474248424942504251425242534254425542564257425842594260426142624263426442654266426742684269427042714272427342744275427642774278427942804281428242834284428542864287428842894290429142924293429442954296429742984299430043014302430343044305430643074308430943104311431243134314431543164317431843194320432143224323432443254326432743284329433043314332433343344335433643374338433943404341434243434344434543464347434843494350435143524353435443554356435743584359436043614362436343644365436643674368436943704371437243734374437543764377437843794380438143824383438443854386438743884389439043914392439343944395439643974398439944004401440244034404440544064407440844094410441144124413441444154416441744184419442044214422442344244425442644274428442944304431443244334434443544364437443844394440444144424443444444454446444744484449445044514452445344544455445644574458445944604461446244634464446544664467446844694470447144724473447444754476447744784479448044814482448344844485448644874488448944904491449244934494449544964497449844994500450145024503450445054506450745084509451045114512451345144515451645174518451945204521452245234524452545264527452845294530453145324533453445354536453745384539454045414542454345444545454645474548454945504551455245534554455545564557455845594560456145624563456445654566456745684569457045714572457345744575457645774578457945804581458245834584458545864587458845894590459145924593459445954596459745984599460046014602460346044605460646074608460946104611461246134614461546164617461846194620462146224623462446254626462746284629463046314632463346344635463646374638463946404641464246434644464546464647464846494650465146524653465446554656465746584659466046614662466346644665466646674668466946704671467246734674467546764677467846794680468146824683468446854686468746884689469046914692469346944695469646974698469947004701470247034704470547064707470847094710471147124713471447154716471747184719472047214722472347244725472647274728472947304731473247334734473547364737473847394740474147424743474447454746474747484749475047514752475347544755475647574758475947604761476247634764476547664767476847694770477147724773477447754776477747784779478047814782478347844785478647874788478947904791479247934794479547964797479847994800480148024803480448054806480748084809481048114812481348144815481648174818481948204821482248234824482548264827482848294830483148324833483448354836483748384839484048414842484348444845484648474848484948504851485248534854485548564857485848594860486148624863486448654866486748684869487048714872487348744875487648774878487948804881488248834884488548864887488848894890489148924893489448954896489748984899490049014902490349044905490649074908490949104911491249134914491549164917491849194920492149224923492449254926492749284929493049314932493349344935493649374938493949404941494249434944494549464947494849494950495149524953495449554956495749584959496049614962496349644965496649674968496949704971497249734974497549764977497849794980498149824983498449854986498749884989499049914992499349944995499649974998499950005001500250035004500550065007500850095010501150125013501450155016501750185019502050215022502350245025502650275028502950305031503250335034503550365037503850395040504150425043504450455046504750485049505050515052505350545055505650575058505950605061506250635064506550665067506850695070507150725073507450755076507750785079508050815082508350845085508650875088508950905091509250935094509550965097509850995100510151025103510451055106510751085109511051115112511351145115511651175118511951205121512251235124512551265127512851295130513151325133513451355136513751385139514051415142514351445145514651475148514951505151515251535154515551565157515851595160516151625163516451655166516751685169517051715172517351745175517651775178517951805181518251835184518551865187518851895190519151925193519451955196519751985199520052015202520352045205520652075208520952105211521252135214521552165217521852195220522152225223522452255226522752285229523052315232523352345235523652375238523952405241524252435244524552465247524852495250525152525253525452555256525752585259526052615262526352645265526652675268526952705271527252735274527552765277527852795280528152825283528452855286528752885289529052915292529352945295529652975298529953005301530253035304530553065307530853095310531153125313531453155316531753185319532053215322532353245325532653275328532953305331533253335334533553365337533853395340534153425343534453455346534753485349535053515352535353545355535653575358535953605361536253635364536553665367536853695370537153725373537453755376537753785379538053815382538353845385538653875388538953905391539253935394539553965397539853995400540154025403540454055406540754085409541054115412541354145415541654175418541954205421542254235424542554265427542854295430543154325433543454355436543754385439544054415442544354445445544654475448544954505451545254535454545554565457545854595460546154625463546454655466546754685469547054715472547354745475547654775478547954805481548254835484548554865487548854895490549154925493549454955496549754985499550055015502550355045505550655075508550955105511551255135514551555165517551855195520552155225523552455255526552755285529553055315532553355345535553655375538553955405541554255435544554555465547554855495550555155525553555455555556555755585559556055615562556355645565556655675568556955705571557255735574557555765577557855795580558155825583558455855586558755885589559055915592559355945595559655975598559956005601560256035604560556065607560856095610561156125613561456155616561756185619562056215622562356245625562656275628562956305631563256335634563556365637563856395640564156425643564456455646564756485649565056515652565356545655565656575658565956605661566256635664566556665667566856695670567156725673567456755676567756785679568056815682568356845685568656875688568956905691569256935694569556965697569856995700570157025703570457055706570757085709571057115712571357145715571657175718571957205721572257235724572557265727572857295730573157325733573457355736573757385739574057415742574357445745574657475748574957505751575257535754575557565757575857595760576157625763576457655766576757685769577057715772577357745775577657775778577957805781578257835784578557865787578857895790579157925793579457955796579757985799580058015802580358045805580658075808580958105811581258135814581558165817581858195820582158225823582458255826582758285829583058315832583358345835583658375838583958405841584258435844584558465847584858495850585158525853585458555856585758585859586058615862586358645865586658675868586958705871587258735874587558765877587858795880588158825883588458855886588758885889589058915892589358945895589658975898589959005901590259035904590559065907590859095910591159125913591459155916591759185919592059215922592359245925592659275928592959305931593259335934593559365937593859395940594159425943594459455946594759485949595059515952595359545955595659575958595959605961596259635964596559665967596859695970597159725973597459755976597759785979598059815982598359845985598659875988598959905991599259935994599559965997599859996000600160026003600460056006600760086009601060116012601360146015601660176018601960206021602260236024602560266027602860296030603160326033603460356036603760386039604060416042604360446045604660476048604960506051605260536054605560566057605860596060606160626063606460656066606760686069607060716072607360746075607660776078607960806081608260836084608560866087608860896090609160926093609460956096609760986099610061016102610361046105610661076108610961106111611261136114611561166117611861196120612161226123612461256126612761286129613061316132613361346135613661376138613961406141614261436144614561466147614861496150615161526153615461556156615761586159616061616162616361646165616661676168616961706171617261736174617561766177617861796180618161826183618461856186618761886189619061916192619361946195619661976198619962006201620262036204620562066207620862096210621162126213621462156216621762186219622062216222622362246225622662276228622962306231623262336234623562366237623862396240624162426243624462456246624762486249625062516252625362546255625662576258625962606261626262636264626562666267626862696270627162726273627462756276627762786279628062816282628362846285628662876288628962906291629262936294629562966297629862996300630163026303630463056306630763086309631063116312631363146315631663176318631963206321632263236324632563266327632863296330633163326333633463356336633763386339634063416342634363446345634663476348634963506351635263536354635563566357635863596360636163626363636463656366636763686369637063716372637363746375637663776378637963806381638263836384638563866387638863896390639163926393639463956396639763986399640064016402640364046405640664076408640964106411641264136414641564166417641864196420642164226423642464256426642764286429643064316432643364346435643664376438643964406441644264436444644564466447644864496450645164526453645464556456645764586459646064616462646364646465646664676468646964706471647264736474647564766477647864796480648164826483648464856486648764886489649064916492649364946495649664976498649965006501650265036504650565066507650865096510651165126513651465156516651765186519652065216522652365246525652665276528652965306531653265336534653565366537653865396540654165426543654465456546654765486549655065516552655365546555655665576558655965606561656265636564656565666567656865696570657165726573657465756576657765786579658065816582658365846585658665876588658965906591659265936594659565966597659865996600660166026603660466056606660766086609661066116612661366146615661666176618661966206621662266236624662566266627662866296630663166326633663466356636663766386639664066416642664366446645664666476648664966506651665266536654665566566657665866596660666166626663666466656666666766686669667066716672667366746675667666776678667966806681668266836684668566866687668866896690669166926693669466956696669766986699670067016702670367046705670667076708670967106711671267136714671567166717671867196720672167226723672467256726672767286729673067316732673367346735673667376738673967406741674267436744674567466747674867496750675167526753675467556756675767586759676067616762676367646765676667676768676967706771677267736774677567766777677867796780678167826783678467856786678767886789679067916792679367946795679667976798679968006801680268036804680568066807680868096810681168126813681468156816681768186819682068216822682368246825682668276828682968306831683268336834683568366837683868396840684168426843684468456846684768486849685068516852685368546855685668576858685968606861686268636864686568666867686868696870687168726873687468756876687768786879688068816882688368846885688668876888688968906891689268936894689568966897689868996900690169026903690469056906690769086909691069116912691369146915691669176918691969206921692269236924692569266927692869296930693169326933693469356936693769386939694069416942694369446945694669476948694969506951695269536954695569566957695869596960696169626963696469656966696769686969697069716972697369746975697669776978697969806981698269836984698569866987698869896990699169926993699469956996699769986999700070017002700370047005700670077008700970107011701270137014701570167017701870197020702170227023702470257026702770287029703070317032703370347035703670377038703970407041704270437044704570467047704870497050705170527053705470557056705770587059706070617062706370647065706670677068706970707071707270737074707570767077707870797080708170827083708470857086708770887089709070917092709370947095709670977098709971007101710271037104710571067107710871097110711171127113711471157116711771187119712071217122712371247125712671277128712971307131713271337134713571367137713871397140714171427143714471457146714771487149715071517152715371547155715671577158715971607161716271637164716571667167716871697170717171727173717471757176717771787179718071817182718371847185718671877188718971907191719271937194719571967197719871997200720172027203720472057206720772087209721072117212721372147215721672177218721972207221722272237224722572267227722872297230723172327233723472357236723772387239724072417242724372447245724672477248724972507251725272537254725572567257725872597260726172627263726472657266726772687269727072717272727372747275727672777278727972807281728272837284728572867287728872897290729172927293729472957296729772987299730073017302730373047305730673077308730973107311731273137314731573167317731873197320732173227323732473257326732773287329733073317332733373347335733673377338733973407341734273437344734573467347734873497350735173527353735473557356735773587359736073617362736373647365736673677368736973707371737273737374737573767377737873797380738173827383738473857386738773887389739073917392739373947395739673977398739974007401740274037404740574067407740874097410741174127413741474157416741774187419742074217422742374247425742674277428742974307431743274337434743574367437743874397440744174427443744474457446744774487449745074517452745374547455745674577458745974607461746274637464746574667467746874697470747174727473747474757476747774787479748074817482748374847485748674877488748974907491749274937494749574967497749874997500750175027503750475057506750775087509751075117512751375147515751675177518751975207521752275237524752575267527752875297530753175327533753475357536753775387539754075417542754375447545754675477548754975507551755275537554755575567557755875597560756175627563756475657566756775687569757075717572757375747575757675777578757975807581758275837584758575867587758875897590759175927593759475957596759775987599760076017602760376047605760676077608760976107611761276137614761576167617761876197620762176227623762476257626762776287629763076317632763376347635763676377638763976407641764276437644764576467647764876497650765176527653765476557656765776587659766076617662766376647665766676677668766976707671767276737674767576767677767876797680768176827683768476857686768776887689769076917692769376947695769676977698769977007701770277037704770577067707770877097710771177127713771477157716771777187719772077217722772377247725772677277728772977307731773277337734773577367737773877397740774177427743774477457746774777487749775077517752775377547755775677577758775977607761776277637764776577667767776877697770777177727773777477757776777777787779778077817782778377847785778677877788778977907791779277937794779577967797779877997800780178027803780478057806780778087809781078117812781378147815781678177818781978207821782278237824782578267827782878297830783178327833783478357836783778387839784078417842784378447845784678477848784978507851785278537854785578567857785878597860786178627863786478657866786778687869787078717872787378747875787678777878787978807881788278837884788578867887788878897890789178927893789478957896789778987899790079017902790379047905790679077908790979107911791279137914791579167917791879197920792179227923792479257926792779287929793079317932793379347935793679377938793979407941794279437944794579467947794879497950795179527953795479557956795779587959796079617962796379647965796679677968796979707971797279737974797579767977797879797980798179827983798479857986798779887989799079917992799379947995799679977998799980008001800280038004800580068007800880098010801180128013801480158016801780188019802080218022802380248025802680278028802980308031803280338034803580368037803880398040804180428043804480458046804780488049805080518052805380548055805680578058805980608061806280638064806580668067806880698070807180728073807480758076807780788079808080818082808380848085808680878088808980908091809280938094809580968097809880998100810181028103810481058106810781088109811081118112811381148115811681178118811981208121812281238124812581268127812881298130813181328133813481358136813781388139814081418142814381448145814681478148814981508151815281538154815581568157815881598160816181628163816481658166816781688169817081718172817381748175817681778178817981808181818281838184818581868187818881898190819181928193819481958196819781988199820082018202820382048205820682078208820982108211821282138214821582168217821882198220822182228223822482258226822782288229823082318232823382348235823682378238823982408241824282438244824582468247824882498250825182528253825482558256825782588259826082618262826382648265826682678268826982708271827282738274827582768277827882798280828182828283828482858286828782888289829082918292829382948295829682978298829983008301830283038304830583068307830883098310831183128313831483158316831783188319832083218322832383248325832683278328832983308331833283338334833583368337833883398340834183428343834483458346834783488349835083518352835383548355835683578358835983608361836283638364836583668367836883698370837183728373837483758376837783788379838083818382838383848385838683878388838983908391839283938394839583968397839883998400840184028403840484058406840784088409841084118412841384148415841684178418841984208421842284238424842584268427842884298430843184328433843484358436843784388439844084418442844384448445844684478448844984508451845284538454845584568457845884598460846184628463846484658466846784688469847084718472847384748475847684778478847984808481848284838484848584868487848884898490849184928493849484958496849784988499850085018502850385048505850685078508850985108511851285138514851585168517851885198520852185228523852485258526852785288529853085318532853385348535853685378538853985408541854285438544854585468547854885498550855185528553855485558556855785588559856085618562856385648565856685678568856985708571857285738574857585768577857885798580858185828583858485858586858785888589859085918592859385948595859685978598859986008601860286038604860586068607860886098610861186128613861486158616861786188619862086218622862386248625862686278628862986308631863286338634863586368637863886398640864186428643864486458646864786488649865086518652865386548655865686578658865986608661866286638664866586668667866886698670867186728673867486758676867786788679868086818682868386848685868686878688868986908691869286938694869586968697869886998700870187028703870487058706870787088709871087118712871387148715871687178718871987208721872287238724872587268727872887298730873187328733873487358736873787388739874087418742874387448745874687478748874987508751875287538754875587568757875887598760876187628763876487658766876787688769877087718772877387748775877687778778877987808781878287838784878587868787878887898790879187928793879487958796879787988799880088018802880388048805880688078808880988108811881288138814881588168817881888198820882188228823882488258826882788288829883088318832883388348835883688378838883988408841884288438844884588468847884888498850885188528853885488558856885788588859886088618862886388648865886688678868886988708871887288738874887588768877887888798880888188828883888488858886888788888889889088918892889388948895889688978898889989008901890289038904890589068907890889098910891189128913891489158916891789188919892089218922892389248925892689278928892989308931893289338934893589368937893889398940894189428943894489458946894789488949895089518952895389548955895689578958895989608961896289638964896589668967896889698970897189728973897489758976897789788979898089818982898389848985898689878988898989908991899289938994899589968997899889999000900190029003900490059006900790089009901090119012901390149015901690179018901990209021902290239024902590269027902890299030903190329033903490359036903790389039904090419042904390449045904690479048904990509051905290539054905590569057905890599060906190629063906490659066906790689069907090719072907390749075907690779078907990809081908290839084908590869087908890899090909190929093909490959096909790989099910091019102910391049105910691079108910991109111911291139114911591169117911891199120912191229123912491259126912791289129913091319132913391349135913691379138913991409141914291439144914591469147914891499150915191529153915491559156915791589159916091619162916391649165916691679168916991709171917291739174917591769177917891799180918191829183918491859186918791889189919091919192919391949195919691979198919992009201920292039204920592069207920892099210921192129213921492159216921792189219922092219222922392249225922692279228922992309231923292339234923592369237923892399240924192429243924492459246924792489249925092519252925392549255925692579258925992609261926292639264926592669267926892699270927192729273927492759276927792789279928092819282928392849285928692879288928992909291929292939294929592969297929892999300930193029303930493059306930793089309931093119312931393149315931693179318931993209321932293239324932593269327932893299330933193329333933493359336933793389339934093419342934393449345934693479348934993509351935293539354935593569357935893599360936193629363936493659366936793689369937093719372937393749375937693779378937993809381938293839384938593869387938893899390939193929393939493959396939793989399940094019402940394049405940694079408940994109411941294139414941594169417941894199420942194229423942494259426942794289429943094319432943394349435943694379438943994409441944294439444944594469447944894499450945194529453945494559456945794589459946094619462946394649465946694679468946994709471947294739474947594769477947894799480948194829483948494859486948794889489949094919492949394949495949694979498949995009501950295039504950595069507950895099510951195129513951495159516951795189519952095219522952395249525952695279528952995309531953295339534953595369537953895399540954195429543954495459546954795489549955095519552955395549555955695579558955995609561956295639564956595669567956895699570957195729573957495759576957795789579958095819582958395849585958695879588958995909591959295939594959595969597959895999600960196029603960496059606960796089609961096119612961396149615961696179618961996209621962296239624962596269627962896299630963196329633963496359636963796389639964096419642964396449645964696479648964996509651965296539654965596569657965896599660966196629663966496659666966796689669967096719672967396749675967696779678967996809681968296839684968596869687968896899690969196929693969496959696969796989699970097019702970397049705970697079708970997109711971297139714971597169717971897199720972197229723972497259726972797289729973097319732973397349735973697379738973997409741974297439744974597469747974897499750975197529753975497559756975797589759976097619762976397649765976697679768976997709771977297739774977597769777977897799780978197829783978497859786978797889789979097919792979397949795979697979798979998009801980298039804980598069807980898099810981198129813981498159816981798189819982098219822982398249825982698279828982998309831983298339834983598369837983898399840984198429843984498459846984798489849985098519852985398549855985698579858985998609861986298639864986598669867986898699870987198729873987498759876987798789879988098819882988398849885988698879888988998909891989298939894989598969897989898999900990199029903990499059906990799089909991099119912991399149915991699179918991999209921992299239924992599269927992899299930993199329933993499359936993799389939994099419942994399449945994699479948994999509951995299539954995599569957995899599960996199629963996499659966996799689969997099719972997399749975997699779978997999809981998299839984998599869987998899899990999199929993999499959996999799989999100001000110002100031000410005100061000710008100091001010011100121001310014100151001610017100181001910020100211002210023100241002510026100271002810029100301003110032100331003410035100361003710038100391004010041100421004310044100451004610047100481004910050100511005210053100541005510056100571005810059100601006110062100631006410065100661006710068100691007010071100721007310074100751007610077100781007910080100811008210083100841008510086100871008810089100901009110092100931009410095100961009710098100991010010101101021010310104101051010610107101081010910110101111011210113101141011510116101171011810119101201012110122101231012410125101261012710128101291013010131101321013310134101351013610137101381013910140101411014210143101441014510146101471014810149101501015110152101531015410155101561015710158101591016010161101621016310164101651016610167101681016910170101711017210173101741017510176101771017810179101801018110182101831018410185101861018710188101891019010191101921019310194101951019610197101981019910200102011020210203102041020510206102071020810209102101021110212102131021410215102161021710218102191022010221102221022310224102251022610227102281022910230102311023210233102341023510236102371023810239102401024110242102431024410245102461024710248102491025010251102521025310254102551025610257102581025910260102611026210263102641026510266102671026810269102701027110272102731027410275102761027710278102791028010281102821028310284102851028610287102881028910290102911029210293102941029510296102971029810299103001030110302103031030410305103061030710308103091031010311103121031310314103151031610317103181031910320103211032210323103241032510326103271032810329103301033110332103331033410335103361033710338103391034010341103421034310344103451034610347103481034910350103511035210353103541035510356103571035810359103601036110362103631036410365103661036710368103691037010371103721037310374103751037610377103781037910380103811038210383103841038510386103871038810389103901039110392103931039410395103961039710398103991040010401104021040310404104051040610407104081040910410104111041210413104141041510416104171041810419104201042110422104231042410425104261042710428104291043010431104321043310434104351043610437104381043910440104411044210443104441044510446104471044810449104501045110452104531045410455104561045710458104591046010461104621046310464104651046610467104681046910470104711047210473104741047510476104771047810479104801048110482104831048410485104861048710488104891049010491104921049310494104951049610497104981049910500105011050210503105041050510506105071050810509105101051110512105131051410515105161051710518105191052010521105221052310524105251052610527105281052910530105311053210533105341053510536105371053810539105401054110542105431054410545105461054710548105491055010551105521055310554105551055610557105581055910560105611056210563105641056510566105671056810569105701057110572105731057410575105761057710578105791058010581105821058310584105851058610587105881058910590105911059210593105941059510596105971059810599106001060110602106031060410605106061060710608106091061010611106121061310614106151061610617106181061910620106211062210623106241062510626106271062810629106301063110632106331063410635106361063710638106391064010641106421064310644106451064610647106481064910650106511065210653106541065510656106571065810659106601066110662106631066410665106661066710668106691067010671106721067310674106751067610677106781067910680106811068210683106841068510686106871068810689106901069110692106931069410695106961069710698106991070010701107021070310704107051070610707107081070910710107111071210713107141071510716107171071810719107201072110722107231072410725107261072710728107291073010731107321073310734107351073610737107381073910740107411074210743107441074510746107471074810749107501075110752107531075410755107561075710758107591076010761107621076310764107651076610767107681076910770107711077210773107741077510776107771077810779107801078110782107831078410785107861078710788107891079010791107921079310794107951079610797107981079910800108011080210803108041080510806108071080810809108101081110812108131081410815108161081710818108191082010821108221082310824108251082610827108281082910830108311083210833108341083510836108371083810839108401084110842108431084410845108461084710848108491085010851108521085310854108551085610857108581085910860108611086210863108641086510866108671086810869108701087110872108731087410875108761087710878108791088010881108821088310884108851088610887108881088910890108911089210893108941089510896108971089810899109001090110902109031090410905109061090710908109091091010911109121091310914109151091610917109181091910920109211092210923109241092510926109271092810929109301093110932109331093410935109361093710938109391094010941109421094310944109451094610947109481094910950109511095210953109541095510956109571095810959109601096110962109631096410965109661096710968109691097010971109721097310974109751097610977109781097910980109811098210983109841098510986109871098810989109901099110992109931099410995109961099710998109991100011001110021100311004110051100611007110081100911010110111101211013110141101511016110171101811019110201102111022110231102411025110261102711028110291103011031110321103311034110351103611037110381103911040110411104211043110441104511046110471104811049110501105111052110531105411055110561105711058110591106011061110621106311064110651106611067110681106911070110711107211073110741107511076110771107811079110801108111082110831108411085110861108711088110891109011091110921109311094110951109611097110981109911100111011110211103111041110511106111071110811109111101111111112111131111411115111161111711118111191112011121111221112311124111251112611127111281112911130111311113211133111341113511136111371113811139111401114111142111431114411145111461114711148111491115011151111521115311154111551115611157111581115911160111611116211163111641116511166111671116811169111701117111172111731117411175111761117711178111791118011181111821118311184111851118611187111881118911190111911119211193111941119511196111971119811199112001120111202112031120411205112061120711208112091121011211112121121311214112151121611217112181121911220112211122211223112241122511226112271122811229112301123111232112331123411235112361123711238112391124011241112421124311244112451124611247112481124911250112511125211253112541125511256112571125811259112601126111262112631126411265112661126711268112691127011271112721127311274112751127611277112781127911280112811128211283112841128511286112871128811289112901129111292112931129411295112961129711298112991130011301113021130311304113051130611307113081130911310113111131211313113141131511316113171131811319113201132111322113231132411325113261132711328113291133011331113321133311334113351133611337113381133911340113411134211343113441134511346113471134811349113501135111352113531135411355113561135711358113591136011361113621136311364113651136611367113681136911370113711137211373113741137511376113771137811379113801138111382113831138411385113861138711388113891139011391113921139311394113951139611397113981139911400114011140211403114041140511406114071140811409114101141111412114131141411415114161141711418114191142011421114221142311424114251142611427114281142911430114311143211433114341143511436114371143811439114401144111442114431144411445114461144711448114491145011451114521145311454114551145611457114581145911460114611146211463114641146511466114671146811469114701147111472114731147411475114761147711478114791148011481114821148311484114851148611487114881148911490114911149211493114941149511496114971149811499115001150111502115031150411505115061150711508115091151011511115121151311514115151151611517115181151911520115211152211523115241152511526115271152811529115301153111532115331153411535115361153711538115391154011541115421154311544115451154611547115481154911550115511155211553115541155511556115571155811559115601156111562115631156411565115661156711568115691157011571115721157311574115751157611577115781157911580115811158211583115841158511586115871158811589115901159111592115931159411595115961159711598115991160011601116021160311604116051160611607116081160911610116111161211613116141161511616116171161811619116201162111622116231162411625116261162711628116291163011631116321163311634116351163611637116381163911640116411164211643116441164511646116471164811649116501165111652116531165411655116561165711658116591166011661116621166311664116651166611667116681166911670116711167211673116741167511676116771167811679116801168111682116831168411685116861168711688116891169011691116921169311694116951169611697116981169911700117011170211703117041170511706117071170811709117101171111712117131171411715117161171711718117191172011721117221172311724117251172611727117281172911730117311173211733117341173511736117371173811739117401174111742117431174411745117461174711748117491175011751117521175311754117551175611757117581175911760117611176211763117641176511766117671176811769117701177111772117731177411775117761177711778117791178011781117821178311784117851178611787117881178911790117911179211793117941179511796117971179811799118001180111802118031180411805118061180711808118091181011811118121181311814118151181611817118181181911820118211182211823118241182511826118271182811829118301183111832118331183411835118361183711838118391184011841118421184311844118451184611847118481184911850118511185211853118541185511856118571185811859118601186111862118631186411865118661186711868118691187011871118721187311874118751187611877118781187911880118811188211883118841188511886118871188811889118901189111892118931189411895118961189711898118991190011901119021190311904119051190611907119081190911910119111191211913119141191511916119171191811919119201192111922119231192411925119261192711928119291193011931119321193311934119351193611937119381193911940119411194211943119441194511946119471194811949119501195111952119531195411955119561195711958119591196011961119621196311964119651196611967119681196911970119711197211973119741197511976119771197811979119801198111982119831198411985119861198711988119891199011991119921199311994119951199611997119981199912000120011200212003120041200512006120071200812009120101201112012120131201412015120161201712018120191202012021120221202312024120251202612027120281202912030120311203212033120341203512036120371203812039120401204112042120431204412045120461204712048120491205012051120521205312054120551205612057120581205912060120611206212063120641206512066120671206812069120701207112072120731207412075120761207712078120791208012081120821208312084120851208612087120881208912090120911209212093120941209512096120971209812099121001210112102121031210412105121061210712108121091211012111121121211312114121151211612117121181211912120121211212212123121241212512126121271212812129121301213112132121331213412135121361213712138121391214012141121421214312144121451214612147121481214912150121511215212153121541215512156121571215812159121601216112162121631216412165121661216712168121691217012171121721217312174121751217612177121781217912180121811218212183121841218512186121871218812189121901219112192121931219412195121961219712198121991220012201122021220312204122051220612207122081220912210122111221212213122141221512216122171221812219122201222112222122231222412225122261222712228122291223012231122321223312234122351223612237122381223912240122411224212243122441224512246122471224812249122501225112252122531225412255122561225712258122591226012261122621226312264122651226612267122681226912270122711227212273122741227512276122771227812279122801228112282122831228412285122861228712288122891229012291122921229312294122951229612297122981229912300123011230212303123041230512306123071230812309123101231112312123131231412315123161231712318123191232012321123221232312324123251232612327123281232912330123311233212333123341233512336123371233812339123401234112342123431234412345123461234712348123491235012351123521235312354123551235612357123581235912360123611236212363123641236512366123671236812369123701237112372123731237412375123761237712378123791238012381123821238312384123851238612387123881238912390123911239212393123941239512396123971239812399124001240112402124031240412405124061240712408124091241012411124121241312414124151241612417124181241912420124211242212423124241242512426124271242812429124301243112432124331243412435124361243712438124391244012441124421244312444124451244612447124481244912450124511245212453124541245512456124571245812459124601246112462124631246412465124661246712468124691247012471124721247312474124751247612477124781247912480124811248212483124841248512486124871248812489124901249112492124931249412495124961249712498124991250012501125021250312504125051250612507125081250912510125111251212513125141251512516125171251812519125201252112522125231252412525125261252712528125291253012531125321253312534125351253612537125381253912540125411254212543125441254512546125471254812549125501255112552125531255412555125561255712558125591256012561125621256312564125651256612567125681256912570125711257212573125741257512576125771257812579125801258112582125831258412585125861258712588125891259012591125921259312594125951259612597125981259912600126011260212603126041260512606126071260812609126101261112612126131261412615126161261712618126191262012621126221262312624126251262612627126281262912630126311263212633126341263512636126371263812639126401264112642126431264412645126461264712648126491265012651126521265312654126551265612657126581265912660126611266212663126641266512666126671266812669126701267112672126731267412675126761267712678126791268012681126821268312684126851268612687126881268912690126911269212693126941269512696126971269812699127001270112702127031270412705127061270712708127091271012711127121271312714127151271612717127181271912720127211272212723127241272512726127271272812729127301273112732127331273412735127361273712738127391274012741127421274312744127451274612747127481274912750127511275212753127541275512756127571275812759127601276112762127631276412765127661276712768127691277012771127721277312774127751277612777127781277912780127811278212783127841278512786127871278812789127901279112792127931279412795127961279712798127991280012801128021280312804128051280612807128081280912810128111281212813128141281512816128171281812819128201282112822128231282412825128261282712828128291283012831128321283312834128351283612837128381283912840128411284212843128441284512846128471284812849128501285112852128531285412855128561285712858128591286012861128621286312864128651286612867128681286912870128711287212873128741287512876128771287812879128801288112882128831288412885128861288712888128891289012891128921289312894128951289612897128981289912900129011290212903129041290512906129071290812909129101291112912129131291412915129161291712918129191292012921129221292312924129251292612927129281292912930129311293212933129341293512936129371293812939129401294112942129431294412945129461294712948129491295012951129521295312954129551295612957129581295912960129611296212963129641296512966129671296812969129701297112972129731297412975129761297712978129791298012981129821298312984129851298612987129881298912990129911299212993129941299512996129971299812999130001300113002130031300413005130061300713008130091301013011130121301313014130151301613017130181301913020130211302213023130241302513026130271302813029130301303113032130331303413035130361303713038130391304013041130421304313044130451304613047130481304913050130511305213053130541305513056130571305813059130601306113062130631306413065130661306713068130691307013071130721307313074130751307613077130781307913080130811308213083130841308513086130871308813089130901309113092130931309413095130961309713098130991310013101131021310313104131051310613107131081310913110131111311213113131141311513116131171311813119131201312113122131231312413125131261312713128131291313013131131321313313134131351313613137131381313913140131411314213143131441314513146131471314813149131501315113152131531315413155131561315713158131591316013161131621316313164131651316613167131681316913170131711317213173131741317513176131771317813179131801318113182131831318413185131861318713188131891319013191131921319313194131951319613197131981319913200132011320213203132041320513206132071320813209132101321113212132131321413215132161321713218132191322013221132221322313224132251322613227132281322913230132311323213233132341323513236132371323813239132401324113242132431324413245132461324713248132491325013251132521325313254132551325613257132581325913260132611326213263132641326513266132671326813269132701327113272132731327413275132761327713278132791328013281132821328313284132851328613287132881328913290132911329213293132941329513296132971329813299133001330113302133031330413305133061330713308133091331013311133121331313314133151331613317133181331913320133211332213323133241332513326133271332813329133301333113332133331333413335133361333713338133391334013341133421334313344133451334613347133481334913350133511335213353133541335513356133571335813359133601336113362133631336413365133661336713368133691337013371133721337313374133751337613377133781337913380133811338213383133841338513386133871338813389133901339113392133931339413395133961339713398133991340013401134021340313404134051340613407134081340913410134111341213413134141341513416134171341813419134201342113422134231342413425134261342713428134291343013431134321343313434134351343613437134381343913440134411344213443134441344513446134471344813449134501345113452134531345413455134561345713458134591346013461134621346313464134651346613467134681346913470134711347213473134741347513476134771347813479134801348113482134831348413485134861348713488134891349013491134921349313494134951349613497134981349913500135011350213503135041350513506135071350813509135101351113512135131351413515135161351713518135191352013521135221352313524135251352613527135281352913530135311353213533135341353513536135371353813539135401354113542135431354413545135461354713548135491355013551135521355313554135551355613557135581355913560135611356213563135641356513566135671356813569135701357113572135731357413575135761357713578135791358013581135821358313584135851358613587135881358913590135911359213593135941359513596135971359813599136001360113602136031360413605136061360713608136091361013611136121361313614136151361613617136181361913620136211362213623136241362513626136271362813629136301363113632136331363413635136361363713638136391364013641136421364313644136451364613647136481364913650136511365213653136541365513656136571365813659136601366113662136631366413665136661366713668136691367013671136721367313674136751367613677136781367913680136811368213683136841368513686136871368813689136901369113692136931369413695136961369713698136991370013701137021370313704137051370613707137081370913710137111371213713137141371513716137171371813719137201372113722137231372413725137261372713728137291373013731137321373313734137351373613737137381373913740137411374213743137441374513746137471374813749137501375113752137531375413755137561375713758137591376013761137621376313764137651376613767137681376913770137711377213773137741377513776137771377813779137801378113782137831378413785137861378713788137891379013791137921379313794137951379613797137981379913800138011380213803138041380513806138071380813809138101381113812138131381413815138161381713818138191382013821138221382313824138251382613827138281382913830138311383213833138341383513836138371383813839138401384113842138431384413845138461384713848138491385013851138521385313854138551385613857138581385913860138611386213863138641386513866138671386813869138701387113872138731387413875138761387713878138791388013881138821388313884138851388613887138881388913890138911389213893138941389513896138971389813899139001390113902139031390413905139061390713908139091391013911139121391313914139151391613917139181391913920139211392213923139241392513926139271392813929139301393113932139331393413935139361393713938139391394013941139421394313944139451394613947139481394913950139511395213953139541395513956139571395813959139601396113962139631396413965139661396713968139691397013971139721397313974139751397613977139781397913980139811398213983139841398513986139871398813989139901399113992139931399413995139961399713998139991400014001140021400314004140051400614007140081400914010140111401214013140141401514016140171401814019140201402114022140231402414025140261402714028140291403014031140321403314034140351403614037140381403914040140411404214043140441404514046140471404814049140501405114052140531405414055140561405714058140591406014061140621406314064140651406614067140681406914070140711407214073140741407514076140771407814079140801408114082140831408414085140861408714088140891409014091140921409314094140951409614097140981409914100141011410214103141041410514106141071410814109141101411114112141131411414115141161411714118141191412014121141221412314124141251412614127141281412914130141311413214133141341413514136141371413814139141401414114142141431414414145141461414714148141491415014151141521415314154141551415614157141581415914160141611416214163141641416514166141671416814169141701417114172141731417414175141761417714178141791418014181141821418314184141851418614187141881418914190141911419214193141941419514196141971419814199142001420114202142031420414205142061420714208142091421014211142121421314214142151421614217142181421914220142211422214223142241422514226142271422814229142301423114232142331423414235142361423714238142391424014241142421424314244142451424614247142481424914250142511425214253142541425514256142571425814259142601426114262142631426414265142661426714268142691427014271142721427314274142751427614277142781427914280142811428214283142841428514286142871428814289142901429114292142931429414295142961429714298142991430014301143021430314304143051430614307143081430914310143111431214313143141431514316143171431814319143201432114322143231432414325143261432714328143291433014331143321433314334143351433614337143381433914340143411434214343143441434514346143471434814349143501435114352143531435414355143561435714358143591436014361143621436314364143651436614367143681436914370143711437214373143741437514376143771437814379143801438114382143831438414385143861438714388143891439014391143921439314394143951439614397143981439914400144011440214403144041440514406144071440814409144101441114412144131441414415144161441714418
  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/exp2"
  8. // ...
  9. // mapsengineService, err := mapsengine.New(oauthHttpClient)
  10. package mapsengine // import "google.golang.org/api/mapsengine/exp2"
  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:exp2"
  41. const apiName = "mapsengine"
  42. const apiVersion = "exp2"
  43. const basePath = "https://www.googleapis.com/mapsengine/exp2/"
  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. Note:
  1043. // Datasources are returned in response to a get request but not a list
  1044. // request. After requesting a list of layers, you'll need to send a get
  1045. // request to retrieve the datasources for each layer.
  1046. Datasources []*Datasource `json:"datasources,omitempty"`
  1047. // Description: The description of this Layer, supplied by the author.
  1048. Description string `json:"description,omitempty"`
  1049. // DraftAccessList: Deprecated: The name of an access list of the Map
  1050. // Editor type. The user on whose behalf the request is being sent must
  1051. // be an editor on that access list. Note: Google Maps Engine no longer
  1052. // uses access lists. Instead, each asset has its own list of
  1053. // permissions. For backward compatibility, the API still accepts access
  1054. // lists for projects that are already using access lists. If you
  1055. // created a GME account/project after July 14th, 2014, you will not be
  1056. // able to send API requests that include access lists. Note: This is an
  1057. // input field only. It is not returned in response to a list or get
  1058. // request.
  1059. DraftAccessList string `json:"draftAccessList,omitempty"`
  1060. // Etag: The ETag, used to refer to the current version of the asset.
  1061. Etag string `json:"etag,omitempty"`
  1062. // Id: A globally unique ID, used to refer to this Layer.
  1063. Id string `json:"id,omitempty"`
  1064. // LastModifiedTime: The last modified time of this layer. The value is
  1065. // an RFC 3339 formatted date-time value (e.g. 1970-01-01T00:00:00Z).
  1066. LastModifiedTime string `json:"lastModifiedTime,omitempty"`
  1067. // LastModifierEmail: The email address of the last modifier of this
  1068. // layer. This is only returned on GET requests and not LIST requests.
  1069. LastModifierEmail string `json:"lastModifierEmail,omitempty"`
  1070. // LayerType: The type of the datasources used to build this Layer. This
  1071. // should be used instead of datasourceType. At least one of layerType
  1072. // and datasourceType and must be specified, but layerType takes
  1073. // precedence.
  1074. //
  1075. // Possible values:
  1076. // "image"
  1077. // "vector"
  1078. LayerType string `json:"layerType,omitempty"`
  1079. // Name: The name of this Layer, supplied by the author.
  1080. Name string `json:"name,omitempty"`
  1081. // ProcessingStatus: The processing status of this layer.
  1082. //
  1083. // Possible values:
  1084. // "complete"
  1085. // "failed"
  1086. // "notReady"
  1087. // "processing"
  1088. // "ready"
  1089. ProcessingStatus string `json:"processingStatus,omitempty"`
  1090. // ProjectId: The ID of the project that this Layer is in.
  1091. ProjectId string `json:"projectId,omitempty"`
  1092. // PublishedAccessList: Deprecated: The access list to whom view
  1093. // permissions are granted. The value must be the name of a Maps Engine
  1094. // access list of the Map Viewer type, and the user must be a viewer on
  1095. // that list. Note: Google Maps Engine no longer uses access lists.
  1096. // Instead, each asset has its own list of permissions. For backward
  1097. // compatibility, the API still accepts access lists for projects that
  1098. // are already using access lists. If you created a GME account/project
  1099. // after July 14th, 2014, you will not be able to send API requests that
  1100. // include access lists. Note: This is an input field only. It is not
  1101. // returned in response to a list or get request.
  1102. PublishedAccessList string `json:"publishedAccessList,omitempty"`
  1103. // PublishingStatus: The publishing status of this layer.
  1104. //
  1105. // Possible values:
  1106. // "notPublished"
  1107. // "published"
  1108. PublishingStatus string `json:"publishingStatus,omitempty"`
  1109. // Style: The styling information for a vector layer. Note: Style
  1110. // information is returned in response to a get request but not a list
  1111. // request. After requesting a list of layers, you'll need to send a get
  1112. // request to retrieve the VectorStyles for each layer.
  1113. Style *VectorStyle `json:"style,omitempty"`
  1114. // Tags: Tags of this Layer.
  1115. Tags []string `json:"tags,omitempty"`
  1116. // WritersCanEditPermissions: If true, WRITERs of the asset are able to
  1117. // edit the asset permissions.
  1118. WritersCanEditPermissions bool `json:"writersCanEditPermissions,omitempty"`
  1119. // ServerResponse contains the HTTP response code and headers from the
  1120. // server.
  1121. googleapi.ServerResponse `json:"-"`
  1122. // ForceSendFields is a list of field names (e.g. "Bbox") to
  1123. // unconditionally include in API requests. By default, fields with
  1124. // empty values are omitted from API requests. However, any non-pointer,
  1125. // non-interface field appearing in ForceSendFields will be sent to the
  1126. // server regardless of whether the field is empty or not. This may be
  1127. // used to include empty fields in Patch requests.
  1128. ForceSendFields []string `json:"-"`
  1129. }
  1130. func (s *Layer) MarshalJSON() ([]byte, error) {
  1131. type noMethod Layer
  1132. raw := noMethod(*s)
  1133. return gensupport.MarshalJSON(raw, s.ForceSendFields)
  1134. }
  1135. // LayersListResponse: The response returned by a call to layers.List.
  1136. // Note: The list response does not include all the fields available in
  1137. // a layer. Refer to the layer resource description for details of the
  1138. // fields that are not included. You'll need to send a get request to
  1139. // retrieve the additional fields for each layer.
  1140. type LayersListResponse struct {
  1141. // Layers: Resources returned.
  1142. Layers []*Layer `json:"layers,omitempty"`
  1143. // NextPageToken: Next page token.
  1144. NextPageToken string `json:"nextPageToken,omitempty"`
  1145. // ServerResponse contains the HTTP response code and headers from the
  1146. // server.
  1147. googleapi.ServerResponse `json:"-"`
  1148. // ForceSendFields is a list of field names (e.g. "Layers") to
  1149. // unconditionally include in API requests. By default, fields with
  1150. // empty values are omitted from API requests. However, any non-pointer,
  1151. // non-interface field appearing in ForceSendFields will be sent to the
  1152. // server regardless of whether the field is empty or not. This may be
  1153. // used to include empty fields in Patch requests.
  1154. ForceSendFields []string `json:"-"`
  1155. }
  1156. func (s *LayersListResponse) MarshalJSON() ([]byte, error) {
  1157. type noMethod LayersListResponse
  1158. raw := noMethod(*s)
  1159. return gensupport.MarshalJSON(raw, s.ForceSendFields)
  1160. }
  1161. // LineStyle: Style for lines.
  1162. type LineStyle struct {
  1163. // Border: Border of the line. 0 < border.width <= 5.
  1164. Border *Border `json:"border,omitempty"`
  1165. // Dash: Dash defines the pattern of the line, the values are pixel
  1166. // lengths of alternating dash and gap. If dash is not provided, then it
  1167. // means a solid line. Dash can contain up to 10 values and must contain
  1168. // even number of values.
  1169. Dash []float64 `json:"dash,omitempty"`
  1170. // Label: Label style for the line.
  1171. Label *LabelStyle `json:"label,omitempty"`
  1172. // Stroke: Stroke of the line.
  1173. Stroke *LineStyleStroke `json:"stroke,omitempty"`
  1174. // ForceSendFields is a list of field names (e.g. "Border") to
  1175. // unconditionally include in API requests. By default, fields with
  1176. // empty values are omitted from API requests. However, any non-pointer,
  1177. // non-interface field appearing in ForceSendFields will be sent to the
  1178. // server regardless of whether the field is empty or not. This may be
  1179. // used to include empty fields in Patch requests.
  1180. ForceSendFields []string `json:"-"`
  1181. }
  1182. func (s *LineStyle) MarshalJSON() ([]byte, error) {
  1183. type noMethod LineStyle
  1184. raw := noMethod(*s)
  1185. return gensupport.MarshalJSON(raw, s.ForceSendFields)
  1186. }
  1187. // LineStyleStroke: Stroke of the line.
  1188. type LineStyleStroke struct {
  1189. // Color: Color of the line.
  1190. Color string `json:"color,omitempty"`
  1191. // Opacity: Opacity of the line.
  1192. Opacity float64 `json:"opacity,omitempty"`
  1193. // Width: Width of the line, in pixels. 0 <= width <= 10. If width is
  1194. // set to 0, the line will be invisible.
  1195. Width float64 `json:"width,omitempty"`
  1196. // ForceSendFields is a list of field names (e.g. "Color") to
  1197. // unconditionally include in API requests. By default, fields with
  1198. // empty values are omitted from API requests. However, any non-pointer,
  1199. // non-interface field appearing in ForceSendFields will be sent to the
  1200. // server regardless of whether the field is empty or not. This may be
  1201. // used to include empty fields in Patch requests.
  1202. ForceSendFields []string `json:"-"`
  1203. }
  1204. func (s *LineStyleStroke) MarshalJSON() ([]byte, error) {
  1205. type noMethod LineStyleStroke
  1206. raw := noMethod(*s)
  1207. return gensupport.MarshalJSON(raw, s.ForceSendFields)
  1208. }
  1209. // Map: A Map is a collection of Layers, optionally contained within
  1210. // folders.
  1211. type Map struct {
  1212. // Bbox: A rectangular bounding box which contains all of the data in
  1213. // this Map. The box is expressed as \"west, south, east, north\". The
  1214. // numbers represent latitude and longitude in decimal degrees.
  1215. Bbox []float64 `json:"bbox,omitempty"`
  1216. // Contents: The contents of this Map.
  1217. Contents []MapItem `json:"contents,omitempty"`
  1218. // CreationTime: The creation time of this map. The value is an RFC 3339
  1219. // formatted date-time value (e.g. 1970-01-01T00:00:00Z).
  1220. CreationTime string `json:"creationTime,omitempty"`
  1221. // CreatorEmail: The email address of the creator of this map. This is
  1222. // only returned on GET requests and not LIST requests.
  1223. CreatorEmail string `json:"creatorEmail,omitempty"`
  1224. // DefaultViewport: An array of four numbers (west, south, east, north)
  1225. // which defines the rectangular bounding box of the default viewport.
  1226. // The numbers represent latitude and longitude in decimal degrees.
  1227. DefaultViewport []float64 `json:"defaultViewport,omitempty"`
  1228. // Description: The description of this Map, supplied by the author.
  1229. Description string `json:"description,omitempty"`
  1230. // DraftAccessList: Deprecated: The name of an access list of the Map
  1231. // Editor type. The user on whose behalf the request is being sent must
  1232. // be an editor on that access list. Note: Google Maps Engine no longer
  1233. // uses access lists. Instead, each asset has its own list of
  1234. // permissions. For backward compatibility, the API still accepts access
  1235. // lists for projects that are already using access lists. If you
  1236. // created a GME account/project after July 14th, 2014, you will not be
  1237. // able to send API requests that include access lists. Note: This is an
  1238. // input field only. It is not returned in response to a list or get
  1239. // request.
  1240. DraftAccessList string `json:"draftAccessList,omitempty"`
  1241. // Etag: The ETag, used to refer to the current version of the asset.
  1242. Etag string `json:"etag,omitempty"`
  1243. // Id: A globally unique ID, used to refer to this Map.
  1244. Id string `json:"id,omitempty"`
  1245. // LastModifiedTime: The last modified time of this map. The value is an
  1246. // RFC 3339 formatted date-time value (e.g. 1970-01-01T00:00:00Z).
  1247. LastModifiedTime string `json:"lastModifiedTime,omitempty"`
  1248. // LastModifierEmail: The email address of the last modifier of this
  1249. // map. This is only returned on GET requests and not LIST requests.
  1250. LastModifierEmail string `json:"lastModifierEmail,omitempty"`
  1251. // Name: The name of this Map, supplied by the author.
  1252. Name string `json:"name,omitempty"`
  1253. // ProcessingStatus: The processing status of this map. Map processing
  1254. // is automatically started once a map becomes ready for processing.
  1255. //
  1256. // Possible values:
  1257. // "complete"
  1258. // "failed"
  1259. // "notReady"
  1260. // "processing"
  1261. // "ready"
  1262. ProcessingStatus string `json:"processingStatus,omitempty"`
  1263. // ProjectId: The ID of the project that this Map is in.
  1264. ProjectId string `json:"projectId,omitempty"`
  1265. // PublishedAccessList: Deprecated: The access list to whom view
  1266. // permissions are granted. The value must be the name of a Maps Engine
  1267. // access list of the Map Viewer type, and the user must be a viewer on
  1268. // that list. Note: Google Maps Engine no longer uses access lists.
  1269. // Instead, each asset has its own list of permissions. For backward
  1270. // compatibility, the API still accepts access lists for projects that
  1271. // are already using access lists. If you created a GME account/project
  1272. // after July 14th, 2014, you will not be able to send API requests that
  1273. // include access lists. This is an input field only. It is not returned
  1274. // in response to a list or get request.
  1275. PublishedAccessList string `json:"publishedAccessList,omitempty"`
  1276. // PublishingStatus: The publishing status of this map.
  1277. //
  1278. // Possible values:
  1279. // "notPublished"
  1280. // "published"
  1281. PublishingStatus string `json:"publishingStatus,omitempty"`
  1282. // Tags: Tags of this Map.
  1283. Tags []string `json:"tags,omitempty"`
  1284. // Versions: Deprecated: An array containing the available versions of
  1285. // this Map. Currently may only contain "published". The
  1286. // publishingStatus field should be used instead.
  1287. Versions []string `json:"versions,omitempty"`
  1288. // WritersCanEditPermissions: If true, WRITERs of the asset are able to
  1289. // edit the asset permissions.
  1290. WritersCanEditPermissions bool `json:"writersCanEditPermissions,omitempty"`
  1291. // ServerResponse contains the HTTP response code and headers from the
  1292. // server.
  1293. googleapi.ServerResponse `json:"-"`
  1294. // ForceSendFields is a list of field names (e.g. "Bbox") to
  1295. // unconditionally include in API requests. By default, fields with
  1296. // empty values are omitted from API requests. However, any non-pointer,
  1297. // non-interface field appearing in ForceSendFields will be sent to the
  1298. // server regardless of whether the field is empty or not. This may be
  1299. // used to include empty fields in Patch requests.
  1300. ForceSendFields []string `json:"-"`
  1301. }
  1302. func (s *Map) MarshalJSON() ([]byte, error) {
  1303. type noMethod Map
  1304. raw := noMethod(*s)
  1305. return gensupport.MarshalJSON(raw, s.ForceSendFields)
  1306. }
  1307. type MapFolder struct {
  1308. Contents []MapItem `json:"contents,omitempty"`
  1309. // DefaultViewport: An array of four numbers (west, south, east, north)
  1310. // which defines the rectangular bounding box of the default viewport.
  1311. // The numbers represent latitude and longitude in decimal degrees.
  1312. DefaultViewport []float64 `json:"defaultViewport,omitempty"`
  1313. // Expandable: The expandability setting of this MapFolder. If true, the
  1314. // folder can be expanded.
  1315. Expandable bool `json:"expandable,omitempty"`
  1316. // Key: A user defined alias for this MapFolder, specific to this Map.
  1317. Key string `json:"key,omitempty"`
  1318. // Name: The name of this MapFolder.
  1319. Name string `json:"name,omitempty"`
  1320. // Type: Identifies this object as a MapFolder.
  1321. //
  1322. // Possible values:
  1323. // "folder"
  1324. Type string `json:"type,omitempty"`
  1325. // Visibility: The visibility setting of this MapFolder. One of
  1326. // "defaultOn" or "defaultOff".
  1327. Visibility string `json:"visibility,omitempty"`
  1328. // ForceSendFields is a list of field names (e.g. "Contents") to
  1329. // unconditionally include in API requests. By default, fields with
  1330. // empty values are omitted from API requests. However, any non-pointer,
  1331. // non-interface field appearing in ForceSendFields will be sent to the
  1332. // server regardless of whether the field is empty or not. This may be
  1333. // used to include empty fields in Patch requests.
  1334. ForceSendFields []string `json:"-"`
  1335. }
  1336. func (s *MapFolder) MarshalJSON() ([]byte, error) {
  1337. type noMethod MapFolder
  1338. raw := noMethod(*s)
  1339. return gensupport.MarshalJSON(raw, s.ForceSendFields)
  1340. }
  1341. type MapItem map[string]interface{}
  1342. func (t MapItem) Type() string {
  1343. return googleapi.VariantType(t)
  1344. }
  1345. func (t MapItem) Folder() (r MapFolder, ok bool) {
  1346. if t.Type() != "Folder" {
  1347. return r, false
  1348. }
  1349. ok = googleapi.ConvertVariant(map[string]interface{}(t), &r)
  1350. return r, ok
  1351. }
  1352. func (t MapItem) KmlLink() (r MapKmlLink, ok bool) {
  1353. if t.Type() != "KmlLink" {
  1354. return r, false
  1355. }
  1356. ok = googleapi.ConvertVariant(map[string]interface{}(t), &r)
  1357. return r, ok
  1358. }
  1359. func (t MapItem) Layer() (r MapLayer, ok bool) {
  1360. if t.Type() != "Layer" {
  1361. return r, false
  1362. }
  1363. ok = googleapi.ConvertVariant(map[string]interface{}(t), &r)
  1364. return r, ok
  1365. }
  1366. type MapKmlLink struct {
  1367. // DefaultViewport: An array of four numbers (west, south, east, north)
  1368. // which defines the rectangular bounding box of the default viewport.
  1369. // The numbers represent latitude and longitude in decimal degrees.
  1370. DefaultViewport []float64 `json:"defaultViewport,omitempty"`
  1371. // KmlUrl: The URL to the KML file represented by this MapKmlLink.
  1372. KmlUrl string `json:"kmlUrl,omitempty"`
  1373. // Name: The name of this MapKmlLink.
  1374. Name string `json:"name,omitempty"`
  1375. // Type: Identifies this object as a MapKmlLink.
  1376. //
  1377. // Possible values:
  1378. // "kmlLink"
  1379. Type string `json:"type,omitempty"`
  1380. // Visibility: The visibility setting of this MapKmlLink. One of
  1381. // "defaultOn" or "defaultOff".
  1382. Visibility string `json:"visibility,omitempty"`
  1383. // ForceSendFields is a list of field names (e.g. "DefaultViewport") to
  1384. // unconditionally include in API requests. By default, fields with
  1385. // empty values are omitted from API requests. However, any non-pointer,
  1386. // non-interface field appearing in ForceSendFields will be sent to the
  1387. // server regardless of whether the field is empty or not. This may be
  1388. // used to include empty fields in Patch requests.
  1389. ForceSendFields []string `json:"-"`
  1390. }
  1391. func (s *MapKmlLink) MarshalJSON() ([]byte, error) {
  1392. type noMethod MapKmlLink
  1393. raw := noMethod(*s)
  1394. return gensupport.MarshalJSON(raw, s.ForceSendFields)
  1395. }
  1396. type MapLayer struct {
  1397. // DefaultViewport: An array of four numbers (west, south, east, north)
  1398. // which defines the rectangular bounding box of the default viewport.
  1399. // The numbers represent latitude and longitude in decimal degrees.
  1400. DefaultViewport []float64 `json:"defaultViewport,omitempty"`
  1401. // Id: The ID of this MapLayer. This ID can be used to request more
  1402. // details about the layer.
  1403. Id string `json:"id,omitempty"`
  1404. // Key: A user defined alias for this MapLayer, specific to this Map.
  1405. Key string `json:"key,omitempty"`
  1406. // Name: The name of this MapLayer.
  1407. Name string `json:"name,omitempty"`
  1408. // Type: Identifies this object as a MapLayer.
  1409. //
  1410. // Possible values:
  1411. // "layer"
  1412. Type string `json:"type,omitempty"`
  1413. // Visibility: The visibility setting of this MapLayer. One of
  1414. // "defaultOn" or "defaultOff".
  1415. Visibility string `json:"visibility,omitempty"`
  1416. // ForceSendFields is a list of field names (e.g. "DefaultViewport") to
  1417. // unconditionally include in API requests. By default, fields with
  1418. // empty values are omitted from API requests. However, any non-pointer,
  1419. // non-interface field appearing in ForceSendFields will be sent to the
  1420. // server regardless of whether the field is empty or not. This may be
  1421. // used to include empty fields in Patch requests.
  1422. ForceSendFields []string `json:"-"`
  1423. }
  1424. func (s *MapLayer) MarshalJSON() ([]byte, error) {
  1425. type noMethod MapLayer
  1426. raw := noMethod(*s)
  1427. return gensupport.MarshalJSON(raw, s.ForceSendFields)
  1428. }
  1429. // MapsListResponse: The response returned by a call to maps.List.
  1430. type MapsListResponse struct {
  1431. // Maps: Resources returned.
  1432. Maps []*Map `json:"maps,omitempty"`
  1433. // NextPageToken: Next page token.
  1434. NextPageToken string `json:"nextPageToken,omitempty"`
  1435. // ServerResponse contains the HTTP response code and headers from the
  1436. // server.
  1437. googleapi.ServerResponse `json:"-"`
  1438. // ForceSendFields is a list of field names (e.g. "Maps") to
  1439. // unconditionally include in API requests. By default, fields with
  1440. // empty values are omitted from API requests. However, any non-pointer,
  1441. // non-interface field appearing in ForceSendFields will be sent to the
  1442. // server regardless of whether the field is empty or not. This may be
  1443. // used to include empty fields in Patch requests.
  1444. ForceSendFields []string `json:"-"`
  1445. }
  1446. func (s *MapsListResponse) MarshalJSON() ([]byte, error) {
  1447. type noMethod MapsListResponse
  1448. raw := noMethod(*s)
  1449. return gensupport.MarshalJSON(raw, s.ForceSendFields)
  1450. }
  1451. // Parent: A list of the parents of an asset.
  1452. type Parent struct {
  1453. // Id: The ID of this parent.
  1454. Id string `json:"id,omitempty"`
  1455. // ForceSendFields is a list of field names (e.g. "Id") to
  1456. // unconditionally include in API requests. By default, fields with
  1457. // empty values are omitted from API requests. However, any non-pointer,
  1458. // non-interface field appearing in ForceSendFields will be sent to the
  1459. // server regardless of whether the field is empty or not. This may be
  1460. // used to include empty fields in Patch requests.
  1461. ForceSendFields []string `json:"-"`
  1462. }
  1463. func (s *Parent) MarshalJSON() ([]byte, error) {
  1464. type noMethod Parent
  1465. raw := noMethod(*s)
  1466. return gensupport.MarshalJSON(raw, s.ForceSendFields)
  1467. }
  1468. // ParentsListResponse: The response returned by a call to parents.List.
  1469. type ParentsListResponse struct {
  1470. // NextPageToken: Next page token.
  1471. NextPageToken string `json:"nextPageToken,omitempty"`
  1472. // Parents: The parent assets.
  1473. Parents []*Parent `json:"parents,omitempty"`
  1474. // ServerResponse contains the HTTP response code and headers from the
  1475. // server.
  1476. googleapi.ServerResponse `json:"-"`
  1477. // ForceSendFields is a list of field names (e.g. "NextPageToken") to
  1478. // unconditionally include in API requests. By default, fields with
  1479. // empty values are omitted from API requests. However, any non-pointer,
  1480. // non-interface field appearing in ForceSendFields will be sent to the
  1481. // server regardless of whether the field is empty or not. This may be
  1482. // used to include empty fields in Patch requests.
  1483. ForceSendFields []string `json:"-"`
  1484. }
  1485. func (s *ParentsListResponse) MarshalJSON() ([]byte, error) {
  1486. type noMethod ParentsListResponse
  1487. raw := noMethod(*s)
  1488. return gensupport.MarshalJSON(raw, s.ForceSendFields)
  1489. }
  1490. // Permission: A permission defines the user or group that has access to
  1491. // an asset, and the type of access they have.
  1492. type Permission struct {
  1493. // Discoverable: Indicates whether a public asset is listed and can be
  1494. // found via a web search (value true), or is visible only to people who
  1495. // have a link to the asset (value false).
  1496. Discoverable bool `json:"discoverable,omitempty"`
  1497. // Id: The unique identifier of the permission. This could be the email
  1498. // address of the user or group this permission refers to, or the string
  1499. // "anyone" for public permissions.
  1500. Id string `json:"id,omitempty"`
  1501. // Role: The type of access granted to this user or group.
  1502. //
  1503. // Possible values:
  1504. // "owner"
  1505. // "reader"
  1506. // "viewer"
  1507. // "writer"
  1508. Role string `json:"role,omitempty"`
  1509. // Type: The account type.
  1510. //
  1511. // Possible values:
  1512. // "anyone"
  1513. // "group"
  1514. // "user"
  1515. Type string `json:"type,omitempty"`
  1516. // ForceSendFields is a list of field names (e.g. "Discoverable") to
  1517. // unconditionally include in API requests. By default, fields with
  1518. // empty values are omitted from API requests. However, any non-pointer,
  1519. // non-interface field appearing in ForceSendFields will be sent to the
  1520. // server regardless of whether the field is empty or not. This may be
  1521. // used to include empty fields in Patch requests.
  1522. ForceSendFields []string `json:"-"`
  1523. }
  1524. func (s *Permission) MarshalJSON() ([]byte, error) {
  1525. type noMethod Permission
  1526. raw := noMethod(*s)
  1527. return gensupport.MarshalJSON(raw, s.ForceSendFields)
  1528. }
  1529. // PermissionsBatchDeleteRequest: The request sent to
  1530. // mapsengine.permissions.batchDelete.
  1531. type PermissionsBatchDeleteRequest struct {
  1532. // Ids: An array of permission ids to be removed. This could be the
  1533. // email address of the user or group this permission refers to, or the
  1534. // string "anyone" for public permissions.
  1535. Ids []string `json:"ids,omitempty"`
  1536. // ForceSendFields is a list of field names (e.g. "Ids") to
  1537. // unconditionally include in API requests. By default, fields with
  1538. // empty values are omitted from API requests. However, any non-pointer,
  1539. // non-interface field appearing in ForceSendFields will be sent to the
  1540. // server regardless of whether the field is empty or not. This may be
  1541. // used to include empty fields in Patch requests.
  1542. ForceSendFields []string `json:"-"`
  1543. }
  1544. func (s *PermissionsBatchDeleteRequest) MarshalJSON() ([]byte, error) {
  1545. type noMethod PermissionsBatchDeleteRequest
  1546. raw := noMethod(*s)
  1547. return gensupport.MarshalJSON(raw, s.ForceSendFields)
  1548. }
  1549. // PermissionsBatchDeleteResponse: The response returned by a call to
  1550. // mapsengine.permissions.batchDelete.
  1551. type PermissionsBatchDeleteResponse struct {
  1552. // ServerResponse contains the HTTP response code and headers from the
  1553. // server.
  1554. googleapi.ServerResponse `json:"-"`
  1555. }
  1556. // PermissionsBatchUpdateRequest: The request sent to
  1557. // mapsengine.permissions.batchUpdate.
  1558. type PermissionsBatchUpdateRequest struct {
  1559. // Permissions: The permissions to be inserted or updated.
  1560. Permissions []*Permission `json:"permissions,omitempty"`
  1561. // ForceSendFields is a list of field names (e.g. "Permissions") to
  1562. // unconditionally include in API requests. By default, fields with
  1563. // empty values are omitted from API requests. However, any non-pointer,
  1564. // non-interface field appearing in ForceSendFields will be sent to the
  1565. // server regardless of whether the field is empty or not. This may be
  1566. // used to include empty fields in Patch requests.
  1567. ForceSendFields []string `json:"-"`
  1568. }
  1569. func (s *PermissionsBatchUpdateRequest) MarshalJSON() ([]byte, error) {
  1570. type noMethod PermissionsBatchUpdateRequest
  1571. raw := noMethod(*s)
  1572. return gensupport.MarshalJSON(raw, s.ForceSendFields)
  1573. }
  1574. // PermissionsBatchUpdateResponse: The response returned by a call to
  1575. // mapsengine.permissions.batchUpdate.
  1576. type PermissionsBatchUpdateResponse struct {
  1577. // ServerResponse contains the HTTP response code and headers from the
  1578. // server.
  1579. googleapi.ServerResponse `json:"-"`
  1580. }
  1581. type PermissionsListResponse struct {
  1582. // Permissions: The set of permissions associated with this asset.
  1583. Permissions []*Permission `json:"permissions,omitempty"`
  1584. // ServerResponse contains the HTTP response code and headers from the
  1585. // server.
  1586. googleapi.ServerResponse `json:"-"`
  1587. // ForceSendFields is a list of field names (e.g. "Permissions") to
  1588. // unconditionally include in API requests. By default, fields with
  1589. // empty values are omitted from API requests. However, any non-pointer,
  1590. // non-interface field appearing in ForceSendFields will be sent to the
  1591. // server regardless of whether the field is empty or not. This may be
  1592. // used to include empty fields in Patch requests.
  1593. ForceSendFields []string `json:"-"`
  1594. }
  1595. func (s *PermissionsListResponse) MarshalJSON() ([]byte, error) {
  1596. type noMethod PermissionsListResponse
  1597. raw := noMethod(*s)
  1598. return gensupport.MarshalJSON(raw, s.ForceSendFields)
  1599. }
  1600. // PointStyle: Style for points.
  1601. type PointStyle struct {
  1602. // Icon: Icon for the point; if it isn't null, exactly one of 'name',
  1603. // 'id' or 'scaledShape' must be set.
  1604. Icon *IconStyle `json:"icon,omitempty"`
  1605. // Label: Label style for the point.
  1606. Label *LabelStyle `json:"label,omitempty"`
  1607. // ForceSendFields is a list of field names (e.g. "Icon") to
  1608. // unconditionally include in API requests. By default, fields with
  1609. // empty values are omitted from API requests. However, any non-pointer,
  1610. // non-interface field appearing in ForceSendFields will be sent to the
  1611. // server regardless of whether the field is empty or not. This may be
  1612. // used to include empty fields in Patch requests.
  1613. ForceSendFields []string `json:"-"`
  1614. }
  1615. func (s *PointStyle) MarshalJSON() ([]byte, error) {
  1616. type noMethod PointStyle
  1617. raw := noMethod(*s)
  1618. return gensupport.MarshalJSON(raw, s.ForceSendFields)
  1619. }
  1620. // PolygonStyle: Style for polygons.
  1621. type PolygonStyle struct {
  1622. // Fill: Fill color of the polygon. If not provided, the polygon will be
  1623. // transparent and not visible if there is no border.
  1624. Fill *Color `json:"fill,omitempty"`
  1625. // Label: Label style for the polygon.
  1626. Label *LabelStyle `json:"label,omitempty"`
  1627. // Stroke: Border of the polygon. 0 < border.width <= 10.
  1628. Stroke *Border `json:"stroke,omitempty"`
  1629. // ForceSendFields is a list of field names (e.g. "Fill") to
  1630. // unconditionally include in API requests. By default, fields with
  1631. // empty values are omitted from API requests. However, any non-pointer,
  1632. // non-interface field appearing in ForceSendFields will be sent to the
  1633. // server regardless of whether the field is empty or not. This may be
  1634. // used to include empty fields in Patch requests.
  1635. ForceSendFields []string `json:"-"`
  1636. }
  1637. func (s *PolygonStyle) MarshalJSON() ([]byte, error) {
  1638. type noMethod PolygonStyle
  1639. raw := noMethod(*s)
  1640. return gensupport.MarshalJSON(raw, s.ForceSendFields)
  1641. }
  1642. // ProcessResponse: The response returned by a call to any asset's
  1643. // Process method.
  1644. type ProcessResponse struct {
  1645. // ServerResponse contains the HTTP response code and headers from the
  1646. // server.
  1647. googleapi.ServerResponse `json:"-"`
  1648. }
  1649. // Project: A project groups a collection of resources.
  1650. type Project struct {
  1651. // Id: An ID used to refer to this project.
  1652. Id string `json:"id,omitempty"`
  1653. // Name: A user provided name for this project.
  1654. Name string `json:"name,omitempty"`
  1655. // ForceSendFields is a list of field names (e.g. "Id") to
  1656. // unconditionally include in API requests. By default, fields with
  1657. // empty values are omitted from API requests. However, any non-pointer,
  1658. // non-interface field appearing in ForceSendFields will be sent to the
  1659. // server regardless of whether the field is empty or not. This may be
  1660. // used to include empty fields in Patch requests.
  1661. ForceSendFields []string `json:"-"`
  1662. }
  1663. func (s *Project) MarshalJSON() ([]byte, error) {
  1664. type noMethod Project
  1665. raw := noMethod(*s)
  1666. return gensupport.MarshalJSON(raw, s.ForceSendFields)
  1667. }
  1668. // ProjectsListResponse: The response returned by a call to
  1669. // projects.List.
  1670. type ProjectsListResponse struct {
  1671. // Projects: Projects returned.
  1672. Projects []*Project `json:"projects,omitempty"`
  1673. // ServerResponse contains the HTTP response code and headers from the
  1674. // server.
  1675. googleapi.ServerResponse `json:"-"`
  1676. // ForceSendFields is a list of field names (e.g. "Projects") to
  1677. // unconditionally include in API requests. By default, fields with
  1678. // empty values are omitted from API requests. However, any non-pointer,
  1679. // non-interface field appearing in ForceSendFields will be sent to the
  1680. // server regardless of whether the field is empty or not. This may be
  1681. // used to include empty fields in Patch requests.
  1682. ForceSendFields []string `json:"-"`
  1683. }
  1684. func (s *ProjectsListResponse) MarshalJSON() ([]byte, error) {
  1685. type noMethod ProjectsListResponse
  1686. raw := noMethod(*s)
  1687. return gensupport.MarshalJSON(raw, s.ForceSendFields)
  1688. }
  1689. // PublishResponse: The response returned by a call to any asset's
  1690. // Publish method.
  1691. type PublishResponse struct {
  1692. // ServerResponse contains the HTTP response code and headers from the
  1693. // server.
  1694. googleapi.ServerResponse `json:"-"`
  1695. }
  1696. // PublishedLayer: The published version of a layer.
  1697. type PublishedLayer struct {
  1698. // Description: The description of this Layer, supplied by the author.
  1699. Description string `json:"description,omitempty"`
  1700. // Id: A globally unique ID, used to refer to this Layer.
  1701. Id string `json:"id,omitempty"`
  1702. // LayerType: The type of the datasources used to build this Layer. This
  1703. // should be used instead of datasourceType. At least one of layerType
  1704. // and datasourceType and must be specified, but layerType takes
  1705. // precedence.
  1706. //
  1707. // Possible values:
  1708. // "image"
  1709. // "vector"
  1710. LayerType string `json:"layerType,omitempty"`
  1711. // Name: The name of this Layer, supplied by the author.
  1712. Name string `json:"name,omitempty"`
  1713. // ProjectId: The ID of the project that this Layer is in.
  1714. ProjectId string `json:"projectId,omitempty"`
  1715. // ServerResponse contains the HTTP response code and headers from the
  1716. // server.
  1717. googleapi.ServerResponse `json:"-"`
  1718. // ForceSendFields is a list of field names (e.g. "Description") to
  1719. // unconditionally include in API requests. By default, fields with
  1720. // empty values are omitted from API requests. However, any non-pointer,
  1721. // non-interface field appearing in ForceSendFields will be sent to the
  1722. // server regardless of whether the field is empty or not. This may be
  1723. // used to include empty fields in Patch requests.
  1724. ForceSendFields []string `json:"-"`
  1725. }
  1726. func (s *PublishedLayer) MarshalJSON() ([]byte, error) {
  1727. type noMethod PublishedLayer
  1728. raw := noMethod(*s)
  1729. return gensupport.MarshalJSON(raw, s.ForceSendFields)
  1730. }
  1731. // PublishedLayersListResponse: The response returned by a call to
  1732. // layers.List.published.
  1733. type PublishedLayersListResponse struct {
  1734. // Layers: Resources returned.
  1735. Layers []*PublishedLayer `json:"layers,omitempty"`
  1736. // NextPageToken: Next page token.
  1737. NextPageToken string `json:"nextPageToken,omitempty"`
  1738. // ServerResponse contains the HTTP response code and headers from the
  1739. // server.
  1740. googleapi.ServerResponse `json:"-"`
  1741. // ForceSendFields is a list of field names (e.g. "Layers") to
  1742. // unconditionally include in API requests. By default, fields with
  1743. // empty values are omitted from API requests. However, any non-pointer,
  1744. // non-interface field appearing in ForceSendFields will be sent to the
  1745. // server regardless of whether the field is empty or not. This may be
  1746. // used to include empty fields in Patch requests.
  1747. ForceSendFields []string `json:"-"`
  1748. }
  1749. func (s *PublishedLayersListResponse) MarshalJSON() ([]byte, error) {
  1750. type noMethod PublishedLayersListResponse
  1751. raw := noMethod(*s)
  1752. return gensupport.MarshalJSON(raw, s.ForceSendFields)
  1753. }
  1754. // PublishedMap: The published version of a map asset.
  1755. type PublishedMap struct {
  1756. // Contents: The contents of this Map.
  1757. Contents []MapItem `json:"contents,omitempty"`
  1758. // DefaultViewport: An array of four numbers (west, south, east, north)
  1759. // which defines the rectangular bounding box of the default viewport.
  1760. // The numbers represent latitude and longitude in decimal degrees.
  1761. DefaultViewport []float64 `json:"defaultViewport,omitempty"`
  1762. // Description: The description of this Map, supplied by the author.
  1763. Description string `json:"description,omitempty"`
  1764. // Id: A globally unique ID, used to refer to this Map.
  1765. Id string `json:"id,omitempty"`
  1766. // Name: The name of this Map, supplied by the author.
  1767. Name string `json:"name,omitempty"`
  1768. // ProjectId: The ID of the project that this Map is in.
  1769. ProjectId string `json:"projectId,omitempty"`
  1770. // ServerResponse contains the HTTP response code and headers from the
  1771. // server.
  1772. googleapi.ServerResponse `json:"-"`
  1773. // ForceSendFields is a list of field names (e.g. "Contents") to
  1774. // unconditionally include in API requests. By default, fields with
  1775. // empty values are omitted from API requests. However, any non-pointer,
  1776. // non-interface field appearing in ForceSendFields will be sent to the
  1777. // server regardless of whether the field is empty or not. This may be
  1778. // used to include empty fields in Patch requests.
  1779. ForceSendFields []string `json:"-"`
  1780. }
  1781. func (s *PublishedMap) MarshalJSON() ([]byte, error) {
  1782. type noMethod PublishedMap
  1783. raw := noMethod(*s)
  1784. return gensupport.MarshalJSON(raw, s.ForceSendFields)
  1785. }
  1786. // PublishedMapsListResponse: The response returned by a call to
  1787. // maps.List.published.
  1788. type PublishedMapsListResponse struct {
  1789. // Maps: Resources returned.
  1790. Maps []*PublishedMap `json:"maps,omitempty"`
  1791. // NextPageToken: Next page token.
  1792. NextPageToken string `json:"nextPageToken,omitempty"`
  1793. // ServerResponse contains the HTTP response code and headers from the
  1794. // server.
  1795. googleapi.ServerResponse `json:"-"`
  1796. // ForceSendFields is a list of field names (e.g. "Maps") to
  1797. // unconditionally include in API requests. By default, fields with
  1798. // empty values are omitted from API requests. However, any non-pointer,
  1799. // non-interface field appearing in ForceSendFields will be sent to the
  1800. // server regardless of whether the field is empty or not. This may be
  1801. // used to include empty fields in Patch requests.
  1802. ForceSendFields []string `json:"-"`
  1803. }
  1804. func (s *PublishedMapsListResponse) MarshalJSON() ([]byte, error) {
  1805. type noMethod PublishedMapsListResponse
  1806. raw := noMethod(*s)
  1807. return gensupport.MarshalJSON(raw, s.ForceSendFields)
  1808. }
  1809. // Raster: A geo-referenced raster.
  1810. type Raster struct {
  1811. // AcquisitionTime: The acquisition time of this Raster.
  1812. AcquisitionTime *AcquisitionTime `json:"acquisitionTime,omitempty"`
  1813. // Attribution: The name of the attribution to be used for this Raster.
  1814. Attribution string `json:"attribution,omitempty"`
  1815. // Bbox: A rectangular bounding box which contains all of the data in
  1816. // this Raster. The box is expressed as \"west, south, east, north\".
  1817. // The numbers represent latitudes and longitudes in decimal degrees.
  1818. Bbox []float64 `json:"bbox,omitempty"`
  1819. // CreationTime: The creation time of this raster. The value is an RFC
  1820. // 3339 formatted date-time value (e.g. 1970-01-01T00:00:00Z).
  1821. CreationTime string `json:"creationTime,omitempty"`
  1822. // CreatorEmail: The email address of the creator of this raster. This
  1823. // is only returned on GET requests and not LIST requests.
  1824. CreatorEmail string `json:"creatorEmail,omitempty"`
  1825. // Description: The description of this Raster, supplied by the author.
  1826. Description string `json:"description,omitempty"`
  1827. // DraftAccessList: Deprecated: The name of an access list of the Map
  1828. // Editor type. The user on whose behalf the request is being sent must
  1829. // be an editor on that access list. Note: Google Maps Engine no longer
  1830. // uses access lists. Instead, each asset has its own list of
  1831. // permissions. For backward compatibility, the API still accepts access
  1832. // lists for projects that are already using access lists. If you
  1833. // created a GME account/project after July 14th, 2014, you will not be
  1834. // able to send API requests that include access lists. Note: This is an
  1835. // input field only. It is not returned in response to a list or get
  1836. // request.
  1837. DraftAccessList string `json:"draftAccessList,omitempty"`
  1838. // Etag: The ETag, used to refer to the current version of the asset.
  1839. Etag string `json:"etag,omitempty"`
  1840. // Files: The files associated with this Raster.
  1841. Files []*File `json:"files,omitempty"`
  1842. // Id: A globally unique ID, used to refer to this Raster.
  1843. Id string `json:"id,omitempty"`
  1844. // LastModifiedTime: The last modified time of this raster. The value is
  1845. // an RFC 3339 formatted date-time value (e.g. 1970-01-01T00:00:00Z).
  1846. LastModifiedTime string `json:"lastModifiedTime,omitempty"`
  1847. // LastModifierEmail: The email address of the last modifier of this
  1848. // raster. This is only returned on GET requests and not LIST requests.
  1849. LastModifierEmail string `json:"lastModifierEmail,omitempty"`
  1850. // MaskType: The mask processing type of this Raster.
  1851. MaskType string `json:"maskType,omitempty"`
  1852. // Name: The name of this Raster, supplied by the author.
  1853. Name string `json:"name,omitempty"`
  1854. // ProcessingStatus: The processing status of this Raster.
  1855. //
  1856. // Possible values:
  1857. // "complete"
  1858. // "failed"
  1859. // "notReady"
  1860. // "processing"
  1861. // "ready"
  1862. ProcessingStatus string `json:"processingStatus,omitempty"`
  1863. // ProjectId: The ID of the project that this Raster is in.
  1864. ProjectId string `json:"projectId,omitempty"`
  1865. // RasterType: The type of this Raster. Always "image" today.
  1866. //
  1867. // Possible values:
  1868. // "image"
  1869. RasterType string `json:"rasterType,omitempty"`
  1870. // Tags: Tags of this Raster.
  1871. Tags []string `json:"tags,omitempty"`
  1872. // WritersCanEditPermissions: If true, WRITERs of the asset are able to
  1873. // edit the asset permissions.
  1874. WritersCanEditPermissions bool `json:"writersCanEditPermissions,omitempty"`
  1875. // ServerResponse contains the HTTP response code and headers from the
  1876. // server.
  1877. googleapi.ServerResponse `json:"-"`
  1878. // ForceSendFields is a list of field names (e.g. "AcquisitionTime") to
  1879. // unconditionally include in API requests. By default, fields with
  1880. // empty values are omitted from API requests. However, any non-pointer,
  1881. // non-interface field appearing in ForceSendFields will be sent to the
  1882. // server regardless of whether the field is empty or not. This may be
  1883. // used to include empty fields in Patch requests.
  1884. ForceSendFields []string `json:"-"`
  1885. }
  1886. func (s *Raster) MarshalJSON() ([]byte, error) {
  1887. type noMethod Raster
  1888. raw := noMethod(*s)
  1889. return gensupport.MarshalJSON(raw, s.ForceSendFields)
  1890. }
  1891. // RasterCollection: A raster collection groups multiple Raster
  1892. // resources for inclusion in a Layer.
  1893. type RasterCollection struct {
  1894. // Attribution: The name of the attribution to be used for this
  1895. // RasterCollection. Note: Attribution is returned in response to a get
  1896. // request but not a list request. After requesting a list of raster
  1897. // collections, you'll need to send a get request to retrieve the
  1898. // attribution for each raster collection.
  1899. Attribution string `json:"attribution,omitempty"`
  1900. // Bbox: A rectangular bounding box which contains all of the data in
  1901. // this RasterCollection. The box is expressed as \"west, south, east,
  1902. // north\". The numbers represent latitude and longitude in decimal
  1903. // degrees.
  1904. Bbox []float64 `json:"bbox,omitempty"`
  1905. // CreationTime: The creation time of this RasterCollection. The value
  1906. // is an RFC 3339 formatted date-time value (e.g. 1970-01-01T00:00:00Z).
  1907. CreationTime string `json:"creationTime,omitempty"`
  1908. // CreatorEmail: The email address of the creator of this raster
  1909. // collection. This is only returned on GET requests and not LIST
  1910. // requests.
  1911. CreatorEmail string `json:"creatorEmail,omitempty"`
  1912. // Description: The description of this RasterCollection, supplied by
  1913. // the author.
  1914. Description string `json:"description,omitempty"`
  1915. // DraftAccessList: Deprecated: The name of an access list of the Map
  1916. // Editor type. The user on whose behalf the request is being sent must
  1917. // be an editor on that access list. Note: Google Maps Engine no longer
  1918. // uses access lists. Instead, each asset has its own list of
  1919. // permissions. For backward compatibility, the API still accepts access
  1920. // lists for projects that are already using access lists. If you
  1921. // created a GME account/project after July 14th, 2014, you will not be
  1922. // able to send API requests that include access lists. Note: This is an
  1923. // input field only. It is not returned in response to a list or get
  1924. // request.
  1925. DraftAccessList string `json:"draftAccessList,omitempty"`
  1926. // Etag: The ETag, used to refer to the current version of the asset.
  1927. Etag string `json:"etag,omitempty"`
  1928. // Id: A globally unique ID, used to refer to this RasterCollection.
  1929. Id string `json:"id,omitempty"`
  1930. // LastModifiedTime: The last modified time of this RasterCollection.
  1931. // The value is an RFC 3339 formatted date-time value (e.g.
  1932. // 1970-01-01T00:00:00Z).
  1933. LastModifiedTime string `json:"lastModifiedTime,omitempty"`
  1934. // LastModifierEmail: The email address of the last modifier of this
  1935. // raster collection. This is only returned on GET requests and not LIST
  1936. // requests.
  1937. LastModifierEmail string `json:"lastModifierEmail,omitempty"`
  1938. // Mosaic: True if this RasterCollection is a mosaic.
  1939. Mosaic bool `json:"mosaic,omitempty"`
  1940. // Name: The name of this RasterCollection, supplied by the author.
  1941. Name string `json:"name,omitempty"`
  1942. // ProcessingStatus: The processing status of this RasterCollection.
  1943. //
  1944. // Possible values:
  1945. // "complete"
  1946. // "failed"
  1947. // "notReady"
  1948. // "processing"
  1949. // "ready"
  1950. ProcessingStatus string `json:"processingStatus,omitempty"`
  1951. // ProjectId: The ID of the project that this RasterCollection is in.
  1952. ProjectId string `json:"projectId,omitempty"`
  1953. // RasterType: The type of rasters contained within this
  1954. // RasterCollection.
  1955. //
  1956. // Possible values:
  1957. // "image"
  1958. RasterType string `json:"rasterType,omitempty"`
  1959. // Tags: Tags of this RasterCollection.
  1960. Tags []string `json:"tags,omitempty"`
  1961. // WritersCanEditPermissions: If true, WRITERs of the asset are able to
  1962. // edit the asset permissions.
  1963. WritersCanEditPermissions bool `json:"writersCanEditPermissions,omitempty"`
  1964. // ServerResponse contains the HTTP response code and headers from the
  1965. // server.
  1966. googleapi.ServerResponse `json:"-"`
  1967. // ForceSendFields is a list of field names (e.g. "Attribution") to
  1968. // unconditionally include in API requests. By default, fields with
  1969. // empty values are omitted from API requests. However, any non-pointer,
  1970. // non-interface field appearing in ForceSendFields will be sent to the
  1971. // server regardless of whether the field is empty or not. This may be
  1972. // used to include empty fields in Patch requests.
  1973. ForceSendFields []string `json:"-"`
  1974. }
  1975. func (s *RasterCollection) MarshalJSON() ([]byte, error) {
  1976. type noMethod RasterCollection
  1977. raw := noMethod(*s)
  1978. return gensupport.MarshalJSON(raw, s.ForceSendFields)
  1979. }
  1980. // RasterCollectionsListResponse: The response returned by a call to
  1981. // raster_collections.List. Note: The list response does not include all
  1982. // the fields available in a raster collection. Refer to the
  1983. // RasterCollection resource description for details of the fields that
  1984. // are not included. You'll need to send a get request to retrieve the
  1985. // additional fields for each raster collection.
  1986. type RasterCollectionsListResponse struct {
  1987. // NextPageToken: Next page token.
  1988. NextPageToken string `json:"nextPageToken,omitempty"`
  1989. // RasterCollections: Resources returned.
  1990. RasterCollections []*RasterCollection `json:"rasterCollections,omitempty"`
  1991. // ServerResponse contains the HTTP response code and headers from the
  1992. // server.
  1993. googleapi.ServerResponse `json:"-"`
  1994. // ForceSendFields is a list of field names (e.g. "NextPageToken") to
  1995. // unconditionally include in API requests. By default, fields with
  1996. // empty values are omitted from API requests. However, any non-pointer,
  1997. // non-interface field appearing in ForceSendFields will be sent to the
  1998. // server regardless of whether the field is empty or not. This may be
  1999. // used to include empty fields in Patch requests.
  2000. ForceSendFields []string `json:"-"`
  2001. }
  2002. func (s *RasterCollectionsListResponse) MarshalJSON() ([]byte, error) {
  2003. type noMethod RasterCollectionsListResponse
  2004. raw := noMethod(*s)
  2005. return gensupport.MarshalJSON(raw, s.ForceSendFields)
  2006. }
  2007. // RasterCollectionsRaster: A raster resource.
  2008. type RasterCollectionsRaster struct {
  2009. // Bbox: A rectangular bounding box which contains all of the data in
  2010. // this Raster. The box is expressed as \"west, south, east, north\".
  2011. // The numbers represent latitudes and longitudes in decimal degrees.
  2012. Bbox []float64 `json:"bbox,omitempty"`
  2013. // CreationTime: The creation time of this raster. The value is an RFC
  2014. // 3339 formatted date-time value (e.g. 1970-01-01T00:00:00Z).
  2015. CreationTime string `json:"creationTime,omitempty"`
  2016. // Description: The description of this Raster, supplied by the author.
  2017. Description string `json:"description,omitempty"`
  2018. // Id: A globally unique ID, used to refer to this Raster.
  2019. Id string `json:"id,omitempty"`
  2020. // LastModifiedTime: The last modified time of this raster. The value is
  2021. // an RFC 3339 formatted date-time value (e.g. 1970-01-01T00:00:00Z).
  2022. LastModifiedTime string `json:"lastModifiedTime,omitempty"`
  2023. // Name: The name of this Raster, supplied by the author.
  2024. Name string `json:"name,omitempty"`
  2025. // ProjectId: The ID of the project that this Raster is in.
  2026. ProjectId string `json:"projectId,omitempty"`
  2027. // RasterType: The type of this Raster. Always "image" today.
  2028. RasterType string `json:"rasterType,omitempty"`
  2029. // Tags: Tags of this Raster.
  2030. Tags []string `json:"tags,omitempty"`
  2031. // ForceSendFields is a list of field names (e.g. "Bbox") to
  2032. // unconditionally include in API requests. By default, fields with
  2033. // empty values are omitted from API requests. However, any non-pointer,
  2034. // non-interface field appearing in ForceSendFields will be sent to the
  2035. // server regardless of whether the field is empty or not. This may be
  2036. // used to include empty fields in Patch requests.
  2037. ForceSendFields []string `json:"-"`
  2038. }
  2039. func (s *RasterCollectionsRaster) MarshalJSON() ([]byte, error) {
  2040. type noMethod RasterCollectionsRaster
  2041. raw := noMethod(*s)
  2042. return gensupport.MarshalJSON(raw, s.ForceSendFields)
  2043. }
  2044. // RasterCollectionsRasterBatchDeleteRequest: The request sent to
  2045. // rasterCollections.Rasters.BatchDelete.
  2046. type RasterCollectionsRasterBatchDeleteRequest struct {
  2047. // Ids: An array of Raster asset IDs to be removed from this
  2048. // RasterCollection.
  2049. Ids []string `json:"ids,omitempty"`
  2050. // ForceSendFields is a list of field names (e.g. "Ids") to
  2051. // unconditionally include in API requests. By default, fields with
  2052. // empty values are omitted from API requests. However, any non-pointer,
  2053. // non-interface field appearing in ForceSendFields will be sent to the
  2054. // server regardless of whether the field is empty or not. This may be
  2055. // used to include empty fields in Patch requests.
  2056. ForceSendFields []string `json:"-"`
  2057. }
  2058. func (s *RasterCollectionsRasterBatchDeleteRequest) MarshalJSON() ([]byte, error) {
  2059. type noMethod RasterCollectionsRasterBatchDeleteRequest
  2060. raw := noMethod(*s)
  2061. return gensupport.MarshalJSON(raw, s.ForceSendFields)
  2062. }
  2063. // RasterCollectionsRastersBatchDeleteResponse: The response returned by
  2064. // a call to rasterCollections.rasters.batchDelete.
  2065. type RasterCollectionsRastersBatchDeleteResponse struct {
  2066. // ServerResponse contains the HTTP response code and headers from the
  2067. // server.
  2068. googleapi.ServerResponse `json:"-"`
  2069. }
  2070. // RasterCollectionsRastersBatchInsertRequest: The request sent to
  2071. // rasterCollections.Rasters.BatchInsert.
  2072. type RasterCollectionsRastersBatchInsertRequest struct {
  2073. // Ids: An array of Raster asset IDs to be added to this
  2074. // RasterCollection.
  2075. Ids []string `json:"ids,omitempty"`
  2076. // ForceSendFields is a list of field names (e.g. "Ids") to
  2077. // unconditionally include in API requests. By default, fields with
  2078. // empty values are omitted from API requests. However, any non-pointer,
  2079. // non-interface field appearing in ForceSendFields will be sent to the
  2080. // server regardless of whether the field is empty or not. This may be
  2081. // used to include empty fields in Patch requests.
  2082. ForceSendFields []string `json:"-"`
  2083. }
  2084. func (s *RasterCollectionsRastersBatchInsertRequest) MarshalJSON() ([]byte, error) {
  2085. type noMethod RasterCollectionsRastersBatchInsertRequest
  2086. raw := noMethod(*s)
  2087. return gensupport.MarshalJSON(raw, s.ForceSendFields)
  2088. }
  2089. // RasterCollectionsRastersBatchInsertResponse: The response returned by
  2090. // a call to rasterCollections.rasters.batchInsert.
  2091. type RasterCollectionsRastersBatchInsertResponse struct {
  2092. // ServerResponse contains the HTTP response code and headers from the
  2093. // server.
  2094. googleapi.ServerResponse `json:"-"`
  2095. }
  2096. // RasterCollectionsRastersListResponse: The response returned by a call
  2097. // to rasterCollections.rasters.List.
  2098. type RasterCollectionsRastersListResponse struct {
  2099. // NextPageToken: Next page token.
  2100. NextPageToken string `json:"nextPageToken,omitempty"`
  2101. // Rasters: Resources returned.
  2102. Rasters []*RasterCollectionsRaster `json:"rasters,omitempty"`
  2103. // ServerResponse contains the HTTP response code and headers from the
  2104. // server.
  2105. googleapi.ServerResponse `json:"-"`
  2106. // ForceSendFields is a list of field names (e.g. "NextPageToken") to
  2107. // unconditionally include in API requests. By default, fields with
  2108. // empty values are omitted from API requests. However, any non-pointer,
  2109. // non-interface field appearing in ForceSendFields will be sent to the
  2110. // server regardless of whether the field is empty or not. This may be
  2111. // used to include empty fields in Patch requests.
  2112. ForceSendFields []string `json:"-"`
  2113. }
  2114. func (s *RasterCollectionsRastersListResponse) MarshalJSON() ([]byte, error) {
  2115. type noMethod RasterCollectionsRastersListResponse
  2116. raw := noMethod(*s)
  2117. return gensupport.MarshalJSON(raw, s.ForceSendFields)
  2118. }
  2119. // RastersListResponse: The response returned by a call to rasters.List.
  2120. type RastersListResponse struct {
  2121. // NextPageToken: Next page token.
  2122. NextPageToken string `json:"nextPageToken,omitempty"`
  2123. // Rasters: Resources returned.
  2124. Rasters []*Raster `json:"rasters,omitempty"`
  2125. // ServerResponse contains the HTTP response code and headers from the
  2126. // server.
  2127. googleapi.ServerResponse `json:"-"`
  2128. // ForceSendFields is a list of field names (e.g. "NextPageToken") to
  2129. // unconditionally include in API requests. By default, fields with
  2130. // empty values are omitted from API requests. However, any non-pointer,
  2131. // non-interface field appearing in ForceSendFields will be sent to the
  2132. // server regardless of whether the field is empty or not. This may be
  2133. // used to include empty fields in Patch requests.
  2134. ForceSendFields []string `json:"-"`
  2135. }
  2136. func (s *RastersListResponse) MarshalJSON() ([]byte, error) {
  2137. type noMethod RastersListResponse
  2138. raw := noMethod(*s)
  2139. return gensupport.MarshalJSON(raw, s.ForceSendFields)
  2140. }
  2141. // ScaledShape: Parameters for styling points as scaled shapes.
  2142. type ScaledShape struct {
  2143. // Border: Border color/width of the shape. If not specified the shape
  2144. // won't have a border.
  2145. Border *Border `json:"border,omitempty"`
  2146. // Fill: The fill color of the shape. If not specified the shape will be
  2147. // transparent (although the borders may not be).
  2148. Fill *Color `json:"fill,omitempty"`
  2149. // Shape: Name of the shape.
  2150. //
  2151. // Possible values:
  2152. // "circle"
  2153. Shape string `json:"shape,omitempty"`
  2154. // ForceSendFields is a list of field names (e.g. "Border") to
  2155. // unconditionally include in API requests. By default, fields with
  2156. // empty values are omitted from API requests. However, any non-pointer,
  2157. // non-interface field appearing in ForceSendFields will be sent to the
  2158. // server regardless of whether the field is empty or not. This may be
  2159. // used to include empty fields in Patch requests.
  2160. ForceSendFields []string `json:"-"`
  2161. }
  2162. func (s *ScaledShape) MarshalJSON() ([]byte, error) {
  2163. type noMethod ScaledShape
  2164. raw := noMethod(*s)
  2165. return gensupport.MarshalJSON(raw, s.ForceSendFields)
  2166. }
  2167. // ScalingFunction: Parameters for scaling scaled shapes.
  2168. type ScalingFunction struct {
  2169. // Column: Name of the numeric column used to scale a shape.
  2170. Column string `json:"column,omitempty"`
  2171. // ScalingType: The type of scaling function to use. Defaults to SQRT.
  2172. // Currently only linear and square root scaling are supported.
  2173. //
  2174. // Possible values:
  2175. // "linear"
  2176. // "sqrt"
  2177. ScalingType string `json:"scalingType,omitempty"`
  2178. // SizeRange: The range of shape sizes, in pixels. For circles, the size
  2179. // corresponds to the diameter.
  2180. SizeRange *SizeRange `json:"sizeRange,omitempty"`
  2181. // ValueRange: The range of values to display across the size range.
  2182. ValueRange *ValueRange `json:"valueRange,omitempty"`
  2183. // ForceSendFields is a list of field names (e.g. "Column") to
  2184. // unconditionally include in API requests. By default, fields with
  2185. // empty values are omitted from API requests. However, any non-pointer,
  2186. // non-interface field appearing in ForceSendFields will be sent to the
  2187. // server regardless of whether the field is empty or not. This may be
  2188. // used to include empty fields in Patch requests.
  2189. ForceSendFields []string `json:"-"`
  2190. }
  2191. func (s *ScalingFunction) MarshalJSON() ([]byte, error) {
  2192. type noMethod ScalingFunction
  2193. raw := noMethod(*s)
  2194. return gensupport.MarshalJSON(raw, s.ForceSendFields)
  2195. }
  2196. // Schema: A schema indicating the properties which may be associated
  2197. // with features within a Table, and the types of those properties.
  2198. type Schema struct {
  2199. // Columns: An array of TableColumn objects. The first object in the
  2200. // array must be named geometry and be of type points, lineStrings,
  2201. // polygons, or mixedGeometry.
  2202. Columns []*TableColumn `json:"columns,omitempty"`
  2203. // PrimaryGeometry: The name of the column that contains a feature's
  2204. // geometry. This field can be omitted during table create; Google Maps
  2205. // Engine supports only a single geometry column, which must be named
  2206. // geometry and be the first object in the columns array.
  2207. PrimaryGeometry string `json:"primaryGeometry,omitempty"`
  2208. // PrimaryKey: The name of the column that contains the unique
  2209. // identifier of a Feature.
  2210. PrimaryKey string `json:"primaryKey,omitempty"`
  2211. // ForceSendFields is a list of field names (e.g. "Columns") to
  2212. // unconditionally include in API requests. By default, fields with
  2213. // empty values are omitted from API requests. However, any non-pointer,
  2214. // non-interface field appearing in ForceSendFields will be sent to the
  2215. // server regardless of whether the field is empty or not. This may be
  2216. // used to include empty fields in Patch requests.
  2217. ForceSendFields []string `json:"-"`
  2218. }
  2219. func (s *Schema) MarshalJSON() ([]byte, error) {
  2220. type noMethod Schema
  2221. raw := noMethod(*s)
  2222. return gensupport.MarshalJSON(raw, s.ForceSendFields)
  2223. }
  2224. // SizeRange: Scaled shape size range in pixels. For circles, size
  2225. // corresponds to diameter.
  2226. type SizeRange struct {
  2227. // Max: Maximum size, in pixels.
  2228. Max float64 `json:"max,omitempty"`
  2229. // Min: Minimum size, in pixels.
  2230. Min float64 `json:"min,omitempty"`
  2231. // ForceSendFields is a list of field names (e.g. "Max") to
  2232. // unconditionally include in API requests. By default, fields with
  2233. // empty values are omitted from API requests. However, any non-pointer,
  2234. // non-interface field appearing in ForceSendFields will be sent to the
  2235. // server regardless of whether the field is empty or not. This may be
  2236. // used to include empty fields in Patch requests.
  2237. ForceSendFields []string `json:"-"`
  2238. }
  2239. func (s *SizeRange) MarshalJSON() ([]byte, error) {
  2240. type noMethod SizeRange
  2241. raw := noMethod(*s)
  2242. return gensupport.MarshalJSON(raw, s.ForceSendFields)
  2243. }
  2244. // Table: A collection of geographic features, and associated metadata.
  2245. type Table struct {
  2246. // Bbox: A rectangular bounding box which contains all of the data in
  2247. // this Table. The box is expressed as \"west, south, east, north\". The
  2248. // numbers represent latitude and longitude in decimal degrees.
  2249. Bbox []float64 `json:"bbox,omitempty"`
  2250. // CreationTime: The creation time of this table. The value is an RFC
  2251. // 3339 formatted date-time value (e.g. 1970-01-01T00:00:00Z).
  2252. CreationTime string `json:"creationTime,omitempty"`
  2253. // CreatorEmail: The email address of the creator of this table. This is
  2254. // only returned on GET requests and not LIST requests.
  2255. CreatorEmail string `json:"creatorEmail,omitempty"`
  2256. // Description: The description of this table, supplied by the author.
  2257. Description string `json:"description,omitempty"`
  2258. // DraftAccessList: Deprecated: The name of an access list of the Map
  2259. // Editor type. The user on whose behalf the request is being sent must
  2260. // be an editor on that access list. Note: Google Maps Engine no longer
  2261. // uses access lists. Instead, each asset has its own list of
  2262. // permissions. For backward compatibility, the API still accepts access
  2263. // lists for projects that are already using access lists. If you
  2264. // created a GME account/project after July 14th, 2014, you will not be
  2265. // able to send API requests that include access lists. Note: This is an
  2266. // input field only. It is not returned in response to a list or get
  2267. // request.
  2268. DraftAccessList string `json:"draftAccessList,omitempty"`
  2269. // Etag: The ETag, used to refer to the current version of the asset.
  2270. Etag string `json:"etag,omitempty"`
  2271. // Files: The files associated with this table.
  2272. Files []*File `json:"files,omitempty"`
  2273. // Id: A globally unique ID, used to refer to this table.
  2274. Id string `json:"id,omitempty"`
  2275. // LastModifiedTime: The last modified time of this table. The value is
  2276. // an RFC 3339 formatted date-time value (e.g. 1970-01-01T00:00:00Z).
  2277. LastModifiedTime string `json:"lastModifiedTime,omitempty"`
  2278. // LastModifierEmail: The email address of the last modifier of this
  2279. // table. This is only returned on GET requests and not LIST requests.
  2280. LastModifierEmail string `json:"lastModifierEmail,omitempty"`
  2281. // Name: The name of this table, supplied by the author.
  2282. Name string `json:"name,omitempty"`
  2283. // ProcessingStatus: The processing status of this table.
  2284. //
  2285. // Possible values:
  2286. // "complete"
  2287. // "failed"
  2288. // "notReady"
  2289. // "processing"
  2290. // "ready"
  2291. ProcessingStatus string `json:"processingStatus,omitempty"`
  2292. // ProjectId: The ID of the project to which the table belongs.
  2293. ProjectId string `json:"projectId,omitempty"`
  2294. // PublishedAccessList: Deprecated: The access list to whom view
  2295. // permissions are granted. The value must be the name of a Maps Engine
  2296. // access list of the Map Viewer type, and the user must be a viewer on
  2297. // that list. Note: Google Maps Engine no longer uses access lists.
  2298. // Instead, each asset has its own list of permissions. For backward
  2299. // compatibility, the API still accepts access lists for projects that
  2300. // are already using access lists. If you created a GME account/project
  2301. // after July 14th, 2014, you will not be able to send API requests that
  2302. // include access lists. Note: This is an input field only. It is not
  2303. // returned in response to a list or get request.
  2304. PublishedAccessList string `json:"publishedAccessList,omitempty"`
  2305. // Schema: The schema for this table. Note: The schema is returned in
  2306. // response to a get request but not a list request. After requesting a
  2307. // list of tables, you'll need to send a get request to retrieve the
  2308. // schema for each table.
  2309. Schema *Schema `json:"schema,omitempty"`
  2310. // SourceEncoding: Encoding of the uploaded files. Valid values include
  2311. // UTF-8, CP1251, ISO 8859-1, and Shift_JIS.
  2312. SourceEncoding string `json:"sourceEncoding,omitempty"`
  2313. // Tags: An array of text strings, with each string representing a tag.
  2314. // More information about tags can be found in the Tagging data article
  2315. // of the Maps Engine help center.
  2316. Tags []string `json:"tags,omitempty"`
  2317. // WritersCanEditPermissions: If true, WRITERs of the asset are able to
  2318. // edit the asset permissions.
  2319. WritersCanEditPermissions bool `json:"writersCanEditPermissions,omitempty"`
  2320. // ServerResponse contains the HTTP response code and headers from the
  2321. // server.
  2322. googleapi.ServerResponse `json:"-"`
  2323. // ForceSendFields is a list of field names (e.g. "Bbox") to
  2324. // unconditionally include in API requests. By default, fields with
  2325. // empty values are omitted from API requests. However, any non-pointer,
  2326. // non-interface field appearing in ForceSendFields will be sent to the
  2327. // server regardless of whether the field is empty or not. This may be
  2328. // used to include empty fields in Patch requests.
  2329. ForceSendFields []string `json:"-"`
  2330. }
  2331. func (s *Table) MarshalJSON() ([]byte, error) {
  2332. type noMethod Table
  2333. raw := noMethod(*s)
  2334. return gensupport.MarshalJSON(raw, s.ForceSendFields)
  2335. }
  2336. type TableColumn struct {
  2337. // Name: The column name.
  2338. Name string `json:"name,omitempty"`
  2339. // Type: The type of data stored in this column.
  2340. //
  2341. // Possible values:
  2342. // "datetime"
  2343. // "double"
  2344. // "integer"
  2345. // "lineStrings"
  2346. // "mixedGeometry"
  2347. // "points"
  2348. // "polygons"
  2349. // "string"
  2350. Type string `json:"type,omitempty"`
  2351. // ForceSendFields is a list of field names (e.g. "Name") to
  2352. // unconditionally include in API requests. By default, fields with
  2353. // empty values are omitted from API requests. However, any non-pointer,
  2354. // non-interface field appearing in ForceSendFields will be sent to the
  2355. // server regardless of whether the field is empty or not. This may be
  2356. // used to include empty fields in Patch requests.
  2357. ForceSendFields []string `json:"-"`
  2358. }
  2359. func (s *TableColumn) MarshalJSON() ([]byte, error) {
  2360. type noMethod TableColumn
  2361. raw := noMethod(*s)
  2362. return gensupport.MarshalJSON(raw, s.ForceSendFields)
  2363. }
  2364. // TablesListResponse: The response returned by a call to tables.List.
  2365. // Note: The list response does not include all the fields available in
  2366. // a table. Refer to the table resource description for details of the
  2367. // fields that are not included. You'll need to send a get request to
  2368. // retrieve the additional fields for each table.
  2369. type TablesListResponse struct {
  2370. // NextPageToken: Next page token.
  2371. NextPageToken string `json:"nextPageToken,omitempty"`
  2372. // Tables: Resources returned.
  2373. Tables []*Table `json:"tables,omitempty"`
  2374. // ServerResponse contains the HTTP response code and headers from the
  2375. // server.
  2376. googleapi.ServerResponse `json:"-"`
  2377. // ForceSendFields is a list of field names (e.g. "NextPageToken") to
  2378. // unconditionally include in API requests. By default, fields with
  2379. // empty values are omitted from API requests. However, any non-pointer,
  2380. // non-interface field appearing in ForceSendFields will be sent to the
  2381. // server regardless of whether the field is empty or not. This may be
  2382. // used to include empty fields in Patch requests.
  2383. ForceSendFields []string `json:"-"`
  2384. }
  2385. func (s *TablesListResponse) MarshalJSON() ([]byte, error) {
  2386. type noMethod TablesListResponse
  2387. raw := noMethod(*s)
  2388. return gensupport.MarshalJSON(raw, s.ForceSendFields)
  2389. }
  2390. // ValueRange: Range of values used for scaling shapes. The min/max
  2391. // values will be drawn as shapes with the min/max size.
  2392. type ValueRange struct {
  2393. // Max: Maximum value.
  2394. Max float64 `json:"max,omitempty"`
  2395. // Min: Minimum value.
  2396. Min float64 `json:"min,omitempty"`
  2397. // ForceSendFields is a list of field names (e.g. "Max") to
  2398. // unconditionally include in API requests. By default, fields with
  2399. // empty values are omitted from API requests. However, any non-pointer,
  2400. // non-interface field appearing in ForceSendFields will be sent to the
  2401. // server regardless of whether the field is empty or not. This may be
  2402. // used to include empty fields in Patch requests.
  2403. ForceSendFields []string `json:"-"`
  2404. }
  2405. func (s *ValueRange) MarshalJSON() ([]byte, error) {
  2406. type noMethod ValueRange
  2407. raw := noMethod(*s)
  2408. return gensupport.MarshalJSON(raw, s.ForceSendFields)
  2409. }
  2410. // VectorStyle: A vector style contains styling information for vector
  2411. // layer.
  2412. type VectorStyle struct {
  2413. DisplayRules []*DisplayRule `json:"displayRules,omitempty"`
  2414. // FeatureInfo: Individual feature info, this is called Info Window in
  2415. // Maps Engine UI. If not provided, a default template with all
  2416. // attributes will be generated.
  2417. FeatureInfo *FeatureInfo `json:"featureInfo,omitempty"`
  2418. // Type: The type of the vector style. Currently, only displayRule is
  2419. // supported.
  2420. //
  2421. // Possible values:
  2422. // "displayRule"
  2423. Type string `json:"type,omitempty"`
  2424. // ForceSendFields is a list of field names (e.g. "DisplayRules") to
  2425. // unconditionally include in API requests. By default, fields with
  2426. // empty values are omitted from API requests. However, any non-pointer,
  2427. // non-interface field appearing in ForceSendFields will be sent to the
  2428. // server regardless of whether the field is empty or not. This may be
  2429. // used to include empty fields in Patch requests.
  2430. ForceSendFields []string `json:"-"`
  2431. }
  2432. func (s *VectorStyle) MarshalJSON() ([]byte, error) {
  2433. type noMethod VectorStyle
  2434. raw := noMethod(*s)
  2435. return gensupport.MarshalJSON(raw, s.ForceSendFields)
  2436. }
  2437. // ZoomLevels: Zoom level range. Zoom levels are restricted between 0
  2438. // and 24, inclusive.
  2439. type ZoomLevels struct {
  2440. // Max: Maximum zoom level.
  2441. Max int64 `json:"max,omitempty"`
  2442. // Min: Minimum zoom level.
  2443. Min int64 `json:"min,omitempty"`
  2444. // ForceSendFields is a list of field names (e.g. "Max") to
  2445. // unconditionally include in API requests. By default, fields with
  2446. // empty values are omitted from API requests. However, any non-pointer,
  2447. // non-interface field appearing in ForceSendFields will be sent to the
  2448. // server regardless of whether the field is empty or not. This may be
  2449. // used to include empty fields in Patch requests.
  2450. ForceSendFields []string `json:"-"`
  2451. }
  2452. func (s *ZoomLevels) MarshalJSON() ([]byte, error) {
  2453. type noMethod ZoomLevels
  2454. raw := noMethod(*s)
  2455. return gensupport.MarshalJSON(raw, s.ForceSendFields)
  2456. }
  2457. // method id "mapsengine.assets.get":
  2458. type AssetsGetCall struct {
  2459. s *Service
  2460. id string
  2461. urlParams_ gensupport.URLParams
  2462. ifNoneMatch_ string
  2463. ctx_ context.Context
  2464. }
  2465. // Get: Return metadata for a particular asset.
  2466. func (r *AssetsService) Get(id string) *AssetsGetCall {
  2467. c := &AssetsGetCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  2468. c.id = id
  2469. return c
  2470. }
  2471. // Fields allows partial responses to be retrieved. See
  2472. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  2473. // for more information.
  2474. func (c *AssetsGetCall) Fields(s ...googleapi.Field) *AssetsGetCall {
  2475. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  2476. return c
  2477. }
  2478. // IfNoneMatch sets the optional parameter which makes the operation
  2479. // fail if the object's ETag matches the given value. This is useful for
  2480. // getting updates only after the object has changed since the last
  2481. // request. Use googleapi.IsNotModified to check whether the response
  2482. // error from Do is the result of In-None-Match.
  2483. func (c *AssetsGetCall) IfNoneMatch(entityTag string) *AssetsGetCall {
  2484. c.ifNoneMatch_ = entityTag
  2485. return c
  2486. }
  2487. // Context sets the context to be used in this call's Do method. Any
  2488. // pending HTTP request will be aborted if the provided context is
  2489. // canceled.
  2490. func (c *AssetsGetCall) Context(ctx context.Context) *AssetsGetCall {
  2491. c.ctx_ = ctx
  2492. return c
  2493. }
  2494. func (c *AssetsGetCall) doRequest(alt string) (*http.Response, error) {
  2495. var body io.Reader = nil
  2496. c.urlParams_.Set("alt", alt)
  2497. urls := googleapi.ResolveRelative(c.s.BasePath, "assets/{id}")
  2498. urls += "?" + c.urlParams_.Encode()
  2499. req, _ := http.NewRequest("GET", urls, body)
  2500. googleapi.Expand(req.URL, map[string]string{
  2501. "id": c.id,
  2502. })
  2503. req.Header.Set("User-Agent", c.s.userAgent())
  2504. if c.ifNoneMatch_ != "" {
  2505. req.Header.Set("If-None-Match", c.ifNoneMatch_)
  2506. }
  2507. if c.ctx_ != nil {
  2508. return ctxhttp.Do(c.ctx_, c.s.client, req)
  2509. }
  2510. return c.s.client.Do(req)
  2511. }
  2512. // Do executes the "mapsengine.assets.get" call.
  2513. // Exactly one of *Asset or error will be non-nil. Any non-2xx status
  2514. // code is an error. Response headers are in either
  2515. // *Asset.ServerResponse.Header or (if a response was returned at all)
  2516. // in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to
  2517. // check whether the returned error was because http.StatusNotModified
  2518. // was returned.
  2519. func (c *AssetsGetCall) Do(opts ...googleapi.CallOption) (*Asset, error) {
  2520. gensupport.SetOptions(c.urlParams_, opts...)
  2521. res, err := c.doRequest("json")
  2522. if res != nil && res.StatusCode == http.StatusNotModified {
  2523. if res.Body != nil {
  2524. res.Body.Close()
  2525. }
  2526. return nil, &googleapi.Error{
  2527. Code: res.StatusCode,
  2528. Header: res.Header,
  2529. }
  2530. }
  2531. if err != nil {
  2532. return nil, err
  2533. }
  2534. defer googleapi.CloseBody(res)
  2535. if err := googleapi.CheckResponse(res); err != nil {
  2536. return nil, err
  2537. }
  2538. ret := &Asset{
  2539. ServerResponse: googleapi.ServerResponse{
  2540. Header: res.Header,
  2541. HTTPStatusCode: res.StatusCode,
  2542. },
  2543. }
  2544. if err := json.NewDecoder(res.Body).Decode(&ret); err != nil {
  2545. return nil, err
  2546. }
  2547. return ret, nil
  2548. // {
  2549. // "description": "Return metadata for a particular asset.",
  2550. // "httpMethod": "GET",
  2551. // "id": "mapsengine.assets.get",
  2552. // "parameterOrder": [
  2553. // "id"
  2554. // ],
  2555. // "parameters": {
  2556. // "id": {
  2557. // "description": "The ID of the asset.",
  2558. // "location": "path",
  2559. // "required": true,
  2560. // "type": "string"
  2561. // }
  2562. // },
  2563. // "path": "assets/{id}",
  2564. // "response": {
  2565. // "$ref": "Asset"
  2566. // },
  2567. // "scopes": [
  2568. // "https://www.googleapis.com/auth/mapsengine",
  2569. // "https://www.googleapis.com/auth/mapsengine.readonly"
  2570. // ]
  2571. // }
  2572. }
  2573. // method id "mapsengine.assets.list":
  2574. type AssetsListCall struct {
  2575. s *Service
  2576. urlParams_ gensupport.URLParams
  2577. ifNoneMatch_ string
  2578. ctx_ context.Context
  2579. }
  2580. // List: Return all assets readable by the current user.
  2581. func (r *AssetsService) List() *AssetsListCall {
  2582. c := &AssetsListCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  2583. return c
  2584. }
  2585. // Bbox sets the optional parameter "bbox": A bounding box, expressed as
  2586. // "west,south,east,north". If set, only assets which intersect this
  2587. // bounding box will be returned.
  2588. func (c *AssetsListCall) Bbox(bbox string) *AssetsListCall {
  2589. c.urlParams_.Set("bbox", bbox)
  2590. return c
  2591. }
  2592. // CreatedAfter sets the optional parameter "createdAfter": An RFC 3339
  2593. // formatted date-time value (e.g. 1970-01-01T00:00:00Z). Returned
  2594. // assets will have been created at or after this time.
  2595. func (c *AssetsListCall) CreatedAfter(createdAfter string) *AssetsListCall {
  2596. c.urlParams_.Set("createdAfter", createdAfter)
  2597. return c
  2598. }
  2599. // CreatedBefore sets the optional parameter "createdBefore": An RFC
  2600. // 3339 formatted date-time value (e.g. 1970-01-01T00:00:00Z). Returned
  2601. // assets will have been created at or before this time.
  2602. func (c *AssetsListCall) CreatedBefore(createdBefore string) *AssetsListCall {
  2603. c.urlParams_.Set("createdBefore", createdBefore)
  2604. return c
  2605. }
  2606. // CreatorEmail sets the optional parameter "creatorEmail": An email
  2607. // address representing a user. Returned assets that have been created
  2608. // by the user associated with the provided email address.
  2609. func (c *AssetsListCall) CreatorEmail(creatorEmail string) *AssetsListCall {
  2610. c.urlParams_.Set("creatorEmail", creatorEmail)
  2611. return c
  2612. }
  2613. // MaxResults sets the optional parameter "maxResults": The maximum
  2614. // number of items to include in a single response page. The maximum
  2615. // supported value is 100.
  2616. func (c *AssetsListCall) MaxResults(maxResults int64) *AssetsListCall {
  2617. c.urlParams_.Set("maxResults", fmt.Sprint(maxResults))
  2618. return c
  2619. }
  2620. // ModifiedAfter sets the optional parameter "modifiedAfter": An RFC
  2621. // 3339 formatted date-time value (e.g. 1970-01-01T00:00:00Z). Returned
  2622. // assets will have been modified at or after this time.
  2623. func (c *AssetsListCall) ModifiedAfter(modifiedAfter string) *AssetsListCall {
  2624. c.urlParams_.Set("modifiedAfter", modifiedAfter)
  2625. return c
  2626. }
  2627. // ModifiedBefore sets the optional parameter "modifiedBefore": An RFC
  2628. // 3339 formatted date-time value (e.g. 1970-01-01T00:00:00Z). Returned
  2629. // assets will have been modified at or before this time.
  2630. func (c *AssetsListCall) ModifiedBefore(modifiedBefore string) *AssetsListCall {
  2631. c.urlParams_.Set("modifiedBefore", modifiedBefore)
  2632. return c
  2633. }
  2634. // PageToken sets the optional parameter "pageToken": The continuation
  2635. // token, used to page through large result sets. To get the next page
  2636. // of results, set this parameter to the value of nextPageToken from the
  2637. // previous response.
  2638. func (c *AssetsListCall) PageToken(pageToken string) *AssetsListCall {
  2639. c.urlParams_.Set("pageToken", pageToken)
  2640. return c
  2641. }
  2642. // ProjectId sets the optional parameter "projectId": The ID of a Maps
  2643. // Engine project, used to filter the response. To list all available
  2644. // projects with their IDs, send a Projects: list request. You can also
  2645. // find your project ID as the value of the DashboardPlace:cid URL
  2646. // parameter when signed in to mapsengine.google.com.
  2647. func (c *AssetsListCall) ProjectId(projectId string) *AssetsListCall {
  2648. c.urlParams_.Set("projectId", projectId)
  2649. return c
  2650. }
  2651. // Role sets the optional parameter "role": The role parameter indicates
  2652. // that the response should only contain assets where the current user
  2653. // has the specified level of access.
  2654. //
  2655. // Possible values:
  2656. // "owner" - The user can read, write and administer the asset.
  2657. // "reader" - The user can read the asset.
  2658. // "writer" - The user can read and write the asset.
  2659. func (c *AssetsListCall) Role(role string) *AssetsListCall {
  2660. c.urlParams_.Set("role", role)
  2661. return c
  2662. }
  2663. // Search sets the optional parameter "search": An unstructured search
  2664. // string used to filter the set of results based on asset metadata.
  2665. func (c *AssetsListCall) Search(search string) *AssetsListCall {
  2666. c.urlParams_.Set("search", search)
  2667. return c
  2668. }
  2669. // Tags sets the optional parameter "tags": A comma separated list of
  2670. // tags. Returned assets will contain all the tags from the list.
  2671. func (c *AssetsListCall) Tags(tags string) *AssetsListCall {
  2672. c.urlParams_.Set("tags", tags)
  2673. return c
  2674. }
  2675. // Type sets the optional parameter "type": A comma separated list of
  2676. // asset types. Returned assets will have one of the types from the
  2677. // provided list. Supported values are 'map', 'layer',
  2678. // 'rasterCollection' and 'table'.
  2679. func (c *AssetsListCall) Type(type_ string) *AssetsListCall {
  2680. c.urlParams_.Set("type", type_)
  2681. return c
  2682. }
  2683. // Fields allows partial responses to be retrieved. See
  2684. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  2685. // for more information.
  2686. func (c *AssetsListCall) Fields(s ...googleapi.Field) *AssetsListCall {
  2687. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  2688. return c
  2689. }
  2690. // IfNoneMatch sets the optional parameter which makes the operation
  2691. // fail if the object's ETag matches the given value. This is useful for
  2692. // getting updates only after the object has changed since the last
  2693. // request. Use googleapi.IsNotModified to check whether the response
  2694. // error from Do is the result of In-None-Match.
  2695. func (c *AssetsListCall) IfNoneMatch(entityTag string) *AssetsListCall {
  2696. c.ifNoneMatch_ = entityTag
  2697. return c
  2698. }
  2699. // Context sets the context to be used in this call's Do method. Any
  2700. // pending HTTP request will be aborted if the provided context is
  2701. // canceled.
  2702. func (c *AssetsListCall) Context(ctx context.Context) *AssetsListCall {
  2703. c.ctx_ = ctx
  2704. return c
  2705. }
  2706. func (c *AssetsListCall) doRequest(alt string) (*http.Response, error) {
  2707. var body io.Reader = nil
  2708. c.urlParams_.Set("alt", alt)
  2709. urls := googleapi.ResolveRelative(c.s.BasePath, "assets")
  2710. urls += "?" + c.urlParams_.Encode()
  2711. req, _ := http.NewRequest("GET", urls, body)
  2712. googleapi.SetOpaque(req.URL)
  2713. req.Header.Set("User-Agent", c.s.userAgent())
  2714. if c.ifNoneMatch_ != "" {
  2715. req.Header.Set("If-None-Match", c.ifNoneMatch_)
  2716. }
  2717. if c.ctx_ != nil {
  2718. return ctxhttp.Do(c.ctx_, c.s.client, req)
  2719. }
  2720. return c.s.client.Do(req)
  2721. }
  2722. // Do executes the "mapsengine.assets.list" call.
  2723. // Exactly one of *AssetsListResponse or error will be non-nil. Any
  2724. // non-2xx status code is an error. Response headers are in either
  2725. // *AssetsListResponse.ServerResponse.Header or (if a response was
  2726. // returned at all) in error.(*googleapi.Error).Header. Use
  2727. // googleapi.IsNotModified to check whether the returned error was
  2728. // because http.StatusNotModified was returned.
  2729. func (c *AssetsListCall) Do(opts ...googleapi.CallOption) (*AssetsListResponse, error) {
  2730. gensupport.SetOptions(c.urlParams_, opts...)
  2731. res, err := c.doRequest("json")
  2732. if res != nil && res.StatusCode == http.StatusNotModified {
  2733. if res.Body != nil {
  2734. res.Body.Close()
  2735. }
  2736. return nil, &googleapi.Error{
  2737. Code: res.StatusCode,
  2738. Header: res.Header,
  2739. }
  2740. }
  2741. if err != nil {
  2742. return nil, err
  2743. }
  2744. defer googleapi.CloseBody(res)
  2745. if err := googleapi.CheckResponse(res); err != nil {
  2746. return nil, err
  2747. }
  2748. ret := &AssetsListResponse{
  2749. ServerResponse: googleapi.ServerResponse{
  2750. Header: res.Header,
  2751. HTTPStatusCode: res.StatusCode,
  2752. },
  2753. }
  2754. if err := json.NewDecoder(res.Body).Decode(&ret); err != nil {
  2755. return nil, err
  2756. }
  2757. return ret, nil
  2758. // {
  2759. // "description": "Return all assets readable by the current user.",
  2760. // "httpMethod": "GET",
  2761. // "id": "mapsengine.assets.list",
  2762. // "parameters": {
  2763. // "bbox": {
  2764. // "description": "A bounding box, expressed as \"west,south,east,north\". If set, only assets which intersect this bounding box will be returned.",
  2765. // "location": "query",
  2766. // "type": "string"
  2767. // },
  2768. // "createdAfter": {
  2769. // "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.",
  2770. // "format": "date-time",
  2771. // "location": "query",
  2772. // "type": "string"
  2773. // },
  2774. // "createdBefore": {
  2775. // "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.",
  2776. // "format": "date-time",
  2777. // "location": "query",
  2778. // "type": "string"
  2779. // },
  2780. // "creatorEmail": {
  2781. // "description": "An email address representing a user. Returned assets that have been created by the user associated with the provided email address.",
  2782. // "location": "query",
  2783. // "type": "string"
  2784. // },
  2785. // "maxResults": {
  2786. // "description": "The maximum number of items to include in a single response page. The maximum supported value is 100.",
  2787. // "format": "uint32",
  2788. // "location": "query",
  2789. // "type": "integer"
  2790. // },
  2791. // "modifiedAfter": {
  2792. // "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.",
  2793. // "format": "date-time",
  2794. // "location": "query",
  2795. // "type": "string"
  2796. // },
  2797. // "modifiedBefore": {
  2798. // "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.",
  2799. // "format": "date-time",
  2800. // "location": "query",
  2801. // "type": "string"
  2802. // },
  2803. // "pageToken": {
  2804. // "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.",
  2805. // "location": "query",
  2806. // "type": "string"
  2807. // },
  2808. // "projectId": {
  2809. // "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.",
  2810. // "location": "query",
  2811. // "type": "string"
  2812. // },
  2813. // "role": {
  2814. // "description": "The role parameter indicates that the response should only contain assets where the current user has the specified level of access.",
  2815. // "enum": [
  2816. // "owner",
  2817. // "reader",
  2818. // "writer"
  2819. // ],
  2820. // "enumDescriptions": [
  2821. // "The user can read, write and administer the asset.",
  2822. // "The user can read the asset.",
  2823. // "The user can read and write the asset."
  2824. // ],
  2825. // "location": "query",
  2826. // "type": "string"
  2827. // },
  2828. // "search": {
  2829. // "description": "An unstructured search string used to filter the set of results based on asset metadata.",
  2830. // "location": "query",
  2831. // "type": "string"
  2832. // },
  2833. // "tags": {
  2834. // "description": "A comma separated list of tags. Returned assets will contain all the tags from the list.",
  2835. // "location": "query",
  2836. // "type": "string"
  2837. // },
  2838. // "type": {
  2839. // "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'.",
  2840. // "location": "query",
  2841. // "type": "string"
  2842. // }
  2843. // },
  2844. // "path": "assets",
  2845. // "response": {
  2846. // "$ref": "AssetsListResponse"
  2847. // },
  2848. // "scopes": [
  2849. // "https://www.googleapis.com/auth/mapsengine",
  2850. // "https://www.googleapis.com/auth/mapsengine.readonly"
  2851. // ]
  2852. // }
  2853. }
  2854. // Pages invokes f for each page of results.
  2855. // A non-nil error returned from f will halt the iteration.
  2856. // The provided context supersedes any context provided to the Context method.
  2857. func (c *AssetsListCall) Pages(ctx context.Context, f func(*AssetsListResponse) error) error {
  2858. c.ctx_ = ctx
  2859. defer c.PageToken(c.urlParams_.Get("pageToken")) // reset paging to original point
  2860. for {
  2861. x, err := c.Do()
  2862. if err != nil {
  2863. return err
  2864. }
  2865. if err := f(x); err != nil {
  2866. return err
  2867. }
  2868. if x.NextPageToken == "" {
  2869. return nil
  2870. }
  2871. c.PageToken(x.NextPageToken)
  2872. }
  2873. }
  2874. // method id "mapsengine.assets.parents.list":
  2875. type AssetsParentsListCall struct {
  2876. s *Service
  2877. id string
  2878. urlParams_ gensupport.URLParams
  2879. ifNoneMatch_ string
  2880. ctx_ context.Context
  2881. }
  2882. // List: Return all parent ids of the specified asset.
  2883. func (r *AssetsParentsService) List(id string) *AssetsParentsListCall {
  2884. c := &AssetsParentsListCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  2885. c.id = id
  2886. return c
  2887. }
  2888. // MaxResults sets the optional parameter "maxResults": The maximum
  2889. // number of items to include in a single response page. The maximum
  2890. // supported value is 50.
  2891. func (c *AssetsParentsListCall) MaxResults(maxResults int64) *AssetsParentsListCall {
  2892. c.urlParams_.Set("maxResults", fmt.Sprint(maxResults))
  2893. return c
  2894. }
  2895. // PageToken sets the optional parameter "pageToken": The continuation
  2896. // token, used to page through large result sets. To get the next page
  2897. // of results, set this parameter to the value of nextPageToken from the
  2898. // previous response.
  2899. func (c *AssetsParentsListCall) PageToken(pageToken string) *AssetsParentsListCall {
  2900. c.urlParams_.Set("pageToken", pageToken)
  2901. return c
  2902. }
  2903. // Fields allows partial responses to be retrieved. See
  2904. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  2905. // for more information.
  2906. func (c *AssetsParentsListCall) Fields(s ...googleapi.Field) *AssetsParentsListCall {
  2907. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  2908. return c
  2909. }
  2910. // IfNoneMatch sets the optional parameter which makes the operation
  2911. // fail if the object's ETag matches the given value. This is useful for
  2912. // getting updates only after the object has changed since the last
  2913. // request. Use googleapi.IsNotModified to check whether the response
  2914. // error from Do is the result of In-None-Match.
  2915. func (c *AssetsParentsListCall) IfNoneMatch(entityTag string) *AssetsParentsListCall {
  2916. c.ifNoneMatch_ = entityTag
  2917. return c
  2918. }
  2919. // Context sets the context to be used in this call's Do method. Any
  2920. // pending HTTP request will be aborted if the provided context is
  2921. // canceled.
  2922. func (c *AssetsParentsListCall) Context(ctx context.Context) *AssetsParentsListCall {
  2923. c.ctx_ = ctx
  2924. return c
  2925. }
  2926. func (c *AssetsParentsListCall) doRequest(alt string) (*http.Response, error) {
  2927. var body io.Reader = nil
  2928. c.urlParams_.Set("alt", alt)
  2929. urls := googleapi.ResolveRelative(c.s.BasePath, "assets/{id}/parents")
  2930. urls += "?" + c.urlParams_.Encode()
  2931. req, _ := http.NewRequest("GET", urls, body)
  2932. googleapi.Expand(req.URL, map[string]string{
  2933. "id": c.id,
  2934. })
  2935. req.Header.Set("User-Agent", c.s.userAgent())
  2936. if c.ifNoneMatch_ != "" {
  2937. req.Header.Set("If-None-Match", c.ifNoneMatch_)
  2938. }
  2939. if c.ctx_ != nil {
  2940. return ctxhttp.Do(c.ctx_, c.s.client, req)
  2941. }
  2942. return c.s.client.Do(req)
  2943. }
  2944. // Do executes the "mapsengine.assets.parents.list" call.
  2945. // Exactly one of *ParentsListResponse or error will be non-nil. Any
  2946. // non-2xx status code is an error. Response headers are in either
  2947. // *ParentsListResponse.ServerResponse.Header or (if a response was
  2948. // returned at all) in error.(*googleapi.Error).Header. Use
  2949. // googleapi.IsNotModified to check whether the returned error was
  2950. // because http.StatusNotModified was returned.
  2951. func (c *AssetsParentsListCall) Do(opts ...googleapi.CallOption) (*ParentsListResponse, error) {
  2952. gensupport.SetOptions(c.urlParams_, opts...)
  2953. res, err := c.doRequest("json")
  2954. if res != nil && res.StatusCode == http.StatusNotModified {
  2955. if res.Body != nil {
  2956. res.Body.Close()
  2957. }
  2958. return nil, &googleapi.Error{
  2959. Code: res.StatusCode,
  2960. Header: res.Header,
  2961. }
  2962. }
  2963. if err != nil {
  2964. return nil, err
  2965. }
  2966. defer googleapi.CloseBody(res)
  2967. if err := googleapi.CheckResponse(res); err != nil {
  2968. return nil, err
  2969. }
  2970. ret := &ParentsListResponse{
  2971. ServerResponse: googleapi.ServerResponse{
  2972. Header: res.Header,
  2973. HTTPStatusCode: res.StatusCode,
  2974. },
  2975. }
  2976. if err := json.NewDecoder(res.Body).Decode(&ret); err != nil {
  2977. return nil, err
  2978. }
  2979. return ret, nil
  2980. // {
  2981. // "description": "Return all parent ids of the specified asset.",
  2982. // "httpMethod": "GET",
  2983. // "id": "mapsengine.assets.parents.list",
  2984. // "parameterOrder": [
  2985. // "id"
  2986. // ],
  2987. // "parameters": {
  2988. // "id": {
  2989. // "description": "The ID of the asset whose parents will be listed.",
  2990. // "location": "path",
  2991. // "required": true,
  2992. // "type": "string"
  2993. // },
  2994. // "maxResults": {
  2995. // "description": "The maximum number of items to include in a single response page. The maximum supported value is 50.",
  2996. // "format": "uint32",
  2997. // "location": "query",
  2998. // "type": "integer"
  2999. // },
  3000. // "pageToken": {
  3001. // "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.",
  3002. // "location": "query",
  3003. // "type": "string"
  3004. // }
  3005. // },
  3006. // "path": "assets/{id}/parents",
  3007. // "response": {
  3008. // "$ref": "ParentsListResponse"
  3009. // },
  3010. // "scopes": [
  3011. // "https://www.googleapis.com/auth/mapsengine",
  3012. // "https://www.googleapis.com/auth/mapsengine.readonly"
  3013. // ]
  3014. // }
  3015. }
  3016. // Pages invokes f for each page of results.
  3017. // A non-nil error returned from f will halt the iteration.
  3018. // The provided context supersedes any context provided to the Context method.
  3019. func (c *AssetsParentsListCall) Pages(ctx context.Context, f func(*ParentsListResponse) error) error {
  3020. c.ctx_ = ctx
  3021. defer c.PageToken(c.urlParams_.Get("pageToken")) // reset paging to original point
  3022. for {
  3023. x, err := c.Do()
  3024. if err != nil {
  3025. return err
  3026. }
  3027. if err := f(x); err != nil {
  3028. return err
  3029. }
  3030. if x.NextPageToken == "" {
  3031. return nil
  3032. }
  3033. c.PageToken(x.NextPageToken)
  3034. }
  3035. }
  3036. // method id "mapsengine.assets.permissions.list":
  3037. type AssetsPermissionsListCall struct {
  3038. s *Service
  3039. id string
  3040. urlParams_ gensupport.URLParams
  3041. ifNoneMatch_ string
  3042. ctx_ context.Context
  3043. }
  3044. // List: Return all of the permissions for the specified asset.
  3045. func (r *AssetsPermissionsService) List(id string) *AssetsPermissionsListCall {
  3046. c := &AssetsPermissionsListCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  3047. c.id = id
  3048. return c
  3049. }
  3050. // Fields allows partial responses to be retrieved. See
  3051. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  3052. // for more information.
  3053. func (c *AssetsPermissionsListCall) Fields(s ...googleapi.Field) *AssetsPermissionsListCall {
  3054. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  3055. return c
  3056. }
  3057. // IfNoneMatch sets the optional parameter which makes the operation
  3058. // fail if the object's ETag matches the given value. This is useful for
  3059. // getting updates only after the object has changed since the last
  3060. // request. Use googleapi.IsNotModified to check whether the response
  3061. // error from Do is the result of In-None-Match.
  3062. func (c *AssetsPermissionsListCall) IfNoneMatch(entityTag string) *AssetsPermissionsListCall {
  3063. c.ifNoneMatch_ = entityTag
  3064. return c
  3065. }
  3066. // Context sets the context to be used in this call's Do method. Any
  3067. // pending HTTP request will be aborted if the provided context is
  3068. // canceled.
  3069. func (c *AssetsPermissionsListCall) Context(ctx context.Context) *AssetsPermissionsListCall {
  3070. c.ctx_ = ctx
  3071. return c
  3072. }
  3073. func (c *AssetsPermissionsListCall) doRequest(alt string) (*http.Response, error) {
  3074. var body io.Reader = nil
  3075. c.urlParams_.Set("alt", alt)
  3076. urls := googleapi.ResolveRelative(c.s.BasePath, "assets/{id}/permissions")
  3077. urls += "?" + c.urlParams_.Encode()
  3078. req, _ := http.NewRequest("GET", urls, body)
  3079. googleapi.Expand(req.URL, map[string]string{
  3080. "id": c.id,
  3081. })
  3082. req.Header.Set("User-Agent", c.s.userAgent())
  3083. if c.ifNoneMatch_ != "" {
  3084. req.Header.Set("If-None-Match", c.ifNoneMatch_)
  3085. }
  3086. if c.ctx_ != nil {
  3087. return ctxhttp.Do(c.ctx_, c.s.client, req)
  3088. }
  3089. return c.s.client.Do(req)
  3090. }
  3091. // Do executes the "mapsengine.assets.permissions.list" call.
  3092. // Exactly one of *PermissionsListResponse or error will be non-nil. Any
  3093. // non-2xx status code is an error. Response headers are in either
  3094. // *PermissionsListResponse.ServerResponse.Header or (if a response was
  3095. // returned at all) in error.(*googleapi.Error).Header. Use
  3096. // googleapi.IsNotModified to check whether the returned error was
  3097. // because http.StatusNotModified was returned.
  3098. func (c *AssetsPermissionsListCall) Do(opts ...googleapi.CallOption) (*PermissionsListResponse, error) {
  3099. gensupport.SetOptions(c.urlParams_, opts...)
  3100. res, err := c.doRequest("json")
  3101. if res != nil && res.StatusCode == http.StatusNotModified {
  3102. if res.Body != nil {
  3103. res.Body.Close()
  3104. }
  3105. return nil, &googleapi.Error{
  3106. Code: res.StatusCode,
  3107. Header: res.Header,
  3108. }
  3109. }
  3110. if err != nil {
  3111. return nil, err
  3112. }
  3113. defer googleapi.CloseBody(res)
  3114. if err := googleapi.CheckResponse(res); err != nil {
  3115. return nil, err
  3116. }
  3117. ret := &PermissionsListResponse{
  3118. ServerResponse: googleapi.ServerResponse{
  3119. Header: res.Header,
  3120. HTTPStatusCode: res.StatusCode,
  3121. },
  3122. }
  3123. if err := json.NewDecoder(res.Body).Decode(&ret); err != nil {
  3124. return nil, err
  3125. }
  3126. return ret, nil
  3127. // {
  3128. // "description": "Return all of the permissions for the specified asset.",
  3129. // "httpMethod": "GET",
  3130. // "id": "mapsengine.assets.permissions.list",
  3131. // "parameterOrder": [
  3132. // "id"
  3133. // ],
  3134. // "parameters": {
  3135. // "id": {
  3136. // "description": "The ID of the asset whose permissions will be listed.",
  3137. // "location": "path",
  3138. // "required": true,
  3139. // "type": "string"
  3140. // }
  3141. // },
  3142. // "path": "assets/{id}/permissions",
  3143. // "response": {
  3144. // "$ref": "PermissionsListResponse"
  3145. // },
  3146. // "scopes": [
  3147. // "https://www.googleapis.com/auth/mapsengine",
  3148. // "https://www.googleapis.com/auth/mapsengine.readonly"
  3149. // ]
  3150. // }
  3151. }
  3152. // method id "mapsengine.layers.cancelProcessing":
  3153. type LayersCancelProcessingCall struct {
  3154. s *Service
  3155. id string
  3156. urlParams_ gensupport.URLParams
  3157. ctx_ context.Context
  3158. }
  3159. // CancelProcessing: Cancel processing on a layer asset.
  3160. func (r *LayersService) CancelProcessing(id string) *LayersCancelProcessingCall {
  3161. c := &LayersCancelProcessingCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  3162. c.id = id
  3163. return c
  3164. }
  3165. // Fields allows partial responses to be retrieved. See
  3166. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  3167. // for more information.
  3168. func (c *LayersCancelProcessingCall) Fields(s ...googleapi.Field) *LayersCancelProcessingCall {
  3169. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  3170. return c
  3171. }
  3172. // Context sets the context to be used in this call's Do method. Any
  3173. // pending HTTP request will be aborted if the provided context is
  3174. // canceled.
  3175. func (c *LayersCancelProcessingCall) Context(ctx context.Context) *LayersCancelProcessingCall {
  3176. c.ctx_ = ctx
  3177. return c
  3178. }
  3179. func (c *LayersCancelProcessingCall) doRequest(alt string) (*http.Response, error) {
  3180. var body io.Reader = nil
  3181. c.urlParams_.Set("alt", alt)
  3182. urls := googleapi.ResolveRelative(c.s.BasePath, "layers/{id}/cancelProcessing")
  3183. urls += "?" + c.urlParams_.Encode()
  3184. req, _ := http.NewRequest("POST", urls, body)
  3185. googleapi.Expand(req.URL, map[string]string{
  3186. "id": c.id,
  3187. })
  3188. req.Header.Set("User-Agent", c.s.userAgent())
  3189. if c.ctx_ != nil {
  3190. return ctxhttp.Do(c.ctx_, c.s.client, req)
  3191. }
  3192. return c.s.client.Do(req)
  3193. }
  3194. // Do executes the "mapsengine.layers.cancelProcessing" call.
  3195. // Exactly one of *ProcessResponse or error will be non-nil. Any non-2xx
  3196. // status code is an error. Response headers are in either
  3197. // *ProcessResponse.ServerResponse.Header or (if a response was returned
  3198. // at all) in error.(*googleapi.Error).Header. Use
  3199. // googleapi.IsNotModified to check whether the returned error was
  3200. // because http.StatusNotModified was returned.
  3201. func (c *LayersCancelProcessingCall) Do(opts ...googleapi.CallOption) (*ProcessResponse, error) {
  3202. gensupport.SetOptions(c.urlParams_, opts...)
  3203. res, err := c.doRequest("json")
  3204. if res != nil && res.StatusCode == http.StatusNotModified {
  3205. if res.Body != nil {
  3206. res.Body.Close()
  3207. }
  3208. return nil, &googleapi.Error{
  3209. Code: res.StatusCode,
  3210. Header: res.Header,
  3211. }
  3212. }
  3213. if err != nil {
  3214. return nil, err
  3215. }
  3216. defer googleapi.CloseBody(res)
  3217. if err := googleapi.CheckResponse(res); err != nil {
  3218. return nil, err
  3219. }
  3220. ret := &ProcessResponse{
  3221. ServerResponse: googleapi.ServerResponse{
  3222. Header: res.Header,
  3223. HTTPStatusCode: res.StatusCode,
  3224. },
  3225. }
  3226. if err := json.NewDecoder(res.Body).Decode(&ret); err != nil {
  3227. return nil, err
  3228. }
  3229. return ret, nil
  3230. // {
  3231. // "description": "Cancel processing on a layer asset.",
  3232. // "httpMethod": "POST",
  3233. // "id": "mapsengine.layers.cancelProcessing",
  3234. // "parameterOrder": [
  3235. // "id"
  3236. // ],
  3237. // "parameters": {
  3238. // "id": {
  3239. // "description": "The ID of the layer.",
  3240. // "location": "path",
  3241. // "required": true,
  3242. // "type": "string"
  3243. // }
  3244. // },
  3245. // "path": "layers/{id}/cancelProcessing",
  3246. // "response": {
  3247. // "$ref": "ProcessResponse"
  3248. // },
  3249. // "scopes": [
  3250. // "https://www.googleapis.com/auth/mapsengine"
  3251. // ]
  3252. // }
  3253. }
  3254. // method id "mapsengine.layers.create":
  3255. type LayersCreateCall struct {
  3256. s *Service
  3257. layer *Layer
  3258. urlParams_ gensupport.URLParams
  3259. ctx_ context.Context
  3260. }
  3261. // Create: Create a layer asset.
  3262. func (r *LayersService) Create(layer *Layer) *LayersCreateCall {
  3263. c := &LayersCreateCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  3264. c.layer = layer
  3265. return c
  3266. }
  3267. // Process sets the optional parameter "process": Whether to queue the
  3268. // created layer for processing.
  3269. func (c *LayersCreateCall) Process(process bool) *LayersCreateCall {
  3270. c.urlParams_.Set("process", fmt.Sprint(process))
  3271. return c
  3272. }
  3273. // Fields allows partial responses to be retrieved. See
  3274. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  3275. // for more information.
  3276. func (c *LayersCreateCall) Fields(s ...googleapi.Field) *LayersCreateCall {
  3277. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  3278. return c
  3279. }
  3280. // Context sets the context to be used in this call's Do method. Any
  3281. // pending HTTP request will be aborted if the provided context is
  3282. // canceled.
  3283. func (c *LayersCreateCall) Context(ctx context.Context) *LayersCreateCall {
  3284. c.ctx_ = ctx
  3285. return c
  3286. }
  3287. func (c *LayersCreateCall) doRequest(alt string) (*http.Response, error) {
  3288. var body io.Reader = nil
  3289. body, err := googleapi.WithoutDataWrapper.JSONReader(c.layer)
  3290. if err != nil {
  3291. return nil, err
  3292. }
  3293. ctype := "application/json"
  3294. c.urlParams_.Set("alt", alt)
  3295. urls := googleapi.ResolveRelative(c.s.BasePath, "layers")
  3296. urls += "?" + c.urlParams_.Encode()
  3297. req, _ := http.NewRequest("POST", urls, body)
  3298. googleapi.SetOpaque(req.URL)
  3299. req.Header.Set("Content-Type", ctype)
  3300. req.Header.Set("User-Agent", c.s.userAgent())
  3301. if c.ctx_ != nil {
  3302. return ctxhttp.Do(c.ctx_, c.s.client, req)
  3303. }
  3304. return c.s.client.Do(req)
  3305. }
  3306. // Do executes the "mapsengine.layers.create" call.
  3307. // Exactly one of *Layer or error will be non-nil. Any non-2xx status
  3308. // code is an error. Response headers are in either
  3309. // *Layer.ServerResponse.Header or (if a response was returned at all)
  3310. // in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to
  3311. // check whether the returned error was because http.StatusNotModified
  3312. // was returned.
  3313. func (c *LayersCreateCall) Do(opts ...googleapi.CallOption) (*Layer, error) {
  3314. gensupport.SetOptions(c.urlParams_, opts...)
  3315. res, err := c.doRequest("json")
  3316. if res != nil && res.StatusCode == http.StatusNotModified {
  3317. if res.Body != nil {
  3318. res.Body.Close()
  3319. }
  3320. return nil, &googleapi.Error{
  3321. Code: res.StatusCode,
  3322. Header: res.Header,
  3323. }
  3324. }
  3325. if err != nil {
  3326. return nil, err
  3327. }
  3328. defer googleapi.CloseBody(res)
  3329. if err := googleapi.CheckResponse(res); err != nil {
  3330. return nil, err
  3331. }
  3332. ret := &Layer{
  3333. ServerResponse: googleapi.ServerResponse{
  3334. Header: res.Header,
  3335. HTTPStatusCode: res.StatusCode,
  3336. },
  3337. }
  3338. if err := json.NewDecoder(res.Body).Decode(&ret); err != nil {
  3339. return nil, err
  3340. }
  3341. return ret, nil
  3342. // {
  3343. // "description": "Create a layer asset.",
  3344. // "httpMethod": "POST",
  3345. // "id": "mapsengine.layers.create",
  3346. // "parameters": {
  3347. // "process": {
  3348. // "description": "Whether to queue the created layer for processing.",
  3349. // "location": "query",
  3350. // "type": "boolean"
  3351. // }
  3352. // },
  3353. // "path": "layers",
  3354. // "request": {
  3355. // "$ref": "Layer"
  3356. // },
  3357. // "response": {
  3358. // "$ref": "Layer"
  3359. // },
  3360. // "scopes": [
  3361. // "https://www.googleapis.com/auth/mapsengine"
  3362. // ]
  3363. // }
  3364. }
  3365. // method id "mapsengine.layers.delete":
  3366. type LayersDeleteCall struct {
  3367. s *Service
  3368. id string
  3369. urlParams_ gensupport.URLParams
  3370. ctx_ context.Context
  3371. }
  3372. // Delete: Delete a layer.
  3373. func (r *LayersService) Delete(id string) *LayersDeleteCall {
  3374. c := &LayersDeleteCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  3375. c.id = id
  3376. return c
  3377. }
  3378. // Fields allows partial responses to be retrieved. See
  3379. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  3380. // for more information.
  3381. func (c *LayersDeleteCall) Fields(s ...googleapi.Field) *LayersDeleteCall {
  3382. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  3383. return c
  3384. }
  3385. // Context sets the context to be used in this call's Do method. Any
  3386. // pending HTTP request will be aborted if the provided context is
  3387. // canceled.
  3388. func (c *LayersDeleteCall) Context(ctx context.Context) *LayersDeleteCall {
  3389. c.ctx_ = ctx
  3390. return c
  3391. }
  3392. func (c *LayersDeleteCall) doRequest(alt string) (*http.Response, error) {
  3393. var body io.Reader = nil
  3394. c.urlParams_.Set("alt", alt)
  3395. urls := googleapi.ResolveRelative(c.s.BasePath, "layers/{id}")
  3396. urls += "?" + c.urlParams_.Encode()
  3397. req, _ := http.NewRequest("DELETE", urls, body)
  3398. googleapi.Expand(req.URL, map[string]string{
  3399. "id": c.id,
  3400. })
  3401. req.Header.Set("User-Agent", c.s.userAgent())
  3402. if c.ctx_ != nil {
  3403. return ctxhttp.Do(c.ctx_, c.s.client, req)
  3404. }
  3405. return c.s.client.Do(req)
  3406. }
  3407. // Do executes the "mapsengine.layers.delete" call.
  3408. func (c *LayersDeleteCall) Do(opts ...googleapi.CallOption) error {
  3409. gensupport.SetOptions(c.urlParams_, opts...)
  3410. res, err := c.doRequest("json")
  3411. if err != nil {
  3412. return err
  3413. }
  3414. defer googleapi.CloseBody(res)
  3415. if err := googleapi.CheckResponse(res); err != nil {
  3416. return err
  3417. }
  3418. return nil
  3419. // {
  3420. // "description": "Delete a layer.",
  3421. // "httpMethod": "DELETE",
  3422. // "id": "mapsengine.layers.delete",
  3423. // "parameterOrder": [
  3424. // "id"
  3425. // ],
  3426. // "parameters": {
  3427. // "id": {
  3428. // "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.",
  3429. // "location": "path",
  3430. // "required": true,
  3431. // "type": "string"
  3432. // }
  3433. // },
  3434. // "path": "layers/{id}",
  3435. // "scopes": [
  3436. // "https://www.googleapis.com/auth/mapsengine"
  3437. // ]
  3438. // }
  3439. }
  3440. // method id "mapsengine.layers.get":
  3441. type LayersGetCall struct {
  3442. s *Service
  3443. id string
  3444. urlParams_ gensupport.URLParams
  3445. ifNoneMatch_ string
  3446. ctx_ context.Context
  3447. }
  3448. // Get: Return metadata for a particular layer.
  3449. func (r *LayersService) Get(id string) *LayersGetCall {
  3450. c := &LayersGetCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  3451. c.id = id
  3452. return c
  3453. }
  3454. // Version sets the optional parameter "version": Deprecated: The
  3455. // version parameter indicates which version of the layer should be
  3456. // returned. When version is set to published, the published version of
  3457. // the layer will be returned. Please use the layers.getPublished
  3458. // endpoint instead.
  3459. //
  3460. // Possible values:
  3461. // "draft" - The draft version.
  3462. // "published" - The published version.
  3463. func (c *LayersGetCall) Version(version string) *LayersGetCall {
  3464. c.urlParams_.Set("version", version)
  3465. return c
  3466. }
  3467. // Fields allows partial responses to be retrieved. See
  3468. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  3469. // for more information.
  3470. func (c *LayersGetCall) Fields(s ...googleapi.Field) *LayersGetCall {
  3471. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  3472. return c
  3473. }
  3474. // IfNoneMatch sets the optional parameter which makes the operation
  3475. // fail if the object's ETag matches the given value. This is useful for
  3476. // getting updates only after the object has changed since the last
  3477. // request. Use googleapi.IsNotModified to check whether the response
  3478. // error from Do is the result of In-None-Match.
  3479. func (c *LayersGetCall) IfNoneMatch(entityTag string) *LayersGetCall {
  3480. c.ifNoneMatch_ = entityTag
  3481. return c
  3482. }
  3483. // Context sets the context to be used in this call's Do method. Any
  3484. // pending HTTP request will be aborted if the provided context is
  3485. // canceled.
  3486. func (c *LayersGetCall) Context(ctx context.Context) *LayersGetCall {
  3487. c.ctx_ = ctx
  3488. return c
  3489. }
  3490. func (c *LayersGetCall) doRequest(alt string) (*http.Response, error) {
  3491. var body io.Reader = nil
  3492. c.urlParams_.Set("alt", alt)
  3493. urls := googleapi.ResolveRelative(c.s.BasePath, "layers/{id}")
  3494. urls += "?" + c.urlParams_.Encode()
  3495. req, _ := http.NewRequest("GET", urls, body)
  3496. googleapi.Expand(req.URL, map[string]string{
  3497. "id": c.id,
  3498. })
  3499. req.Header.Set("User-Agent", c.s.userAgent())
  3500. if c.ifNoneMatch_ != "" {
  3501. req.Header.Set("If-None-Match", c.ifNoneMatch_)
  3502. }
  3503. if c.ctx_ != nil {
  3504. return ctxhttp.Do(c.ctx_, c.s.client, req)
  3505. }
  3506. return c.s.client.Do(req)
  3507. }
  3508. // Do executes the "mapsengine.layers.get" call.
  3509. // Exactly one of *Layer or error will be non-nil. Any non-2xx status
  3510. // code is an error. Response headers are in either
  3511. // *Layer.ServerResponse.Header or (if a response was returned at all)
  3512. // in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to
  3513. // check whether the returned error was because http.StatusNotModified
  3514. // was returned.
  3515. func (c *LayersGetCall) Do(opts ...googleapi.CallOption) (*Layer, error) {
  3516. gensupport.SetOptions(c.urlParams_, opts...)
  3517. res, err := c.doRequest("json")
  3518. if res != nil && res.StatusCode == http.StatusNotModified {
  3519. if res.Body != nil {
  3520. res.Body.Close()
  3521. }
  3522. return nil, &googleapi.Error{
  3523. Code: res.StatusCode,
  3524. Header: res.Header,
  3525. }
  3526. }
  3527. if err != nil {
  3528. return nil, err
  3529. }
  3530. defer googleapi.CloseBody(res)
  3531. if err := googleapi.CheckResponse(res); err != nil {
  3532. return nil, err
  3533. }
  3534. ret := &Layer{
  3535. ServerResponse: googleapi.ServerResponse{
  3536. Header: res.Header,
  3537. HTTPStatusCode: res.StatusCode,
  3538. },
  3539. }
  3540. if err := json.NewDecoder(res.Body).Decode(&ret); err != nil {
  3541. return nil, err
  3542. }
  3543. return ret, nil
  3544. // {
  3545. // "description": "Return metadata for a particular layer.",
  3546. // "httpMethod": "GET",
  3547. // "id": "mapsengine.layers.get",
  3548. // "parameterOrder": [
  3549. // "id"
  3550. // ],
  3551. // "parameters": {
  3552. // "id": {
  3553. // "description": "The ID of the layer.",
  3554. // "location": "path",
  3555. // "required": true,
  3556. // "type": "string"
  3557. // },
  3558. // "version": {
  3559. // "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.",
  3560. // "enum": [
  3561. // "draft",
  3562. // "published"
  3563. // ],
  3564. // "enumDescriptions": [
  3565. // "The draft version.",
  3566. // "The published version."
  3567. // ],
  3568. // "location": "query",
  3569. // "type": "string"
  3570. // }
  3571. // },
  3572. // "path": "layers/{id}",
  3573. // "response": {
  3574. // "$ref": "Layer"
  3575. // },
  3576. // "scopes": [
  3577. // "https://www.googleapis.com/auth/mapsengine",
  3578. // "https://www.googleapis.com/auth/mapsengine.readonly"
  3579. // ]
  3580. // }
  3581. }
  3582. // method id "mapsengine.layers.getPublished":
  3583. type LayersGetPublishedCall struct {
  3584. s *Service
  3585. id string
  3586. urlParams_ gensupport.URLParams
  3587. ifNoneMatch_ string
  3588. ctx_ context.Context
  3589. }
  3590. // GetPublished: Return the published metadata for a particular layer.
  3591. func (r *LayersService) GetPublished(id string) *LayersGetPublishedCall {
  3592. c := &LayersGetPublishedCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  3593. c.id = id
  3594. return c
  3595. }
  3596. // Fields allows partial responses to be retrieved. See
  3597. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  3598. // for more information.
  3599. func (c *LayersGetPublishedCall) Fields(s ...googleapi.Field) *LayersGetPublishedCall {
  3600. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  3601. return c
  3602. }
  3603. // IfNoneMatch sets the optional parameter which makes the operation
  3604. // fail if the object's ETag matches the given value. This is useful for
  3605. // getting updates only after the object has changed since the last
  3606. // request. Use googleapi.IsNotModified to check whether the response
  3607. // error from Do is the result of In-None-Match.
  3608. func (c *LayersGetPublishedCall) IfNoneMatch(entityTag string) *LayersGetPublishedCall {
  3609. c.ifNoneMatch_ = entityTag
  3610. return c
  3611. }
  3612. // Context sets the context to be used in this call's Do method. Any
  3613. // pending HTTP request will be aborted if the provided context is
  3614. // canceled.
  3615. func (c *LayersGetPublishedCall) Context(ctx context.Context) *LayersGetPublishedCall {
  3616. c.ctx_ = ctx
  3617. return c
  3618. }
  3619. func (c *LayersGetPublishedCall) doRequest(alt string) (*http.Response, error) {
  3620. var body io.Reader = nil
  3621. c.urlParams_.Set("alt", alt)
  3622. urls := googleapi.ResolveRelative(c.s.BasePath, "layers/{id}/published")
  3623. urls += "?" + c.urlParams_.Encode()
  3624. req, _ := http.NewRequest("GET", urls, body)
  3625. googleapi.Expand(req.URL, map[string]string{
  3626. "id": c.id,
  3627. })
  3628. req.Header.Set("User-Agent", c.s.userAgent())
  3629. if c.ifNoneMatch_ != "" {
  3630. req.Header.Set("If-None-Match", c.ifNoneMatch_)
  3631. }
  3632. if c.ctx_ != nil {
  3633. return ctxhttp.Do(c.ctx_, c.s.client, req)
  3634. }
  3635. return c.s.client.Do(req)
  3636. }
  3637. // Do executes the "mapsengine.layers.getPublished" call.
  3638. // Exactly one of *PublishedLayer or error will be non-nil. Any non-2xx
  3639. // status code is an error. Response headers are in either
  3640. // *PublishedLayer.ServerResponse.Header or (if a response was returned
  3641. // at all) in error.(*googleapi.Error).Header. Use
  3642. // googleapi.IsNotModified to check whether the returned error was
  3643. // because http.StatusNotModified was returned.
  3644. func (c *LayersGetPublishedCall) Do(opts ...googleapi.CallOption) (*PublishedLayer, error) {
  3645. gensupport.SetOptions(c.urlParams_, opts...)
  3646. res, err := c.doRequest("json")
  3647. if res != nil && res.StatusCode == http.StatusNotModified {
  3648. if res.Body != nil {
  3649. res.Body.Close()
  3650. }
  3651. return nil, &googleapi.Error{
  3652. Code: res.StatusCode,
  3653. Header: res.Header,
  3654. }
  3655. }
  3656. if err != nil {
  3657. return nil, err
  3658. }
  3659. defer googleapi.CloseBody(res)
  3660. if err := googleapi.CheckResponse(res); err != nil {
  3661. return nil, err
  3662. }
  3663. ret := &PublishedLayer{
  3664. ServerResponse: googleapi.ServerResponse{
  3665. Header: res.Header,
  3666. HTTPStatusCode: res.StatusCode,
  3667. },
  3668. }
  3669. if err := json.NewDecoder(res.Body).Decode(&ret); err != nil {
  3670. return nil, err
  3671. }
  3672. return ret, nil
  3673. // {
  3674. // "description": "Return the published metadata for a particular layer.",
  3675. // "httpMethod": "GET",
  3676. // "id": "mapsengine.layers.getPublished",
  3677. // "parameterOrder": [
  3678. // "id"
  3679. // ],
  3680. // "parameters": {
  3681. // "id": {
  3682. // "description": "The ID of the layer.",
  3683. // "location": "path",
  3684. // "required": true,
  3685. // "type": "string"
  3686. // }
  3687. // },
  3688. // "path": "layers/{id}/published",
  3689. // "response": {
  3690. // "$ref": "PublishedLayer"
  3691. // },
  3692. // "scopes": [
  3693. // "https://www.googleapis.com/auth/mapsengine",
  3694. // "https://www.googleapis.com/auth/mapsengine.readonly"
  3695. // ]
  3696. // }
  3697. }
  3698. // method id "mapsengine.layers.list":
  3699. type LayersListCall struct {
  3700. s *Service
  3701. urlParams_ gensupport.URLParams
  3702. ifNoneMatch_ string
  3703. ctx_ context.Context
  3704. }
  3705. // List: Return all layers readable by the current user.
  3706. func (r *LayersService) List() *LayersListCall {
  3707. c := &LayersListCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  3708. return c
  3709. }
  3710. // Bbox sets the optional parameter "bbox": A bounding box, expressed as
  3711. // "west,south,east,north". If set, only assets which intersect this
  3712. // bounding box will be returned.
  3713. func (c *LayersListCall) Bbox(bbox string) *LayersListCall {
  3714. c.urlParams_.Set("bbox", bbox)
  3715. return c
  3716. }
  3717. // CreatedAfter sets the optional parameter "createdAfter": An RFC 3339
  3718. // formatted date-time value (e.g. 1970-01-01T00:00:00Z). Returned
  3719. // assets will have been created at or after this time.
  3720. func (c *LayersListCall) CreatedAfter(createdAfter string) *LayersListCall {
  3721. c.urlParams_.Set("createdAfter", createdAfter)
  3722. return c
  3723. }
  3724. // CreatedBefore sets the optional parameter "createdBefore": An RFC
  3725. // 3339 formatted date-time value (e.g. 1970-01-01T00:00:00Z). Returned
  3726. // assets will have been created at or before this time.
  3727. func (c *LayersListCall) CreatedBefore(createdBefore string) *LayersListCall {
  3728. c.urlParams_.Set("createdBefore", createdBefore)
  3729. return c
  3730. }
  3731. // CreatorEmail sets the optional parameter "creatorEmail": An email
  3732. // address representing a user. Returned assets that have been created
  3733. // by the user associated with the provided email address.
  3734. func (c *LayersListCall) CreatorEmail(creatorEmail string) *LayersListCall {
  3735. c.urlParams_.Set("creatorEmail", creatorEmail)
  3736. return c
  3737. }
  3738. // MaxResults sets the optional parameter "maxResults": The maximum
  3739. // number of items to include in a single response page. The maximum
  3740. // supported value is 100.
  3741. func (c *LayersListCall) MaxResults(maxResults int64) *LayersListCall {
  3742. c.urlParams_.Set("maxResults", fmt.Sprint(maxResults))
  3743. return c
  3744. }
  3745. // ModifiedAfter sets the optional parameter "modifiedAfter": An RFC
  3746. // 3339 formatted date-time value (e.g. 1970-01-01T00:00:00Z). Returned
  3747. // assets will have been modified at or after this time.
  3748. func (c *LayersListCall) ModifiedAfter(modifiedAfter string) *LayersListCall {
  3749. c.urlParams_.Set("modifiedAfter", modifiedAfter)
  3750. return c
  3751. }
  3752. // ModifiedBefore sets the optional parameter "modifiedBefore": An RFC
  3753. // 3339 formatted date-time value (e.g. 1970-01-01T00:00:00Z). Returned
  3754. // assets will have been modified at or before this time.
  3755. func (c *LayersListCall) ModifiedBefore(modifiedBefore string) *LayersListCall {
  3756. c.urlParams_.Set("modifiedBefore", modifiedBefore)
  3757. return c
  3758. }
  3759. // PageToken sets the optional parameter "pageToken": The continuation
  3760. // token, used to page through large result sets. To get the next page
  3761. // of results, set this parameter to the value of nextPageToken from the
  3762. // previous response.
  3763. func (c *LayersListCall) PageToken(pageToken string) *LayersListCall {
  3764. c.urlParams_.Set("pageToken", pageToken)
  3765. return c
  3766. }
  3767. // ProcessingStatus sets the optional parameter "processingStatus":
  3768. //
  3769. // Possible values:
  3770. // "complete" - The layer has completed processing.
  3771. // "failed" - The layer has failed processing.
  3772. // "notReady" - The layer is not ready for processing.
  3773. // "processing" - The layer is processing.
  3774. // "ready" - The layer is ready for processing.
  3775. func (c *LayersListCall) ProcessingStatus(processingStatus string) *LayersListCall {
  3776. c.urlParams_.Set("processingStatus", processingStatus)
  3777. return c
  3778. }
  3779. // ProjectId sets the optional parameter "projectId": The ID of a Maps
  3780. // Engine project, used to filter the response. To list all available
  3781. // projects with their IDs, send a Projects: list request. You can also
  3782. // find your project ID as the value of the DashboardPlace:cid URL
  3783. // parameter when signed in to mapsengine.google.com.
  3784. func (c *LayersListCall) ProjectId(projectId string) *LayersListCall {
  3785. c.urlParams_.Set("projectId", projectId)
  3786. return c
  3787. }
  3788. // Role sets the optional parameter "role": The role parameter indicates
  3789. // that the response should only contain assets where the current user
  3790. // has the specified level of access.
  3791. //
  3792. // Possible values:
  3793. // "owner" - The user can read, write and administer the asset.
  3794. // "reader" - The user can read the asset.
  3795. // "writer" - The user can read and write the asset.
  3796. func (c *LayersListCall) Role(role string) *LayersListCall {
  3797. c.urlParams_.Set("role", role)
  3798. return c
  3799. }
  3800. // Search sets the optional parameter "search": An unstructured search
  3801. // string used to filter the set of results based on asset metadata.
  3802. func (c *LayersListCall) Search(search string) *LayersListCall {
  3803. c.urlParams_.Set("search", search)
  3804. return c
  3805. }
  3806. // Tags sets the optional parameter "tags": A comma separated list of
  3807. // tags. Returned assets will contain all the tags from the list.
  3808. func (c *LayersListCall) Tags(tags string) *LayersListCall {
  3809. c.urlParams_.Set("tags", tags)
  3810. return c
  3811. }
  3812. // Fields allows partial responses to be retrieved. See
  3813. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  3814. // for more information.
  3815. func (c *LayersListCall) Fields(s ...googleapi.Field) *LayersListCall {
  3816. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  3817. return c
  3818. }
  3819. // IfNoneMatch sets the optional parameter which makes the operation
  3820. // fail if the object's ETag matches the given value. This is useful for
  3821. // getting updates only after the object has changed since the last
  3822. // request. Use googleapi.IsNotModified to check whether the response
  3823. // error from Do is the result of In-None-Match.
  3824. func (c *LayersListCall) IfNoneMatch(entityTag string) *LayersListCall {
  3825. c.ifNoneMatch_ = entityTag
  3826. return c
  3827. }
  3828. // Context sets the context to be used in this call's Do method. Any
  3829. // pending HTTP request will be aborted if the provided context is
  3830. // canceled.
  3831. func (c *LayersListCall) Context(ctx context.Context) *LayersListCall {
  3832. c.ctx_ = ctx
  3833. return c
  3834. }
  3835. func (c *LayersListCall) doRequest(alt string) (*http.Response, error) {
  3836. var body io.Reader = nil
  3837. c.urlParams_.Set("alt", alt)
  3838. urls := googleapi.ResolveRelative(c.s.BasePath, "layers")
  3839. urls += "?" + c.urlParams_.Encode()
  3840. req, _ := http.NewRequest("GET", urls, body)
  3841. googleapi.SetOpaque(req.URL)
  3842. req.Header.Set("User-Agent", c.s.userAgent())
  3843. if c.ifNoneMatch_ != "" {
  3844. req.Header.Set("If-None-Match", c.ifNoneMatch_)
  3845. }
  3846. if c.ctx_ != nil {
  3847. return ctxhttp.Do(c.ctx_, c.s.client, req)
  3848. }
  3849. return c.s.client.Do(req)
  3850. }
  3851. // Do executes the "mapsengine.layers.list" call.
  3852. // Exactly one of *LayersListResponse or error will be non-nil. Any
  3853. // non-2xx status code is an error. Response headers are in either
  3854. // *LayersListResponse.ServerResponse.Header or (if a response was
  3855. // returned at all) in error.(*googleapi.Error).Header. Use
  3856. // googleapi.IsNotModified to check whether the returned error was
  3857. // because http.StatusNotModified was returned.
  3858. func (c *LayersListCall) Do(opts ...googleapi.CallOption) (*LayersListResponse, error) {
  3859. gensupport.SetOptions(c.urlParams_, opts...)
  3860. res, err := c.doRequest("json")
  3861. if res != nil && res.StatusCode == http.StatusNotModified {
  3862. if res.Body != nil {
  3863. res.Body.Close()
  3864. }
  3865. return nil, &googleapi.Error{
  3866. Code: res.StatusCode,
  3867. Header: res.Header,
  3868. }
  3869. }
  3870. if err != nil {
  3871. return nil, err
  3872. }
  3873. defer googleapi.CloseBody(res)
  3874. if err := googleapi.CheckResponse(res); err != nil {
  3875. return nil, err
  3876. }
  3877. ret := &LayersListResponse{
  3878. ServerResponse: googleapi.ServerResponse{
  3879. Header: res.Header,
  3880. HTTPStatusCode: res.StatusCode,
  3881. },
  3882. }
  3883. if err := json.NewDecoder(res.Body).Decode(&ret); err != nil {
  3884. return nil, err
  3885. }
  3886. return ret, nil
  3887. // {
  3888. // "description": "Return all layers readable by the current user.",
  3889. // "httpMethod": "GET",
  3890. // "id": "mapsengine.layers.list",
  3891. // "parameters": {
  3892. // "bbox": {
  3893. // "description": "A bounding box, expressed as \"west,south,east,north\". If set, only assets which intersect this bounding box will be returned.",
  3894. // "location": "query",
  3895. // "type": "string"
  3896. // },
  3897. // "createdAfter": {
  3898. // "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.",
  3899. // "format": "date-time",
  3900. // "location": "query",
  3901. // "type": "string"
  3902. // },
  3903. // "createdBefore": {
  3904. // "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.",
  3905. // "format": "date-time",
  3906. // "location": "query",
  3907. // "type": "string"
  3908. // },
  3909. // "creatorEmail": {
  3910. // "description": "An email address representing a user. Returned assets that have been created by the user associated with the provided email address.",
  3911. // "location": "query",
  3912. // "type": "string"
  3913. // },
  3914. // "maxResults": {
  3915. // "description": "The maximum number of items to include in a single response page. The maximum supported value is 100.",
  3916. // "format": "uint32",
  3917. // "location": "query",
  3918. // "type": "integer"
  3919. // },
  3920. // "modifiedAfter": {
  3921. // "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.",
  3922. // "format": "date-time",
  3923. // "location": "query",
  3924. // "type": "string"
  3925. // },
  3926. // "modifiedBefore": {
  3927. // "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.",
  3928. // "format": "date-time",
  3929. // "location": "query",
  3930. // "type": "string"
  3931. // },
  3932. // "pageToken": {
  3933. // "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.",
  3934. // "location": "query",
  3935. // "type": "string"
  3936. // },
  3937. // "processingStatus": {
  3938. // "enum": [
  3939. // "complete",
  3940. // "failed",
  3941. // "notReady",
  3942. // "processing",
  3943. // "ready"
  3944. // ],
  3945. // "enumDescriptions": [
  3946. // "The layer has completed processing.",
  3947. // "The layer has failed processing.",
  3948. // "The layer is not ready for processing.",
  3949. // "The layer is processing.",
  3950. // "The layer is ready for processing."
  3951. // ],
  3952. // "location": "query",
  3953. // "type": "string"
  3954. // },
  3955. // "projectId": {
  3956. // "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.",
  3957. // "location": "query",
  3958. // "type": "string"
  3959. // },
  3960. // "role": {
  3961. // "description": "The role parameter indicates that the response should only contain assets where the current user has the specified level of access.",
  3962. // "enum": [
  3963. // "owner",
  3964. // "reader",
  3965. // "writer"
  3966. // ],
  3967. // "enumDescriptions": [
  3968. // "The user can read, write and administer the asset.",
  3969. // "The user can read the asset.",
  3970. // "The user can read and write the asset."
  3971. // ],
  3972. // "location": "query",
  3973. // "type": "string"
  3974. // },
  3975. // "search": {
  3976. // "description": "An unstructured search string used to filter the set of results based on asset metadata.",
  3977. // "location": "query",
  3978. // "type": "string"
  3979. // },
  3980. // "tags": {
  3981. // "description": "A comma separated list of tags. Returned assets will contain all the tags from the list.",
  3982. // "location": "query",
  3983. // "type": "string"
  3984. // }
  3985. // },
  3986. // "path": "layers",
  3987. // "response": {
  3988. // "$ref": "LayersListResponse"
  3989. // },
  3990. // "scopes": [
  3991. // "https://www.googleapis.com/auth/mapsengine",
  3992. // "https://www.googleapis.com/auth/mapsengine.readonly"
  3993. // ]
  3994. // }
  3995. }
  3996. // Pages invokes f for each page of results.
  3997. // A non-nil error returned from f will halt the iteration.
  3998. // The provided context supersedes any context provided to the Context method.
  3999. func (c *LayersListCall) Pages(ctx context.Context, f func(*LayersListResponse) error) error {
  4000. c.ctx_ = ctx
  4001. defer c.PageToken(c.urlParams_.Get("pageToken")) // reset paging to original point
  4002. for {
  4003. x, err := c.Do()
  4004. if err != nil {
  4005. return err
  4006. }
  4007. if err := f(x); err != nil {
  4008. return err
  4009. }
  4010. if x.NextPageToken == "" {
  4011. return nil
  4012. }
  4013. c.PageToken(x.NextPageToken)
  4014. }
  4015. }
  4016. // method id "mapsengine.layers.listPublished":
  4017. type LayersListPublishedCall struct {
  4018. s *Service
  4019. urlParams_ gensupport.URLParams
  4020. ifNoneMatch_ string
  4021. ctx_ context.Context
  4022. }
  4023. // ListPublished: Return all published layers readable by the current
  4024. // user.
  4025. func (r *LayersService) ListPublished() *LayersListPublishedCall {
  4026. c := &LayersListPublishedCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  4027. return c
  4028. }
  4029. // MaxResults sets the optional parameter "maxResults": The maximum
  4030. // number of items to include in a single response page. The maximum
  4031. // supported value is 100.
  4032. func (c *LayersListPublishedCall) MaxResults(maxResults int64) *LayersListPublishedCall {
  4033. c.urlParams_.Set("maxResults", fmt.Sprint(maxResults))
  4034. return c
  4035. }
  4036. // PageToken sets the optional parameter "pageToken": The continuation
  4037. // token, used to page through large result sets. To get the next page
  4038. // of results, set this parameter to the value of nextPageToken from the
  4039. // previous response.
  4040. func (c *LayersListPublishedCall) PageToken(pageToken string) *LayersListPublishedCall {
  4041. c.urlParams_.Set("pageToken", pageToken)
  4042. return c
  4043. }
  4044. // ProjectId sets the optional parameter "projectId": The ID of a Maps
  4045. // Engine project, used to filter the response. To list all available
  4046. // projects with their IDs, send a Projects: list request. You can also
  4047. // find your project ID as the value of the DashboardPlace:cid URL
  4048. // parameter when signed in to mapsengine.google.com.
  4049. func (c *LayersListPublishedCall) ProjectId(projectId string) *LayersListPublishedCall {
  4050. c.urlParams_.Set("projectId", projectId)
  4051. return c
  4052. }
  4053. // Search sets the optional parameter "search": An unstructured search
  4054. // string used to filter the set of results based on asset metadata.
  4055. func (c *LayersListPublishedCall) Search(search string) *LayersListPublishedCall {
  4056. c.urlParams_.Set("search", search)
  4057. return c
  4058. }
  4059. // Fields allows partial responses to be retrieved. See
  4060. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  4061. // for more information.
  4062. func (c *LayersListPublishedCall) Fields(s ...googleapi.Field) *LayersListPublishedCall {
  4063. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  4064. return c
  4065. }
  4066. // IfNoneMatch sets the optional parameter which makes the operation
  4067. // fail if the object's ETag matches the given value. This is useful for
  4068. // getting updates only after the object has changed since the last
  4069. // request. Use googleapi.IsNotModified to check whether the response
  4070. // error from Do is the result of In-None-Match.
  4071. func (c *LayersListPublishedCall) IfNoneMatch(entityTag string) *LayersListPublishedCall {
  4072. c.ifNoneMatch_ = entityTag
  4073. return c
  4074. }
  4075. // Context sets the context to be used in this call's Do method. Any
  4076. // pending HTTP request will be aborted if the provided context is
  4077. // canceled.
  4078. func (c *LayersListPublishedCall) Context(ctx context.Context) *LayersListPublishedCall {
  4079. c.ctx_ = ctx
  4080. return c
  4081. }
  4082. func (c *LayersListPublishedCall) doRequest(alt string) (*http.Response, error) {
  4083. var body io.Reader = nil
  4084. c.urlParams_.Set("alt", alt)
  4085. urls := googleapi.ResolveRelative(c.s.BasePath, "layers/published")
  4086. urls += "?" + c.urlParams_.Encode()
  4087. req, _ := http.NewRequest("GET", urls, body)
  4088. googleapi.SetOpaque(req.URL)
  4089. req.Header.Set("User-Agent", c.s.userAgent())
  4090. if c.ifNoneMatch_ != "" {
  4091. req.Header.Set("If-None-Match", c.ifNoneMatch_)
  4092. }
  4093. if c.ctx_ != nil {
  4094. return ctxhttp.Do(c.ctx_, c.s.client, req)
  4095. }
  4096. return c.s.client.Do(req)
  4097. }
  4098. // Do executes the "mapsengine.layers.listPublished" call.
  4099. // Exactly one of *PublishedLayersListResponse or error will be non-nil.
  4100. // Any non-2xx status code is an error. Response headers are in either
  4101. // *PublishedLayersListResponse.ServerResponse.Header or (if a response
  4102. // was returned at all) in error.(*googleapi.Error).Header. Use
  4103. // googleapi.IsNotModified to check whether the returned error was
  4104. // because http.StatusNotModified was returned.
  4105. func (c *LayersListPublishedCall) Do(opts ...googleapi.CallOption) (*PublishedLayersListResponse, error) {
  4106. gensupport.SetOptions(c.urlParams_, opts...)
  4107. res, err := c.doRequest("json")
  4108. if res != nil && res.StatusCode == http.StatusNotModified {
  4109. if res.Body != nil {
  4110. res.Body.Close()
  4111. }
  4112. return nil, &googleapi.Error{
  4113. Code: res.StatusCode,
  4114. Header: res.Header,
  4115. }
  4116. }
  4117. if err != nil {
  4118. return nil, err
  4119. }
  4120. defer googleapi.CloseBody(res)
  4121. if err := googleapi.CheckResponse(res); err != nil {
  4122. return nil, err
  4123. }
  4124. ret := &PublishedLayersListResponse{
  4125. ServerResponse: googleapi.ServerResponse{
  4126. Header: res.Header,
  4127. HTTPStatusCode: res.StatusCode,
  4128. },
  4129. }
  4130. if err := json.NewDecoder(res.Body).Decode(&ret); err != nil {
  4131. return nil, err
  4132. }
  4133. return ret, nil
  4134. // {
  4135. // "description": "Return all published layers readable by the current user.",
  4136. // "httpMethod": "GET",
  4137. // "id": "mapsengine.layers.listPublished",
  4138. // "parameters": {
  4139. // "maxResults": {
  4140. // "description": "The maximum number of items to include in a single response page. The maximum supported value is 100.",
  4141. // "format": "uint32",
  4142. // "location": "query",
  4143. // "type": "integer"
  4144. // },
  4145. // "pageToken": {
  4146. // "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.",
  4147. // "location": "query",
  4148. // "type": "string"
  4149. // },
  4150. // "projectId": {
  4151. // "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.",
  4152. // "location": "query",
  4153. // "type": "string"
  4154. // },
  4155. // "search": {
  4156. // "description": "An unstructured search string used to filter the set of results based on asset metadata.",
  4157. // "location": "query",
  4158. // "type": "string"
  4159. // }
  4160. // },
  4161. // "path": "layers/published",
  4162. // "response": {
  4163. // "$ref": "PublishedLayersListResponse"
  4164. // },
  4165. // "scopes": [
  4166. // "https://www.googleapis.com/auth/mapsengine",
  4167. // "https://www.googleapis.com/auth/mapsengine.readonly"
  4168. // ]
  4169. // }
  4170. }
  4171. // Pages invokes f for each page of results.
  4172. // A non-nil error returned from f will halt the iteration.
  4173. // The provided context supersedes any context provided to the Context method.
  4174. func (c *LayersListPublishedCall) Pages(ctx context.Context, f func(*PublishedLayersListResponse) error) error {
  4175. c.ctx_ = ctx
  4176. defer c.PageToken(c.urlParams_.Get("pageToken")) // reset paging to original point
  4177. for {
  4178. x, err := c.Do()
  4179. if err != nil {
  4180. return err
  4181. }
  4182. if err := f(x); err != nil {
  4183. return err
  4184. }
  4185. if x.NextPageToken == "" {
  4186. return nil
  4187. }
  4188. c.PageToken(x.NextPageToken)
  4189. }
  4190. }
  4191. // method id "mapsengine.layers.patch":
  4192. type LayersPatchCall struct {
  4193. s *Service
  4194. id string
  4195. layer *Layer
  4196. urlParams_ gensupport.URLParams
  4197. ctx_ context.Context
  4198. }
  4199. // Patch: Mutate a layer asset.
  4200. func (r *LayersService) Patch(id string, layer *Layer) *LayersPatchCall {
  4201. c := &LayersPatchCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  4202. c.id = id
  4203. c.layer = layer
  4204. return c
  4205. }
  4206. // Fields allows partial responses to be retrieved. See
  4207. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  4208. // for more information.
  4209. func (c *LayersPatchCall) Fields(s ...googleapi.Field) *LayersPatchCall {
  4210. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  4211. return c
  4212. }
  4213. // Context sets the context to be used in this call's Do method. Any
  4214. // pending HTTP request will be aborted if the provided context is
  4215. // canceled.
  4216. func (c *LayersPatchCall) Context(ctx context.Context) *LayersPatchCall {
  4217. c.ctx_ = ctx
  4218. return c
  4219. }
  4220. func (c *LayersPatchCall) doRequest(alt string) (*http.Response, error) {
  4221. var body io.Reader = nil
  4222. body, err := googleapi.WithoutDataWrapper.JSONReader(c.layer)
  4223. if err != nil {
  4224. return nil, err
  4225. }
  4226. ctype := "application/json"
  4227. c.urlParams_.Set("alt", alt)
  4228. urls := googleapi.ResolveRelative(c.s.BasePath, "layers/{id}")
  4229. urls += "?" + c.urlParams_.Encode()
  4230. req, _ := http.NewRequest("PATCH", urls, body)
  4231. googleapi.Expand(req.URL, map[string]string{
  4232. "id": c.id,
  4233. })
  4234. req.Header.Set("Content-Type", ctype)
  4235. req.Header.Set("User-Agent", c.s.userAgent())
  4236. if c.ctx_ != nil {
  4237. return ctxhttp.Do(c.ctx_, c.s.client, req)
  4238. }
  4239. return c.s.client.Do(req)
  4240. }
  4241. // Do executes the "mapsengine.layers.patch" call.
  4242. func (c *LayersPatchCall) Do(opts ...googleapi.CallOption) error {
  4243. gensupport.SetOptions(c.urlParams_, opts...)
  4244. res, err := c.doRequest("json")
  4245. if err != nil {
  4246. return err
  4247. }
  4248. defer googleapi.CloseBody(res)
  4249. if err := googleapi.CheckResponse(res); err != nil {
  4250. return err
  4251. }
  4252. return nil
  4253. // {
  4254. // "description": "Mutate a layer asset.",
  4255. // "httpMethod": "PATCH",
  4256. // "id": "mapsengine.layers.patch",
  4257. // "parameterOrder": [
  4258. // "id"
  4259. // ],
  4260. // "parameters": {
  4261. // "id": {
  4262. // "description": "The ID of the layer.",
  4263. // "location": "path",
  4264. // "required": true,
  4265. // "type": "string"
  4266. // }
  4267. // },
  4268. // "path": "layers/{id}",
  4269. // "request": {
  4270. // "$ref": "Layer"
  4271. // },
  4272. // "scopes": [
  4273. // "https://www.googleapis.com/auth/mapsengine"
  4274. // ]
  4275. // }
  4276. }
  4277. // method id "mapsengine.layers.process":
  4278. type LayersProcessCall struct {
  4279. s *Service
  4280. id string
  4281. urlParams_ gensupport.URLParams
  4282. ctx_ context.Context
  4283. }
  4284. // Process: Process a layer asset.
  4285. func (r *LayersService) Process(id string) *LayersProcessCall {
  4286. c := &LayersProcessCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  4287. c.id = id
  4288. return c
  4289. }
  4290. // Fields allows partial responses to be retrieved. See
  4291. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  4292. // for more information.
  4293. func (c *LayersProcessCall) Fields(s ...googleapi.Field) *LayersProcessCall {
  4294. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  4295. return c
  4296. }
  4297. // Context sets the context to be used in this call's Do method. Any
  4298. // pending HTTP request will be aborted if the provided context is
  4299. // canceled.
  4300. func (c *LayersProcessCall) Context(ctx context.Context) *LayersProcessCall {
  4301. c.ctx_ = ctx
  4302. return c
  4303. }
  4304. func (c *LayersProcessCall) doRequest(alt string) (*http.Response, error) {
  4305. var body io.Reader = nil
  4306. c.urlParams_.Set("alt", alt)
  4307. urls := googleapi.ResolveRelative(c.s.BasePath, "layers/{id}/process")
  4308. urls += "?" + c.urlParams_.Encode()
  4309. req, _ := http.NewRequest("POST", urls, body)
  4310. googleapi.Expand(req.URL, map[string]string{
  4311. "id": c.id,
  4312. })
  4313. req.Header.Set("User-Agent", c.s.userAgent())
  4314. if c.ctx_ != nil {
  4315. return ctxhttp.Do(c.ctx_, c.s.client, req)
  4316. }
  4317. return c.s.client.Do(req)
  4318. }
  4319. // Do executes the "mapsengine.layers.process" call.
  4320. // Exactly one of *ProcessResponse or error will be non-nil. Any non-2xx
  4321. // status code is an error. Response headers are in either
  4322. // *ProcessResponse.ServerResponse.Header or (if a response was returned
  4323. // at all) in error.(*googleapi.Error).Header. Use
  4324. // googleapi.IsNotModified to check whether the returned error was
  4325. // because http.StatusNotModified was returned.
  4326. func (c *LayersProcessCall) Do(opts ...googleapi.CallOption) (*ProcessResponse, error) {
  4327. gensupport.SetOptions(c.urlParams_, opts...)
  4328. res, err := c.doRequest("json")
  4329. if res != nil && res.StatusCode == http.StatusNotModified {
  4330. if res.Body != nil {
  4331. res.Body.Close()
  4332. }
  4333. return nil, &googleapi.Error{
  4334. Code: res.StatusCode,
  4335. Header: res.Header,
  4336. }
  4337. }
  4338. if err != nil {
  4339. return nil, err
  4340. }
  4341. defer googleapi.CloseBody(res)
  4342. if err := googleapi.CheckResponse(res); err != nil {
  4343. return nil, err
  4344. }
  4345. ret := &ProcessResponse{
  4346. ServerResponse: googleapi.ServerResponse{
  4347. Header: res.Header,
  4348. HTTPStatusCode: res.StatusCode,
  4349. },
  4350. }
  4351. if err := json.NewDecoder(res.Body).Decode(&ret); err != nil {
  4352. return nil, err
  4353. }
  4354. return ret, nil
  4355. // {
  4356. // "description": "Process a layer asset.",
  4357. // "httpMethod": "POST",
  4358. // "id": "mapsengine.layers.process",
  4359. // "parameterOrder": [
  4360. // "id"
  4361. // ],
  4362. // "parameters": {
  4363. // "id": {
  4364. // "description": "The ID of the layer.",
  4365. // "location": "path",
  4366. // "required": true,
  4367. // "type": "string"
  4368. // }
  4369. // },
  4370. // "path": "layers/{id}/process",
  4371. // "response": {
  4372. // "$ref": "ProcessResponse"
  4373. // },
  4374. // "scopes": [
  4375. // "https://www.googleapis.com/auth/mapsengine"
  4376. // ]
  4377. // }
  4378. }
  4379. // method id "mapsengine.layers.publish":
  4380. type LayersPublishCall struct {
  4381. s *Service
  4382. id string
  4383. urlParams_ gensupport.URLParams
  4384. ctx_ context.Context
  4385. }
  4386. // Publish: Publish a layer asset.
  4387. func (r *LayersService) Publish(id string) *LayersPublishCall {
  4388. c := &LayersPublishCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  4389. c.id = id
  4390. return c
  4391. }
  4392. // Force sets the optional parameter "force": If set to true, the API
  4393. // will allow publication of the layer even if it's out of date. If not
  4394. // true, you'll need to reprocess any out-of-date layer before
  4395. // publishing.
  4396. func (c *LayersPublishCall) Force(force bool) *LayersPublishCall {
  4397. c.urlParams_.Set("force", fmt.Sprint(force))
  4398. return c
  4399. }
  4400. // Fields allows partial responses to be retrieved. See
  4401. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  4402. // for more information.
  4403. func (c *LayersPublishCall) Fields(s ...googleapi.Field) *LayersPublishCall {
  4404. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  4405. return c
  4406. }
  4407. // Context sets the context to be used in this call's Do method. Any
  4408. // pending HTTP request will be aborted if the provided context is
  4409. // canceled.
  4410. func (c *LayersPublishCall) Context(ctx context.Context) *LayersPublishCall {
  4411. c.ctx_ = ctx
  4412. return c
  4413. }
  4414. func (c *LayersPublishCall) doRequest(alt string) (*http.Response, error) {
  4415. var body io.Reader = nil
  4416. c.urlParams_.Set("alt", alt)
  4417. urls := googleapi.ResolveRelative(c.s.BasePath, "layers/{id}/publish")
  4418. urls += "?" + c.urlParams_.Encode()
  4419. req, _ := http.NewRequest("POST", urls, body)
  4420. googleapi.Expand(req.URL, map[string]string{
  4421. "id": c.id,
  4422. })
  4423. req.Header.Set("User-Agent", c.s.userAgent())
  4424. if c.ctx_ != nil {
  4425. return ctxhttp.Do(c.ctx_, c.s.client, req)
  4426. }
  4427. return c.s.client.Do(req)
  4428. }
  4429. // Do executes the "mapsengine.layers.publish" call.
  4430. // Exactly one of *PublishResponse or error will be non-nil. Any non-2xx
  4431. // status code is an error. Response headers are in either
  4432. // *PublishResponse.ServerResponse.Header or (if a response was returned
  4433. // at all) in error.(*googleapi.Error).Header. Use
  4434. // googleapi.IsNotModified to check whether the returned error was
  4435. // because http.StatusNotModified was returned.
  4436. func (c *LayersPublishCall) Do(opts ...googleapi.CallOption) (*PublishResponse, error) {
  4437. gensupport.SetOptions(c.urlParams_, opts...)
  4438. res, err := c.doRequest("json")
  4439. if res != nil && res.StatusCode == http.StatusNotModified {
  4440. if res.Body != nil {
  4441. res.Body.Close()
  4442. }
  4443. return nil, &googleapi.Error{
  4444. Code: res.StatusCode,
  4445. Header: res.Header,
  4446. }
  4447. }
  4448. if err != nil {
  4449. return nil, err
  4450. }
  4451. defer googleapi.CloseBody(res)
  4452. if err := googleapi.CheckResponse(res); err != nil {
  4453. return nil, err
  4454. }
  4455. ret := &PublishResponse{
  4456. ServerResponse: googleapi.ServerResponse{
  4457. Header: res.Header,
  4458. HTTPStatusCode: res.StatusCode,
  4459. },
  4460. }
  4461. if err := json.NewDecoder(res.Body).Decode(&ret); err != nil {
  4462. return nil, err
  4463. }
  4464. return ret, nil
  4465. // {
  4466. // "description": "Publish a layer asset.",
  4467. // "httpMethod": "POST",
  4468. // "id": "mapsengine.layers.publish",
  4469. // "parameterOrder": [
  4470. // "id"
  4471. // ],
  4472. // "parameters": {
  4473. // "force": {
  4474. // "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.",
  4475. // "location": "query",
  4476. // "type": "boolean"
  4477. // },
  4478. // "id": {
  4479. // "description": "The ID of the layer.",
  4480. // "location": "path",
  4481. // "required": true,
  4482. // "type": "string"
  4483. // }
  4484. // },
  4485. // "path": "layers/{id}/publish",
  4486. // "response": {
  4487. // "$ref": "PublishResponse"
  4488. // },
  4489. // "scopes": [
  4490. // "https://www.googleapis.com/auth/mapsengine"
  4491. // ]
  4492. // }
  4493. }
  4494. // method id "mapsengine.layers.unpublish":
  4495. type LayersUnpublishCall struct {
  4496. s *Service
  4497. id string
  4498. urlParams_ gensupport.URLParams
  4499. ctx_ context.Context
  4500. }
  4501. // Unpublish: Unpublish a layer asset.
  4502. func (r *LayersService) Unpublish(id string) *LayersUnpublishCall {
  4503. c := &LayersUnpublishCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  4504. c.id = id
  4505. return c
  4506. }
  4507. // Fields allows partial responses to be retrieved. See
  4508. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  4509. // for more information.
  4510. func (c *LayersUnpublishCall) Fields(s ...googleapi.Field) *LayersUnpublishCall {
  4511. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  4512. return c
  4513. }
  4514. // Context sets the context to be used in this call's Do method. Any
  4515. // pending HTTP request will be aborted if the provided context is
  4516. // canceled.
  4517. func (c *LayersUnpublishCall) Context(ctx context.Context) *LayersUnpublishCall {
  4518. c.ctx_ = ctx
  4519. return c
  4520. }
  4521. func (c *LayersUnpublishCall) doRequest(alt string) (*http.Response, error) {
  4522. var body io.Reader = nil
  4523. c.urlParams_.Set("alt", alt)
  4524. urls := googleapi.ResolveRelative(c.s.BasePath, "layers/{id}/unpublish")
  4525. urls += "?" + c.urlParams_.Encode()
  4526. req, _ := http.NewRequest("POST", urls, body)
  4527. googleapi.Expand(req.URL, map[string]string{
  4528. "id": c.id,
  4529. })
  4530. req.Header.Set("User-Agent", c.s.userAgent())
  4531. if c.ctx_ != nil {
  4532. return ctxhttp.Do(c.ctx_, c.s.client, req)
  4533. }
  4534. return c.s.client.Do(req)
  4535. }
  4536. // Do executes the "mapsengine.layers.unpublish" call.
  4537. // Exactly one of *PublishResponse or error will be non-nil. Any non-2xx
  4538. // status code is an error. Response headers are in either
  4539. // *PublishResponse.ServerResponse.Header or (if a response was returned
  4540. // at all) in error.(*googleapi.Error).Header. Use
  4541. // googleapi.IsNotModified to check whether the returned error was
  4542. // because http.StatusNotModified was returned.
  4543. func (c *LayersUnpublishCall) Do(opts ...googleapi.CallOption) (*PublishResponse, error) {
  4544. gensupport.SetOptions(c.urlParams_, opts...)
  4545. res, err := c.doRequest("json")
  4546. if res != nil && res.StatusCode == http.StatusNotModified {
  4547. if res.Body != nil {
  4548. res.Body.Close()
  4549. }
  4550. return nil, &googleapi.Error{
  4551. Code: res.StatusCode,
  4552. Header: res.Header,
  4553. }
  4554. }
  4555. if err != nil {
  4556. return nil, err
  4557. }
  4558. defer googleapi.CloseBody(res)
  4559. if err := googleapi.CheckResponse(res); err != nil {
  4560. return nil, err
  4561. }
  4562. ret := &PublishResponse{
  4563. ServerResponse: googleapi.ServerResponse{
  4564. Header: res.Header,
  4565. HTTPStatusCode: res.StatusCode,
  4566. },
  4567. }
  4568. if err := json.NewDecoder(res.Body).Decode(&ret); err != nil {
  4569. return nil, err
  4570. }
  4571. return ret, nil
  4572. // {
  4573. // "description": "Unpublish a layer asset.",
  4574. // "httpMethod": "POST",
  4575. // "id": "mapsengine.layers.unpublish",
  4576. // "parameterOrder": [
  4577. // "id"
  4578. // ],
  4579. // "parameters": {
  4580. // "id": {
  4581. // "description": "The ID of the layer.",
  4582. // "location": "path",
  4583. // "required": true,
  4584. // "type": "string"
  4585. // }
  4586. // },
  4587. // "path": "layers/{id}/unpublish",
  4588. // "response": {
  4589. // "$ref": "PublishResponse"
  4590. // },
  4591. // "scopes": [
  4592. // "https://www.googleapis.com/auth/mapsengine"
  4593. // ]
  4594. // }
  4595. }
  4596. // method id "mapsengine.layers.parents.list":
  4597. type LayersParentsListCall struct {
  4598. s *Service
  4599. id string
  4600. urlParams_ gensupport.URLParams
  4601. ifNoneMatch_ string
  4602. ctx_ context.Context
  4603. }
  4604. // List: Return all parent ids of the specified layer.
  4605. func (r *LayersParentsService) List(id string) *LayersParentsListCall {
  4606. c := &LayersParentsListCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  4607. c.id = id
  4608. return c
  4609. }
  4610. // MaxResults sets the optional parameter "maxResults": The maximum
  4611. // number of items to include in a single response page. The maximum
  4612. // supported value is 50.
  4613. func (c *LayersParentsListCall) MaxResults(maxResults int64) *LayersParentsListCall {
  4614. c.urlParams_.Set("maxResults", fmt.Sprint(maxResults))
  4615. return c
  4616. }
  4617. // PageToken sets the optional parameter "pageToken": The continuation
  4618. // token, used to page through large result sets. To get the next page
  4619. // of results, set this parameter to the value of nextPageToken from the
  4620. // previous response.
  4621. func (c *LayersParentsListCall) PageToken(pageToken string) *LayersParentsListCall {
  4622. c.urlParams_.Set("pageToken", pageToken)
  4623. return c
  4624. }
  4625. // Fields allows partial responses to be retrieved. See
  4626. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  4627. // for more information.
  4628. func (c *LayersParentsListCall) Fields(s ...googleapi.Field) *LayersParentsListCall {
  4629. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  4630. return c
  4631. }
  4632. // IfNoneMatch sets the optional parameter which makes the operation
  4633. // fail if the object's ETag matches the given value. This is useful for
  4634. // getting updates only after the object has changed since the last
  4635. // request. Use googleapi.IsNotModified to check whether the response
  4636. // error from Do is the result of In-None-Match.
  4637. func (c *LayersParentsListCall) IfNoneMatch(entityTag string) *LayersParentsListCall {
  4638. c.ifNoneMatch_ = entityTag
  4639. return c
  4640. }
  4641. // Context sets the context to be used in this call's Do method. Any
  4642. // pending HTTP request will be aborted if the provided context is
  4643. // canceled.
  4644. func (c *LayersParentsListCall) Context(ctx context.Context) *LayersParentsListCall {
  4645. c.ctx_ = ctx
  4646. return c
  4647. }
  4648. func (c *LayersParentsListCall) doRequest(alt string) (*http.Response, error) {
  4649. var body io.Reader = nil
  4650. c.urlParams_.Set("alt", alt)
  4651. urls := googleapi.ResolveRelative(c.s.BasePath, "layers/{id}/parents")
  4652. urls += "?" + c.urlParams_.Encode()
  4653. req, _ := http.NewRequest("GET", urls, body)
  4654. googleapi.Expand(req.URL, map[string]string{
  4655. "id": c.id,
  4656. })
  4657. req.Header.Set("User-Agent", c.s.userAgent())
  4658. if c.ifNoneMatch_ != "" {
  4659. req.Header.Set("If-None-Match", c.ifNoneMatch_)
  4660. }
  4661. if c.ctx_ != nil {
  4662. return ctxhttp.Do(c.ctx_, c.s.client, req)
  4663. }
  4664. return c.s.client.Do(req)
  4665. }
  4666. // Do executes the "mapsengine.layers.parents.list" call.
  4667. // Exactly one of *ParentsListResponse or error will be non-nil. Any
  4668. // non-2xx status code is an error. Response headers are in either
  4669. // *ParentsListResponse.ServerResponse.Header or (if a response was
  4670. // returned at all) in error.(*googleapi.Error).Header. Use
  4671. // googleapi.IsNotModified to check whether the returned error was
  4672. // because http.StatusNotModified was returned.
  4673. func (c *LayersParentsListCall) Do(opts ...googleapi.CallOption) (*ParentsListResponse, error) {
  4674. gensupport.SetOptions(c.urlParams_, opts...)
  4675. res, err := c.doRequest("json")
  4676. if res != nil && res.StatusCode == http.StatusNotModified {
  4677. if res.Body != nil {
  4678. res.Body.Close()
  4679. }
  4680. return nil, &googleapi.Error{
  4681. Code: res.StatusCode,
  4682. Header: res.Header,
  4683. }
  4684. }
  4685. if err != nil {
  4686. return nil, err
  4687. }
  4688. defer googleapi.CloseBody(res)
  4689. if err := googleapi.CheckResponse(res); err != nil {
  4690. return nil, err
  4691. }
  4692. ret := &ParentsListResponse{
  4693. ServerResponse: googleapi.ServerResponse{
  4694. Header: res.Header,
  4695. HTTPStatusCode: res.StatusCode,
  4696. },
  4697. }
  4698. if err := json.NewDecoder(res.Body).Decode(&ret); err != nil {
  4699. return nil, err
  4700. }
  4701. return ret, nil
  4702. // {
  4703. // "description": "Return all parent ids of the specified layer.",
  4704. // "httpMethod": "GET",
  4705. // "id": "mapsengine.layers.parents.list",
  4706. // "parameterOrder": [
  4707. // "id"
  4708. // ],
  4709. // "parameters": {
  4710. // "id": {
  4711. // "description": "The ID of the layer whose parents will be listed.",
  4712. // "location": "path",
  4713. // "required": true,
  4714. // "type": "string"
  4715. // },
  4716. // "maxResults": {
  4717. // "description": "The maximum number of items to include in a single response page. The maximum supported value is 50.",
  4718. // "format": "uint32",
  4719. // "location": "query",
  4720. // "type": "integer"
  4721. // },
  4722. // "pageToken": {
  4723. // "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.",
  4724. // "location": "query",
  4725. // "type": "string"
  4726. // }
  4727. // },
  4728. // "path": "layers/{id}/parents",
  4729. // "response": {
  4730. // "$ref": "ParentsListResponse"
  4731. // },
  4732. // "scopes": [
  4733. // "https://www.googleapis.com/auth/mapsengine",
  4734. // "https://www.googleapis.com/auth/mapsengine.readonly"
  4735. // ]
  4736. // }
  4737. }
  4738. // Pages invokes f for each page of results.
  4739. // A non-nil error returned from f will halt the iteration.
  4740. // The provided context supersedes any context provided to the Context method.
  4741. func (c *LayersParentsListCall) Pages(ctx context.Context, f func(*ParentsListResponse) error) error {
  4742. c.ctx_ = ctx
  4743. defer c.PageToken(c.urlParams_.Get("pageToken")) // reset paging to original point
  4744. for {
  4745. x, err := c.Do()
  4746. if err != nil {
  4747. return err
  4748. }
  4749. if err := f(x); err != nil {
  4750. return err
  4751. }
  4752. if x.NextPageToken == "" {
  4753. return nil
  4754. }
  4755. c.PageToken(x.NextPageToken)
  4756. }
  4757. }
  4758. // method id "mapsengine.layers.permissions.batchDelete":
  4759. type LayersPermissionsBatchDeleteCall struct {
  4760. s *Service
  4761. id string
  4762. permissionsbatchdeleterequest *PermissionsBatchDeleteRequest
  4763. urlParams_ gensupport.URLParams
  4764. ctx_ context.Context
  4765. }
  4766. // BatchDelete: Remove permission entries from an already existing
  4767. // asset.
  4768. func (r *LayersPermissionsService) BatchDelete(id string, permissionsbatchdeleterequest *PermissionsBatchDeleteRequest) *LayersPermissionsBatchDeleteCall {
  4769. c := &LayersPermissionsBatchDeleteCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  4770. c.id = id
  4771. c.permissionsbatchdeleterequest = permissionsbatchdeleterequest
  4772. return c
  4773. }
  4774. // Fields allows partial responses to be retrieved. See
  4775. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  4776. // for more information.
  4777. func (c *LayersPermissionsBatchDeleteCall) Fields(s ...googleapi.Field) *LayersPermissionsBatchDeleteCall {
  4778. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  4779. return c
  4780. }
  4781. // Context sets the context to be used in this call's Do method. Any
  4782. // pending HTTP request will be aborted if the provided context is
  4783. // canceled.
  4784. func (c *LayersPermissionsBatchDeleteCall) Context(ctx context.Context) *LayersPermissionsBatchDeleteCall {
  4785. c.ctx_ = ctx
  4786. return c
  4787. }
  4788. func (c *LayersPermissionsBatchDeleteCall) doRequest(alt string) (*http.Response, error) {
  4789. var body io.Reader = nil
  4790. body, err := googleapi.WithoutDataWrapper.JSONReader(c.permissionsbatchdeleterequest)
  4791. if err != nil {
  4792. return nil, err
  4793. }
  4794. ctype := "application/json"
  4795. c.urlParams_.Set("alt", alt)
  4796. urls := googleapi.ResolveRelative(c.s.BasePath, "layers/{id}/permissions/batchDelete")
  4797. urls += "?" + c.urlParams_.Encode()
  4798. req, _ := http.NewRequest("POST", urls, body)
  4799. googleapi.Expand(req.URL, map[string]string{
  4800. "id": c.id,
  4801. })
  4802. req.Header.Set("Content-Type", ctype)
  4803. req.Header.Set("User-Agent", c.s.userAgent())
  4804. if c.ctx_ != nil {
  4805. return ctxhttp.Do(c.ctx_, c.s.client, req)
  4806. }
  4807. return c.s.client.Do(req)
  4808. }
  4809. // Do executes the "mapsengine.layers.permissions.batchDelete" call.
  4810. // Exactly one of *PermissionsBatchDeleteResponse or error will be
  4811. // non-nil. Any non-2xx status code is an error. Response headers are in
  4812. // either *PermissionsBatchDeleteResponse.ServerResponse.Header or (if a
  4813. // response was returned at all) in error.(*googleapi.Error).Header. Use
  4814. // googleapi.IsNotModified to check whether the returned error was
  4815. // because http.StatusNotModified was returned.
  4816. func (c *LayersPermissionsBatchDeleteCall) Do(opts ...googleapi.CallOption) (*PermissionsBatchDeleteResponse, error) {
  4817. gensupport.SetOptions(c.urlParams_, opts...)
  4818. res, err := c.doRequest("json")
  4819. if res != nil && res.StatusCode == http.StatusNotModified {
  4820. if res.Body != nil {
  4821. res.Body.Close()
  4822. }
  4823. return nil, &googleapi.Error{
  4824. Code: res.StatusCode,
  4825. Header: res.Header,
  4826. }
  4827. }
  4828. if err != nil {
  4829. return nil, err
  4830. }
  4831. defer googleapi.CloseBody(res)
  4832. if err := googleapi.CheckResponse(res); err != nil {
  4833. return nil, err
  4834. }
  4835. ret := &PermissionsBatchDeleteResponse{
  4836. ServerResponse: googleapi.ServerResponse{
  4837. Header: res.Header,
  4838. HTTPStatusCode: res.StatusCode,
  4839. },
  4840. }
  4841. if err := json.NewDecoder(res.Body).Decode(&ret); err != nil {
  4842. return nil, err
  4843. }
  4844. return ret, nil
  4845. // {
  4846. // "description": "Remove permission entries from an already existing asset.",
  4847. // "httpMethod": "POST",
  4848. // "id": "mapsengine.layers.permissions.batchDelete",
  4849. // "parameterOrder": [
  4850. // "id"
  4851. // ],
  4852. // "parameters": {
  4853. // "id": {
  4854. // "description": "The ID of the asset from which permissions will be removed.",
  4855. // "location": "path",
  4856. // "required": true,
  4857. // "type": "string"
  4858. // }
  4859. // },
  4860. // "path": "layers/{id}/permissions/batchDelete",
  4861. // "request": {
  4862. // "$ref": "PermissionsBatchDeleteRequest"
  4863. // },
  4864. // "response": {
  4865. // "$ref": "PermissionsBatchDeleteResponse"
  4866. // },
  4867. // "scopes": [
  4868. // "https://www.googleapis.com/auth/mapsengine"
  4869. // ]
  4870. // }
  4871. }
  4872. // method id "mapsengine.layers.permissions.batchUpdate":
  4873. type LayersPermissionsBatchUpdateCall struct {
  4874. s *Service
  4875. id string
  4876. permissionsbatchupdaterequest *PermissionsBatchUpdateRequest
  4877. urlParams_ gensupport.URLParams
  4878. ctx_ context.Context
  4879. }
  4880. // BatchUpdate: Add or update permission entries to an already existing
  4881. // asset.
  4882. //
  4883. // An asset can hold up to 20 different permission entries. Each
  4884. // batchInsert request is atomic.
  4885. func (r *LayersPermissionsService) BatchUpdate(id string, permissionsbatchupdaterequest *PermissionsBatchUpdateRequest) *LayersPermissionsBatchUpdateCall {
  4886. c := &LayersPermissionsBatchUpdateCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  4887. c.id = id
  4888. c.permissionsbatchupdaterequest = permissionsbatchupdaterequest
  4889. return c
  4890. }
  4891. // Fields allows partial responses to be retrieved. See
  4892. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  4893. // for more information.
  4894. func (c *LayersPermissionsBatchUpdateCall) Fields(s ...googleapi.Field) *LayersPermissionsBatchUpdateCall {
  4895. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  4896. return c
  4897. }
  4898. // Context sets the context to be used in this call's Do method. Any
  4899. // pending HTTP request will be aborted if the provided context is
  4900. // canceled.
  4901. func (c *LayersPermissionsBatchUpdateCall) Context(ctx context.Context) *LayersPermissionsBatchUpdateCall {
  4902. c.ctx_ = ctx
  4903. return c
  4904. }
  4905. func (c *LayersPermissionsBatchUpdateCall) doRequest(alt string) (*http.Response, error) {
  4906. var body io.Reader = nil
  4907. body, err := googleapi.WithoutDataWrapper.JSONReader(c.permissionsbatchupdaterequest)
  4908. if err != nil {
  4909. return nil, err
  4910. }
  4911. ctype := "application/json"
  4912. c.urlParams_.Set("alt", alt)
  4913. urls := googleapi.ResolveRelative(c.s.BasePath, "layers/{id}/permissions/batchUpdate")
  4914. urls += "?" + c.urlParams_.Encode()
  4915. req, _ := http.NewRequest("POST", urls, body)
  4916. googleapi.Expand(req.URL, map[string]string{
  4917. "id": c.id,
  4918. })
  4919. req.Header.Set("Content-Type", ctype)
  4920. req.Header.Set("User-Agent", c.s.userAgent())
  4921. if c.ctx_ != nil {
  4922. return ctxhttp.Do(c.ctx_, c.s.client, req)
  4923. }
  4924. return c.s.client.Do(req)
  4925. }
  4926. // Do executes the "mapsengine.layers.permissions.batchUpdate" call.
  4927. // Exactly one of *PermissionsBatchUpdateResponse or error will be
  4928. // non-nil. Any non-2xx status code is an error. Response headers are in
  4929. // either *PermissionsBatchUpdateResponse.ServerResponse.Header or (if a
  4930. // response was returned at all) in error.(*googleapi.Error).Header. Use
  4931. // googleapi.IsNotModified to check whether the returned error was
  4932. // because http.StatusNotModified was returned.
  4933. func (c *LayersPermissionsBatchUpdateCall) Do(opts ...googleapi.CallOption) (*PermissionsBatchUpdateResponse, error) {
  4934. gensupport.SetOptions(c.urlParams_, opts...)
  4935. res, err := c.doRequest("json")
  4936. if res != nil && res.StatusCode == http.StatusNotModified {
  4937. if res.Body != nil {
  4938. res.Body.Close()
  4939. }
  4940. return nil, &googleapi.Error{
  4941. Code: res.StatusCode,
  4942. Header: res.Header,
  4943. }
  4944. }
  4945. if err != nil {
  4946. return nil, err
  4947. }
  4948. defer googleapi.CloseBody(res)
  4949. if err := googleapi.CheckResponse(res); err != nil {
  4950. return nil, err
  4951. }
  4952. ret := &PermissionsBatchUpdateResponse{
  4953. ServerResponse: googleapi.ServerResponse{
  4954. Header: res.Header,
  4955. HTTPStatusCode: res.StatusCode,
  4956. },
  4957. }
  4958. if err := json.NewDecoder(res.Body).Decode(&ret); err != nil {
  4959. return nil, err
  4960. }
  4961. return ret, nil
  4962. // {
  4963. // "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.",
  4964. // "httpMethod": "POST",
  4965. // "id": "mapsengine.layers.permissions.batchUpdate",
  4966. // "parameterOrder": [
  4967. // "id"
  4968. // ],
  4969. // "parameters": {
  4970. // "id": {
  4971. // "description": "The ID of the asset to which permissions will be added.",
  4972. // "location": "path",
  4973. // "required": true,
  4974. // "type": "string"
  4975. // }
  4976. // },
  4977. // "path": "layers/{id}/permissions/batchUpdate",
  4978. // "request": {
  4979. // "$ref": "PermissionsBatchUpdateRequest"
  4980. // },
  4981. // "response": {
  4982. // "$ref": "PermissionsBatchUpdateResponse"
  4983. // },
  4984. // "scopes": [
  4985. // "https://www.googleapis.com/auth/mapsengine"
  4986. // ]
  4987. // }
  4988. }
  4989. // method id "mapsengine.layers.permissions.list":
  4990. type LayersPermissionsListCall struct {
  4991. s *Service
  4992. id string
  4993. urlParams_ gensupport.URLParams
  4994. ifNoneMatch_ string
  4995. ctx_ context.Context
  4996. }
  4997. // List: Return all of the permissions for the specified asset.
  4998. func (r *LayersPermissionsService) List(id string) *LayersPermissionsListCall {
  4999. c := &LayersPermissionsListCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  5000. c.id = id
  5001. return c
  5002. }
  5003. // Fields allows partial responses to be retrieved. See
  5004. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  5005. // for more information.
  5006. func (c *LayersPermissionsListCall) Fields(s ...googleapi.Field) *LayersPermissionsListCall {
  5007. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  5008. return c
  5009. }
  5010. // IfNoneMatch sets the optional parameter which makes the operation
  5011. // fail if the object's ETag matches the given value. This is useful for
  5012. // getting updates only after the object has changed since the last
  5013. // request. Use googleapi.IsNotModified to check whether the response
  5014. // error from Do is the result of In-None-Match.
  5015. func (c *LayersPermissionsListCall) IfNoneMatch(entityTag string) *LayersPermissionsListCall {
  5016. c.ifNoneMatch_ = entityTag
  5017. return c
  5018. }
  5019. // Context sets the context to be used in this call's Do method. Any
  5020. // pending HTTP request will be aborted if the provided context is
  5021. // canceled.
  5022. func (c *LayersPermissionsListCall) Context(ctx context.Context) *LayersPermissionsListCall {
  5023. c.ctx_ = ctx
  5024. return c
  5025. }
  5026. func (c *LayersPermissionsListCall) doRequest(alt string) (*http.Response, error) {
  5027. var body io.Reader = nil
  5028. c.urlParams_.Set("alt", alt)
  5029. urls := googleapi.ResolveRelative(c.s.BasePath, "layers/{id}/permissions")
  5030. urls += "?" + c.urlParams_.Encode()
  5031. req, _ := http.NewRequest("GET", urls, body)
  5032. googleapi.Expand(req.URL, map[string]string{
  5033. "id": c.id,
  5034. })
  5035. req.Header.Set("User-Agent", c.s.userAgent())
  5036. if c.ifNoneMatch_ != "" {
  5037. req.Header.Set("If-None-Match", c.ifNoneMatch_)
  5038. }
  5039. if c.ctx_ != nil {
  5040. return ctxhttp.Do(c.ctx_, c.s.client, req)
  5041. }
  5042. return c.s.client.Do(req)
  5043. }
  5044. // Do executes the "mapsengine.layers.permissions.list" call.
  5045. // Exactly one of *PermissionsListResponse or error will be non-nil. Any
  5046. // non-2xx status code is an error. Response headers are in either
  5047. // *PermissionsListResponse.ServerResponse.Header or (if a response was
  5048. // returned at all) in error.(*googleapi.Error).Header. Use
  5049. // googleapi.IsNotModified to check whether the returned error was
  5050. // because http.StatusNotModified was returned.
  5051. func (c *LayersPermissionsListCall) Do(opts ...googleapi.CallOption) (*PermissionsListResponse, error) {
  5052. gensupport.SetOptions(c.urlParams_, opts...)
  5053. res, err := c.doRequest("json")
  5054. if res != nil && res.StatusCode == http.StatusNotModified {
  5055. if res.Body != nil {
  5056. res.Body.Close()
  5057. }
  5058. return nil, &googleapi.Error{
  5059. Code: res.StatusCode,
  5060. Header: res.Header,
  5061. }
  5062. }
  5063. if err != nil {
  5064. return nil, err
  5065. }
  5066. defer googleapi.CloseBody(res)
  5067. if err := googleapi.CheckResponse(res); err != nil {
  5068. return nil, err
  5069. }
  5070. ret := &PermissionsListResponse{
  5071. ServerResponse: googleapi.ServerResponse{
  5072. Header: res.Header,
  5073. HTTPStatusCode: res.StatusCode,
  5074. },
  5075. }
  5076. if err := json.NewDecoder(res.Body).Decode(&ret); err != nil {
  5077. return nil, err
  5078. }
  5079. return ret, nil
  5080. // {
  5081. // "description": "Return all of the permissions for the specified asset.",
  5082. // "httpMethod": "GET",
  5083. // "id": "mapsengine.layers.permissions.list",
  5084. // "parameterOrder": [
  5085. // "id"
  5086. // ],
  5087. // "parameters": {
  5088. // "id": {
  5089. // "description": "The ID of the asset whose permissions will be listed.",
  5090. // "location": "path",
  5091. // "required": true,
  5092. // "type": "string"
  5093. // }
  5094. // },
  5095. // "path": "layers/{id}/permissions",
  5096. // "response": {
  5097. // "$ref": "PermissionsListResponse"
  5098. // },
  5099. // "scopes": [
  5100. // "https://www.googleapis.com/auth/mapsengine",
  5101. // "https://www.googleapis.com/auth/mapsengine.readonly"
  5102. // ]
  5103. // }
  5104. }
  5105. // method id "mapsengine.maps.create":
  5106. type MapsCreateCall struct {
  5107. s *Service
  5108. map_ *Map
  5109. urlParams_ gensupport.URLParams
  5110. ctx_ context.Context
  5111. }
  5112. // Create: Create a map asset.
  5113. func (r *MapsService) Create(map_ *Map) *MapsCreateCall {
  5114. c := &MapsCreateCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  5115. c.map_ = map_
  5116. return c
  5117. }
  5118. // Fields allows partial responses to be retrieved. See
  5119. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  5120. // for more information.
  5121. func (c *MapsCreateCall) Fields(s ...googleapi.Field) *MapsCreateCall {
  5122. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  5123. return c
  5124. }
  5125. // Context sets the context to be used in this call's Do method. Any
  5126. // pending HTTP request will be aborted if the provided context is
  5127. // canceled.
  5128. func (c *MapsCreateCall) Context(ctx context.Context) *MapsCreateCall {
  5129. c.ctx_ = ctx
  5130. return c
  5131. }
  5132. func (c *MapsCreateCall) doRequest(alt string) (*http.Response, error) {
  5133. var body io.Reader = nil
  5134. body, err := googleapi.WithoutDataWrapper.JSONReader(c.map_)
  5135. if err != nil {
  5136. return nil, err
  5137. }
  5138. ctype := "application/json"
  5139. c.urlParams_.Set("alt", alt)
  5140. urls := googleapi.ResolveRelative(c.s.BasePath, "maps")
  5141. urls += "?" + c.urlParams_.Encode()
  5142. req, _ := http.NewRequest("POST", urls, body)
  5143. googleapi.SetOpaque(req.URL)
  5144. req.Header.Set("Content-Type", ctype)
  5145. req.Header.Set("User-Agent", c.s.userAgent())
  5146. if c.ctx_ != nil {
  5147. return ctxhttp.Do(c.ctx_, c.s.client, req)
  5148. }
  5149. return c.s.client.Do(req)
  5150. }
  5151. // Do executes the "mapsengine.maps.create" call.
  5152. // Exactly one of *Map or error will be non-nil. Any non-2xx status code
  5153. // is an error. Response headers are in either
  5154. // *Map.ServerResponse.Header or (if a response was returned at all) in
  5155. // error.(*googleapi.Error).Header. Use googleapi.IsNotModified to check
  5156. // whether the returned error was because http.StatusNotModified was
  5157. // returned.
  5158. func (c *MapsCreateCall) Do(opts ...googleapi.CallOption) (*Map, error) {
  5159. gensupport.SetOptions(c.urlParams_, opts...)
  5160. res, err := c.doRequest("json")
  5161. if res != nil && res.StatusCode == http.StatusNotModified {
  5162. if res.Body != nil {
  5163. res.Body.Close()
  5164. }
  5165. return nil, &googleapi.Error{
  5166. Code: res.StatusCode,
  5167. Header: res.Header,
  5168. }
  5169. }
  5170. if err != nil {
  5171. return nil, err
  5172. }
  5173. defer googleapi.CloseBody(res)
  5174. if err := googleapi.CheckResponse(res); err != nil {
  5175. return nil, err
  5176. }
  5177. ret := &Map{
  5178. ServerResponse: googleapi.ServerResponse{
  5179. Header: res.Header,
  5180. HTTPStatusCode: res.StatusCode,
  5181. },
  5182. }
  5183. if err := json.NewDecoder(res.Body).Decode(&ret); err != nil {
  5184. return nil, err
  5185. }
  5186. return ret, nil
  5187. // {
  5188. // "description": "Create a map asset.",
  5189. // "httpMethod": "POST",
  5190. // "id": "mapsengine.maps.create",
  5191. // "path": "maps",
  5192. // "request": {
  5193. // "$ref": "Map"
  5194. // },
  5195. // "response": {
  5196. // "$ref": "Map"
  5197. // },
  5198. // "scopes": [
  5199. // "https://www.googleapis.com/auth/mapsengine"
  5200. // ]
  5201. // }
  5202. }
  5203. // method id "mapsengine.maps.delete":
  5204. type MapsDeleteCall struct {
  5205. s *Service
  5206. id string
  5207. urlParams_ gensupport.URLParams
  5208. ctx_ context.Context
  5209. }
  5210. // Delete: Delete a map.
  5211. func (r *MapsService) Delete(id string) *MapsDeleteCall {
  5212. c := &MapsDeleteCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  5213. c.id = id
  5214. return c
  5215. }
  5216. // Fields allows partial responses to be retrieved. See
  5217. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  5218. // for more information.
  5219. func (c *MapsDeleteCall) Fields(s ...googleapi.Field) *MapsDeleteCall {
  5220. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  5221. return c
  5222. }
  5223. // Context sets the context to be used in this call's Do method. Any
  5224. // pending HTTP request will be aborted if the provided context is
  5225. // canceled.
  5226. func (c *MapsDeleteCall) Context(ctx context.Context) *MapsDeleteCall {
  5227. c.ctx_ = ctx
  5228. return c
  5229. }
  5230. func (c *MapsDeleteCall) doRequest(alt string) (*http.Response, error) {
  5231. var body io.Reader = nil
  5232. c.urlParams_.Set("alt", alt)
  5233. urls := googleapi.ResolveRelative(c.s.BasePath, "maps/{id}")
  5234. urls += "?" + c.urlParams_.Encode()
  5235. req, _ := http.NewRequest("DELETE", urls, body)
  5236. googleapi.Expand(req.URL, map[string]string{
  5237. "id": c.id,
  5238. })
  5239. req.Header.Set("User-Agent", c.s.userAgent())
  5240. if c.ctx_ != nil {
  5241. return ctxhttp.Do(c.ctx_, c.s.client, req)
  5242. }
  5243. return c.s.client.Do(req)
  5244. }
  5245. // Do executes the "mapsengine.maps.delete" call.
  5246. func (c *MapsDeleteCall) Do(opts ...googleapi.CallOption) error {
  5247. gensupport.SetOptions(c.urlParams_, opts...)
  5248. res, err := c.doRequest("json")
  5249. if err != nil {
  5250. return err
  5251. }
  5252. defer googleapi.CloseBody(res)
  5253. if err := googleapi.CheckResponse(res); err != nil {
  5254. return err
  5255. }
  5256. return nil
  5257. // {
  5258. // "description": "Delete a map.",
  5259. // "httpMethod": "DELETE",
  5260. // "id": "mapsengine.maps.delete",
  5261. // "parameterOrder": [
  5262. // "id"
  5263. // ],
  5264. // "parameters": {
  5265. // "id": {
  5266. // "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.",
  5267. // "location": "path",
  5268. // "required": true,
  5269. // "type": "string"
  5270. // }
  5271. // },
  5272. // "path": "maps/{id}",
  5273. // "scopes": [
  5274. // "https://www.googleapis.com/auth/mapsengine"
  5275. // ]
  5276. // }
  5277. }
  5278. // method id "mapsengine.maps.get":
  5279. type MapsGetCall struct {
  5280. s *Service
  5281. id string
  5282. urlParams_ gensupport.URLParams
  5283. ifNoneMatch_ string
  5284. ctx_ context.Context
  5285. }
  5286. // Get: Return metadata for a particular map.
  5287. func (r *MapsService) Get(id string) *MapsGetCall {
  5288. c := &MapsGetCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  5289. c.id = id
  5290. return c
  5291. }
  5292. // Version sets the optional parameter "version": Deprecated: The
  5293. // version parameter indicates which version of the map should be
  5294. // returned. When version is set to published, the published version of
  5295. // the map will be returned. Please use the maps.getPublished endpoint
  5296. // instead.
  5297. //
  5298. // Possible values:
  5299. // "draft" - The draft version.
  5300. // "published" - The published version.
  5301. func (c *MapsGetCall) Version(version string) *MapsGetCall {
  5302. c.urlParams_.Set("version", version)
  5303. return c
  5304. }
  5305. // Fields allows partial responses to be retrieved. See
  5306. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  5307. // for more information.
  5308. func (c *MapsGetCall) Fields(s ...googleapi.Field) *MapsGetCall {
  5309. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  5310. return c
  5311. }
  5312. // IfNoneMatch sets the optional parameter which makes the operation
  5313. // fail if the object's ETag matches the given value. This is useful for
  5314. // getting updates only after the object has changed since the last
  5315. // request. Use googleapi.IsNotModified to check whether the response
  5316. // error from Do is the result of In-None-Match.
  5317. func (c *MapsGetCall) IfNoneMatch(entityTag string) *MapsGetCall {
  5318. c.ifNoneMatch_ = entityTag
  5319. return c
  5320. }
  5321. // Context sets the context to be used in this call's Do method. Any
  5322. // pending HTTP request will be aborted if the provided context is
  5323. // canceled.
  5324. func (c *MapsGetCall) Context(ctx context.Context) *MapsGetCall {
  5325. c.ctx_ = ctx
  5326. return c
  5327. }
  5328. func (c *MapsGetCall) doRequest(alt string) (*http.Response, error) {
  5329. var body io.Reader = nil
  5330. c.urlParams_.Set("alt", alt)
  5331. urls := googleapi.ResolveRelative(c.s.BasePath, "maps/{id}")
  5332. urls += "?" + c.urlParams_.Encode()
  5333. req, _ := http.NewRequest("GET", urls, body)
  5334. googleapi.Expand(req.URL, map[string]string{
  5335. "id": c.id,
  5336. })
  5337. req.Header.Set("User-Agent", c.s.userAgent())
  5338. if c.ifNoneMatch_ != "" {
  5339. req.Header.Set("If-None-Match", c.ifNoneMatch_)
  5340. }
  5341. if c.ctx_ != nil {
  5342. return ctxhttp.Do(c.ctx_, c.s.client, req)
  5343. }
  5344. return c.s.client.Do(req)
  5345. }
  5346. // Do executes the "mapsengine.maps.get" call.
  5347. // Exactly one of *Map or error will be non-nil. Any non-2xx status code
  5348. // is an error. Response headers are in either
  5349. // *Map.ServerResponse.Header or (if a response was returned at all) in
  5350. // error.(*googleapi.Error).Header. Use googleapi.IsNotModified to check
  5351. // whether the returned error was because http.StatusNotModified was
  5352. // returned.
  5353. func (c *MapsGetCall) Do(opts ...googleapi.CallOption) (*Map, error) {
  5354. gensupport.SetOptions(c.urlParams_, opts...)
  5355. res, err := c.doRequest("json")
  5356. if res != nil && res.StatusCode == http.StatusNotModified {
  5357. if res.Body != nil {
  5358. res.Body.Close()
  5359. }
  5360. return nil, &googleapi.Error{
  5361. Code: res.StatusCode,
  5362. Header: res.Header,
  5363. }
  5364. }
  5365. if err != nil {
  5366. return nil, err
  5367. }
  5368. defer googleapi.CloseBody(res)
  5369. if err := googleapi.CheckResponse(res); err != nil {
  5370. return nil, err
  5371. }
  5372. ret := &Map{
  5373. ServerResponse: googleapi.ServerResponse{
  5374. Header: res.Header,
  5375. HTTPStatusCode: res.StatusCode,
  5376. },
  5377. }
  5378. if err := json.NewDecoder(res.Body).Decode(&ret); err != nil {
  5379. return nil, err
  5380. }
  5381. return ret, nil
  5382. // {
  5383. // "description": "Return metadata for a particular map.",
  5384. // "httpMethod": "GET",
  5385. // "id": "mapsengine.maps.get",
  5386. // "parameterOrder": [
  5387. // "id"
  5388. // ],
  5389. // "parameters": {
  5390. // "id": {
  5391. // "description": "The ID of the map.",
  5392. // "location": "path",
  5393. // "required": true,
  5394. // "type": "string"
  5395. // },
  5396. // "version": {
  5397. // "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.",
  5398. // "enum": [
  5399. // "draft",
  5400. // "published"
  5401. // ],
  5402. // "enumDescriptions": [
  5403. // "The draft version.",
  5404. // "The published version."
  5405. // ],
  5406. // "location": "query",
  5407. // "type": "string"
  5408. // }
  5409. // },
  5410. // "path": "maps/{id}",
  5411. // "response": {
  5412. // "$ref": "Map"
  5413. // },
  5414. // "scopes": [
  5415. // "https://www.googleapis.com/auth/mapsengine",
  5416. // "https://www.googleapis.com/auth/mapsengine.readonly"
  5417. // ]
  5418. // }
  5419. }
  5420. // method id "mapsengine.maps.getPublished":
  5421. type MapsGetPublishedCall struct {
  5422. s *Service
  5423. id string
  5424. urlParams_ gensupport.URLParams
  5425. ifNoneMatch_ string
  5426. ctx_ context.Context
  5427. }
  5428. // GetPublished: Return the published metadata for a particular map.
  5429. func (r *MapsService) GetPublished(id string) *MapsGetPublishedCall {
  5430. c := &MapsGetPublishedCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  5431. c.id = id
  5432. return c
  5433. }
  5434. // Fields allows partial responses to be retrieved. See
  5435. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  5436. // for more information.
  5437. func (c *MapsGetPublishedCall) Fields(s ...googleapi.Field) *MapsGetPublishedCall {
  5438. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  5439. return c
  5440. }
  5441. // IfNoneMatch sets the optional parameter which makes the operation
  5442. // fail if the object's ETag matches the given value. This is useful for
  5443. // getting updates only after the object has changed since the last
  5444. // request. Use googleapi.IsNotModified to check whether the response
  5445. // error from Do is the result of In-None-Match.
  5446. func (c *MapsGetPublishedCall) IfNoneMatch(entityTag string) *MapsGetPublishedCall {
  5447. c.ifNoneMatch_ = entityTag
  5448. return c
  5449. }
  5450. // Context sets the context to be used in this call's Do method. Any
  5451. // pending HTTP request will be aborted if the provided context is
  5452. // canceled.
  5453. func (c *MapsGetPublishedCall) Context(ctx context.Context) *MapsGetPublishedCall {
  5454. c.ctx_ = ctx
  5455. return c
  5456. }
  5457. func (c *MapsGetPublishedCall) doRequest(alt string) (*http.Response, error) {
  5458. var body io.Reader = nil
  5459. c.urlParams_.Set("alt", alt)
  5460. urls := googleapi.ResolveRelative(c.s.BasePath, "maps/{id}/published")
  5461. urls += "?" + c.urlParams_.Encode()
  5462. req, _ := http.NewRequest("GET", urls, body)
  5463. googleapi.Expand(req.URL, map[string]string{
  5464. "id": c.id,
  5465. })
  5466. req.Header.Set("User-Agent", c.s.userAgent())
  5467. if c.ifNoneMatch_ != "" {
  5468. req.Header.Set("If-None-Match", c.ifNoneMatch_)
  5469. }
  5470. if c.ctx_ != nil {
  5471. return ctxhttp.Do(c.ctx_, c.s.client, req)
  5472. }
  5473. return c.s.client.Do(req)
  5474. }
  5475. // Do executes the "mapsengine.maps.getPublished" call.
  5476. // Exactly one of *PublishedMap or error will be non-nil. Any non-2xx
  5477. // status code is an error. Response headers are in either
  5478. // *PublishedMap.ServerResponse.Header or (if a response was returned at
  5479. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  5480. // to check whether the returned error was because
  5481. // http.StatusNotModified was returned.
  5482. func (c *MapsGetPublishedCall) Do(opts ...googleapi.CallOption) (*PublishedMap, error) {
  5483. gensupport.SetOptions(c.urlParams_, opts...)
  5484. res, err := c.doRequest("json")
  5485. if res != nil && res.StatusCode == http.StatusNotModified {
  5486. if res.Body != nil {
  5487. res.Body.Close()
  5488. }
  5489. return nil, &googleapi.Error{
  5490. Code: res.StatusCode,
  5491. Header: res.Header,
  5492. }
  5493. }
  5494. if err != nil {
  5495. return nil, err
  5496. }
  5497. defer googleapi.CloseBody(res)
  5498. if err := googleapi.CheckResponse(res); err != nil {
  5499. return nil, err
  5500. }
  5501. ret := &PublishedMap{
  5502. ServerResponse: googleapi.ServerResponse{
  5503. Header: res.Header,
  5504. HTTPStatusCode: res.StatusCode,
  5505. },
  5506. }
  5507. if err := json.NewDecoder(res.Body).Decode(&ret); err != nil {
  5508. return nil, err
  5509. }
  5510. return ret, nil
  5511. // {
  5512. // "description": "Return the published metadata for a particular map.",
  5513. // "httpMethod": "GET",
  5514. // "id": "mapsengine.maps.getPublished",
  5515. // "parameterOrder": [
  5516. // "id"
  5517. // ],
  5518. // "parameters": {
  5519. // "id": {
  5520. // "description": "The ID of the map.",
  5521. // "location": "path",
  5522. // "required": true,
  5523. // "type": "string"
  5524. // }
  5525. // },
  5526. // "path": "maps/{id}/published",
  5527. // "response": {
  5528. // "$ref": "PublishedMap"
  5529. // },
  5530. // "scopes": [
  5531. // "https://www.googleapis.com/auth/mapsengine",
  5532. // "https://www.googleapis.com/auth/mapsengine.readonly"
  5533. // ]
  5534. // }
  5535. }
  5536. // method id "mapsengine.maps.list":
  5537. type MapsListCall struct {
  5538. s *Service
  5539. urlParams_ gensupport.URLParams
  5540. ifNoneMatch_ string
  5541. ctx_ context.Context
  5542. }
  5543. // List: Return all maps readable by the current user.
  5544. func (r *MapsService) List() *MapsListCall {
  5545. c := &MapsListCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  5546. return c
  5547. }
  5548. // Bbox sets the optional parameter "bbox": A bounding box, expressed as
  5549. // "west,south,east,north". If set, only assets which intersect this
  5550. // bounding box will be returned.
  5551. func (c *MapsListCall) Bbox(bbox string) *MapsListCall {
  5552. c.urlParams_.Set("bbox", bbox)
  5553. return c
  5554. }
  5555. // CreatedAfter sets the optional parameter "createdAfter": An RFC 3339
  5556. // formatted date-time value (e.g. 1970-01-01T00:00:00Z). Returned
  5557. // assets will have been created at or after this time.
  5558. func (c *MapsListCall) CreatedAfter(createdAfter string) *MapsListCall {
  5559. c.urlParams_.Set("createdAfter", createdAfter)
  5560. return c
  5561. }
  5562. // CreatedBefore sets the optional parameter "createdBefore": An RFC
  5563. // 3339 formatted date-time value (e.g. 1970-01-01T00:00:00Z). Returned
  5564. // assets will have been created at or before this time.
  5565. func (c *MapsListCall) CreatedBefore(createdBefore string) *MapsListCall {
  5566. c.urlParams_.Set("createdBefore", createdBefore)
  5567. return c
  5568. }
  5569. // CreatorEmail sets the optional parameter "creatorEmail": An email
  5570. // address representing a user. Returned assets that have been created
  5571. // by the user associated with the provided email address.
  5572. func (c *MapsListCall) CreatorEmail(creatorEmail string) *MapsListCall {
  5573. c.urlParams_.Set("creatorEmail", creatorEmail)
  5574. return c
  5575. }
  5576. // MaxResults sets the optional parameter "maxResults": The maximum
  5577. // number of items to include in a single response page. The maximum
  5578. // supported value is 100.
  5579. func (c *MapsListCall) MaxResults(maxResults int64) *MapsListCall {
  5580. c.urlParams_.Set("maxResults", fmt.Sprint(maxResults))
  5581. return c
  5582. }
  5583. // ModifiedAfter sets the optional parameter "modifiedAfter": An RFC
  5584. // 3339 formatted date-time value (e.g. 1970-01-01T00:00:00Z). Returned
  5585. // assets will have been modified at or after this time.
  5586. func (c *MapsListCall) ModifiedAfter(modifiedAfter string) *MapsListCall {
  5587. c.urlParams_.Set("modifiedAfter", modifiedAfter)
  5588. return c
  5589. }
  5590. // ModifiedBefore sets the optional parameter "modifiedBefore": An RFC
  5591. // 3339 formatted date-time value (e.g. 1970-01-01T00:00:00Z). Returned
  5592. // assets will have been modified at or before this time.
  5593. func (c *MapsListCall) ModifiedBefore(modifiedBefore string) *MapsListCall {
  5594. c.urlParams_.Set("modifiedBefore", modifiedBefore)
  5595. return c
  5596. }
  5597. // PageToken sets the optional parameter "pageToken": The continuation
  5598. // token, used to page through large result sets. To get the next page
  5599. // of results, set this parameter to the value of nextPageToken from the
  5600. // previous response.
  5601. func (c *MapsListCall) PageToken(pageToken string) *MapsListCall {
  5602. c.urlParams_.Set("pageToken", pageToken)
  5603. return c
  5604. }
  5605. // ProcessingStatus sets the optional parameter "processingStatus":
  5606. //
  5607. // Possible values:
  5608. // "complete" - The map has completed processing.
  5609. // "failed" - The map has failed processing.
  5610. // "notReady" - The map is not ready for processing.
  5611. // "processing" - The map is processing.
  5612. func (c *MapsListCall) ProcessingStatus(processingStatus string) *MapsListCall {
  5613. c.urlParams_.Set("processingStatus", processingStatus)
  5614. return c
  5615. }
  5616. // ProjectId sets the optional parameter "projectId": The ID of a Maps
  5617. // Engine project, used to filter the response. To list all available
  5618. // projects with their IDs, send a Projects: list request. You can also
  5619. // find your project ID as the value of the DashboardPlace:cid URL
  5620. // parameter when signed in to mapsengine.google.com.
  5621. func (c *MapsListCall) ProjectId(projectId string) *MapsListCall {
  5622. c.urlParams_.Set("projectId", projectId)
  5623. return c
  5624. }
  5625. // Role sets the optional parameter "role": The role parameter indicates
  5626. // that the response should only contain assets where the current user
  5627. // has the specified level of access.
  5628. //
  5629. // Possible values:
  5630. // "owner" - The user can read, write and administer the asset.
  5631. // "reader" - The user can read the asset.
  5632. // "writer" - The user can read and write the asset.
  5633. func (c *MapsListCall) Role(role string) *MapsListCall {
  5634. c.urlParams_.Set("role", role)
  5635. return c
  5636. }
  5637. // Search sets the optional parameter "search": An unstructured search
  5638. // string used to filter the set of results based on asset metadata.
  5639. func (c *MapsListCall) Search(search string) *MapsListCall {
  5640. c.urlParams_.Set("search", search)
  5641. return c
  5642. }
  5643. // Tags sets the optional parameter "tags": A comma separated list of
  5644. // tags. Returned assets will contain all the tags from the list.
  5645. func (c *MapsListCall) Tags(tags string) *MapsListCall {
  5646. c.urlParams_.Set("tags", tags)
  5647. return c
  5648. }
  5649. // Version sets the optional parameter "version": Deprecated: The
  5650. // version parameter indicates which version of the maps should be
  5651. // returned. When version is set to published this parameter will filter
  5652. // the result set to include only maps that are published. Please use
  5653. // the maps.listPublished endpoint instead.
  5654. //
  5655. // Possible values:
  5656. // "draft" - The draft version.
  5657. // "published" - The published version.
  5658. func (c *MapsListCall) Version(version string) *MapsListCall {
  5659. c.urlParams_.Set("version", version)
  5660. return c
  5661. }
  5662. // Fields allows partial responses to be retrieved. See
  5663. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  5664. // for more information.
  5665. func (c *MapsListCall) Fields(s ...googleapi.Field) *MapsListCall {
  5666. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  5667. return c
  5668. }
  5669. // IfNoneMatch sets the optional parameter which makes the operation
  5670. // fail if the object's ETag matches the given value. This is useful for
  5671. // getting updates only after the object has changed since the last
  5672. // request. Use googleapi.IsNotModified to check whether the response
  5673. // error from Do is the result of In-None-Match.
  5674. func (c *MapsListCall) IfNoneMatch(entityTag string) *MapsListCall {
  5675. c.ifNoneMatch_ = entityTag
  5676. return c
  5677. }
  5678. // Context sets the context to be used in this call's Do method. Any
  5679. // pending HTTP request will be aborted if the provided context is
  5680. // canceled.
  5681. func (c *MapsListCall) Context(ctx context.Context) *MapsListCall {
  5682. c.ctx_ = ctx
  5683. return c
  5684. }
  5685. func (c *MapsListCall) doRequest(alt string) (*http.Response, error) {
  5686. var body io.Reader = nil
  5687. c.urlParams_.Set("alt", alt)
  5688. urls := googleapi.ResolveRelative(c.s.BasePath, "maps")
  5689. urls += "?" + c.urlParams_.Encode()
  5690. req, _ := http.NewRequest("GET", urls, body)
  5691. googleapi.SetOpaque(req.URL)
  5692. req.Header.Set("User-Agent", c.s.userAgent())
  5693. if c.ifNoneMatch_ != "" {
  5694. req.Header.Set("If-None-Match", c.ifNoneMatch_)
  5695. }
  5696. if c.ctx_ != nil {
  5697. return ctxhttp.Do(c.ctx_, c.s.client, req)
  5698. }
  5699. return c.s.client.Do(req)
  5700. }
  5701. // Do executes the "mapsengine.maps.list" call.
  5702. // Exactly one of *MapsListResponse or error will be non-nil. Any
  5703. // non-2xx status code is an error. Response headers are in either
  5704. // *MapsListResponse.ServerResponse.Header or (if a response was
  5705. // returned at all) in error.(*googleapi.Error).Header. Use
  5706. // googleapi.IsNotModified to check whether the returned error was
  5707. // because http.StatusNotModified was returned.
  5708. func (c *MapsListCall) Do(opts ...googleapi.CallOption) (*MapsListResponse, error) {
  5709. gensupport.SetOptions(c.urlParams_, opts...)
  5710. res, err := c.doRequest("json")
  5711. if res != nil && res.StatusCode == http.StatusNotModified {
  5712. if res.Body != nil {
  5713. res.Body.Close()
  5714. }
  5715. return nil, &googleapi.Error{
  5716. Code: res.StatusCode,
  5717. Header: res.Header,
  5718. }
  5719. }
  5720. if err != nil {
  5721. return nil, err
  5722. }
  5723. defer googleapi.CloseBody(res)
  5724. if err := googleapi.CheckResponse(res); err != nil {
  5725. return nil, err
  5726. }
  5727. ret := &MapsListResponse{
  5728. ServerResponse: googleapi.ServerResponse{
  5729. Header: res.Header,
  5730. HTTPStatusCode: res.StatusCode,
  5731. },
  5732. }
  5733. if err := json.NewDecoder(res.Body).Decode(&ret); err != nil {
  5734. return nil, err
  5735. }
  5736. return ret, nil
  5737. // {
  5738. // "description": "Return all maps readable by the current user.",
  5739. // "httpMethod": "GET",
  5740. // "id": "mapsengine.maps.list",
  5741. // "parameters": {
  5742. // "bbox": {
  5743. // "description": "A bounding box, expressed as \"west,south,east,north\". If set, only assets which intersect this bounding box will be returned.",
  5744. // "location": "query",
  5745. // "type": "string"
  5746. // },
  5747. // "createdAfter": {
  5748. // "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.",
  5749. // "format": "date-time",
  5750. // "location": "query",
  5751. // "type": "string"
  5752. // },
  5753. // "createdBefore": {
  5754. // "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.",
  5755. // "format": "date-time",
  5756. // "location": "query",
  5757. // "type": "string"
  5758. // },
  5759. // "creatorEmail": {
  5760. // "description": "An email address representing a user. Returned assets that have been created by the user associated with the provided email address.",
  5761. // "location": "query",
  5762. // "type": "string"
  5763. // },
  5764. // "maxResults": {
  5765. // "description": "The maximum number of items to include in a single response page. The maximum supported value is 100.",
  5766. // "format": "uint32",
  5767. // "location": "query",
  5768. // "type": "integer"
  5769. // },
  5770. // "modifiedAfter": {
  5771. // "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.",
  5772. // "format": "date-time",
  5773. // "location": "query",
  5774. // "type": "string"
  5775. // },
  5776. // "modifiedBefore": {
  5777. // "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.",
  5778. // "format": "date-time",
  5779. // "location": "query",
  5780. // "type": "string"
  5781. // },
  5782. // "pageToken": {
  5783. // "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.",
  5784. // "location": "query",
  5785. // "type": "string"
  5786. // },
  5787. // "processingStatus": {
  5788. // "enum": [
  5789. // "complete",
  5790. // "failed",
  5791. // "notReady",
  5792. // "processing"
  5793. // ],
  5794. // "enumDescriptions": [
  5795. // "The map has completed processing.",
  5796. // "The map has failed processing.",
  5797. // "The map is not ready for processing.",
  5798. // "The map is processing."
  5799. // ],
  5800. // "location": "query",
  5801. // "type": "string"
  5802. // },
  5803. // "projectId": {
  5804. // "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.",
  5805. // "location": "query",
  5806. // "type": "string"
  5807. // },
  5808. // "role": {
  5809. // "description": "The role parameter indicates that the response should only contain assets where the current user has the specified level of access.",
  5810. // "enum": [
  5811. // "owner",
  5812. // "reader",
  5813. // "writer"
  5814. // ],
  5815. // "enumDescriptions": [
  5816. // "The user can read, write and administer the asset.",
  5817. // "The user can read the asset.",
  5818. // "The user can read and write the asset."
  5819. // ],
  5820. // "location": "query",
  5821. // "type": "string"
  5822. // },
  5823. // "search": {
  5824. // "description": "An unstructured search string used to filter the set of results based on asset metadata.",
  5825. // "location": "query",
  5826. // "type": "string"
  5827. // },
  5828. // "tags": {
  5829. // "description": "A comma separated list of tags. Returned assets will contain all the tags from the list.",
  5830. // "location": "query",
  5831. // "type": "string"
  5832. // },
  5833. // "version": {
  5834. // "description": "Deprecated: The version parameter indicates which version of the maps should be returned. When version is set to published this parameter will filter the result set to include only maps that are published. Please use the maps.listPublished endpoint instead.",
  5835. // "enum": [
  5836. // "draft",
  5837. // "published"
  5838. // ],
  5839. // "enumDescriptions": [
  5840. // "The draft version.",
  5841. // "The published version."
  5842. // ],
  5843. // "location": "query",
  5844. // "type": "string"
  5845. // }
  5846. // },
  5847. // "path": "maps",
  5848. // "response": {
  5849. // "$ref": "MapsListResponse"
  5850. // },
  5851. // "scopes": [
  5852. // "https://www.googleapis.com/auth/mapsengine",
  5853. // "https://www.googleapis.com/auth/mapsengine.readonly"
  5854. // ]
  5855. // }
  5856. }
  5857. // Pages invokes f for each page of results.
  5858. // A non-nil error returned from f will halt the iteration.
  5859. // The provided context supersedes any context provided to the Context method.
  5860. func (c *MapsListCall) Pages(ctx context.Context, f func(*MapsListResponse) error) error {
  5861. c.ctx_ = ctx
  5862. defer c.PageToken(c.urlParams_.Get("pageToken")) // reset paging to original point
  5863. for {
  5864. x, err := c.Do()
  5865. if err != nil {
  5866. return err
  5867. }
  5868. if err := f(x); err != nil {
  5869. return err
  5870. }
  5871. if x.NextPageToken == "" {
  5872. return nil
  5873. }
  5874. c.PageToken(x.NextPageToken)
  5875. }
  5876. }
  5877. // method id "mapsengine.maps.listPublished":
  5878. type MapsListPublishedCall struct {
  5879. s *Service
  5880. urlParams_ gensupport.URLParams
  5881. ifNoneMatch_ string
  5882. ctx_ context.Context
  5883. }
  5884. // ListPublished: Return all published maps readable by the current
  5885. // user.
  5886. func (r *MapsService) ListPublished() *MapsListPublishedCall {
  5887. c := &MapsListPublishedCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  5888. return c
  5889. }
  5890. // MaxResults sets the optional parameter "maxResults": The maximum
  5891. // number of items to include in a single response page. The maximum
  5892. // supported value is 100.
  5893. func (c *MapsListPublishedCall) MaxResults(maxResults int64) *MapsListPublishedCall {
  5894. c.urlParams_.Set("maxResults", fmt.Sprint(maxResults))
  5895. return c
  5896. }
  5897. // PageToken sets the optional parameter "pageToken": The continuation
  5898. // token, used to page through large result sets. To get the next page
  5899. // of results, set this parameter to the value of nextPageToken from the
  5900. // previous response.
  5901. func (c *MapsListPublishedCall) PageToken(pageToken string) *MapsListPublishedCall {
  5902. c.urlParams_.Set("pageToken", pageToken)
  5903. return c
  5904. }
  5905. // ProjectId sets the optional parameter "projectId": The ID of a Maps
  5906. // Engine project, used to filter the response. To list all available
  5907. // projects with their IDs, send a Projects: list request. You can also
  5908. // find your project ID as the value of the DashboardPlace:cid URL
  5909. // parameter when signed in to mapsengine.google.com.
  5910. func (c *MapsListPublishedCall) ProjectId(projectId string) *MapsListPublishedCall {
  5911. c.urlParams_.Set("projectId", projectId)
  5912. return c
  5913. }
  5914. // Search sets the optional parameter "search": An unstructured search
  5915. // string used to filter the set of results based on asset metadata.
  5916. func (c *MapsListPublishedCall) Search(search string) *MapsListPublishedCall {
  5917. c.urlParams_.Set("search", search)
  5918. return c
  5919. }
  5920. // Fields allows partial responses to be retrieved. See
  5921. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  5922. // for more information.
  5923. func (c *MapsListPublishedCall) Fields(s ...googleapi.Field) *MapsListPublishedCall {
  5924. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  5925. return c
  5926. }
  5927. // IfNoneMatch sets the optional parameter which makes the operation
  5928. // fail if the object's ETag matches the given value. This is useful for
  5929. // getting updates only after the object has changed since the last
  5930. // request. Use googleapi.IsNotModified to check whether the response
  5931. // error from Do is the result of In-None-Match.
  5932. func (c *MapsListPublishedCall) IfNoneMatch(entityTag string) *MapsListPublishedCall {
  5933. c.ifNoneMatch_ = entityTag
  5934. return c
  5935. }
  5936. // Context sets the context to be used in this call's Do method. Any
  5937. // pending HTTP request will be aborted if the provided context is
  5938. // canceled.
  5939. func (c *MapsListPublishedCall) Context(ctx context.Context) *MapsListPublishedCall {
  5940. c.ctx_ = ctx
  5941. return c
  5942. }
  5943. func (c *MapsListPublishedCall) doRequest(alt string) (*http.Response, error) {
  5944. var body io.Reader = nil
  5945. c.urlParams_.Set("alt", alt)
  5946. urls := googleapi.ResolveRelative(c.s.BasePath, "maps/published")
  5947. urls += "?" + c.urlParams_.Encode()
  5948. req, _ := http.NewRequest("GET", urls, body)
  5949. googleapi.SetOpaque(req.URL)
  5950. req.Header.Set("User-Agent", c.s.userAgent())
  5951. if c.ifNoneMatch_ != "" {
  5952. req.Header.Set("If-None-Match", c.ifNoneMatch_)
  5953. }
  5954. if c.ctx_ != nil {
  5955. return ctxhttp.Do(c.ctx_, c.s.client, req)
  5956. }
  5957. return c.s.client.Do(req)
  5958. }
  5959. // Do executes the "mapsengine.maps.listPublished" call.
  5960. // Exactly one of *PublishedMapsListResponse or error will be non-nil.
  5961. // Any non-2xx status code is an error. Response headers are in either
  5962. // *PublishedMapsListResponse.ServerResponse.Header or (if a response
  5963. // was returned at all) in error.(*googleapi.Error).Header. Use
  5964. // googleapi.IsNotModified to check whether the returned error was
  5965. // because http.StatusNotModified was returned.
  5966. func (c *MapsListPublishedCall) Do(opts ...googleapi.CallOption) (*PublishedMapsListResponse, error) {
  5967. gensupport.SetOptions(c.urlParams_, opts...)
  5968. res, err := c.doRequest("json")
  5969. if res != nil && res.StatusCode == http.StatusNotModified {
  5970. if res.Body != nil {
  5971. res.Body.Close()
  5972. }
  5973. return nil, &googleapi.Error{
  5974. Code: res.StatusCode,
  5975. Header: res.Header,
  5976. }
  5977. }
  5978. if err != nil {
  5979. return nil, err
  5980. }
  5981. defer googleapi.CloseBody(res)
  5982. if err := googleapi.CheckResponse(res); err != nil {
  5983. return nil, err
  5984. }
  5985. ret := &PublishedMapsListResponse{
  5986. ServerResponse: googleapi.ServerResponse{
  5987. Header: res.Header,
  5988. HTTPStatusCode: res.StatusCode,
  5989. },
  5990. }
  5991. if err := json.NewDecoder(res.Body).Decode(&ret); err != nil {
  5992. return nil, err
  5993. }
  5994. return ret, nil
  5995. // {
  5996. // "description": "Return all published maps readable by the current user.",
  5997. // "httpMethod": "GET",
  5998. // "id": "mapsengine.maps.listPublished",
  5999. // "parameters": {
  6000. // "maxResults": {
  6001. // "description": "The maximum number of items to include in a single response page. The maximum supported value is 100.",
  6002. // "format": "uint32",
  6003. // "location": "query",
  6004. // "type": "integer"
  6005. // },
  6006. // "pageToken": {
  6007. // "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.",
  6008. // "location": "query",
  6009. // "type": "string"
  6010. // },
  6011. // "projectId": {
  6012. // "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.",
  6013. // "location": "query",
  6014. // "type": "string"
  6015. // },
  6016. // "search": {
  6017. // "description": "An unstructured search string used to filter the set of results based on asset metadata.",
  6018. // "location": "query",
  6019. // "type": "string"
  6020. // }
  6021. // },
  6022. // "path": "maps/published",
  6023. // "response": {
  6024. // "$ref": "PublishedMapsListResponse"
  6025. // },
  6026. // "scopes": [
  6027. // "https://www.googleapis.com/auth/mapsengine",
  6028. // "https://www.googleapis.com/auth/mapsengine.readonly"
  6029. // ]
  6030. // }
  6031. }
  6032. // Pages invokes f for each page of results.
  6033. // A non-nil error returned from f will halt the iteration.
  6034. // The provided context supersedes any context provided to the Context method.
  6035. func (c *MapsListPublishedCall) Pages(ctx context.Context, f func(*PublishedMapsListResponse) error) error {
  6036. c.ctx_ = ctx
  6037. defer c.PageToken(c.urlParams_.Get("pageToken")) // reset paging to original point
  6038. for {
  6039. x, err := c.Do()
  6040. if err != nil {
  6041. return err
  6042. }
  6043. if err := f(x); err != nil {
  6044. return err
  6045. }
  6046. if x.NextPageToken == "" {
  6047. return nil
  6048. }
  6049. c.PageToken(x.NextPageToken)
  6050. }
  6051. }
  6052. // method id "mapsengine.maps.patch":
  6053. type MapsPatchCall struct {
  6054. s *Service
  6055. id string
  6056. map_ *Map
  6057. urlParams_ gensupport.URLParams
  6058. ctx_ context.Context
  6059. }
  6060. // Patch: Mutate a map asset.
  6061. func (r *MapsService) Patch(id string, map_ *Map) *MapsPatchCall {
  6062. c := &MapsPatchCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  6063. c.id = id
  6064. c.map_ = map_
  6065. return c
  6066. }
  6067. // Fields allows partial responses to be retrieved. See
  6068. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  6069. // for more information.
  6070. func (c *MapsPatchCall) Fields(s ...googleapi.Field) *MapsPatchCall {
  6071. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  6072. return c
  6073. }
  6074. // Context sets the context to be used in this call's Do method. Any
  6075. // pending HTTP request will be aborted if the provided context is
  6076. // canceled.
  6077. func (c *MapsPatchCall) Context(ctx context.Context) *MapsPatchCall {
  6078. c.ctx_ = ctx
  6079. return c
  6080. }
  6081. func (c *MapsPatchCall) doRequest(alt string) (*http.Response, error) {
  6082. var body io.Reader = nil
  6083. body, err := googleapi.WithoutDataWrapper.JSONReader(c.map_)
  6084. if err != nil {
  6085. return nil, err
  6086. }
  6087. ctype := "application/json"
  6088. c.urlParams_.Set("alt", alt)
  6089. urls := googleapi.ResolveRelative(c.s.BasePath, "maps/{id}")
  6090. urls += "?" + c.urlParams_.Encode()
  6091. req, _ := http.NewRequest("PATCH", urls, body)
  6092. googleapi.Expand(req.URL, map[string]string{
  6093. "id": c.id,
  6094. })
  6095. req.Header.Set("Content-Type", ctype)
  6096. req.Header.Set("User-Agent", c.s.userAgent())
  6097. if c.ctx_ != nil {
  6098. return ctxhttp.Do(c.ctx_, c.s.client, req)
  6099. }
  6100. return c.s.client.Do(req)
  6101. }
  6102. // Do executes the "mapsengine.maps.patch" call.
  6103. func (c *MapsPatchCall) Do(opts ...googleapi.CallOption) error {
  6104. gensupport.SetOptions(c.urlParams_, opts...)
  6105. res, err := c.doRequest("json")
  6106. if err != nil {
  6107. return err
  6108. }
  6109. defer googleapi.CloseBody(res)
  6110. if err := googleapi.CheckResponse(res); err != nil {
  6111. return err
  6112. }
  6113. return nil
  6114. // {
  6115. // "description": "Mutate a map asset.",
  6116. // "httpMethod": "PATCH",
  6117. // "id": "mapsengine.maps.patch",
  6118. // "parameterOrder": [
  6119. // "id"
  6120. // ],
  6121. // "parameters": {
  6122. // "id": {
  6123. // "description": "The ID of the map.",
  6124. // "location": "path",
  6125. // "required": true,
  6126. // "type": "string"
  6127. // }
  6128. // },
  6129. // "path": "maps/{id}",
  6130. // "request": {
  6131. // "$ref": "Map"
  6132. // },
  6133. // "scopes": [
  6134. // "https://www.googleapis.com/auth/mapsengine"
  6135. // ]
  6136. // }
  6137. }
  6138. // method id "mapsengine.maps.publish":
  6139. type MapsPublishCall struct {
  6140. s *Service
  6141. id string
  6142. urlParams_ gensupport.URLParams
  6143. ctx_ context.Context
  6144. }
  6145. // Publish: Publish a map asset.
  6146. func (r *MapsService) Publish(id string) *MapsPublishCall {
  6147. c := &MapsPublishCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  6148. c.id = id
  6149. return c
  6150. }
  6151. // Force sets the optional parameter "force": If set to true, the API
  6152. // will allow publication of the map even if it's out of date. If false,
  6153. // the map must have a processingStatus of complete before publishing.
  6154. func (c *MapsPublishCall) Force(force bool) *MapsPublishCall {
  6155. c.urlParams_.Set("force", fmt.Sprint(force))
  6156. return c
  6157. }
  6158. // Fields allows partial responses to be retrieved. See
  6159. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  6160. // for more information.
  6161. func (c *MapsPublishCall) Fields(s ...googleapi.Field) *MapsPublishCall {
  6162. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  6163. return c
  6164. }
  6165. // Context sets the context to be used in this call's Do method. Any
  6166. // pending HTTP request will be aborted if the provided context is
  6167. // canceled.
  6168. func (c *MapsPublishCall) Context(ctx context.Context) *MapsPublishCall {
  6169. c.ctx_ = ctx
  6170. return c
  6171. }
  6172. func (c *MapsPublishCall) doRequest(alt string) (*http.Response, error) {
  6173. var body io.Reader = nil
  6174. c.urlParams_.Set("alt", alt)
  6175. urls := googleapi.ResolveRelative(c.s.BasePath, "maps/{id}/publish")
  6176. urls += "?" + c.urlParams_.Encode()
  6177. req, _ := http.NewRequest("POST", urls, body)
  6178. googleapi.Expand(req.URL, map[string]string{
  6179. "id": c.id,
  6180. })
  6181. req.Header.Set("User-Agent", c.s.userAgent())
  6182. if c.ctx_ != nil {
  6183. return ctxhttp.Do(c.ctx_, c.s.client, req)
  6184. }
  6185. return c.s.client.Do(req)
  6186. }
  6187. // Do executes the "mapsengine.maps.publish" call.
  6188. // Exactly one of *PublishResponse or error will be non-nil. Any non-2xx
  6189. // status code is an error. Response headers are in either
  6190. // *PublishResponse.ServerResponse.Header or (if a response was returned
  6191. // at all) in error.(*googleapi.Error).Header. Use
  6192. // googleapi.IsNotModified to check whether the returned error was
  6193. // because http.StatusNotModified was returned.
  6194. func (c *MapsPublishCall) Do(opts ...googleapi.CallOption) (*PublishResponse, error) {
  6195. gensupport.SetOptions(c.urlParams_, opts...)
  6196. res, err := c.doRequest("json")
  6197. if res != nil && res.StatusCode == http.StatusNotModified {
  6198. if res.Body != nil {
  6199. res.Body.Close()
  6200. }
  6201. return nil, &googleapi.Error{
  6202. Code: res.StatusCode,
  6203. Header: res.Header,
  6204. }
  6205. }
  6206. if err != nil {
  6207. return nil, err
  6208. }
  6209. defer googleapi.CloseBody(res)
  6210. if err := googleapi.CheckResponse(res); err != nil {
  6211. return nil, err
  6212. }
  6213. ret := &PublishResponse{
  6214. ServerResponse: googleapi.ServerResponse{
  6215. Header: res.Header,
  6216. HTTPStatusCode: res.StatusCode,
  6217. },
  6218. }
  6219. if err := json.NewDecoder(res.Body).Decode(&ret); err != nil {
  6220. return nil, err
  6221. }
  6222. return ret, nil
  6223. // {
  6224. // "description": "Publish a map asset.",
  6225. // "httpMethod": "POST",
  6226. // "id": "mapsengine.maps.publish",
  6227. // "parameterOrder": [
  6228. // "id"
  6229. // ],
  6230. // "parameters": {
  6231. // "force": {
  6232. // "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.",
  6233. // "location": "query",
  6234. // "type": "boolean"
  6235. // },
  6236. // "id": {
  6237. // "description": "The ID of the map.",
  6238. // "location": "path",
  6239. // "required": true,
  6240. // "type": "string"
  6241. // }
  6242. // },
  6243. // "path": "maps/{id}/publish",
  6244. // "response": {
  6245. // "$ref": "PublishResponse"
  6246. // },
  6247. // "scopes": [
  6248. // "https://www.googleapis.com/auth/mapsengine"
  6249. // ]
  6250. // }
  6251. }
  6252. // method id "mapsengine.maps.unpublish":
  6253. type MapsUnpublishCall struct {
  6254. s *Service
  6255. id string
  6256. urlParams_ gensupport.URLParams
  6257. ctx_ context.Context
  6258. }
  6259. // Unpublish: Unpublish a map asset.
  6260. func (r *MapsService) Unpublish(id string) *MapsUnpublishCall {
  6261. c := &MapsUnpublishCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  6262. c.id = id
  6263. return c
  6264. }
  6265. // Fields allows partial responses to be retrieved. See
  6266. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  6267. // for more information.
  6268. func (c *MapsUnpublishCall) Fields(s ...googleapi.Field) *MapsUnpublishCall {
  6269. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  6270. return c
  6271. }
  6272. // Context sets the context to be used in this call's Do method. Any
  6273. // pending HTTP request will be aborted if the provided context is
  6274. // canceled.
  6275. func (c *MapsUnpublishCall) Context(ctx context.Context) *MapsUnpublishCall {
  6276. c.ctx_ = ctx
  6277. return c
  6278. }
  6279. func (c *MapsUnpublishCall) doRequest(alt string) (*http.Response, error) {
  6280. var body io.Reader = nil
  6281. c.urlParams_.Set("alt", alt)
  6282. urls := googleapi.ResolveRelative(c.s.BasePath, "maps/{id}/unpublish")
  6283. urls += "?" + c.urlParams_.Encode()
  6284. req, _ := http.NewRequest("POST", urls, body)
  6285. googleapi.Expand(req.URL, map[string]string{
  6286. "id": c.id,
  6287. })
  6288. req.Header.Set("User-Agent", c.s.userAgent())
  6289. if c.ctx_ != nil {
  6290. return ctxhttp.Do(c.ctx_, c.s.client, req)
  6291. }
  6292. return c.s.client.Do(req)
  6293. }
  6294. // Do executes the "mapsengine.maps.unpublish" call.
  6295. // Exactly one of *PublishResponse or error will be non-nil. Any non-2xx
  6296. // status code is an error. Response headers are in either
  6297. // *PublishResponse.ServerResponse.Header or (if a response was returned
  6298. // at all) in error.(*googleapi.Error).Header. Use
  6299. // googleapi.IsNotModified to check whether the returned error was
  6300. // because http.StatusNotModified was returned.
  6301. func (c *MapsUnpublishCall) Do(opts ...googleapi.CallOption) (*PublishResponse, error) {
  6302. gensupport.SetOptions(c.urlParams_, opts...)
  6303. res, err := c.doRequest("json")
  6304. if res != nil && res.StatusCode == http.StatusNotModified {
  6305. if res.Body != nil {
  6306. res.Body.Close()
  6307. }
  6308. return nil, &googleapi.Error{
  6309. Code: res.StatusCode,
  6310. Header: res.Header,
  6311. }
  6312. }
  6313. if err != nil {
  6314. return nil, err
  6315. }
  6316. defer googleapi.CloseBody(res)
  6317. if err := googleapi.CheckResponse(res); err != nil {
  6318. return nil, err
  6319. }
  6320. ret := &PublishResponse{
  6321. ServerResponse: googleapi.ServerResponse{
  6322. Header: res.Header,
  6323. HTTPStatusCode: res.StatusCode,
  6324. },
  6325. }
  6326. if err := json.NewDecoder(res.Body).Decode(&ret); err != nil {
  6327. return nil, err
  6328. }
  6329. return ret, nil
  6330. // {
  6331. // "description": "Unpublish a map asset.",
  6332. // "httpMethod": "POST",
  6333. // "id": "mapsengine.maps.unpublish",
  6334. // "parameterOrder": [
  6335. // "id"
  6336. // ],
  6337. // "parameters": {
  6338. // "id": {
  6339. // "description": "The ID of the map.",
  6340. // "location": "path",
  6341. // "required": true,
  6342. // "type": "string"
  6343. // }
  6344. // },
  6345. // "path": "maps/{id}/unpublish",
  6346. // "response": {
  6347. // "$ref": "PublishResponse"
  6348. // },
  6349. // "scopes": [
  6350. // "https://www.googleapis.com/auth/mapsengine"
  6351. // ]
  6352. // }
  6353. }
  6354. // method id "mapsengine.maps.permissions.batchDelete":
  6355. type MapsPermissionsBatchDeleteCall struct {
  6356. s *Service
  6357. id string
  6358. permissionsbatchdeleterequest *PermissionsBatchDeleteRequest
  6359. urlParams_ gensupport.URLParams
  6360. ctx_ context.Context
  6361. }
  6362. // BatchDelete: Remove permission entries from an already existing
  6363. // asset.
  6364. func (r *MapsPermissionsService) BatchDelete(id string, permissionsbatchdeleterequest *PermissionsBatchDeleteRequest) *MapsPermissionsBatchDeleteCall {
  6365. c := &MapsPermissionsBatchDeleteCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  6366. c.id = id
  6367. c.permissionsbatchdeleterequest = permissionsbatchdeleterequest
  6368. return c
  6369. }
  6370. // Fields allows partial responses to be retrieved. See
  6371. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  6372. // for more information.
  6373. func (c *MapsPermissionsBatchDeleteCall) Fields(s ...googleapi.Field) *MapsPermissionsBatchDeleteCall {
  6374. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  6375. return c
  6376. }
  6377. // Context sets the context to be used in this call's Do method. Any
  6378. // pending HTTP request will be aborted if the provided context is
  6379. // canceled.
  6380. func (c *MapsPermissionsBatchDeleteCall) Context(ctx context.Context) *MapsPermissionsBatchDeleteCall {
  6381. c.ctx_ = ctx
  6382. return c
  6383. }
  6384. func (c *MapsPermissionsBatchDeleteCall) doRequest(alt string) (*http.Response, error) {
  6385. var body io.Reader = nil
  6386. body, err := googleapi.WithoutDataWrapper.JSONReader(c.permissionsbatchdeleterequest)
  6387. if err != nil {
  6388. return nil, err
  6389. }
  6390. ctype := "application/json"
  6391. c.urlParams_.Set("alt", alt)
  6392. urls := googleapi.ResolveRelative(c.s.BasePath, "maps/{id}/permissions/batchDelete")
  6393. urls += "?" + c.urlParams_.Encode()
  6394. req, _ := http.NewRequest("POST", urls, body)
  6395. googleapi.Expand(req.URL, map[string]string{
  6396. "id": c.id,
  6397. })
  6398. req.Header.Set("Content-Type", ctype)
  6399. req.Header.Set("User-Agent", c.s.userAgent())
  6400. if c.ctx_ != nil {
  6401. return ctxhttp.Do(c.ctx_, c.s.client, req)
  6402. }
  6403. return c.s.client.Do(req)
  6404. }
  6405. // Do executes the "mapsengine.maps.permissions.batchDelete" call.
  6406. // Exactly one of *PermissionsBatchDeleteResponse or error will be
  6407. // non-nil. Any non-2xx status code is an error. Response headers are in
  6408. // either *PermissionsBatchDeleteResponse.ServerResponse.Header or (if a
  6409. // response was returned at all) in error.(*googleapi.Error).Header. Use
  6410. // googleapi.IsNotModified to check whether the returned error was
  6411. // because http.StatusNotModified was returned.
  6412. func (c *MapsPermissionsBatchDeleteCall) Do(opts ...googleapi.CallOption) (*PermissionsBatchDeleteResponse, error) {
  6413. gensupport.SetOptions(c.urlParams_, opts...)
  6414. res, err := c.doRequest("json")
  6415. if res != nil && res.StatusCode == http.StatusNotModified {
  6416. if res.Body != nil {
  6417. res.Body.Close()
  6418. }
  6419. return nil, &googleapi.Error{
  6420. Code: res.StatusCode,
  6421. Header: res.Header,
  6422. }
  6423. }
  6424. if err != nil {
  6425. return nil, err
  6426. }
  6427. defer googleapi.CloseBody(res)
  6428. if err := googleapi.CheckResponse(res); err != nil {
  6429. return nil, err
  6430. }
  6431. ret := &PermissionsBatchDeleteResponse{
  6432. ServerResponse: googleapi.ServerResponse{
  6433. Header: res.Header,
  6434. HTTPStatusCode: res.StatusCode,
  6435. },
  6436. }
  6437. if err := json.NewDecoder(res.Body).Decode(&ret); err != nil {
  6438. return nil, err
  6439. }
  6440. return ret, nil
  6441. // {
  6442. // "description": "Remove permission entries from an already existing asset.",
  6443. // "httpMethod": "POST",
  6444. // "id": "mapsengine.maps.permissions.batchDelete",
  6445. // "parameterOrder": [
  6446. // "id"
  6447. // ],
  6448. // "parameters": {
  6449. // "id": {
  6450. // "description": "The ID of the asset from which permissions will be removed.",
  6451. // "location": "path",
  6452. // "required": true,
  6453. // "type": "string"
  6454. // }
  6455. // },
  6456. // "path": "maps/{id}/permissions/batchDelete",
  6457. // "request": {
  6458. // "$ref": "PermissionsBatchDeleteRequest"
  6459. // },
  6460. // "response": {
  6461. // "$ref": "PermissionsBatchDeleteResponse"
  6462. // },
  6463. // "scopes": [
  6464. // "https://www.googleapis.com/auth/mapsengine"
  6465. // ]
  6466. // }
  6467. }
  6468. // method id "mapsengine.maps.permissions.batchUpdate":
  6469. type MapsPermissionsBatchUpdateCall struct {
  6470. s *Service
  6471. id string
  6472. permissionsbatchupdaterequest *PermissionsBatchUpdateRequest
  6473. urlParams_ gensupport.URLParams
  6474. ctx_ context.Context
  6475. }
  6476. // BatchUpdate: Add or update permission entries to an already existing
  6477. // asset.
  6478. //
  6479. // An asset can hold up to 20 different permission entries. Each
  6480. // batchInsert request is atomic.
  6481. func (r *MapsPermissionsService) BatchUpdate(id string, permissionsbatchupdaterequest *PermissionsBatchUpdateRequest) *MapsPermissionsBatchUpdateCall {
  6482. c := &MapsPermissionsBatchUpdateCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  6483. c.id = id
  6484. c.permissionsbatchupdaterequest = permissionsbatchupdaterequest
  6485. return c
  6486. }
  6487. // Fields allows partial responses to be retrieved. See
  6488. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  6489. // for more information.
  6490. func (c *MapsPermissionsBatchUpdateCall) Fields(s ...googleapi.Field) *MapsPermissionsBatchUpdateCall {
  6491. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  6492. return c
  6493. }
  6494. // Context sets the context to be used in this call's Do method. Any
  6495. // pending HTTP request will be aborted if the provided context is
  6496. // canceled.
  6497. func (c *MapsPermissionsBatchUpdateCall) Context(ctx context.Context) *MapsPermissionsBatchUpdateCall {
  6498. c.ctx_ = ctx
  6499. return c
  6500. }
  6501. func (c *MapsPermissionsBatchUpdateCall) doRequest(alt string) (*http.Response, error) {
  6502. var body io.Reader = nil
  6503. body, err := googleapi.WithoutDataWrapper.JSONReader(c.permissionsbatchupdaterequest)
  6504. if err != nil {
  6505. return nil, err
  6506. }
  6507. ctype := "application/json"
  6508. c.urlParams_.Set("alt", alt)
  6509. urls := googleapi.ResolveRelative(c.s.BasePath, "maps/{id}/permissions/batchUpdate")
  6510. urls += "?" + c.urlParams_.Encode()
  6511. req, _ := http.NewRequest("POST", urls, body)
  6512. googleapi.Expand(req.URL, map[string]string{
  6513. "id": c.id,
  6514. })
  6515. req.Header.Set("Content-Type", ctype)
  6516. req.Header.Set("User-Agent", c.s.userAgent())
  6517. if c.ctx_ != nil {
  6518. return ctxhttp.Do(c.ctx_, c.s.client, req)
  6519. }
  6520. return c.s.client.Do(req)
  6521. }
  6522. // Do executes the "mapsengine.maps.permissions.batchUpdate" call.
  6523. // Exactly one of *PermissionsBatchUpdateResponse or error will be
  6524. // non-nil. Any non-2xx status code is an error. Response headers are in
  6525. // either *PermissionsBatchUpdateResponse.ServerResponse.Header or (if a
  6526. // response was returned at all) in error.(*googleapi.Error).Header. Use
  6527. // googleapi.IsNotModified to check whether the returned error was
  6528. // because http.StatusNotModified was returned.
  6529. func (c *MapsPermissionsBatchUpdateCall) Do(opts ...googleapi.CallOption) (*PermissionsBatchUpdateResponse, error) {
  6530. gensupport.SetOptions(c.urlParams_, opts...)
  6531. res, err := c.doRequest("json")
  6532. if res != nil && res.StatusCode == http.StatusNotModified {
  6533. if res.Body != nil {
  6534. res.Body.Close()
  6535. }
  6536. return nil, &googleapi.Error{
  6537. Code: res.StatusCode,
  6538. Header: res.Header,
  6539. }
  6540. }
  6541. if err != nil {
  6542. return nil, err
  6543. }
  6544. defer googleapi.CloseBody(res)
  6545. if err := googleapi.CheckResponse(res); err != nil {
  6546. return nil, err
  6547. }
  6548. ret := &PermissionsBatchUpdateResponse{
  6549. ServerResponse: googleapi.ServerResponse{
  6550. Header: res.Header,
  6551. HTTPStatusCode: res.StatusCode,
  6552. },
  6553. }
  6554. if err := json.NewDecoder(res.Body).Decode(&ret); err != nil {
  6555. return nil, err
  6556. }
  6557. return ret, nil
  6558. // {
  6559. // "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.",
  6560. // "httpMethod": "POST",
  6561. // "id": "mapsengine.maps.permissions.batchUpdate",
  6562. // "parameterOrder": [
  6563. // "id"
  6564. // ],
  6565. // "parameters": {
  6566. // "id": {
  6567. // "description": "The ID of the asset to which permissions will be added.",
  6568. // "location": "path",
  6569. // "required": true,
  6570. // "type": "string"
  6571. // }
  6572. // },
  6573. // "path": "maps/{id}/permissions/batchUpdate",
  6574. // "request": {
  6575. // "$ref": "PermissionsBatchUpdateRequest"
  6576. // },
  6577. // "response": {
  6578. // "$ref": "PermissionsBatchUpdateResponse"
  6579. // },
  6580. // "scopes": [
  6581. // "https://www.googleapis.com/auth/mapsengine"
  6582. // ]
  6583. // }
  6584. }
  6585. // method id "mapsengine.maps.permissions.list":
  6586. type MapsPermissionsListCall struct {
  6587. s *Service
  6588. id string
  6589. urlParams_ gensupport.URLParams
  6590. ifNoneMatch_ string
  6591. ctx_ context.Context
  6592. }
  6593. // List: Return all of the permissions for the specified asset.
  6594. func (r *MapsPermissionsService) List(id string) *MapsPermissionsListCall {
  6595. c := &MapsPermissionsListCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  6596. c.id = id
  6597. return c
  6598. }
  6599. // Fields allows partial responses to be retrieved. See
  6600. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  6601. // for more information.
  6602. func (c *MapsPermissionsListCall) Fields(s ...googleapi.Field) *MapsPermissionsListCall {
  6603. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  6604. return c
  6605. }
  6606. // IfNoneMatch sets the optional parameter which makes the operation
  6607. // fail if the object's ETag matches the given value. This is useful for
  6608. // getting updates only after the object has changed since the last
  6609. // request. Use googleapi.IsNotModified to check whether the response
  6610. // error from Do is the result of In-None-Match.
  6611. func (c *MapsPermissionsListCall) IfNoneMatch(entityTag string) *MapsPermissionsListCall {
  6612. c.ifNoneMatch_ = entityTag
  6613. return c
  6614. }
  6615. // Context sets the context to be used in this call's Do method. Any
  6616. // pending HTTP request will be aborted if the provided context is
  6617. // canceled.
  6618. func (c *MapsPermissionsListCall) Context(ctx context.Context) *MapsPermissionsListCall {
  6619. c.ctx_ = ctx
  6620. return c
  6621. }
  6622. func (c *MapsPermissionsListCall) doRequest(alt string) (*http.Response, error) {
  6623. var body io.Reader = nil
  6624. c.urlParams_.Set("alt", alt)
  6625. urls := googleapi.ResolveRelative(c.s.BasePath, "maps/{id}/permissions")
  6626. urls += "?" + c.urlParams_.Encode()
  6627. req, _ := http.NewRequest("GET", urls, body)
  6628. googleapi.Expand(req.URL, map[string]string{
  6629. "id": c.id,
  6630. })
  6631. req.Header.Set("User-Agent", c.s.userAgent())
  6632. if c.ifNoneMatch_ != "" {
  6633. req.Header.Set("If-None-Match", c.ifNoneMatch_)
  6634. }
  6635. if c.ctx_ != nil {
  6636. return ctxhttp.Do(c.ctx_, c.s.client, req)
  6637. }
  6638. return c.s.client.Do(req)
  6639. }
  6640. // Do executes the "mapsengine.maps.permissions.list" call.
  6641. // Exactly one of *PermissionsListResponse or error will be non-nil. Any
  6642. // non-2xx status code is an error. Response headers are in either
  6643. // *PermissionsListResponse.ServerResponse.Header or (if a response was
  6644. // returned at all) in error.(*googleapi.Error).Header. Use
  6645. // googleapi.IsNotModified to check whether the returned error was
  6646. // because http.StatusNotModified was returned.
  6647. func (c *MapsPermissionsListCall) Do(opts ...googleapi.CallOption) (*PermissionsListResponse, error) {
  6648. gensupport.SetOptions(c.urlParams_, opts...)
  6649. res, err := c.doRequest("json")
  6650. if res != nil && res.StatusCode == http.StatusNotModified {
  6651. if res.Body != nil {
  6652. res.Body.Close()
  6653. }
  6654. return nil, &googleapi.Error{
  6655. Code: res.StatusCode,
  6656. Header: res.Header,
  6657. }
  6658. }
  6659. if err != nil {
  6660. return nil, err
  6661. }
  6662. defer googleapi.CloseBody(res)
  6663. if err := googleapi.CheckResponse(res); err != nil {
  6664. return nil, err
  6665. }
  6666. ret := &PermissionsListResponse{
  6667. ServerResponse: googleapi.ServerResponse{
  6668. Header: res.Header,
  6669. HTTPStatusCode: res.StatusCode,
  6670. },
  6671. }
  6672. if err := json.NewDecoder(res.Body).Decode(&ret); err != nil {
  6673. return nil, err
  6674. }
  6675. return ret, nil
  6676. // {
  6677. // "description": "Return all of the permissions for the specified asset.",
  6678. // "httpMethod": "GET",
  6679. // "id": "mapsengine.maps.permissions.list",
  6680. // "parameterOrder": [
  6681. // "id"
  6682. // ],
  6683. // "parameters": {
  6684. // "id": {
  6685. // "description": "The ID of the asset whose permissions will be listed.",
  6686. // "location": "path",
  6687. // "required": true,
  6688. // "type": "string"
  6689. // }
  6690. // },
  6691. // "path": "maps/{id}/permissions",
  6692. // "response": {
  6693. // "$ref": "PermissionsListResponse"
  6694. // },
  6695. // "scopes": [
  6696. // "https://www.googleapis.com/auth/mapsengine",
  6697. // "https://www.googleapis.com/auth/mapsengine.readonly"
  6698. // ]
  6699. // }
  6700. }
  6701. // method id "mapsengine.projects.list":
  6702. type ProjectsListCall struct {
  6703. s *Service
  6704. urlParams_ gensupport.URLParams
  6705. ifNoneMatch_ string
  6706. ctx_ context.Context
  6707. }
  6708. // List: Return all projects readable by the current user.
  6709. func (r *ProjectsService) List() *ProjectsListCall {
  6710. c := &ProjectsListCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  6711. return c
  6712. }
  6713. // Fields allows partial responses to be retrieved. See
  6714. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  6715. // for more information.
  6716. func (c *ProjectsListCall) Fields(s ...googleapi.Field) *ProjectsListCall {
  6717. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  6718. return c
  6719. }
  6720. // IfNoneMatch sets the optional parameter which makes the operation
  6721. // fail if the object's ETag matches the given value. This is useful for
  6722. // getting updates only after the object has changed since the last
  6723. // request. Use googleapi.IsNotModified to check whether the response
  6724. // error from Do is the result of In-None-Match.
  6725. func (c *ProjectsListCall) IfNoneMatch(entityTag string) *ProjectsListCall {
  6726. c.ifNoneMatch_ = entityTag
  6727. return c
  6728. }
  6729. // Context sets the context to be used in this call's Do method. Any
  6730. // pending HTTP request will be aborted if the provided context is
  6731. // canceled.
  6732. func (c *ProjectsListCall) Context(ctx context.Context) *ProjectsListCall {
  6733. c.ctx_ = ctx
  6734. return c
  6735. }
  6736. func (c *ProjectsListCall) doRequest(alt string) (*http.Response, error) {
  6737. var body io.Reader = nil
  6738. c.urlParams_.Set("alt", alt)
  6739. urls := googleapi.ResolveRelative(c.s.BasePath, "projects")
  6740. urls += "?" + c.urlParams_.Encode()
  6741. req, _ := http.NewRequest("GET", urls, body)
  6742. googleapi.SetOpaque(req.URL)
  6743. req.Header.Set("User-Agent", c.s.userAgent())
  6744. if c.ifNoneMatch_ != "" {
  6745. req.Header.Set("If-None-Match", c.ifNoneMatch_)
  6746. }
  6747. if c.ctx_ != nil {
  6748. return ctxhttp.Do(c.ctx_, c.s.client, req)
  6749. }
  6750. return c.s.client.Do(req)
  6751. }
  6752. // Do executes the "mapsengine.projects.list" call.
  6753. // Exactly one of *ProjectsListResponse or error will be non-nil. Any
  6754. // non-2xx status code is an error. Response headers are in either
  6755. // *ProjectsListResponse.ServerResponse.Header or (if a response was
  6756. // returned at all) in error.(*googleapi.Error).Header. Use
  6757. // googleapi.IsNotModified to check whether the returned error was
  6758. // because http.StatusNotModified was returned.
  6759. func (c *ProjectsListCall) Do(opts ...googleapi.CallOption) (*ProjectsListResponse, error) {
  6760. gensupport.SetOptions(c.urlParams_, opts...)
  6761. res, err := c.doRequest("json")
  6762. if res != nil && res.StatusCode == http.StatusNotModified {
  6763. if res.Body != nil {
  6764. res.Body.Close()
  6765. }
  6766. return nil, &googleapi.Error{
  6767. Code: res.StatusCode,
  6768. Header: res.Header,
  6769. }
  6770. }
  6771. if err != nil {
  6772. return nil, err
  6773. }
  6774. defer googleapi.CloseBody(res)
  6775. if err := googleapi.CheckResponse(res); err != nil {
  6776. return nil, err
  6777. }
  6778. ret := &ProjectsListResponse{
  6779. ServerResponse: googleapi.ServerResponse{
  6780. Header: res.Header,
  6781. HTTPStatusCode: res.StatusCode,
  6782. },
  6783. }
  6784. if err := json.NewDecoder(res.Body).Decode(&ret); err != nil {
  6785. return nil, err
  6786. }
  6787. return ret, nil
  6788. // {
  6789. // "description": "Return all projects readable by the current user.",
  6790. // "httpMethod": "GET",
  6791. // "id": "mapsengine.projects.list",
  6792. // "path": "projects",
  6793. // "response": {
  6794. // "$ref": "ProjectsListResponse"
  6795. // },
  6796. // "scopes": [
  6797. // "https://www.googleapis.com/auth/mapsengine",
  6798. // "https://www.googleapis.com/auth/mapsengine.readonly"
  6799. // ]
  6800. // }
  6801. }
  6802. // method id "mapsengine.projects.icons.create":
  6803. type ProjectsIconsCreateCall struct {
  6804. s *Service
  6805. projectId string
  6806. icon *Icon
  6807. urlParams_ gensupport.URLParams
  6808. media_ io.Reader
  6809. resumableBuffer_ *gensupport.ResumableBuffer
  6810. mediaType_ string
  6811. mediaSize_ int64 // mediaSize, if known. Used only for calls to progressUpdater_.
  6812. progressUpdater_ googleapi.ProgressUpdater
  6813. ctx_ context.Context
  6814. }
  6815. // Create: Create an icon.
  6816. func (r *ProjectsIconsService) Create(projectId string, icon *Icon) *ProjectsIconsCreateCall {
  6817. c := &ProjectsIconsCreateCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  6818. c.projectId = projectId
  6819. c.icon = icon
  6820. return c
  6821. }
  6822. // Media specifies the media to upload in one or more chunks. The chunk
  6823. // size may be controlled by supplying a MediaOption generated by
  6824. // googleapi.ChunkSize. The chunk size defaults to
  6825. // googleapi.DefaultUploadChunkSize.
  6826. // At most one of Media and ResumableMedia may be set.
  6827. func (c *ProjectsIconsCreateCall) Media(r io.Reader, options ...googleapi.MediaOption) *ProjectsIconsCreateCall {
  6828. opts := googleapi.ProcessMediaOptions(options)
  6829. chunkSize := opts.ChunkSize
  6830. r, c.mediaType_ = gensupport.DetermineContentType(r, opts.ContentType)
  6831. c.media_, c.resumableBuffer_ = gensupport.PrepareUpload(r, chunkSize)
  6832. return c
  6833. }
  6834. // ResumableMedia specifies the media to upload in chunks and can be
  6835. // canceled with ctx.
  6836. //
  6837. // Deprecated: use Media instead.
  6838. //
  6839. // At most one of Media and ResumableMedia may be set. mediaType
  6840. // identifies the MIME media type of the upload, such as "image/png". If
  6841. // mediaType is "", it will be auto-detected. The provided ctx will
  6842. // supersede any context previously provided to the Context method.
  6843. func (c *ProjectsIconsCreateCall) ResumableMedia(ctx context.Context, r io.ReaderAt, size int64, mediaType string) *ProjectsIconsCreateCall {
  6844. c.ctx_ = ctx
  6845. rdr := gensupport.ReaderAtToReader(r, size)
  6846. rdr, c.mediaType_ = gensupport.DetermineContentType(rdr, mediaType)
  6847. c.resumableBuffer_ = gensupport.NewResumableBuffer(rdr, googleapi.DefaultUploadChunkSize)
  6848. c.media_ = nil
  6849. c.mediaSize_ = size
  6850. return c
  6851. }
  6852. // ProgressUpdater provides a callback function that will be called
  6853. // after every chunk. It should be a low-latency function in order to
  6854. // not slow down the upload operation. This should only be called when
  6855. // using ResumableMedia (as opposed to Media).
  6856. func (c *ProjectsIconsCreateCall) ProgressUpdater(pu googleapi.ProgressUpdater) *ProjectsIconsCreateCall {
  6857. c.progressUpdater_ = pu
  6858. return c
  6859. }
  6860. // Fields allows partial responses to be retrieved. See
  6861. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  6862. // for more information.
  6863. func (c *ProjectsIconsCreateCall) Fields(s ...googleapi.Field) *ProjectsIconsCreateCall {
  6864. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  6865. return c
  6866. }
  6867. // Context sets the context to be used in this call's Do method. Any
  6868. // pending HTTP request will be aborted if the provided context is
  6869. // canceled.
  6870. // This context will supersede any context previously provided to the
  6871. // ResumableMedia method.
  6872. func (c *ProjectsIconsCreateCall) Context(ctx context.Context) *ProjectsIconsCreateCall {
  6873. c.ctx_ = ctx
  6874. return c
  6875. }
  6876. func (c *ProjectsIconsCreateCall) doRequest(alt string) (*http.Response, error) {
  6877. var body io.Reader = nil
  6878. body, err := googleapi.WithoutDataWrapper.JSONReader(c.icon)
  6879. if err != nil {
  6880. return nil, err
  6881. }
  6882. ctype := "application/json"
  6883. c.urlParams_.Set("alt", alt)
  6884. urls := googleapi.ResolveRelative(c.s.BasePath, "projects/{projectId}/icons")
  6885. if c.media_ != nil || c.resumableBuffer_ != nil {
  6886. urls = strings.Replace(urls, "https://www.googleapis.com/", "https://www.googleapis.com/upload/", 1)
  6887. protocol := "multipart"
  6888. if c.resumableBuffer_ != nil {
  6889. protocol = "resumable"
  6890. }
  6891. c.urlParams_.Set("uploadType", protocol)
  6892. }
  6893. urls += "?" + c.urlParams_.Encode()
  6894. if c.media_ != nil {
  6895. var combined io.ReadCloser
  6896. combined, ctype = gensupport.CombineBodyMedia(body, ctype, c.media_, c.mediaType_)
  6897. defer combined.Close()
  6898. body = combined
  6899. }
  6900. req, _ := http.NewRequest("POST", urls, body)
  6901. googleapi.Expand(req.URL, map[string]string{
  6902. "projectId": c.projectId,
  6903. })
  6904. if c.resumableBuffer_ != nil {
  6905. req.Header.Set("X-Upload-Content-Type", c.mediaType_)
  6906. }
  6907. req.Header.Set("Content-Type", ctype)
  6908. req.Header.Set("User-Agent", c.s.userAgent())
  6909. if c.ctx_ != nil {
  6910. return ctxhttp.Do(c.ctx_, c.s.client, req)
  6911. }
  6912. return c.s.client.Do(req)
  6913. }
  6914. // Do executes the "mapsengine.projects.icons.create" call.
  6915. // Exactly one of *Icon or error will be non-nil. Any non-2xx status
  6916. // code is an error. Response headers are in either
  6917. // *Icon.ServerResponse.Header or (if a response was returned at all) in
  6918. // error.(*googleapi.Error).Header. Use googleapi.IsNotModified to check
  6919. // whether the returned error was because http.StatusNotModified was
  6920. // returned.
  6921. func (c *ProjectsIconsCreateCall) Do(opts ...googleapi.CallOption) (*Icon, error) {
  6922. gensupport.SetOptions(c.urlParams_, opts...)
  6923. res, err := gensupport.Retry(c.ctx_, func() (*http.Response, error) {
  6924. return c.doRequest("json")
  6925. }, gensupport.DefaultBackoffStrategy())
  6926. if res != nil && res.StatusCode == http.StatusNotModified {
  6927. if res.Body != nil {
  6928. res.Body.Close()
  6929. }
  6930. return nil, &googleapi.Error{
  6931. Code: res.StatusCode,
  6932. Header: res.Header,
  6933. }
  6934. }
  6935. if err != nil {
  6936. return nil, err
  6937. }
  6938. defer googleapi.CloseBody(res)
  6939. if err := googleapi.CheckResponse(res); err != nil {
  6940. return nil, err
  6941. }
  6942. if c.resumableBuffer_ != nil {
  6943. loc := res.Header.Get("Location")
  6944. rx := &gensupport.ResumableUpload{
  6945. Client: c.s.client,
  6946. UserAgent: c.s.userAgent(),
  6947. URI: loc,
  6948. Media: c.resumableBuffer_,
  6949. MediaType: c.mediaType_,
  6950. Callback: func(curr int64) {
  6951. if c.progressUpdater_ != nil {
  6952. c.progressUpdater_(curr, c.mediaSize_)
  6953. }
  6954. },
  6955. }
  6956. ctx := c.ctx_
  6957. if ctx == nil {
  6958. ctx = context.TODO()
  6959. }
  6960. res, err = rx.Upload(ctx)
  6961. if err != nil {
  6962. return nil, err
  6963. }
  6964. defer res.Body.Close()
  6965. if err := googleapi.CheckResponse(res); err != nil {
  6966. return nil, err
  6967. }
  6968. }
  6969. ret := &Icon{
  6970. ServerResponse: googleapi.ServerResponse{
  6971. Header: res.Header,
  6972. HTTPStatusCode: res.StatusCode,
  6973. },
  6974. }
  6975. if err := json.NewDecoder(res.Body).Decode(&ret); err != nil {
  6976. return nil, err
  6977. }
  6978. return ret, nil
  6979. // {
  6980. // "description": "Create an icon.",
  6981. // "httpMethod": "POST",
  6982. // "id": "mapsengine.projects.icons.create",
  6983. // "mediaUpload": {
  6984. // "accept": [
  6985. // "*/*"
  6986. // ],
  6987. // "maxSize": "100KB",
  6988. // "protocols": {
  6989. // "resumable": {
  6990. // "multipart": true,
  6991. // "path": "/resumable/upload/mapsengine/exp2/projects/{projectId}/icons"
  6992. // },
  6993. // "simple": {
  6994. // "multipart": true,
  6995. // "path": "/upload/mapsengine/exp2/projects/{projectId}/icons"
  6996. // }
  6997. // }
  6998. // },
  6999. // "parameterOrder": [
  7000. // "projectId"
  7001. // ],
  7002. // "parameters": {
  7003. // "projectId": {
  7004. // "description": "The ID of the project.",
  7005. // "location": "path",
  7006. // "required": true,
  7007. // "type": "string"
  7008. // }
  7009. // },
  7010. // "path": "projects/{projectId}/icons",
  7011. // "request": {
  7012. // "$ref": "Icon"
  7013. // },
  7014. // "response": {
  7015. // "$ref": "Icon"
  7016. // },
  7017. // "scopes": [
  7018. // "https://www.googleapis.com/auth/mapsengine"
  7019. // ],
  7020. // "supportsMediaUpload": true
  7021. // }
  7022. }
  7023. // method id "mapsengine.projects.icons.get":
  7024. type ProjectsIconsGetCall struct {
  7025. s *Service
  7026. projectId string
  7027. id string
  7028. urlParams_ gensupport.URLParams
  7029. ifNoneMatch_ string
  7030. ctx_ context.Context
  7031. }
  7032. // Get: Return an icon or its associated metadata
  7033. func (r *ProjectsIconsService) Get(projectId string, id string) *ProjectsIconsGetCall {
  7034. c := &ProjectsIconsGetCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  7035. c.projectId = projectId
  7036. c.id = id
  7037. return c
  7038. }
  7039. // Fields allows partial responses to be retrieved. See
  7040. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  7041. // for more information.
  7042. func (c *ProjectsIconsGetCall) Fields(s ...googleapi.Field) *ProjectsIconsGetCall {
  7043. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  7044. return c
  7045. }
  7046. // IfNoneMatch sets the optional parameter which makes the operation
  7047. // fail if the object's ETag matches the given value. This is useful for
  7048. // getting updates only after the object has changed since the last
  7049. // request. Use googleapi.IsNotModified to check whether the response
  7050. // error from Do is the result of In-None-Match.
  7051. func (c *ProjectsIconsGetCall) IfNoneMatch(entityTag string) *ProjectsIconsGetCall {
  7052. c.ifNoneMatch_ = entityTag
  7053. return c
  7054. }
  7055. // Context sets the context to be used in this call's Do and Download
  7056. // methods. Any pending HTTP request will be aborted if the provided
  7057. // context is canceled.
  7058. func (c *ProjectsIconsGetCall) Context(ctx context.Context) *ProjectsIconsGetCall {
  7059. c.ctx_ = ctx
  7060. return c
  7061. }
  7062. func (c *ProjectsIconsGetCall) doRequest(alt string) (*http.Response, error) {
  7063. var body io.Reader = nil
  7064. c.urlParams_.Set("alt", alt)
  7065. urls := googleapi.ResolveRelative(c.s.BasePath, "projects/{projectId}/icons/{id}")
  7066. urls += "?" + c.urlParams_.Encode()
  7067. req, _ := http.NewRequest("GET", urls, body)
  7068. googleapi.Expand(req.URL, map[string]string{
  7069. "projectId": c.projectId,
  7070. "id": c.id,
  7071. })
  7072. req.Header.Set("User-Agent", c.s.userAgent())
  7073. if c.ifNoneMatch_ != "" {
  7074. req.Header.Set("If-None-Match", c.ifNoneMatch_)
  7075. }
  7076. if c.ctx_ != nil {
  7077. return ctxhttp.Do(c.ctx_, c.s.client, req)
  7078. }
  7079. return c.s.client.Do(req)
  7080. }
  7081. // Download fetches the API endpoint's "media" value, instead of the normal
  7082. // API response value. If the returned error is nil, the Response is guaranteed to
  7083. // have a 2xx status code. Callers must close the Response.Body as usual.
  7084. func (c *ProjectsIconsGetCall) Download(opts ...googleapi.CallOption) (*http.Response, error) {
  7085. gensupport.SetOptions(c.urlParams_, opts...)
  7086. res, err := c.doRequest("media")
  7087. if err != nil {
  7088. return nil, err
  7089. }
  7090. if err := googleapi.CheckMediaResponse(res); err != nil {
  7091. res.Body.Close()
  7092. return nil, err
  7093. }
  7094. return res, nil
  7095. }
  7096. // Do executes the "mapsengine.projects.icons.get" call.
  7097. // Exactly one of *Icon or error will be non-nil. Any non-2xx status
  7098. // code is an error. Response headers are in either
  7099. // *Icon.ServerResponse.Header or (if a response was returned at all) in
  7100. // error.(*googleapi.Error).Header. Use googleapi.IsNotModified to check
  7101. // whether the returned error was because http.StatusNotModified was
  7102. // returned.
  7103. func (c *ProjectsIconsGetCall) Do(opts ...googleapi.CallOption) (*Icon, error) {
  7104. gensupport.SetOptions(c.urlParams_, opts...)
  7105. res, err := c.doRequest("json")
  7106. if res != nil && res.StatusCode == http.StatusNotModified {
  7107. if res.Body != nil {
  7108. res.Body.Close()
  7109. }
  7110. return nil, &googleapi.Error{
  7111. Code: res.StatusCode,
  7112. Header: res.Header,
  7113. }
  7114. }
  7115. if err != nil {
  7116. return nil, err
  7117. }
  7118. defer googleapi.CloseBody(res)
  7119. if err := googleapi.CheckResponse(res); err != nil {
  7120. return nil, err
  7121. }
  7122. ret := &Icon{
  7123. ServerResponse: googleapi.ServerResponse{
  7124. Header: res.Header,
  7125. HTTPStatusCode: res.StatusCode,
  7126. },
  7127. }
  7128. if err := json.NewDecoder(res.Body).Decode(&ret); err != nil {
  7129. return nil, err
  7130. }
  7131. return ret, nil
  7132. // {
  7133. // "description": "Return an icon or its associated metadata",
  7134. // "httpMethod": "GET",
  7135. // "id": "mapsengine.projects.icons.get",
  7136. // "parameterOrder": [
  7137. // "projectId",
  7138. // "id"
  7139. // ],
  7140. // "parameters": {
  7141. // "id": {
  7142. // "description": "The ID of the icon.",
  7143. // "location": "path",
  7144. // "required": true,
  7145. // "type": "string"
  7146. // },
  7147. // "projectId": {
  7148. // "description": "The ID of the project.",
  7149. // "location": "path",
  7150. // "required": true,
  7151. // "type": "string"
  7152. // }
  7153. // },
  7154. // "path": "projects/{projectId}/icons/{id}",
  7155. // "response": {
  7156. // "$ref": "Icon"
  7157. // },
  7158. // "scopes": [
  7159. // "https://www.googleapis.com/auth/mapsengine",
  7160. // "https://www.googleapis.com/auth/mapsengine.readonly"
  7161. // ],
  7162. // "supportsMediaDownload": true
  7163. // }
  7164. }
  7165. // method id "mapsengine.projects.icons.list":
  7166. type ProjectsIconsListCall struct {
  7167. s *Service
  7168. projectId string
  7169. urlParams_ gensupport.URLParams
  7170. ifNoneMatch_ string
  7171. ctx_ context.Context
  7172. }
  7173. // List: Return all icons in the current project
  7174. func (r *ProjectsIconsService) List(projectId string) *ProjectsIconsListCall {
  7175. c := &ProjectsIconsListCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  7176. c.projectId = projectId
  7177. return c
  7178. }
  7179. // MaxResults sets the optional parameter "maxResults": The maximum
  7180. // number of items to include in a single response page. The maximum
  7181. // supported value is 50.
  7182. func (c *ProjectsIconsListCall) MaxResults(maxResults int64) *ProjectsIconsListCall {
  7183. c.urlParams_.Set("maxResults", fmt.Sprint(maxResults))
  7184. return c
  7185. }
  7186. // PageToken sets the optional parameter "pageToken": The continuation
  7187. // token, used to page through large result sets. To get the next page
  7188. // of results, set this parameter to the value of nextPageToken from the
  7189. // previous response.
  7190. func (c *ProjectsIconsListCall) PageToken(pageToken string) *ProjectsIconsListCall {
  7191. c.urlParams_.Set("pageToken", pageToken)
  7192. return c
  7193. }
  7194. // Fields allows partial responses to be retrieved. See
  7195. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  7196. // for more information.
  7197. func (c *ProjectsIconsListCall) Fields(s ...googleapi.Field) *ProjectsIconsListCall {
  7198. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  7199. return c
  7200. }
  7201. // IfNoneMatch sets the optional parameter which makes the operation
  7202. // fail if the object's ETag matches the given value. This is useful for
  7203. // getting updates only after the object has changed since the last
  7204. // request. Use googleapi.IsNotModified to check whether the response
  7205. // error from Do is the result of In-None-Match.
  7206. func (c *ProjectsIconsListCall) IfNoneMatch(entityTag string) *ProjectsIconsListCall {
  7207. c.ifNoneMatch_ = entityTag
  7208. return c
  7209. }
  7210. // Context sets the context to be used in this call's Do method. Any
  7211. // pending HTTP request will be aborted if the provided context is
  7212. // canceled.
  7213. func (c *ProjectsIconsListCall) Context(ctx context.Context) *ProjectsIconsListCall {
  7214. c.ctx_ = ctx
  7215. return c
  7216. }
  7217. func (c *ProjectsIconsListCall) doRequest(alt string) (*http.Response, error) {
  7218. var body io.Reader = nil
  7219. c.urlParams_.Set("alt", alt)
  7220. urls := googleapi.ResolveRelative(c.s.BasePath, "projects/{projectId}/icons")
  7221. urls += "?" + c.urlParams_.Encode()
  7222. req, _ := http.NewRequest("GET", urls, body)
  7223. googleapi.Expand(req.URL, map[string]string{
  7224. "projectId": c.projectId,
  7225. })
  7226. req.Header.Set("User-Agent", c.s.userAgent())
  7227. if c.ifNoneMatch_ != "" {
  7228. req.Header.Set("If-None-Match", c.ifNoneMatch_)
  7229. }
  7230. if c.ctx_ != nil {
  7231. return ctxhttp.Do(c.ctx_, c.s.client, req)
  7232. }
  7233. return c.s.client.Do(req)
  7234. }
  7235. // Do executes the "mapsengine.projects.icons.list" call.
  7236. // Exactly one of *IconsListResponse or error will be non-nil. Any
  7237. // non-2xx status code is an error. Response headers are in either
  7238. // *IconsListResponse.ServerResponse.Header or (if a response was
  7239. // returned at all) in error.(*googleapi.Error).Header. Use
  7240. // googleapi.IsNotModified to check whether the returned error was
  7241. // because http.StatusNotModified was returned.
  7242. func (c *ProjectsIconsListCall) Do(opts ...googleapi.CallOption) (*IconsListResponse, error) {
  7243. gensupport.SetOptions(c.urlParams_, opts...)
  7244. res, err := c.doRequest("json")
  7245. if res != nil && res.StatusCode == http.StatusNotModified {
  7246. if res.Body != nil {
  7247. res.Body.Close()
  7248. }
  7249. return nil, &googleapi.Error{
  7250. Code: res.StatusCode,
  7251. Header: res.Header,
  7252. }
  7253. }
  7254. if err != nil {
  7255. return nil, err
  7256. }
  7257. defer googleapi.CloseBody(res)
  7258. if err := googleapi.CheckResponse(res); err != nil {
  7259. return nil, err
  7260. }
  7261. ret := &IconsListResponse{
  7262. ServerResponse: googleapi.ServerResponse{
  7263. Header: res.Header,
  7264. HTTPStatusCode: res.StatusCode,
  7265. },
  7266. }
  7267. if err := json.NewDecoder(res.Body).Decode(&ret); err != nil {
  7268. return nil, err
  7269. }
  7270. return ret, nil
  7271. // {
  7272. // "description": "Return all icons in the current project",
  7273. // "httpMethod": "GET",
  7274. // "id": "mapsengine.projects.icons.list",
  7275. // "parameterOrder": [
  7276. // "projectId"
  7277. // ],
  7278. // "parameters": {
  7279. // "maxResults": {
  7280. // "description": "The maximum number of items to include in a single response page. The maximum supported value is 50.",
  7281. // "format": "uint32",
  7282. // "location": "query",
  7283. // "type": "integer"
  7284. // },
  7285. // "pageToken": {
  7286. // "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.",
  7287. // "location": "query",
  7288. // "type": "string"
  7289. // },
  7290. // "projectId": {
  7291. // "description": "The ID of the project.",
  7292. // "location": "path",
  7293. // "required": true,
  7294. // "type": "string"
  7295. // }
  7296. // },
  7297. // "path": "projects/{projectId}/icons",
  7298. // "response": {
  7299. // "$ref": "IconsListResponse"
  7300. // },
  7301. // "scopes": [
  7302. // "https://www.googleapis.com/auth/mapsengine",
  7303. // "https://www.googleapis.com/auth/mapsengine.readonly"
  7304. // ]
  7305. // }
  7306. }
  7307. // Pages invokes f for each page of results.
  7308. // A non-nil error returned from f will halt the iteration.
  7309. // The provided context supersedes any context provided to the Context method.
  7310. func (c *ProjectsIconsListCall) Pages(ctx context.Context, f func(*IconsListResponse) error) error {
  7311. c.ctx_ = ctx
  7312. defer c.PageToken(c.urlParams_.Get("pageToken")) // reset paging to original point
  7313. for {
  7314. x, err := c.Do()
  7315. if err != nil {
  7316. return err
  7317. }
  7318. if err := f(x); err != nil {
  7319. return err
  7320. }
  7321. if x.NextPageToken == "" {
  7322. return nil
  7323. }
  7324. c.PageToken(x.NextPageToken)
  7325. }
  7326. }
  7327. // method id "mapsengine.rasterCollections.cancelProcessing":
  7328. type RasterCollectionsCancelProcessingCall struct {
  7329. s *Service
  7330. id string
  7331. urlParams_ gensupport.URLParams
  7332. ctx_ context.Context
  7333. }
  7334. // CancelProcessing: Cancel processing on a raster collection asset.
  7335. func (r *RasterCollectionsService) CancelProcessing(id string) *RasterCollectionsCancelProcessingCall {
  7336. c := &RasterCollectionsCancelProcessingCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  7337. c.id = id
  7338. return c
  7339. }
  7340. // Fields allows partial responses to be retrieved. See
  7341. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  7342. // for more information.
  7343. func (c *RasterCollectionsCancelProcessingCall) Fields(s ...googleapi.Field) *RasterCollectionsCancelProcessingCall {
  7344. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  7345. return c
  7346. }
  7347. // Context sets the context to be used in this call's Do method. Any
  7348. // pending HTTP request will be aborted if the provided context is
  7349. // canceled.
  7350. func (c *RasterCollectionsCancelProcessingCall) Context(ctx context.Context) *RasterCollectionsCancelProcessingCall {
  7351. c.ctx_ = ctx
  7352. return c
  7353. }
  7354. func (c *RasterCollectionsCancelProcessingCall) doRequest(alt string) (*http.Response, error) {
  7355. var body io.Reader = nil
  7356. c.urlParams_.Set("alt", alt)
  7357. urls := googleapi.ResolveRelative(c.s.BasePath, "rasterCollections/{id}/cancelProcessing")
  7358. urls += "?" + c.urlParams_.Encode()
  7359. req, _ := http.NewRequest("POST", urls, body)
  7360. googleapi.Expand(req.URL, map[string]string{
  7361. "id": c.id,
  7362. })
  7363. req.Header.Set("User-Agent", c.s.userAgent())
  7364. if c.ctx_ != nil {
  7365. return ctxhttp.Do(c.ctx_, c.s.client, req)
  7366. }
  7367. return c.s.client.Do(req)
  7368. }
  7369. // Do executes the "mapsengine.rasterCollections.cancelProcessing" call.
  7370. // Exactly one of *ProcessResponse or error will be non-nil. Any non-2xx
  7371. // status code is an error. Response headers are in either
  7372. // *ProcessResponse.ServerResponse.Header or (if a response was returned
  7373. // at all) in error.(*googleapi.Error).Header. Use
  7374. // googleapi.IsNotModified to check whether the returned error was
  7375. // because http.StatusNotModified was returned.
  7376. func (c *RasterCollectionsCancelProcessingCall) Do(opts ...googleapi.CallOption) (*ProcessResponse, error) {
  7377. gensupport.SetOptions(c.urlParams_, opts...)
  7378. res, err := c.doRequest("json")
  7379. if res != nil && res.StatusCode == http.StatusNotModified {
  7380. if res.Body != nil {
  7381. res.Body.Close()
  7382. }
  7383. return nil, &googleapi.Error{
  7384. Code: res.StatusCode,
  7385. Header: res.Header,
  7386. }
  7387. }
  7388. if err != nil {
  7389. return nil, err
  7390. }
  7391. defer googleapi.CloseBody(res)
  7392. if err := googleapi.CheckResponse(res); err != nil {
  7393. return nil, err
  7394. }
  7395. ret := &ProcessResponse{
  7396. ServerResponse: googleapi.ServerResponse{
  7397. Header: res.Header,
  7398. HTTPStatusCode: res.StatusCode,
  7399. },
  7400. }
  7401. if err := json.NewDecoder(res.Body).Decode(&ret); err != nil {
  7402. return nil, err
  7403. }
  7404. return ret, nil
  7405. // {
  7406. // "description": "Cancel processing on a raster collection asset.",
  7407. // "httpMethod": "POST",
  7408. // "id": "mapsengine.rasterCollections.cancelProcessing",
  7409. // "parameterOrder": [
  7410. // "id"
  7411. // ],
  7412. // "parameters": {
  7413. // "id": {
  7414. // "description": "The ID of the raster collection.",
  7415. // "location": "path",
  7416. // "required": true,
  7417. // "type": "string"
  7418. // }
  7419. // },
  7420. // "path": "rasterCollections/{id}/cancelProcessing",
  7421. // "response": {
  7422. // "$ref": "ProcessResponse"
  7423. // },
  7424. // "scopes": [
  7425. // "https://www.googleapis.com/auth/mapsengine"
  7426. // ]
  7427. // }
  7428. }
  7429. // method id "mapsengine.rasterCollections.create":
  7430. type RasterCollectionsCreateCall struct {
  7431. s *Service
  7432. rastercollection *RasterCollection
  7433. urlParams_ gensupport.URLParams
  7434. ctx_ context.Context
  7435. }
  7436. // Create: Create a raster collection asset.
  7437. func (r *RasterCollectionsService) Create(rastercollection *RasterCollection) *RasterCollectionsCreateCall {
  7438. c := &RasterCollectionsCreateCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  7439. c.rastercollection = rastercollection
  7440. return c
  7441. }
  7442. // Fields allows partial responses to be retrieved. See
  7443. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  7444. // for more information.
  7445. func (c *RasterCollectionsCreateCall) Fields(s ...googleapi.Field) *RasterCollectionsCreateCall {
  7446. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  7447. return c
  7448. }
  7449. // Context sets the context to be used in this call's Do method. Any
  7450. // pending HTTP request will be aborted if the provided context is
  7451. // canceled.
  7452. func (c *RasterCollectionsCreateCall) Context(ctx context.Context) *RasterCollectionsCreateCall {
  7453. c.ctx_ = ctx
  7454. return c
  7455. }
  7456. func (c *RasterCollectionsCreateCall) doRequest(alt string) (*http.Response, error) {
  7457. var body io.Reader = nil
  7458. body, err := googleapi.WithoutDataWrapper.JSONReader(c.rastercollection)
  7459. if err != nil {
  7460. return nil, err
  7461. }
  7462. ctype := "application/json"
  7463. c.urlParams_.Set("alt", alt)
  7464. urls := googleapi.ResolveRelative(c.s.BasePath, "rasterCollections")
  7465. urls += "?" + c.urlParams_.Encode()
  7466. req, _ := http.NewRequest("POST", urls, body)
  7467. googleapi.SetOpaque(req.URL)
  7468. req.Header.Set("Content-Type", ctype)
  7469. req.Header.Set("User-Agent", c.s.userAgent())
  7470. if c.ctx_ != nil {
  7471. return ctxhttp.Do(c.ctx_, c.s.client, req)
  7472. }
  7473. return c.s.client.Do(req)
  7474. }
  7475. // Do executes the "mapsengine.rasterCollections.create" call.
  7476. // Exactly one of *RasterCollection or error will be non-nil. Any
  7477. // non-2xx status code is an error. Response headers are in either
  7478. // *RasterCollection.ServerResponse.Header or (if a response was
  7479. // returned at all) in error.(*googleapi.Error).Header. Use
  7480. // googleapi.IsNotModified to check whether the returned error was
  7481. // because http.StatusNotModified was returned.
  7482. func (c *RasterCollectionsCreateCall) Do(opts ...googleapi.CallOption) (*RasterCollection, error) {
  7483. gensupport.SetOptions(c.urlParams_, opts...)
  7484. res, err := c.doRequest("json")
  7485. if res != nil && res.StatusCode == http.StatusNotModified {
  7486. if res.Body != nil {
  7487. res.Body.Close()
  7488. }
  7489. return nil, &googleapi.Error{
  7490. Code: res.StatusCode,
  7491. Header: res.Header,
  7492. }
  7493. }
  7494. if err != nil {
  7495. return nil, err
  7496. }
  7497. defer googleapi.CloseBody(res)
  7498. if err := googleapi.CheckResponse(res); err != nil {
  7499. return nil, err
  7500. }
  7501. ret := &RasterCollection{
  7502. ServerResponse: googleapi.ServerResponse{
  7503. Header: res.Header,
  7504. HTTPStatusCode: res.StatusCode,
  7505. },
  7506. }
  7507. if err := json.NewDecoder(res.Body).Decode(&ret); err != nil {
  7508. return nil, err
  7509. }
  7510. return ret, nil
  7511. // {
  7512. // "description": "Create a raster collection asset.",
  7513. // "httpMethod": "POST",
  7514. // "id": "mapsengine.rasterCollections.create",
  7515. // "path": "rasterCollections",
  7516. // "request": {
  7517. // "$ref": "RasterCollection"
  7518. // },
  7519. // "response": {
  7520. // "$ref": "RasterCollection"
  7521. // },
  7522. // "scopes": [
  7523. // "https://www.googleapis.com/auth/mapsengine"
  7524. // ]
  7525. // }
  7526. }
  7527. // method id "mapsengine.rasterCollections.delete":
  7528. type RasterCollectionsDeleteCall struct {
  7529. s *Service
  7530. id string
  7531. urlParams_ gensupport.URLParams
  7532. ctx_ context.Context
  7533. }
  7534. // Delete: Delete a raster collection.
  7535. func (r *RasterCollectionsService) Delete(id string) *RasterCollectionsDeleteCall {
  7536. c := &RasterCollectionsDeleteCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  7537. c.id = id
  7538. return c
  7539. }
  7540. // Fields allows partial responses to be retrieved. See
  7541. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  7542. // for more information.
  7543. func (c *RasterCollectionsDeleteCall) Fields(s ...googleapi.Field) *RasterCollectionsDeleteCall {
  7544. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  7545. return c
  7546. }
  7547. // Context sets the context to be used in this call's Do method. Any
  7548. // pending HTTP request will be aborted if the provided context is
  7549. // canceled.
  7550. func (c *RasterCollectionsDeleteCall) Context(ctx context.Context) *RasterCollectionsDeleteCall {
  7551. c.ctx_ = ctx
  7552. return c
  7553. }
  7554. func (c *RasterCollectionsDeleteCall) doRequest(alt string) (*http.Response, error) {
  7555. var body io.Reader = nil
  7556. c.urlParams_.Set("alt", alt)
  7557. urls := googleapi.ResolveRelative(c.s.BasePath, "rasterCollections/{id}")
  7558. urls += "?" + c.urlParams_.Encode()
  7559. req, _ := http.NewRequest("DELETE", urls, body)
  7560. googleapi.Expand(req.URL, map[string]string{
  7561. "id": c.id,
  7562. })
  7563. req.Header.Set("User-Agent", c.s.userAgent())
  7564. if c.ctx_ != nil {
  7565. return ctxhttp.Do(c.ctx_, c.s.client, req)
  7566. }
  7567. return c.s.client.Do(req)
  7568. }
  7569. // Do executes the "mapsengine.rasterCollections.delete" call.
  7570. func (c *RasterCollectionsDeleteCall) Do(opts ...googleapi.CallOption) error {
  7571. gensupport.SetOptions(c.urlParams_, opts...)
  7572. res, err := c.doRequest("json")
  7573. if err != nil {
  7574. return err
  7575. }
  7576. defer googleapi.CloseBody(res)
  7577. if err := googleapi.CheckResponse(res); err != nil {
  7578. return err
  7579. }
  7580. return nil
  7581. // {
  7582. // "description": "Delete a raster collection.",
  7583. // "httpMethod": "DELETE",
  7584. // "id": "mapsengine.rasterCollections.delete",
  7585. // "parameterOrder": [
  7586. // "id"
  7587. // ],
  7588. // "parameters": {
  7589. // "id": {
  7590. // "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.",
  7591. // "location": "path",
  7592. // "required": true,
  7593. // "type": "string"
  7594. // }
  7595. // },
  7596. // "path": "rasterCollections/{id}",
  7597. // "scopes": [
  7598. // "https://www.googleapis.com/auth/mapsengine"
  7599. // ]
  7600. // }
  7601. }
  7602. // method id "mapsengine.rasterCollections.get":
  7603. type RasterCollectionsGetCall struct {
  7604. s *Service
  7605. id string
  7606. urlParams_ gensupport.URLParams
  7607. ifNoneMatch_ string
  7608. ctx_ context.Context
  7609. }
  7610. // Get: Return metadata for a particular raster collection.
  7611. func (r *RasterCollectionsService) Get(id string) *RasterCollectionsGetCall {
  7612. c := &RasterCollectionsGetCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  7613. c.id = id
  7614. return c
  7615. }
  7616. // Fields allows partial responses to be retrieved. See
  7617. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  7618. // for more information.
  7619. func (c *RasterCollectionsGetCall) Fields(s ...googleapi.Field) *RasterCollectionsGetCall {
  7620. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  7621. return c
  7622. }
  7623. // IfNoneMatch sets the optional parameter which makes the operation
  7624. // fail if the object's ETag matches the given value. This is useful for
  7625. // getting updates only after the object has changed since the last
  7626. // request. Use googleapi.IsNotModified to check whether the response
  7627. // error from Do is the result of In-None-Match.
  7628. func (c *RasterCollectionsGetCall) IfNoneMatch(entityTag string) *RasterCollectionsGetCall {
  7629. c.ifNoneMatch_ = entityTag
  7630. return c
  7631. }
  7632. // Context sets the context to be used in this call's Do method. Any
  7633. // pending HTTP request will be aborted if the provided context is
  7634. // canceled.
  7635. func (c *RasterCollectionsGetCall) Context(ctx context.Context) *RasterCollectionsGetCall {
  7636. c.ctx_ = ctx
  7637. return c
  7638. }
  7639. func (c *RasterCollectionsGetCall) doRequest(alt string) (*http.Response, error) {
  7640. var body io.Reader = nil
  7641. c.urlParams_.Set("alt", alt)
  7642. urls := googleapi.ResolveRelative(c.s.BasePath, "rasterCollections/{id}")
  7643. urls += "?" + c.urlParams_.Encode()
  7644. req, _ := http.NewRequest("GET", urls, body)
  7645. googleapi.Expand(req.URL, map[string]string{
  7646. "id": c.id,
  7647. })
  7648. req.Header.Set("User-Agent", c.s.userAgent())
  7649. if c.ifNoneMatch_ != "" {
  7650. req.Header.Set("If-None-Match", c.ifNoneMatch_)
  7651. }
  7652. if c.ctx_ != nil {
  7653. return ctxhttp.Do(c.ctx_, c.s.client, req)
  7654. }
  7655. return c.s.client.Do(req)
  7656. }
  7657. // Do executes the "mapsengine.rasterCollections.get" call.
  7658. // Exactly one of *RasterCollection or error will be non-nil. Any
  7659. // non-2xx status code is an error. Response headers are in either
  7660. // *RasterCollection.ServerResponse.Header or (if a response was
  7661. // returned at all) in error.(*googleapi.Error).Header. Use
  7662. // googleapi.IsNotModified to check whether the returned error was
  7663. // because http.StatusNotModified was returned.
  7664. func (c *RasterCollectionsGetCall) Do(opts ...googleapi.CallOption) (*RasterCollection, error) {
  7665. gensupport.SetOptions(c.urlParams_, opts...)
  7666. res, err := c.doRequest("json")
  7667. if res != nil && res.StatusCode == http.StatusNotModified {
  7668. if res.Body != nil {
  7669. res.Body.Close()
  7670. }
  7671. return nil, &googleapi.Error{
  7672. Code: res.StatusCode,
  7673. Header: res.Header,
  7674. }
  7675. }
  7676. if err != nil {
  7677. return nil, err
  7678. }
  7679. defer googleapi.CloseBody(res)
  7680. if err := googleapi.CheckResponse(res); err != nil {
  7681. return nil, err
  7682. }
  7683. ret := &RasterCollection{
  7684. ServerResponse: googleapi.ServerResponse{
  7685. Header: res.Header,
  7686. HTTPStatusCode: res.StatusCode,
  7687. },
  7688. }
  7689. if err := json.NewDecoder(res.Body).Decode(&ret); err != nil {
  7690. return nil, err
  7691. }
  7692. return ret, nil
  7693. // {
  7694. // "description": "Return metadata for a particular raster collection.",
  7695. // "httpMethod": "GET",
  7696. // "id": "mapsengine.rasterCollections.get",
  7697. // "parameterOrder": [
  7698. // "id"
  7699. // ],
  7700. // "parameters": {
  7701. // "id": {
  7702. // "description": "The ID of the raster collection.",
  7703. // "location": "path",
  7704. // "required": true,
  7705. // "type": "string"
  7706. // }
  7707. // },
  7708. // "path": "rasterCollections/{id}",
  7709. // "response": {
  7710. // "$ref": "RasterCollection"
  7711. // },
  7712. // "scopes": [
  7713. // "https://www.googleapis.com/auth/mapsengine",
  7714. // "https://www.googleapis.com/auth/mapsengine.readonly"
  7715. // ]
  7716. // }
  7717. }
  7718. // method id "mapsengine.rasterCollections.list":
  7719. type RasterCollectionsListCall struct {
  7720. s *Service
  7721. urlParams_ gensupport.URLParams
  7722. ifNoneMatch_ string
  7723. ctx_ context.Context
  7724. }
  7725. // List: Return all raster collections readable by the current user.
  7726. func (r *RasterCollectionsService) List() *RasterCollectionsListCall {
  7727. c := &RasterCollectionsListCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  7728. return c
  7729. }
  7730. // Bbox sets the optional parameter "bbox": A bounding box, expressed as
  7731. // "west,south,east,north". If set, only assets which intersect this
  7732. // bounding box will be returned.
  7733. func (c *RasterCollectionsListCall) Bbox(bbox string) *RasterCollectionsListCall {
  7734. c.urlParams_.Set("bbox", bbox)
  7735. return c
  7736. }
  7737. // CreatedAfter sets the optional parameter "createdAfter": An RFC 3339
  7738. // formatted date-time value (e.g. 1970-01-01T00:00:00Z). Returned
  7739. // assets will have been created at or after this time.
  7740. func (c *RasterCollectionsListCall) CreatedAfter(createdAfter string) *RasterCollectionsListCall {
  7741. c.urlParams_.Set("createdAfter", createdAfter)
  7742. return c
  7743. }
  7744. // CreatedBefore sets the optional parameter "createdBefore": An RFC
  7745. // 3339 formatted date-time value (e.g. 1970-01-01T00:00:00Z). Returned
  7746. // assets will have been created at or before this time.
  7747. func (c *RasterCollectionsListCall) CreatedBefore(createdBefore string) *RasterCollectionsListCall {
  7748. c.urlParams_.Set("createdBefore", createdBefore)
  7749. return c
  7750. }
  7751. // CreatorEmail sets the optional parameter "creatorEmail": An email
  7752. // address representing a user. Returned assets that have been created
  7753. // by the user associated with the provided email address.
  7754. func (c *RasterCollectionsListCall) CreatorEmail(creatorEmail string) *RasterCollectionsListCall {
  7755. c.urlParams_.Set("creatorEmail", creatorEmail)
  7756. return c
  7757. }
  7758. // MaxResults sets the optional parameter "maxResults": The maximum
  7759. // number of items to include in a single response page. The maximum
  7760. // supported value is 100.
  7761. func (c *RasterCollectionsListCall) MaxResults(maxResults int64) *RasterCollectionsListCall {
  7762. c.urlParams_.Set("maxResults", fmt.Sprint(maxResults))
  7763. return c
  7764. }
  7765. // ModifiedAfter sets the optional parameter "modifiedAfter": An RFC
  7766. // 3339 formatted date-time value (e.g. 1970-01-01T00:00:00Z). Returned
  7767. // assets will have been modified at or after this time.
  7768. func (c *RasterCollectionsListCall) ModifiedAfter(modifiedAfter string) *RasterCollectionsListCall {
  7769. c.urlParams_.Set("modifiedAfter", modifiedAfter)
  7770. return c
  7771. }
  7772. // ModifiedBefore sets the optional parameter "modifiedBefore": An RFC
  7773. // 3339 formatted date-time value (e.g. 1970-01-01T00:00:00Z). Returned
  7774. // assets will have been modified at or before this time.
  7775. func (c *RasterCollectionsListCall) ModifiedBefore(modifiedBefore string) *RasterCollectionsListCall {
  7776. c.urlParams_.Set("modifiedBefore", modifiedBefore)
  7777. return c
  7778. }
  7779. // PageToken sets the optional parameter "pageToken": The continuation
  7780. // token, used to page through large result sets. To get the next page
  7781. // of results, set this parameter to the value of nextPageToken from the
  7782. // previous response.
  7783. func (c *RasterCollectionsListCall) PageToken(pageToken string) *RasterCollectionsListCall {
  7784. c.urlParams_.Set("pageToken", pageToken)
  7785. return c
  7786. }
  7787. // ProcessingStatus sets the optional parameter "processingStatus":
  7788. //
  7789. // Possible values:
  7790. // "complete" - The raster collection has completed processing.
  7791. // "failed" - The raster collection has failed processing.
  7792. // "notReady" - The raster collection is not ready for processing.
  7793. // "processing" - The raster collection is processing.
  7794. // "ready" - The raster collection is ready for processing.
  7795. func (c *RasterCollectionsListCall) ProcessingStatus(processingStatus string) *RasterCollectionsListCall {
  7796. c.urlParams_.Set("processingStatus", processingStatus)
  7797. return c
  7798. }
  7799. // ProjectId sets the optional parameter "projectId": The ID of a Maps
  7800. // Engine project, used to filter the response. To list all available
  7801. // projects with their IDs, send a Projects: list request. You can also
  7802. // find your project ID as the value of the DashboardPlace:cid URL
  7803. // parameter when signed in to mapsengine.google.com.
  7804. func (c *RasterCollectionsListCall) ProjectId(projectId string) *RasterCollectionsListCall {
  7805. c.urlParams_.Set("projectId", projectId)
  7806. return c
  7807. }
  7808. // Role sets the optional parameter "role": The role parameter indicates
  7809. // that the response should only contain assets where the current user
  7810. // has the specified level of access.
  7811. //
  7812. // Possible values:
  7813. // "owner" - The user can read, write and administer the asset.
  7814. // "reader" - The user can read the asset.
  7815. // "writer" - The user can read and write the asset.
  7816. func (c *RasterCollectionsListCall) Role(role string) *RasterCollectionsListCall {
  7817. c.urlParams_.Set("role", role)
  7818. return c
  7819. }
  7820. // Search sets the optional parameter "search": An unstructured search
  7821. // string used to filter the set of results based on asset metadata.
  7822. func (c *RasterCollectionsListCall) Search(search string) *RasterCollectionsListCall {
  7823. c.urlParams_.Set("search", search)
  7824. return c
  7825. }
  7826. // Tags sets the optional parameter "tags": A comma separated list of
  7827. // tags. Returned assets will contain all the tags from the list.
  7828. func (c *RasterCollectionsListCall) Tags(tags string) *RasterCollectionsListCall {
  7829. c.urlParams_.Set("tags", tags)
  7830. return c
  7831. }
  7832. // Fields allows partial responses to be retrieved. See
  7833. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  7834. // for more information.
  7835. func (c *RasterCollectionsListCall) Fields(s ...googleapi.Field) *RasterCollectionsListCall {
  7836. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  7837. return c
  7838. }
  7839. // IfNoneMatch sets the optional parameter which makes the operation
  7840. // fail if the object's ETag matches the given value. This is useful for
  7841. // getting updates only after the object has changed since the last
  7842. // request. Use googleapi.IsNotModified to check whether the response
  7843. // error from Do is the result of In-None-Match.
  7844. func (c *RasterCollectionsListCall) IfNoneMatch(entityTag string) *RasterCollectionsListCall {
  7845. c.ifNoneMatch_ = entityTag
  7846. return c
  7847. }
  7848. // Context sets the context to be used in this call's Do method. Any
  7849. // pending HTTP request will be aborted if the provided context is
  7850. // canceled.
  7851. func (c *RasterCollectionsListCall) Context(ctx context.Context) *RasterCollectionsListCall {
  7852. c.ctx_ = ctx
  7853. return c
  7854. }
  7855. func (c *RasterCollectionsListCall) doRequest(alt string) (*http.Response, error) {
  7856. var body io.Reader = nil
  7857. c.urlParams_.Set("alt", alt)
  7858. urls := googleapi.ResolveRelative(c.s.BasePath, "rasterCollections")
  7859. urls += "?" + c.urlParams_.Encode()
  7860. req, _ := http.NewRequest("GET", urls, body)
  7861. googleapi.SetOpaque(req.URL)
  7862. req.Header.Set("User-Agent", c.s.userAgent())
  7863. if c.ifNoneMatch_ != "" {
  7864. req.Header.Set("If-None-Match", c.ifNoneMatch_)
  7865. }
  7866. if c.ctx_ != nil {
  7867. return ctxhttp.Do(c.ctx_, c.s.client, req)
  7868. }
  7869. return c.s.client.Do(req)
  7870. }
  7871. // Do executes the "mapsengine.rasterCollections.list" call.
  7872. // Exactly one of *RasterCollectionsListResponse or error will be
  7873. // non-nil. Any non-2xx status code is an error. Response headers are in
  7874. // either *RasterCollectionsListResponse.ServerResponse.Header or (if a
  7875. // response was returned at all) in error.(*googleapi.Error).Header. Use
  7876. // googleapi.IsNotModified to check whether the returned error was
  7877. // because http.StatusNotModified was returned.
  7878. func (c *RasterCollectionsListCall) Do(opts ...googleapi.CallOption) (*RasterCollectionsListResponse, error) {
  7879. gensupport.SetOptions(c.urlParams_, opts...)
  7880. res, err := c.doRequest("json")
  7881. if res != nil && res.StatusCode == http.StatusNotModified {
  7882. if res.Body != nil {
  7883. res.Body.Close()
  7884. }
  7885. return nil, &googleapi.Error{
  7886. Code: res.StatusCode,
  7887. Header: res.Header,
  7888. }
  7889. }
  7890. if err != nil {
  7891. return nil, err
  7892. }
  7893. defer googleapi.CloseBody(res)
  7894. if err := googleapi.CheckResponse(res); err != nil {
  7895. return nil, err
  7896. }
  7897. ret := &RasterCollectionsListResponse{
  7898. ServerResponse: googleapi.ServerResponse{
  7899. Header: res.Header,
  7900. HTTPStatusCode: res.StatusCode,
  7901. },
  7902. }
  7903. if err := json.NewDecoder(res.Body).Decode(&ret); err != nil {
  7904. return nil, err
  7905. }
  7906. return ret, nil
  7907. // {
  7908. // "description": "Return all raster collections readable by the current user.",
  7909. // "httpMethod": "GET",
  7910. // "id": "mapsengine.rasterCollections.list",
  7911. // "parameters": {
  7912. // "bbox": {
  7913. // "description": "A bounding box, expressed as \"west,south,east,north\". If set, only assets which intersect this bounding box will be returned.",
  7914. // "location": "query",
  7915. // "type": "string"
  7916. // },
  7917. // "createdAfter": {
  7918. // "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.",
  7919. // "format": "date-time",
  7920. // "location": "query",
  7921. // "type": "string"
  7922. // },
  7923. // "createdBefore": {
  7924. // "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.",
  7925. // "format": "date-time",
  7926. // "location": "query",
  7927. // "type": "string"
  7928. // },
  7929. // "creatorEmail": {
  7930. // "description": "An email address representing a user. Returned assets that have been created by the user associated with the provided email address.",
  7931. // "location": "query",
  7932. // "type": "string"
  7933. // },
  7934. // "maxResults": {
  7935. // "description": "The maximum number of items to include in a single response page. The maximum supported value is 100.",
  7936. // "format": "uint32",
  7937. // "location": "query",
  7938. // "type": "integer"
  7939. // },
  7940. // "modifiedAfter": {
  7941. // "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.",
  7942. // "format": "date-time",
  7943. // "location": "query",
  7944. // "type": "string"
  7945. // },
  7946. // "modifiedBefore": {
  7947. // "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.",
  7948. // "format": "date-time",
  7949. // "location": "query",
  7950. // "type": "string"
  7951. // },
  7952. // "pageToken": {
  7953. // "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.",
  7954. // "location": "query",
  7955. // "type": "string"
  7956. // },
  7957. // "processingStatus": {
  7958. // "enum": [
  7959. // "complete",
  7960. // "failed",
  7961. // "notReady",
  7962. // "processing",
  7963. // "ready"
  7964. // ],
  7965. // "enumDescriptions": [
  7966. // "The raster collection has completed processing.",
  7967. // "The raster collection has failed processing.",
  7968. // "The raster collection is not ready for processing.",
  7969. // "The raster collection is processing.",
  7970. // "The raster collection is ready for processing."
  7971. // ],
  7972. // "location": "query",
  7973. // "type": "string"
  7974. // },
  7975. // "projectId": {
  7976. // "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.",
  7977. // "location": "query",
  7978. // "type": "string"
  7979. // },
  7980. // "role": {
  7981. // "description": "The role parameter indicates that the response should only contain assets where the current user has the specified level of access.",
  7982. // "enum": [
  7983. // "owner",
  7984. // "reader",
  7985. // "writer"
  7986. // ],
  7987. // "enumDescriptions": [
  7988. // "The user can read, write and administer the asset.",
  7989. // "The user can read the asset.",
  7990. // "The user can read and write the asset."
  7991. // ],
  7992. // "location": "query",
  7993. // "type": "string"
  7994. // },
  7995. // "search": {
  7996. // "description": "An unstructured search string used to filter the set of results based on asset metadata.",
  7997. // "location": "query",
  7998. // "type": "string"
  7999. // },
  8000. // "tags": {
  8001. // "description": "A comma separated list of tags. Returned assets will contain all the tags from the list.",
  8002. // "location": "query",
  8003. // "type": "string"
  8004. // }
  8005. // },
  8006. // "path": "rasterCollections",
  8007. // "response": {
  8008. // "$ref": "RasterCollectionsListResponse"
  8009. // },
  8010. // "scopes": [
  8011. // "https://www.googleapis.com/auth/mapsengine",
  8012. // "https://www.googleapis.com/auth/mapsengine.readonly"
  8013. // ]
  8014. // }
  8015. }
  8016. // Pages invokes f for each page of results.
  8017. // A non-nil error returned from f will halt the iteration.
  8018. // The provided context supersedes any context provided to the Context method.
  8019. func (c *RasterCollectionsListCall) Pages(ctx context.Context, f func(*RasterCollectionsListResponse) error) error {
  8020. c.ctx_ = ctx
  8021. defer c.PageToken(c.urlParams_.Get("pageToken")) // reset paging to original point
  8022. for {
  8023. x, err := c.Do()
  8024. if err != nil {
  8025. return err
  8026. }
  8027. if err := f(x); err != nil {
  8028. return err
  8029. }
  8030. if x.NextPageToken == "" {
  8031. return nil
  8032. }
  8033. c.PageToken(x.NextPageToken)
  8034. }
  8035. }
  8036. // method id "mapsengine.rasterCollections.patch":
  8037. type RasterCollectionsPatchCall struct {
  8038. s *Service
  8039. id string
  8040. rastercollection *RasterCollection
  8041. urlParams_ gensupport.URLParams
  8042. ctx_ context.Context
  8043. }
  8044. // Patch: Mutate a raster collection asset.
  8045. func (r *RasterCollectionsService) Patch(id string, rastercollection *RasterCollection) *RasterCollectionsPatchCall {
  8046. c := &RasterCollectionsPatchCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  8047. c.id = id
  8048. c.rastercollection = rastercollection
  8049. return c
  8050. }
  8051. // Fields allows partial responses to be retrieved. See
  8052. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  8053. // for more information.
  8054. func (c *RasterCollectionsPatchCall) Fields(s ...googleapi.Field) *RasterCollectionsPatchCall {
  8055. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  8056. return c
  8057. }
  8058. // Context sets the context to be used in this call's Do method. Any
  8059. // pending HTTP request will be aborted if the provided context is
  8060. // canceled.
  8061. func (c *RasterCollectionsPatchCall) Context(ctx context.Context) *RasterCollectionsPatchCall {
  8062. c.ctx_ = ctx
  8063. return c
  8064. }
  8065. func (c *RasterCollectionsPatchCall) doRequest(alt string) (*http.Response, error) {
  8066. var body io.Reader = nil
  8067. body, err := googleapi.WithoutDataWrapper.JSONReader(c.rastercollection)
  8068. if err != nil {
  8069. return nil, err
  8070. }
  8071. ctype := "application/json"
  8072. c.urlParams_.Set("alt", alt)
  8073. urls := googleapi.ResolveRelative(c.s.BasePath, "rasterCollections/{id}")
  8074. urls += "?" + c.urlParams_.Encode()
  8075. req, _ := http.NewRequest("PATCH", urls, body)
  8076. googleapi.Expand(req.URL, map[string]string{
  8077. "id": c.id,
  8078. })
  8079. req.Header.Set("Content-Type", ctype)
  8080. req.Header.Set("User-Agent", c.s.userAgent())
  8081. if c.ctx_ != nil {
  8082. return ctxhttp.Do(c.ctx_, c.s.client, req)
  8083. }
  8084. return c.s.client.Do(req)
  8085. }
  8086. // Do executes the "mapsengine.rasterCollections.patch" call.
  8087. func (c *RasterCollectionsPatchCall) Do(opts ...googleapi.CallOption) error {
  8088. gensupport.SetOptions(c.urlParams_, opts...)
  8089. res, err := c.doRequest("json")
  8090. if err != nil {
  8091. return err
  8092. }
  8093. defer googleapi.CloseBody(res)
  8094. if err := googleapi.CheckResponse(res); err != nil {
  8095. return err
  8096. }
  8097. return nil
  8098. // {
  8099. // "description": "Mutate a raster collection asset.",
  8100. // "httpMethod": "PATCH",
  8101. // "id": "mapsengine.rasterCollections.patch",
  8102. // "parameterOrder": [
  8103. // "id"
  8104. // ],
  8105. // "parameters": {
  8106. // "id": {
  8107. // "description": "The ID of the raster collection.",
  8108. // "location": "path",
  8109. // "required": true,
  8110. // "type": "string"
  8111. // }
  8112. // },
  8113. // "path": "rasterCollections/{id}",
  8114. // "request": {
  8115. // "$ref": "RasterCollection"
  8116. // },
  8117. // "scopes": [
  8118. // "https://www.googleapis.com/auth/mapsengine"
  8119. // ]
  8120. // }
  8121. }
  8122. // method id "mapsengine.rasterCollections.process":
  8123. type RasterCollectionsProcessCall struct {
  8124. s *Service
  8125. id string
  8126. urlParams_ gensupport.URLParams
  8127. ctx_ context.Context
  8128. }
  8129. // Process: Process a raster collection asset.
  8130. func (r *RasterCollectionsService) Process(id string) *RasterCollectionsProcessCall {
  8131. c := &RasterCollectionsProcessCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  8132. c.id = id
  8133. return c
  8134. }
  8135. // Fields allows partial responses to be retrieved. See
  8136. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  8137. // for more information.
  8138. func (c *RasterCollectionsProcessCall) Fields(s ...googleapi.Field) *RasterCollectionsProcessCall {
  8139. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  8140. return c
  8141. }
  8142. // Context sets the context to be used in this call's Do method. Any
  8143. // pending HTTP request will be aborted if the provided context is
  8144. // canceled.
  8145. func (c *RasterCollectionsProcessCall) Context(ctx context.Context) *RasterCollectionsProcessCall {
  8146. c.ctx_ = ctx
  8147. return c
  8148. }
  8149. func (c *RasterCollectionsProcessCall) doRequest(alt string) (*http.Response, error) {
  8150. var body io.Reader = nil
  8151. c.urlParams_.Set("alt", alt)
  8152. urls := googleapi.ResolveRelative(c.s.BasePath, "rasterCollections/{id}/process")
  8153. urls += "?" + c.urlParams_.Encode()
  8154. req, _ := http.NewRequest("POST", urls, body)
  8155. googleapi.Expand(req.URL, map[string]string{
  8156. "id": c.id,
  8157. })
  8158. req.Header.Set("User-Agent", c.s.userAgent())
  8159. if c.ctx_ != nil {
  8160. return ctxhttp.Do(c.ctx_, c.s.client, req)
  8161. }
  8162. return c.s.client.Do(req)
  8163. }
  8164. // Do executes the "mapsengine.rasterCollections.process" call.
  8165. // Exactly one of *ProcessResponse or error will be non-nil. Any non-2xx
  8166. // status code is an error. Response headers are in either
  8167. // *ProcessResponse.ServerResponse.Header or (if a response was returned
  8168. // at all) in error.(*googleapi.Error).Header. Use
  8169. // googleapi.IsNotModified to check whether the returned error was
  8170. // because http.StatusNotModified was returned.
  8171. func (c *RasterCollectionsProcessCall) Do(opts ...googleapi.CallOption) (*ProcessResponse, error) {
  8172. gensupport.SetOptions(c.urlParams_, opts...)
  8173. res, err := c.doRequest("json")
  8174. if res != nil && res.StatusCode == http.StatusNotModified {
  8175. if res.Body != nil {
  8176. res.Body.Close()
  8177. }
  8178. return nil, &googleapi.Error{
  8179. Code: res.StatusCode,
  8180. Header: res.Header,
  8181. }
  8182. }
  8183. if err != nil {
  8184. return nil, err
  8185. }
  8186. defer googleapi.CloseBody(res)
  8187. if err := googleapi.CheckResponse(res); err != nil {
  8188. return nil, err
  8189. }
  8190. ret := &ProcessResponse{
  8191. ServerResponse: googleapi.ServerResponse{
  8192. Header: res.Header,
  8193. HTTPStatusCode: res.StatusCode,
  8194. },
  8195. }
  8196. if err := json.NewDecoder(res.Body).Decode(&ret); err != nil {
  8197. return nil, err
  8198. }
  8199. return ret, nil
  8200. // {
  8201. // "description": "Process a raster collection asset.",
  8202. // "httpMethod": "POST",
  8203. // "id": "mapsengine.rasterCollections.process",
  8204. // "parameterOrder": [
  8205. // "id"
  8206. // ],
  8207. // "parameters": {
  8208. // "id": {
  8209. // "description": "The ID of the raster collection.",
  8210. // "location": "path",
  8211. // "required": true,
  8212. // "type": "string"
  8213. // }
  8214. // },
  8215. // "path": "rasterCollections/{id}/process",
  8216. // "response": {
  8217. // "$ref": "ProcessResponse"
  8218. // },
  8219. // "scopes": [
  8220. // "https://www.googleapis.com/auth/mapsengine"
  8221. // ]
  8222. // }
  8223. }
  8224. // method id "mapsengine.rasterCollections.parents.list":
  8225. type RasterCollectionsParentsListCall struct {
  8226. s *Service
  8227. id string
  8228. urlParams_ gensupport.URLParams
  8229. ifNoneMatch_ string
  8230. ctx_ context.Context
  8231. }
  8232. // List: Return all parent ids of the specified raster collection.
  8233. func (r *RasterCollectionsParentsService) List(id string) *RasterCollectionsParentsListCall {
  8234. c := &RasterCollectionsParentsListCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  8235. c.id = id
  8236. return c
  8237. }
  8238. // MaxResults sets the optional parameter "maxResults": The maximum
  8239. // number of items to include in a single response page. The maximum
  8240. // supported value is 50.
  8241. func (c *RasterCollectionsParentsListCall) MaxResults(maxResults int64) *RasterCollectionsParentsListCall {
  8242. c.urlParams_.Set("maxResults", fmt.Sprint(maxResults))
  8243. return c
  8244. }
  8245. // PageToken sets the optional parameter "pageToken": The continuation
  8246. // token, used to page through large result sets. To get the next page
  8247. // of results, set this parameter to the value of nextPageToken from the
  8248. // previous response.
  8249. func (c *RasterCollectionsParentsListCall) PageToken(pageToken string) *RasterCollectionsParentsListCall {
  8250. c.urlParams_.Set("pageToken", pageToken)
  8251. return c
  8252. }
  8253. // Fields allows partial responses to be retrieved. See
  8254. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  8255. // for more information.
  8256. func (c *RasterCollectionsParentsListCall) Fields(s ...googleapi.Field) *RasterCollectionsParentsListCall {
  8257. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  8258. return c
  8259. }
  8260. // IfNoneMatch sets the optional parameter which makes the operation
  8261. // fail if the object's ETag matches the given value. This is useful for
  8262. // getting updates only after the object has changed since the last
  8263. // request. Use googleapi.IsNotModified to check whether the response
  8264. // error from Do is the result of In-None-Match.
  8265. func (c *RasterCollectionsParentsListCall) IfNoneMatch(entityTag string) *RasterCollectionsParentsListCall {
  8266. c.ifNoneMatch_ = entityTag
  8267. return c
  8268. }
  8269. // Context sets the context to be used in this call's Do method. Any
  8270. // pending HTTP request will be aborted if the provided context is
  8271. // canceled.
  8272. func (c *RasterCollectionsParentsListCall) Context(ctx context.Context) *RasterCollectionsParentsListCall {
  8273. c.ctx_ = ctx
  8274. return c
  8275. }
  8276. func (c *RasterCollectionsParentsListCall) doRequest(alt string) (*http.Response, error) {
  8277. var body io.Reader = nil
  8278. c.urlParams_.Set("alt", alt)
  8279. urls := googleapi.ResolveRelative(c.s.BasePath, "rasterCollections/{id}/parents")
  8280. urls += "?" + c.urlParams_.Encode()
  8281. req, _ := http.NewRequest("GET", urls, body)
  8282. googleapi.Expand(req.URL, map[string]string{
  8283. "id": c.id,
  8284. })
  8285. req.Header.Set("User-Agent", c.s.userAgent())
  8286. if c.ifNoneMatch_ != "" {
  8287. req.Header.Set("If-None-Match", c.ifNoneMatch_)
  8288. }
  8289. if c.ctx_ != nil {
  8290. return ctxhttp.Do(c.ctx_, c.s.client, req)
  8291. }
  8292. return c.s.client.Do(req)
  8293. }
  8294. // Do executes the "mapsengine.rasterCollections.parents.list" call.
  8295. // Exactly one of *ParentsListResponse or error will be non-nil. Any
  8296. // non-2xx status code is an error. Response headers are in either
  8297. // *ParentsListResponse.ServerResponse.Header or (if a response was
  8298. // returned at all) in error.(*googleapi.Error).Header. Use
  8299. // googleapi.IsNotModified to check whether the returned error was
  8300. // because http.StatusNotModified was returned.
  8301. func (c *RasterCollectionsParentsListCall) Do(opts ...googleapi.CallOption) (*ParentsListResponse, error) {
  8302. gensupport.SetOptions(c.urlParams_, opts...)
  8303. res, err := c.doRequest("json")
  8304. if res != nil && res.StatusCode == http.StatusNotModified {
  8305. if res.Body != nil {
  8306. res.Body.Close()
  8307. }
  8308. return nil, &googleapi.Error{
  8309. Code: res.StatusCode,
  8310. Header: res.Header,
  8311. }
  8312. }
  8313. if err != nil {
  8314. return nil, err
  8315. }
  8316. defer googleapi.CloseBody(res)
  8317. if err := googleapi.CheckResponse(res); err != nil {
  8318. return nil, err
  8319. }
  8320. ret := &ParentsListResponse{
  8321. ServerResponse: googleapi.ServerResponse{
  8322. Header: res.Header,
  8323. HTTPStatusCode: res.StatusCode,
  8324. },
  8325. }
  8326. if err := json.NewDecoder(res.Body).Decode(&ret); err != nil {
  8327. return nil, err
  8328. }
  8329. return ret, nil
  8330. // {
  8331. // "description": "Return all parent ids of the specified raster collection.",
  8332. // "httpMethod": "GET",
  8333. // "id": "mapsengine.rasterCollections.parents.list",
  8334. // "parameterOrder": [
  8335. // "id"
  8336. // ],
  8337. // "parameters": {
  8338. // "id": {
  8339. // "description": "The ID of the raster collection whose parents will be listed.",
  8340. // "location": "path",
  8341. // "required": true,
  8342. // "type": "string"
  8343. // },
  8344. // "maxResults": {
  8345. // "description": "The maximum number of items to include in a single response page. The maximum supported value is 50.",
  8346. // "format": "uint32",
  8347. // "location": "query",
  8348. // "type": "integer"
  8349. // },
  8350. // "pageToken": {
  8351. // "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.",
  8352. // "location": "query",
  8353. // "type": "string"
  8354. // }
  8355. // },
  8356. // "path": "rasterCollections/{id}/parents",
  8357. // "response": {
  8358. // "$ref": "ParentsListResponse"
  8359. // },
  8360. // "scopes": [
  8361. // "https://www.googleapis.com/auth/mapsengine",
  8362. // "https://www.googleapis.com/auth/mapsengine.readonly"
  8363. // ]
  8364. // }
  8365. }
  8366. // Pages invokes f for each page of results.
  8367. // A non-nil error returned from f will halt the iteration.
  8368. // The provided context supersedes any context provided to the Context method.
  8369. func (c *RasterCollectionsParentsListCall) Pages(ctx context.Context, f func(*ParentsListResponse) error) error {
  8370. c.ctx_ = ctx
  8371. defer c.PageToken(c.urlParams_.Get("pageToken")) // reset paging to original point
  8372. for {
  8373. x, err := c.Do()
  8374. if err != nil {
  8375. return err
  8376. }
  8377. if err := f(x); err != nil {
  8378. return err
  8379. }
  8380. if x.NextPageToken == "" {
  8381. return nil
  8382. }
  8383. c.PageToken(x.NextPageToken)
  8384. }
  8385. }
  8386. // method id "mapsengine.rasterCollections.permissions.batchDelete":
  8387. type RasterCollectionsPermissionsBatchDeleteCall struct {
  8388. s *Service
  8389. id string
  8390. permissionsbatchdeleterequest *PermissionsBatchDeleteRequest
  8391. urlParams_ gensupport.URLParams
  8392. ctx_ context.Context
  8393. }
  8394. // BatchDelete: Remove permission entries from an already existing
  8395. // asset.
  8396. func (r *RasterCollectionsPermissionsService) BatchDelete(id string, permissionsbatchdeleterequest *PermissionsBatchDeleteRequest) *RasterCollectionsPermissionsBatchDeleteCall {
  8397. c := &RasterCollectionsPermissionsBatchDeleteCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  8398. c.id = id
  8399. c.permissionsbatchdeleterequest = permissionsbatchdeleterequest
  8400. return c
  8401. }
  8402. // Fields allows partial responses to be retrieved. See
  8403. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  8404. // for more information.
  8405. func (c *RasterCollectionsPermissionsBatchDeleteCall) Fields(s ...googleapi.Field) *RasterCollectionsPermissionsBatchDeleteCall {
  8406. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  8407. return c
  8408. }
  8409. // Context sets the context to be used in this call's Do method. Any
  8410. // pending HTTP request will be aborted if the provided context is
  8411. // canceled.
  8412. func (c *RasterCollectionsPermissionsBatchDeleteCall) Context(ctx context.Context) *RasterCollectionsPermissionsBatchDeleteCall {
  8413. c.ctx_ = ctx
  8414. return c
  8415. }
  8416. func (c *RasterCollectionsPermissionsBatchDeleteCall) doRequest(alt string) (*http.Response, error) {
  8417. var body io.Reader = nil
  8418. body, err := googleapi.WithoutDataWrapper.JSONReader(c.permissionsbatchdeleterequest)
  8419. if err != nil {
  8420. return nil, err
  8421. }
  8422. ctype := "application/json"
  8423. c.urlParams_.Set("alt", alt)
  8424. urls := googleapi.ResolveRelative(c.s.BasePath, "rasterCollections/{id}/permissions/batchDelete")
  8425. urls += "?" + c.urlParams_.Encode()
  8426. req, _ := http.NewRequest("POST", urls, body)
  8427. googleapi.Expand(req.URL, map[string]string{
  8428. "id": c.id,
  8429. })
  8430. req.Header.Set("Content-Type", ctype)
  8431. req.Header.Set("User-Agent", c.s.userAgent())
  8432. if c.ctx_ != nil {
  8433. return ctxhttp.Do(c.ctx_, c.s.client, req)
  8434. }
  8435. return c.s.client.Do(req)
  8436. }
  8437. // Do executes the "mapsengine.rasterCollections.permissions.batchDelete" call.
  8438. // Exactly one of *PermissionsBatchDeleteResponse or error will be
  8439. // non-nil. Any non-2xx status code is an error. Response headers are in
  8440. // either *PermissionsBatchDeleteResponse.ServerResponse.Header or (if a
  8441. // response was returned at all) in error.(*googleapi.Error).Header. Use
  8442. // googleapi.IsNotModified to check whether the returned error was
  8443. // because http.StatusNotModified was returned.
  8444. func (c *RasterCollectionsPermissionsBatchDeleteCall) Do(opts ...googleapi.CallOption) (*PermissionsBatchDeleteResponse, error) {
  8445. gensupport.SetOptions(c.urlParams_, opts...)
  8446. res, err := c.doRequest("json")
  8447. if res != nil && res.StatusCode == http.StatusNotModified {
  8448. if res.Body != nil {
  8449. res.Body.Close()
  8450. }
  8451. return nil, &googleapi.Error{
  8452. Code: res.StatusCode,
  8453. Header: res.Header,
  8454. }
  8455. }
  8456. if err != nil {
  8457. return nil, err
  8458. }
  8459. defer googleapi.CloseBody(res)
  8460. if err := googleapi.CheckResponse(res); err != nil {
  8461. return nil, err
  8462. }
  8463. ret := &PermissionsBatchDeleteResponse{
  8464. ServerResponse: googleapi.ServerResponse{
  8465. Header: res.Header,
  8466. HTTPStatusCode: res.StatusCode,
  8467. },
  8468. }
  8469. if err := json.NewDecoder(res.Body).Decode(&ret); err != nil {
  8470. return nil, err
  8471. }
  8472. return ret, nil
  8473. // {
  8474. // "description": "Remove permission entries from an already existing asset.",
  8475. // "httpMethod": "POST",
  8476. // "id": "mapsengine.rasterCollections.permissions.batchDelete",
  8477. // "parameterOrder": [
  8478. // "id"
  8479. // ],
  8480. // "parameters": {
  8481. // "id": {
  8482. // "description": "The ID of the asset from which permissions will be removed.",
  8483. // "location": "path",
  8484. // "required": true,
  8485. // "type": "string"
  8486. // }
  8487. // },
  8488. // "path": "rasterCollections/{id}/permissions/batchDelete",
  8489. // "request": {
  8490. // "$ref": "PermissionsBatchDeleteRequest"
  8491. // },
  8492. // "response": {
  8493. // "$ref": "PermissionsBatchDeleteResponse"
  8494. // },
  8495. // "scopes": [
  8496. // "https://www.googleapis.com/auth/mapsengine"
  8497. // ]
  8498. // }
  8499. }
  8500. // method id "mapsengine.rasterCollections.permissions.batchUpdate":
  8501. type RasterCollectionsPermissionsBatchUpdateCall struct {
  8502. s *Service
  8503. id string
  8504. permissionsbatchupdaterequest *PermissionsBatchUpdateRequest
  8505. urlParams_ gensupport.URLParams
  8506. ctx_ context.Context
  8507. }
  8508. // BatchUpdate: Add or update permission entries to an already existing
  8509. // asset.
  8510. //
  8511. // An asset can hold up to 20 different permission entries. Each
  8512. // batchInsert request is atomic.
  8513. func (r *RasterCollectionsPermissionsService) BatchUpdate(id string, permissionsbatchupdaterequest *PermissionsBatchUpdateRequest) *RasterCollectionsPermissionsBatchUpdateCall {
  8514. c := &RasterCollectionsPermissionsBatchUpdateCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  8515. c.id = id
  8516. c.permissionsbatchupdaterequest = permissionsbatchupdaterequest
  8517. return c
  8518. }
  8519. // Fields allows partial responses to be retrieved. See
  8520. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  8521. // for more information.
  8522. func (c *RasterCollectionsPermissionsBatchUpdateCall) Fields(s ...googleapi.Field) *RasterCollectionsPermissionsBatchUpdateCall {
  8523. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  8524. return c
  8525. }
  8526. // Context sets the context to be used in this call's Do method. Any
  8527. // pending HTTP request will be aborted if the provided context is
  8528. // canceled.
  8529. func (c *RasterCollectionsPermissionsBatchUpdateCall) Context(ctx context.Context) *RasterCollectionsPermissionsBatchUpdateCall {
  8530. c.ctx_ = ctx
  8531. return c
  8532. }
  8533. func (c *RasterCollectionsPermissionsBatchUpdateCall) doRequest(alt string) (*http.Response, error) {
  8534. var body io.Reader = nil
  8535. body, err := googleapi.WithoutDataWrapper.JSONReader(c.permissionsbatchupdaterequest)
  8536. if err != nil {
  8537. return nil, err
  8538. }
  8539. ctype := "application/json"
  8540. c.urlParams_.Set("alt", alt)
  8541. urls := googleapi.ResolveRelative(c.s.BasePath, "rasterCollections/{id}/permissions/batchUpdate")
  8542. urls += "?" + c.urlParams_.Encode()
  8543. req, _ := http.NewRequest("POST", urls, body)
  8544. googleapi.Expand(req.URL, map[string]string{
  8545. "id": c.id,
  8546. })
  8547. req.Header.Set("Content-Type", ctype)
  8548. req.Header.Set("User-Agent", c.s.userAgent())
  8549. if c.ctx_ != nil {
  8550. return ctxhttp.Do(c.ctx_, c.s.client, req)
  8551. }
  8552. return c.s.client.Do(req)
  8553. }
  8554. // Do executes the "mapsengine.rasterCollections.permissions.batchUpdate" call.
  8555. // Exactly one of *PermissionsBatchUpdateResponse or error will be
  8556. // non-nil. Any non-2xx status code is an error. Response headers are in
  8557. // either *PermissionsBatchUpdateResponse.ServerResponse.Header or (if a
  8558. // response was returned at all) in error.(*googleapi.Error).Header. Use
  8559. // googleapi.IsNotModified to check whether the returned error was
  8560. // because http.StatusNotModified was returned.
  8561. func (c *RasterCollectionsPermissionsBatchUpdateCall) Do(opts ...googleapi.CallOption) (*PermissionsBatchUpdateResponse, error) {
  8562. gensupport.SetOptions(c.urlParams_, opts...)
  8563. res, err := c.doRequest("json")
  8564. if res != nil && res.StatusCode == http.StatusNotModified {
  8565. if res.Body != nil {
  8566. res.Body.Close()
  8567. }
  8568. return nil, &googleapi.Error{
  8569. Code: res.StatusCode,
  8570. Header: res.Header,
  8571. }
  8572. }
  8573. if err != nil {
  8574. return nil, err
  8575. }
  8576. defer googleapi.CloseBody(res)
  8577. if err := googleapi.CheckResponse(res); err != nil {
  8578. return nil, err
  8579. }
  8580. ret := &PermissionsBatchUpdateResponse{
  8581. ServerResponse: googleapi.ServerResponse{
  8582. Header: res.Header,
  8583. HTTPStatusCode: res.StatusCode,
  8584. },
  8585. }
  8586. if err := json.NewDecoder(res.Body).Decode(&ret); err != nil {
  8587. return nil, err
  8588. }
  8589. return ret, nil
  8590. // {
  8591. // "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.",
  8592. // "httpMethod": "POST",
  8593. // "id": "mapsengine.rasterCollections.permissions.batchUpdate",
  8594. // "parameterOrder": [
  8595. // "id"
  8596. // ],
  8597. // "parameters": {
  8598. // "id": {
  8599. // "description": "The ID of the asset to which permissions will be added.",
  8600. // "location": "path",
  8601. // "required": true,
  8602. // "type": "string"
  8603. // }
  8604. // },
  8605. // "path": "rasterCollections/{id}/permissions/batchUpdate",
  8606. // "request": {
  8607. // "$ref": "PermissionsBatchUpdateRequest"
  8608. // },
  8609. // "response": {
  8610. // "$ref": "PermissionsBatchUpdateResponse"
  8611. // },
  8612. // "scopes": [
  8613. // "https://www.googleapis.com/auth/mapsengine"
  8614. // ]
  8615. // }
  8616. }
  8617. // method id "mapsengine.rasterCollections.permissions.list":
  8618. type RasterCollectionsPermissionsListCall struct {
  8619. s *Service
  8620. id string
  8621. urlParams_ gensupport.URLParams
  8622. ifNoneMatch_ string
  8623. ctx_ context.Context
  8624. }
  8625. // List: Return all of the permissions for the specified asset.
  8626. func (r *RasterCollectionsPermissionsService) List(id string) *RasterCollectionsPermissionsListCall {
  8627. c := &RasterCollectionsPermissionsListCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  8628. c.id = id
  8629. return c
  8630. }
  8631. // Fields allows partial responses to be retrieved. See
  8632. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  8633. // for more information.
  8634. func (c *RasterCollectionsPermissionsListCall) Fields(s ...googleapi.Field) *RasterCollectionsPermissionsListCall {
  8635. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  8636. return c
  8637. }
  8638. // IfNoneMatch sets the optional parameter which makes the operation
  8639. // fail if the object's ETag matches the given value. This is useful for
  8640. // getting updates only after the object has changed since the last
  8641. // request. Use googleapi.IsNotModified to check whether the response
  8642. // error from Do is the result of In-None-Match.
  8643. func (c *RasterCollectionsPermissionsListCall) IfNoneMatch(entityTag string) *RasterCollectionsPermissionsListCall {
  8644. c.ifNoneMatch_ = entityTag
  8645. return c
  8646. }
  8647. // Context sets the context to be used in this call's Do method. Any
  8648. // pending HTTP request will be aborted if the provided context is
  8649. // canceled.
  8650. func (c *RasterCollectionsPermissionsListCall) Context(ctx context.Context) *RasterCollectionsPermissionsListCall {
  8651. c.ctx_ = ctx
  8652. return c
  8653. }
  8654. func (c *RasterCollectionsPermissionsListCall) doRequest(alt string) (*http.Response, error) {
  8655. var body io.Reader = nil
  8656. c.urlParams_.Set("alt", alt)
  8657. urls := googleapi.ResolveRelative(c.s.BasePath, "rasterCollections/{id}/permissions")
  8658. urls += "?" + c.urlParams_.Encode()
  8659. req, _ := http.NewRequest("GET", urls, body)
  8660. googleapi.Expand(req.URL, map[string]string{
  8661. "id": c.id,
  8662. })
  8663. req.Header.Set("User-Agent", c.s.userAgent())
  8664. if c.ifNoneMatch_ != "" {
  8665. req.Header.Set("If-None-Match", c.ifNoneMatch_)
  8666. }
  8667. if c.ctx_ != nil {
  8668. return ctxhttp.Do(c.ctx_, c.s.client, req)
  8669. }
  8670. return c.s.client.Do(req)
  8671. }
  8672. // Do executes the "mapsengine.rasterCollections.permissions.list" call.
  8673. // Exactly one of *PermissionsListResponse or error will be non-nil. Any
  8674. // non-2xx status code is an error. Response headers are in either
  8675. // *PermissionsListResponse.ServerResponse.Header or (if a response was
  8676. // returned at all) in error.(*googleapi.Error).Header. Use
  8677. // googleapi.IsNotModified to check whether the returned error was
  8678. // because http.StatusNotModified was returned.
  8679. func (c *RasterCollectionsPermissionsListCall) Do(opts ...googleapi.CallOption) (*PermissionsListResponse, error) {
  8680. gensupport.SetOptions(c.urlParams_, opts...)
  8681. res, err := c.doRequest("json")
  8682. if res != nil && res.StatusCode == http.StatusNotModified {
  8683. if res.Body != nil {
  8684. res.Body.Close()
  8685. }
  8686. return nil, &googleapi.Error{
  8687. Code: res.StatusCode,
  8688. Header: res.Header,
  8689. }
  8690. }
  8691. if err != nil {
  8692. return nil, err
  8693. }
  8694. defer googleapi.CloseBody(res)
  8695. if err := googleapi.CheckResponse(res); err != nil {
  8696. return nil, err
  8697. }
  8698. ret := &PermissionsListResponse{
  8699. ServerResponse: googleapi.ServerResponse{
  8700. Header: res.Header,
  8701. HTTPStatusCode: res.StatusCode,
  8702. },
  8703. }
  8704. if err := json.NewDecoder(res.Body).Decode(&ret); err != nil {
  8705. return nil, err
  8706. }
  8707. return ret, nil
  8708. // {
  8709. // "description": "Return all of the permissions for the specified asset.",
  8710. // "httpMethod": "GET",
  8711. // "id": "mapsengine.rasterCollections.permissions.list",
  8712. // "parameterOrder": [
  8713. // "id"
  8714. // ],
  8715. // "parameters": {
  8716. // "id": {
  8717. // "description": "The ID of the asset whose permissions will be listed.",
  8718. // "location": "path",
  8719. // "required": true,
  8720. // "type": "string"
  8721. // }
  8722. // },
  8723. // "path": "rasterCollections/{id}/permissions",
  8724. // "response": {
  8725. // "$ref": "PermissionsListResponse"
  8726. // },
  8727. // "scopes": [
  8728. // "https://www.googleapis.com/auth/mapsengine",
  8729. // "https://www.googleapis.com/auth/mapsengine.readonly"
  8730. // ]
  8731. // }
  8732. }
  8733. // method id "mapsengine.rasterCollections.rasters.batchDelete":
  8734. type RasterCollectionsRastersBatchDeleteCall struct {
  8735. s *Service
  8736. id string
  8737. rastercollectionsrasterbatchdeleterequest *RasterCollectionsRasterBatchDeleteRequest
  8738. urlParams_ gensupport.URLParams
  8739. ctx_ context.Context
  8740. }
  8741. // BatchDelete: Remove rasters from an existing raster collection.
  8742. //
  8743. // Up to 50 rasters can be included in a single batchDelete request.
  8744. // Each batchDelete request is atomic.
  8745. func (r *RasterCollectionsRastersService) BatchDelete(id string, rastercollectionsrasterbatchdeleterequest *RasterCollectionsRasterBatchDeleteRequest) *RasterCollectionsRastersBatchDeleteCall {
  8746. c := &RasterCollectionsRastersBatchDeleteCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  8747. c.id = id
  8748. c.rastercollectionsrasterbatchdeleterequest = rastercollectionsrasterbatchdeleterequest
  8749. return c
  8750. }
  8751. // Fields allows partial responses to be retrieved. See
  8752. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  8753. // for more information.
  8754. func (c *RasterCollectionsRastersBatchDeleteCall) Fields(s ...googleapi.Field) *RasterCollectionsRastersBatchDeleteCall {
  8755. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  8756. return c
  8757. }
  8758. // Context sets the context to be used in this call's Do method. Any
  8759. // pending HTTP request will be aborted if the provided context is
  8760. // canceled.
  8761. func (c *RasterCollectionsRastersBatchDeleteCall) Context(ctx context.Context) *RasterCollectionsRastersBatchDeleteCall {
  8762. c.ctx_ = ctx
  8763. return c
  8764. }
  8765. func (c *RasterCollectionsRastersBatchDeleteCall) doRequest(alt string) (*http.Response, error) {
  8766. var body io.Reader = nil
  8767. body, err := googleapi.WithoutDataWrapper.JSONReader(c.rastercollectionsrasterbatchdeleterequest)
  8768. if err != nil {
  8769. return nil, err
  8770. }
  8771. ctype := "application/json"
  8772. c.urlParams_.Set("alt", alt)
  8773. urls := googleapi.ResolveRelative(c.s.BasePath, "rasterCollections/{id}/rasters/batchDelete")
  8774. urls += "?" + c.urlParams_.Encode()
  8775. req, _ := http.NewRequest("POST", urls, body)
  8776. googleapi.Expand(req.URL, map[string]string{
  8777. "id": c.id,
  8778. })
  8779. req.Header.Set("Content-Type", ctype)
  8780. req.Header.Set("User-Agent", c.s.userAgent())
  8781. if c.ctx_ != nil {
  8782. return ctxhttp.Do(c.ctx_, c.s.client, req)
  8783. }
  8784. return c.s.client.Do(req)
  8785. }
  8786. // Do executes the "mapsengine.rasterCollections.rasters.batchDelete" call.
  8787. // Exactly one of *RasterCollectionsRastersBatchDeleteResponse or error
  8788. // will be non-nil. Any non-2xx status code is an error. Response
  8789. // headers are in either
  8790. // *RasterCollectionsRastersBatchDeleteResponse.ServerResponse.Header or
  8791. // (if a response was returned at all) in
  8792. // error.(*googleapi.Error).Header. Use googleapi.IsNotModified to check
  8793. // whether the returned error was because http.StatusNotModified was
  8794. // returned.
  8795. func (c *RasterCollectionsRastersBatchDeleteCall) Do(opts ...googleapi.CallOption) (*RasterCollectionsRastersBatchDeleteResponse, error) {
  8796. gensupport.SetOptions(c.urlParams_, opts...)
  8797. res, err := c.doRequest("json")
  8798. if res != nil && res.StatusCode == http.StatusNotModified {
  8799. if res.Body != nil {
  8800. res.Body.Close()
  8801. }
  8802. return nil, &googleapi.Error{
  8803. Code: res.StatusCode,
  8804. Header: res.Header,
  8805. }
  8806. }
  8807. if err != nil {
  8808. return nil, err
  8809. }
  8810. defer googleapi.CloseBody(res)
  8811. if err := googleapi.CheckResponse(res); err != nil {
  8812. return nil, err
  8813. }
  8814. ret := &RasterCollectionsRastersBatchDeleteResponse{
  8815. ServerResponse: googleapi.ServerResponse{
  8816. Header: res.Header,
  8817. HTTPStatusCode: res.StatusCode,
  8818. },
  8819. }
  8820. if err := json.NewDecoder(res.Body).Decode(&ret); err != nil {
  8821. return nil, err
  8822. }
  8823. return ret, nil
  8824. // {
  8825. // "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.",
  8826. // "httpMethod": "POST",
  8827. // "id": "mapsengine.rasterCollections.rasters.batchDelete",
  8828. // "parameterOrder": [
  8829. // "id"
  8830. // ],
  8831. // "parameters": {
  8832. // "id": {
  8833. // "description": "The ID of the raster collection to which these rasters belong.",
  8834. // "location": "path",
  8835. // "required": true,
  8836. // "type": "string"
  8837. // }
  8838. // },
  8839. // "path": "rasterCollections/{id}/rasters/batchDelete",
  8840. // "request": {
  8841. // "$ref": "RasterCollectionsRasterBatchDeleteRequest"
  8842. // },
  8843. // "response": {
  8844. // "$ref": "RasterCollectionsRastersBatchDeleteResponse"
  8845. // },
  8846. // "scopes": [
  8847. // "https://www.googleapis.com/auth/mapsengine"
  8848. // ]
  8849. // }
  8850. }
  8851. // method id "mapsengine.rasterCollections.rasters.batchInsert":
  8852. type RasterCollectionsRastersBatchInsertCall struct {
  8853. s *Service
  8854. id string
  8855. rastercollectionsrastersbatchinsertrequest *RasterCollectionsRastersBatchInsertRequest
  8856. urlParams_ gensupport.URLParams
  8857. ctx_ context.Context
  8858. }
  8859. // BatchInsert: Add rasters to an existing raster collection. Rasters
  8860. // must be successfully processed in order to be added to a raster
  8861. // collection.
  8862. //
  8863. // Up to 50 rasters can be included in a single batchInsert request.
  8864. // Each batchInsert request is atomic.
  8865. func (r *RasterCollectionsRastersService) BatchInsert(id string, rastercollectionsrastersbatchinsertrequest *RasterCollectionsRastersBatchInsertRequest) *RasterCollectionsRastersBatchInsertCall {
  8866. c := &RasterCollectionsRastersBatchInsertCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  8867. c.id = id
  8868. c.rastercollectionsrastersbatchinsertrequest = rastercollectionsrastersbatchinsertrequest
  8869. return c
  8870. }
  8871. // Fields allows partial responses to be retrieved. See
  8872. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  8873. // for more information.
  8874. func (c *RasterCollectionsRastersBatchInsertCall) Fields(s ...googleapi.Field) *RasterCollectionsRastersBatchInsertCall {
  8875. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  8876. return c
  8877. }
  8878. // Context sets the context to be used in this call's Do method. Any
  8879. // pending HTTP request will be aborted if the provided context is
  8880. // canceled.
  8881. func (c *RasterCollectionsRastersBatchInsertCall) Context(ctx context.Context) *RasterCollectionsRastersBatchInsertCall {
  8882. c.ctx_ = ctx
  8883. return c
  8884. }
  8885. func (c *RasterCollectionsRastersBatchInsertCall) doRequest(alt string) (*http.Response, error) {
  8886. var body io.Reader = nil
  8887. body, err := googleapi.WithoutDataWrapper.JSONReader(c.rastercollectionsrastersbatchinsertrequest)
  8888. if err != nil {
  8889. return nil, err
  8890. }
  8891. ctype := "application/json"
  8892. c.urlParams_.Set("alt", alt)
  8893. urls := googleapi.ResolveRelative(c.s.BasePath, "rasterCollections/{id}/rasters/batchInsert")
  8894. urls += "?" + c.urlParams_.Encode()
  8895. req, _ := http.NewRequest("POST", urls, body)
  8896. googleapi.Expand(req.URL, map[string]string{
  8897. "id": c.id,
  8898. })
  8899. req.Header.Set("Content-Type", ctype)
  8900. req.Header.Set("User-Agent", c.s.userAgent())
  8901. if c.ctx_ != nil {
  8902. return ctxhttp.Do(c.ctx_, c.s.client, req)
  8903. }
  8904. return c.s.client.Do(req)
  8905. }
  8906. // Do executes the "mapsengine.rasterCollections.rasters.batchInsert" call.
  8907. // Exactly one of *RasterCollectionsRastersBatchInsertResponse or error
  8908. // will be non-nil. Any non-2xx status code is an error. Response
  8909. // headers are in either
  8910. // *RasterCollectionsRastersBatchInsertResponse.ServerResponse.Header or
  8911. // (if a response was returned at all) in
  8912. // error.(*googleapi.Error).Header. Use googleapi.IsNotModified to check
  8913. // whether the returned error was because http.StatusNotModified was
  8914. // returned.
  8915. func (c *RasterCollectionsRastersBatchInsertCall) Do(opts ...googleapi.CallOption) (*RasterCollectionsRastersBatchInsertResponse, error) {
  8916. gensupport.SetOptions(c.urlParams_, opts...)
  8917. res, err := c.doRequest("json")
  8918. if res != nil && res.StatusCode == http.StatusNotModified {
  8919. if res.Body != nil {
  8920. res.Body.Close()
  8921. }
  8922. return nil, &googleapi.Error{
  8923. Code: res.StatusCode,
  8924. Header: res.Header,
  8925. }
  8926. }
  8927. if err != nil {
  8928. return nil, err
  8929. }
  8930. defer googleapi.CloseBody(res)
  8931. if err := googleapi.CheckResponse(res); err != nil {
  8932. return nil, err
  8933. }
  8934. ret := &RasterCollectionsRastersBatchInsertResponse{
  8935. ServerResponse: googleapi.ServerResponse{
  8936. Header: res.Header,
  8937. HTTPStatusCode: res.StatusCode,
  8938. },
  8939. }
  8940. if err := json.NewDecoder(res.Body).Decode(&ret); err != nil {
  8941. return nil, err
  8942. }
  8943. return ret, nil
  8944. // {
  8945. // "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.",
  8946. // "httpMethod": "POST",
  8947. // "id": "mapsengine.rasterCollections.rasters.batchInsert",
  8948. // "parameterOrder": [
  8949. // "id"
  8950. // ],
  8951. // "parameters": {
  8952. // "id": {
  8953. // "description": "The ID of the raster collection to which these rasters belong.",
  8954. // "location": "path",
  8955. // "required": true,
  8956. // "type": "string"
  8957. // }
  8958. // },
  8959. // "path": "rasterCollections/{id}/rasters/batchInsert",
  8960. // "request": {
  8961. // "$ref": "RasterCollectionsRastersBatchInsertRequest"
  8962. // },
  8963. // "response": {
  8964. // "$ref": "RasterCollectionsRastersBatchInsertResponse"
  8965. // },
  8966. // "scopes": [
  8967. // "https://www.googleapis.com/auth/mapsengine"
  8968. // ]
  8969. // }
  8970. }
  8971. // method id "mapsengine.rasterCollections.rasters.list":
  8972. type RasterCollectionsRastersListCall struct {
  8973. s *Service
  8974. id string
  8975. urlParams_ gensupport.URLParams
  8976. ifNoneMatch_ string
  8977. ctx_ context.Context
  8978. }
  8979. // List: Return all rasters within a raster collection.
  8980. func (r *RasterCollectionsRastersService) List(id string) *RasterCollectionsRastersListCall {
  8981. c := &RasterCollectionsRastersListCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  8982. c.id = id
  8983. return c
  8984. }
  8985. // Bbox sets the optional parameter "bbox": A bounding box, expressed as
  8986. // "west,south,east,north". If set, only assets which intersect this
  8987. // bounding box will be returned.
  8988. func (c *RasterCollectionsRastersListCall) Bbox(bbox string) *RasterCollectionsRastersListCall {
  8989. c.urlParams_.Set("bbox", bbox)
  8990. return c
  8991. }
  8992. // CreatedAfter sets the optional parameter "createdAfter": An RFC 3339
  8993. // formatted date-time value (e.g. 1970-01-01T00:00:00Z). Returned
  8994. // assets will have been created at or after this time.
  8995. func (c *RasterCollectionsRastersListCall) CreatedAfter(createdAfter string) *RasterCollectionsRastersListCall {
  8996. c.urlParams_.Set("createdAfter", createdAfter)
  8997. return c
  8998. }
  8999. // CreatedBefore sets the optional parameter "createdBefore": An RFC
  9000. // 3339 formatted date-time value (e.g. 1970-01-01T00:00:00Z). Returned
  9001. // assets will have been created at or before this time.
  9002. func (c *RasterCollectionsRastersListCall) CreatedBefore(createdBefore string) *RasterCollectionsRastersListCall {
  9003. c.urlParams_.Set("createdBefore", createdBefore)
  9004. return c
  9005. }
  9006. // CreatorEmail sets the optional parameter "creatorEmail": An email
  9007. // address representing a user. Returned assets that have been created
  9008. // by the user associated with the provided email address.
  9009. func (c *RasterCollectionsRastersListCall) CreatorEmail(creatorEmail string) *RasterCollectionsRastersListCall {
  9010. c.urlParams_.Set("creatorEmail", creatorEmail)
  9011. return c
  9012. }
  9013. // MaxResults sets the optional parameter "maxResults": The maximum
  9014. // number of items to include in a single response page. The maximum
  9015. // supported value is 100.
  9016. func (c *RasterCollectionsRastersListCall) MaxResults(maxResults int64) *RasterCollectionsRastersListCall {
  9017. c.urlParams_.Set("maxResults", fmt.Sprint(maxResults))
  9018. return c
  9019. }
  9020. // ModifiedAfter sets the optional parameter "modifiedAfter": An RFC
  9021. // 3339 formatted date-time value (e.g. 1970-01-01T00:00:00Z). Returned
  9022. // assets will have been modified at or after this time.
  9023. func (c *RasterCollectionsRastersListCall) ModifiedAfter(modifiedAfter string) *RasterCollectionsRastersListCall {
  9024. c.urlParams_.Set("modifiedAfter", modifiedAfter)
  9025. return c
  9026. }
  9027. // ModifiedBefore sets the optional parameter "modifiedBefore": An RFC
  9028. // 3339 formatted date-time value (e.g. 1970-01-01T00:00:00Z). Returned
  9029. // assets will have been modified at or before this time.
  9030. func (c *RasterCollectionsRastersListCall) ModifiedBefore(modifiedBefore string) *RasterCollectionsRastersListCall {
  9031. c.urlParams_.Set("modifiedBefore", modifiedBefore)
  9032. return c
  9033. }
  9034. // PageToken sets the optional parameter "pageToken": The continuation
  9035. // token, used to page through large result sets. To get the next page
  9036. // of results, set this parameter to the value of nextPageToken from the
  9037. // previous response.
  9038. func (c *RasterCollectionsRastersListCall) PageToken(pageToken string) *RasterCollectionsRastersListCall {
  9039. c.urlParams_.Set("pageToken", pageToken)
  9040. return c
  9041. }
  9042. // Role sets the optional parameter "role": The role parameter indicates
  9043. // that the response should only contain assets where the current user
  9044. // has the specified level of access.
  9045. //
  9046. // Possible values:
  9047. // "owner" - The user can read, write and administer the asset.
  9048. // "reader" - The user can read the asset.
  9049. // "writer" - The user can read and write the asset.
  9050. func (c *RasterCollectionsRastersListCall) Role(role string) *RasterCollectionsRastersListCall {
  9051. c.urlParams_.Set("role", role)
  9052. return c
  9053. }
  9054. // Search sets the optional parameter "search": An unstructured search
  9055. // string used to filter the set of results based on asset metadata.
  9056. func (c *RasterCollectionsRastersListCall) Search(search string) *RasterCollectionsRastersListCall {
  9057. c.urlParams_.Set("search", search)
  9058. return c
  9059. }
  9060. // Tags sets the optional parameter "tags": A comma separated list of
  9061. // tags. Returned assets will contain all the tags from the list.
  9062. func (c *RasterCollectionsRastersListCall) Tags(tags string) *RasterCollectionsRastersListCall {
  9063. c.urlParams_.Set("tags", tags)
  9064. return c
  9065. }
  9066. // Fields allows partial responses to be retrieved. See
  9067. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  9068. // for more information.
  9069. func (c *RasterCollectionsRastersListCall) Fields(s ...googleapi.Field) *RasterCollectionsRastersListCall {
  9070. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  9071. return c
  9072. }
  9073. // IfNoneMatch sets the optional parameter which makes the operation
  9074. // fail if the object's ETag matches the given value. This is useful for
  9075. // getting updates only after the object has changed since the last
  9076. // request. Use googleapi.IsNotModified to check whether the response
  9077. // error from Do is the result of In-None-Match.
  9078. func (c *RasterCollectionsRastersListCall) IfNoneMatch(entityTag string) *RasterCollectionsRastersListCall {
  9079. c.ifNoneMatch_ = entityTag
  9080. return c
  9081. }
  9082. // Context sets the context to be used in this call's Do method. Any
  9083. // pending HTTP request will be aborted if the provided context is
  9084. // canceled.
  9085. func (c *RasterCollectionsRastersListCall) Context(ctx context.Context) *RasterCollectionsRastersListCall {
  9086. c.ctx_ = ctx
  9087. return c
  9088. }
  9089. func (c *RasterCollectionsRastersListCall) doRequest(alt string) (*http.Response, error) {
  9090. var body io.Reader = nil
  9091. c.urlParams_.Set("alt", alt)
  9092. urls := googleapi.ResolveRelative(c.s.BasePath, "rasterCollections/{id}/rasters")
  9093. urls += "?" + c.urlParams_.Encode()
  9094. req, _ := http.NewRequest("GET", urls, body)
  9095. googleapi.Expand(req.URL, map[string]string{
  9096. "id": c.id,
  9097. })
  9098. req.Header.Set("User-Agent", c.s.userAgent())
  9099. if c.ifNoneMatch_ != "" {
  9100. req.Header.Set("If-None-Match", c.ifNoneMatch_)
  9101. }
  9102. if c.ctx_ != nil {
  9103. return ctxhttp.Do(c.ctx_, c.s.client, req)
  9104. }
  9105. return c.s.client.Do(req)
  9106. }
  9107. // Do executes the "mapsengine.rasterCollections.rasters.list" call.
  9108. // Exactly one of *RasterCollectionsRastersListResponse or error will be
  9109. // non-nil. Any non-2xx status code is an error. Response headers are in
  9110. // either *RasterCollectionsRastersListResponse.ServerResponse.Header or
  9111. // (if a response was returned at all) in
  9112. // error.(*googleapi.Error).Header. Use googleapi.IsNotModified to check
  9113. // whether the returned error was because http.StatusNotModified was
  9114. // returned.
  9115. func (c *RasterCollectionsRastersListCall) Do(opts ...googleapi.CallOption) (*RasterCollectionsRastersListResponse, error) {
  9116. gensupport.SetOptions(c.urlParams_, opts...)
  9117. res, err := c.doRequest("json")
  9118. if res != nil && res.StatusCode == http.StatusNotModified {
  9119. if res.Body != nil {
  9120. res.Body.Close()
  9121. }
  9122. return nil, &googleapi.Error{
  9123. Code: res.StatusCode,
  9124. Header: res.Header,
  9125. }
  9126. }
  9127. if err != nil {
  9128. return nil, err
  9129. }
  9130. defer googleapi.CloseBody(res)
  9131. if err := googleapi.CheckResponse(res); err != nil {
  9132. return nil, err
  9133. }
  9134. ret := &RasterCollectionsRastersListResponse{
  9135. ServerResponse: googleapi.ServerResponse{
  9136. Header: res.Header,
  9137. HTTPStatusCode: res.StatusCode,
  9138. },
  9139. }
  9140. if err := json.NewDecoder(res.Body).Decode(&ret); err != nil {
  9141. return nil, err
  9142. }
  9143. return ret, nil
  9144. // {
  9145. // "description": "Return all rasters within a raster collection.",
  9146. // "httpMethod": "GET",
  9147. // "id": "mapsengine.rasterCollections.rasters.list",
  9148. // "parameterOrder": [
  9149. // "id"
  9150. // ],
  9151. // "parameters": {
  9152. // "bbox": {
  9153. // "description": "A bounding box, expressed as \"west,south,east,north\". If set, only assets which intersect this bounding box will be returned.",
  9154. // "location": "query",
  9155. // "type": "string"
  9156. // },
  9157. // "createdAfter": {
  9158. // "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.",
  9159. // "format": "date-time",
  9160. // "location": "query",
  9161. // "type": "string"
  9162. // },
  9163. // "createdBefore": {
  9164. // "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.",
  9165. // "format": "date-time",
  9166. // "location": "query",
  9167. // "type": "string"
  9168. // },
  9169. // "creatorEmail": {
  9170. // "description": "An email address representing a user. Returned assets that have been created by the user associated with the provided email address.",
  9171. // "location": "query",
  9172. // "type": "string"
  9173. // },
  9174. // "id": {
  9175. // "description": "The ID of the raster collection to which these rasters belong.",
  9176. // "location": "path",
  9177. // "required": true,
  9178. // "type": "string"
  9179. // },
  9180. // "maxResults": {
  9181. // "description": "The maximum number of items to include in a single response page. The maximum supported value is 100.",
  9182. // "format": "uint32",
  9183. // "location": "query",
  9184. // "type": "integer"
  9185. // },
  9186. // "modifiedAfter": {
  9187. // "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.",
  9188. // "format": "date-time",
  9189. // "location": "query",
  9190. // "type": "string"
  9191. // },
  9192. // "modifiedBefore": {
  9193. // "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.",
  9194. // "format": "date-time",
  9195. // "location": "query",
  9196. // "type": "string"
  9197. // },
  9198. // "pageToken": {
  9199. // "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.",
  9200. // "location": "query",
  9201. // "type": "string"
  9202. // },
  9203. // "role": {
  9204. // "description": "The role parameter indicates that the response should only contain assets where the current user has the specified level of access.",
  9205. // "enum": [
  9206. // "owner",
  9207. // "reader",
  9208. // "writer"
  9209. // ],
  9210. // "enumDescriptions": [
  9211. // "The user can read, write and administer the asset.",
  9212. // "The user can read the asset.",
  9213. // "The user can read and write the asset."
  9214. // ],
  9215. // "location": "query",
  9216. // "type": "string"
  9217. // },
  9218. // "search": {
  9219. // "description": "An unstructured search string used to filter the set of results based on asset metadata.",
  9220. // "location": "query",
  9221. // "type": "string"
  9222. // },
  9223. // "tags": {
  9224. // "description": "A comma separated list of tags. Returned assets will contain all the tags from the list.",
  9225. // "location": "query",
  9226. // "type": "string"
  9227. // }
  9228. // },
  9229. // "path": "rasterCollections/{id}/rasters",
  9230. // "response": {
  9231. // "$ref": "RasterCollectionsRastersListResponse"
  9232. // },
  9233. // "scopes": [
  9234. // "https://www.googleapis.com/auth/mapsengine",
  9235. // "https://www.googleapis.com/auth/mapsengine.readonly"
  9236. // ]
  9237. // }
  9238. }
  9239. // Pages invokes f for each page of results.
  9240. // A non-nil error returned from f will halt the iteration.
  9241. // The provided context supersedes any context provided to the Context method.
  9242. func (c *RasterCollectionsRastersListCall) Pages(ctx context.Context, f func(*RasterCollectionsRastersListResponse) error) error {
  9243. c.ctx_ = ctx
  9244. defer c.PageToken(c.urlParams_.Get("pageToken")) // reset paging to original point
  9245. for {
  9246. x, err := c.Do()
  9247. if err != nil {
  9248. return err
  9249. }
  9250. if err := f(x); err != nil {
  9251. return err
  9252. }
  9253. if x.NextPageToken == "" {
  9254. return nil
  9255. }
  9256. c.PageToken(x.NextPageToken)
  9257. }
  9258. }
  9259. // method id "mapsengine.rasters.delete":
  9260. type RastersDeleteCall struct {
  9261. s *Service
  9262. id string
  9263. urlParams_ gensupport.URLParams
  9264. ctx_ context.Context
  9265. }
  9266. // Delete: Delete a raster.
  9267. func (r *RastersService) Delete(id string) *RastersDeleteCall {
  9268. c := &RastersDeleteCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  9269. c.id = id
  9270. return c
  9271. }
  9272. // Fields allows partial responses to be retrieved. See
  9273. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  9274. // for more information.
  9275. func (c *RastersDeleteCall) Fields(s ...googleapi.Field) *RastersDeleteCall {
  9276. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  9277. return c
  9278. }
  9279. // Context sets the context to be used in this call's Do method. Any
  9280. // pending HTTP request will be aborted if the provided context is
  9281. // canceled.
  9282. func (c *RastersDeleteCall) Context(ctx context.Context) *RastersDeleteCall {
  9283. c.ctx_ = ctx
  9284. return c
  9285. }
  9286. func (c *RastersDeleteCall) doRequest(alt string) (*http.Response, error) {
  9287. var body io.Reader = nil
  9288. c.urlParams_.Set("alt", alt)
  9289. urls := googleapi.ResolveRelative(c.s.BasePath, "rasters/{id}")
  9290. urls += "?" + c.urlParams_.Encode()
  9291. req, _ := http.NewRequest("DELETE", urls, body)
  9292. googleapi.Expand(req.URL, map[string]string{
  9293. "id": c.id,
  9294. })
  9295. req.Header.Set("User-Agent", c.s.userAgent())
  9296. if c.ctx_ != nil {
  9297. return ctxhttp.Do(c.ctx_, c.s.client, req)
  9298. }
  9299. return c.s.client.Do(req)
  9300. }
  9301. // Do executes the "mapsengine.rasters.delete" call.
  9302. func (c *RastersDeleteCall) Do(opts ...googleapi.CallOption) error {
  9303. gensupport.SetOptions(c.urlParams_, opts...)
  9304. res, err := c.doRequest("json")
  9305. if err != nil {
  9306. return err
  9307. }
  9308. defer googleapi.CloseBody(res)
  9309. if err := googleapi.CheckResponse(res); err != nil {
  9310. return err
  9311. }
  9312. return nil
  9313. // {
  9314. // "description": "Delete a raster.",
  9315. // "httpMethod": "DELETE",
  9316. // "id": "mapsengine.rasters.delete",
  9317. // "parameterOrder": [
  9318. // "id"
  9319. // ],
  9320. // "parameters": {
  9321. // "id": {
  9322. // "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.",
  9323. // "location": "path",
  9324. // "required": true,
  9325. // "type": "string"
  9326. // }
  9327. // },
  9328. // "path": "rasters/{id}",
  9329. // "scopes": [
  9330. // "https://www.googleapis.com/auth/mapsengine"
  9331. // ]
  9332. // }
  9333. }
  9334. // method id "mapsengine.rasters.get":
  9335. type RastersGetCall struct {
  9336. s *Service
  9337. id string
  9338. urlParams_ gensupport.URLParams
  9339. ifNoneMatch_ string
  9340. ctx_ context.Context
  9341. }
  9342. // Get: Return metadata for a single raster.
  9343. func (r *RastersService) Get(id string) *RastersGetCall {
  9344. c := &RastersGetCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  9345. c.id = id
  9346. return c
  9347. }
  9348. // Fields allows partial responses to be retrieved. See
  9349. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  9350. // for more information.
  9351. func (c *RastersGetCall) Fields(s ...googleapi.Field) *RastersGetCall {
  9352. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  9353. return c
  9354. }
  9355. // IfNoneMatch sets the optional parameter which makes the operation
  9356. // fail if the object's ETag matches the given value. This is useful for
  9357. // getting updates only after the object has changed since the last
  9358. // request. Use googleapi.IsNotModified to check whether the response
  9359. // error from Do is the result of In-None-Match.
  9360. func (c *RastersGetCall) IfNoneMatch(entityTag string) *RastersGetCall {
  9361. c.ifNoneMatch_ = entityTag
  9362. return c
  9363. }
  9364. // Context sets the context to be used in this call's Do method. Any
  9365. // pending HTTP request will be aborted if the provided context is
  9366. // canceled.
  9367. func (c *RastersGetCall) Context(ctx context.Context) *RastersGetCall {
  9368. c.ctx_ = ctx
  9369. return c
  9370. }
  9371. func (c *RastersGetCall) doRequest(alt string) (*http.Response, error) {
  9372. var body io.Reader = nil
  9373. c.urlParams_.Set("alt", alt)
  9374. urls := googleapi.ResolveRelative(c.s.BasePath, "rasters/{id}")
  9375. urls += "?" + c.urlParams_.Encode()
  9376. req, _ := http.NewRequest("GET", urls, body)
  9377. googleapi.Expand(req.URL, map[string]string{
  9378. "id": c.id,
  9379. })
  9380. req.Header.Set("User-Agent", c.s.userAgent())
  9381. if c.ifNoneMatch_ != "" {
  9382. req.Header.Set("If-None-Match", c.ifNoneMatch_)
  9383. }
  9384. if c.ctx_ != nil {
  9385. return ctxhttp.Do(c.ctx_, c.s.client, req)
  9386. }
  9387. return c.s.client.Do(req)
  9388. }
  9389. // Do executes the "mapsengine.rasters.get" call.
  9390. // Exactly one of *Raster or error will be non-nil. Any non-2xx status
  9391. // code is an error. Response headers are in either
  9392. // *Raster.ServerResponse.Header or (if a response was returned at all)
  9393. // in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to
  9394. // check whether the returned error was because http.StatusNotModified
  9395. // was returned.
  9396. func (c *RastersGetCall) Do(opts ...googleapi.CallOption) (*Raster, error) {
  9397. gensupport.SetOptions(c.urlParams_, opts...)
  9398. res, err := c.doRequest("json")
  9399. if res != nil && res.StatusCode == http.StatusNotModified {
  9400. if res.Body != nil {
  9401. res.Body.Close()
  9402. }
  9403. return nil, &googleapi.Error{
  9404. Code: res.StatusCode,
  9405. Header: res.Header,
  9406. }
  9407. }
  9408. if err != nil {
  9409. return nil, err
  9410. }
  9411. defer googleapi.CloseBody(res)
  9412. if err := googleapi.CheckResponse(res); err != nil {
  9413. return nil, err
  9414. }
  9415. ret := &Raster{
  9416. ServerResponse: googleapi.ServerResponse{
  9417. Header: res.Header,
  9418. HTTPStatusCode: res.StatusCode,
  9419. },
  9420. }
  9421. if err := json.NewDecoder(res.Body).Decode(&ret); err != nil {
  9422. return nil, err
  9423. }
  9424. return ret, nil
  9425. // {
  9426. // "description": "Return metadata for a single raster.",
  9427. // "httpMethod": "GET",
  9428. // "id": "mapsengine.rasters.get",
  9429. // "parameterOrder": [
  9430. // "id"
  9431. // ],
  9432. // "parameters": {
  9433. // "id": {
  9434. // "description": "The ID of the raster.",
  9435. // "location": "path",
  9436. // "required": true,
  9437. // "type": "string"
  9438. // }
  9439. // },
  9440. // "path": "rasters/{id}",
  9441. // "response": {
  9442. // "$ref": "Raster"
  9443. // },
  9444. // "scopes": [
  9445. // "https://www.googleapis.com/auth/mapsengine",
  9446. // "https://www.googleapis.com/auth/mapsengine.readonly"
  9447. // ]
  9448. // }
  9449. }
  9450. // method id "mapsengine.rasters.list":
  9451. type RastersListCall struct {
  9452. s *Service
  9453. urlParams_ gensupport.URLParams
  9454. ifNoneMatch_ string
  9455. ctx_ context.Context
  9456. }
  9457. // List: Return all rasters readable by the current user.
  9458. func (r *RastersService) List(projectId string) *RastersListCall {
  9459. c := &RastersListCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  9460. c.urlParams_.Set("projectId", projectId)
  9461. return c
  9462. }
  9463. // Bbox sets the optional parameter "bbox": A bounding box, expressed as
  9464. // "west,south,east,north". If set, only assets which intersect this
  9465. // bounding box will be returned.
  9466. func (c *RastersListCall) Bbox(bbox string) *RastersListCall {
  9467. c.urlParams_.Set("bbox", bbox)
  9468. return c
  9469. }
  9470. // CreatedAfter sets the optional parameter "createdAfter": An RFC 3339
  9471. // formatted date-time value (e.g. 1970-01-01T00:00:00Z). Returned
  9472. // assets will have been created at or after this time.
  9473. func (c *RastersListCall) CreatedAfter(createdAfter string) *RastersListCall {
  9474. c.urlParams_.Set("createdAfter", createdAfter)
  9475. return c
  9476. }
  9477. // CreatedBefore sets the optional parameter "createdBefore": An RFC
  9478. // 3339 formatted date-time value (e.g. 1970-01-01T00:00:00Z). Returned
  9479. // assets will have been created at or before this time.
  9480. func (c *RastersListCall) CreatedBefore(createdBefore string) *RastersListCall {
  9481. c.urlParams_.Set("createdBefore", createdBefore)
  9482. return c
  9483. }
  9484. // CreatorEmail sets the optional parameter "creatorEmail": An email
  9485. // address representing a user. Returned assets that have been created
  9486. // by the user associated with the provided email address.
  9487. func (c *RastersListCall) CreatorEmail(creatorEmail string) *RastersListCall {
  9488. c.urlParams_.Set("creatorEmail", creatorEmail)
  9489. return c
  9490. }
  9491. // MaxResults sets the optional parameter "maxResults": The maximum
  9492. // number of items to include in a single response page. The maximum
  9493. // supported value is 100.
  9494. func (c *RastersListCall) MaxResults(maxResults int64) *RastersListCall {
  9495. c.urlParams_.Set("maxResults", fmt.Sprint(maxResults))
  9496. return c
  9497. }
  9498. // ModifiedAfter sets the optional parameter "modifiedAfter": An RFC
  9499. // 3339 formatted date-time value (e.g. 1970-01-01T00:00:00Z). Returned
  9500. // assets will have been modified at or after this time.
  9501. func (c *RastersListCall) ModifiedAfter(modifiedAfter string) *RastersListCall {
  9502. c.urlParams_.Set("modifiedAfter", modifiedAfter)
  9503. return c
  9504. }
  9505. // ModifiedBefore sets the optional parameter "modifiedBefore": An RFC
  9506. // 3339 formatted date-time value (e.g. 1970-01-01T00:00:00Z). Returned
  9507. // assets will have been modified at or before this time.
  9508. func (c *RastersListCall) ModifiedBefore(modifiedBefore string) *RastersListCall {
  9509. c.urlParams_.Set("modifiedBefore", modifiedBefore)
  9510. return c
  9511. }
  9512. // PageToken sets the optional parameter "pageToken": The continuation
  9513. // token, used to page through large result sets. To get the next page
  9514. // of results, set this parameter to the value of nextPageToken from the
  9515. // previous response.
  9516. func (c *RastersListCall) PageToken(pageToken string) *RastersListCall {
  9517. c.urlParams_.Set("pageToken", pageToken)
  9518. return c
  9519. }
  9520. // ProcessingStatus sets the optional parameter "processingStatus":
  9521. //
  9522. // Possible values:
  9523. // "complete" - The raster has completed processing.
  9524. // "failed" - The raster has failed processing.
  9525. // "notReady" - The raster is not ready for processing.
  9526. // "processing" - The raster is processing.
  9527. // "ready" - The raster is ready for processing.
  9528. func (c *RastersListCall) ProcessingStatus(processingStatus string) *RastersListCall {
  9529. c.urlParams_.Set("processingStatus", processingStatus)
  9530. return c
  9531. }
  9532. // Role sets the optional parameter "role": The role parameter indicates
  9533. // that the response should only contain assets where the current user
  9534. // has the specified level of access.
  9535. //
  9536. // Possible values:
  9537. // "owner" - The user can read, write and administer the asset.
  9538. // "reader" - The user can read the asset.
  9539. // "writer" - The user can read and write the asset.
  9540. func (c *RastersListCall) Role(role string) *RastersListCall {
  9541. c.urlParams_.Set("role", role)
  9542. return c
  9543. }
  9544. // Search sets the optional parameter "search": An unstructured search
  9545. // string used to filter the set of results based on asset metadata.
  9546. func (c *RastersListCall) Search(search string) *RastersListCall {
  9547. c.urlParams_.Set("search", search)
  9548. return c
  9549. }
  9550. // Tags sets the optional parameter "tags": A comma separated list of
  9551. // tags. Returned assets will contain all the tags from the list.
  9552. func (c *RastersListCall) Tags(tags string) *RastersListCall {
  9553. c.urlParams_.Set("tags", tags)
  9554. return c
  9555. }
  9556. // Fields allows partial responses to be retrieved. See
  9557. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  9558. // for more information.
  9559. func (c *RastersListCall) Fields(s ...googleapi.Field) *RastersListCall {
  9560. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  9561. return c
  9562. }
  9563. // IfNoneMatch sets the optional parameter which makes the operation
  9564. // fail if the object's ETag matches the given value. This is useful for
  9565. // getting updates only after the object has changed since the last
  9566. // request. Use googleapi.IsNotModified to check whether the response
  9567. // error from Do is the result of In-None-Match.
  9568. func (c *RastersListCall) IfNoneMatch(entityTag string) *RastersListCall {
  9569. c.ifNoneMatch_ = entityTag
  9570. return c
  9571. }
  9572. // Context sets the context to be used in this call's Do method. Any
  9573. // pending HTTP request will be aborted if the provided context is
  9574. // canceled.
  9575. func (c *RastersListCall) Context(ctx context.Context) *RastersListCall {
  9576. c.ctx_ = ctx
  9577. return c
  9578. }
  9579. func (c *RastersListCall) doRequest(alt string) (*http.Response, error) {
  9580. var body io.Reader = nil
  9581. c.urlParams_.Set("alt", alt)
  9582. urls := googleapi.ResolveRelative(c.s.BasePath, "rasters")
  9583. urls += "?" + c.urlParams_.Encode()
  9584. req, _ := http.NewRequest("GET", urls, body)
  9585. googleapi.SetOpaque(req.URL)
  9586. req.Header.Set("User-Agent", c.s.userAgent())
  9587. if c.ifNoneMatch_ != "" {
  9588. req.Header.Set("If-None-Match", c.ifNoneMatch_)
  9589. }
  9590. if c.ctx_ != nil {
  9591. return ctxhttp.Do(c.ctx_, c.s.client, req)
  9592. }
  9593. return c.s.client.Do(req)
  9594. }
  9595. // Do executes the "mapsengine.rasters.list" call.
  9596. // Exactly one of *RastersListResponse or error will be non-nil. Any
  9597. // non-2xx status code is an error. Response headers are in either
  9598. // *RastersListResponse.ServerResponse.Header or (if a response was
  9599. // returned at all) in error.(*googleapi.Error).Header. Use
  9600. // googleapi.IsNotModified to check whether the returned error was
  9601. // because http.StatusNotModified was returned.
  9602. func (c *RastersListCall) Do(opts ...googleapi.CallOption) (*RastersListResponse, error) {
  9603. gensupport.SetOptions(c.urlParams_, opts...)
  9604. res, err := c.doRequest("json")
  9605. if res != nil && res.StatusCode == http.StatusNotModified {
  9606. if res.Body != nil {
  9607. res.Body.Close()
  9608. }
  9609. return nil, &googleapi.Error{
  9610. Code: res.StatusCode,
  9611. Header: res.Header,
  9612. }
  9613. }
  9614. if err != nil {
  9615. return nil, err
  9616. }
  9617. defer googleapi.CloseBody(res)
  9618. if err := googleapi.CheckResponse(res); err != nil {
  9619. return nil, err
  9620. }
  9621. ret := &RastersListResponse{
  9622. ServerResponse: googleapi.ServerResponse{
  9623. Header: res.Header,
  9624. HTTPStatusCode: res.StatusCode,
  9625. },
  9626. }
  9627. if err := json.NewDecoder(res.Body).Decode(&ret); err != nil {
  9628. return nil, err
  9629. }
  9630. return ret, nil
  9631. // {
  9632. // "description": "Return all rasters readable by the current user.",
  9633. // "httpMethod": "GET",
  9634. // "id": "mapsengine.rasters.list",
  9635. // "parameterOrder": [
  9636. // "projectId"
  9637. // ],
  9638. // "parameters": {
  9639. // "bbox": {
  9640. // "description": "A bounding box, expressed as \"west,south,east,north\". If set, only assets which intersect this bounding box will be returned.",
  9641. // "location": "query",
  9642. // "type": "string"
  9643. // },
  9644. // "createdAfter": {
  9645. // "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.",
  9646. // "format": "date-time",
  9647. // "location": "query",
  9648. // "type": "string"
  9649. // },
  9650. // "createdBefore": {
  9651. // "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.",
  9652. // "format": "date-time",
  9653. // "location": "query",
  9654. // "type": "string"
  9655. // },
  9656. // "creatorEmail": {
  9657. // "description": "An email address representing a user. Returned assets that have been created by the user associated with the provided email address.",
  9658. // "location": "query",
  9659. // "type": "string"
  9660. // },
  9661. // "maxResults": {
  9662. // "description": "The maximum number of items to include in a single response page. The maximum supported value is 100.",
  9663. // "format": "uint32",
  9664. // "location": "query",
  9665. // "type": "integer"
  9666. // },
  9667. // "modifiedAfter": {
  9668. // "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.",
  9669. // "format": "date-time",
  9670. // "location": "query",
  9671. // "type": "string"
  9672. // },
  9673. // "modifiedBefore": {
  9674. // "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.",
  9675. // "format": "date-time",
  9676. // "location": "query",
  9677. // "type": "string"
  9678. // },
  9679. // "pageToken": {
  9680. // "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.",
  9681. // "location": "query",
  9682. // "type": "string"
  9683. // },
  9684. // "processingStatus": {
  9685. // "enum": [
  9686. // "complete",
  9687. // "failed",
  9688. // "notReady",
  9689. // "processing",
  9690. // "ready"
  9691. // ],
  9692. // "enumDescriptions": [
  9693. // "The raster has completed processing.",
  9694. // "The raster has failed processing.",
  9695. // "The raster is not ready for processing.",
  9696. // "The raster is processing.",
  9697. // "The raster is ready for processing."
  9698. // ],
  9699. // "location": "query",
  9700. // "type": "string"
  9701. // },
  9702. // "projectId": {
  9703. // "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.",
  9704. // "location": "query",
  9705. // "required": true,
  9706. // "type": "string"
  9707. // },
  9708. // "role": {
  9709. // "description": "The role parameter indicates that the response should only contain assets where the current user has the specified level of access.",
  9710. // "enum": [
  9711. // "owner",
  9712. // "reader",
  9713. // "writer"
  9714. // ],
  9715. // "enumDescriptions": [
  9716. // "The user can read, write and administer the asset.",
  9717. // "The user can read the asset.",
  9718. // "The user can read and write the asset."
  9719. // ],
  9720. // "location": "query",
  9721. // "type": "string"
  9722. // },
  9723. // "search": {
  9724. // "description": "An unstructured search string used to filter the set of results based on asset metadata.",
  9725. // "location": "query",
  9726. // "type": "string"
  9727. // },
  9728. // "tags": {
  9729. // "description": "A comma separated list of tags. Returned assets will contain all the tags from the list.",
  9730. // "location": "query",
  9731. // "type": "string"
  9732. // }
  9733. // },
  9734. // "path": "rasters",
  9735. // "response": {
  9736. // "$ref": "RastersListResponse"
  9737. // },
  9738. // "scopes": [
  9739. // "https://www.googleapis.com/auth/mapsengine",
  9740. // "https://www.googleapis.com/auth/mapsengine.readonly"
  9741. // ]
  9742. // }
  9743. }
  9744. // Pages invokes f for each page of results.
  9745. // A non-nil error returned from f will halt the iteration.
  9746. // The provided context supersedes any context provided to the Context method.
  9747. func (c *RastersListCall) Pages(ctx context.Context, f func(*RastersListResponse) error) error {
  9748. c.ctx_ = ctx
  9749. defer c.PageToken(c.urlParams_.Get("pageToken")) // reset paging to original point
  9750. for {
  9751. x, err := c.Do()
  9752. if err != nil {
  9753. return err
  9754. }
  9755. if err := f(x); err != nil {
  9756. return err
  9757. }
  9758. if x.NextPageToken == "" {
  9759. return nil
  9760. }
  9761. c.PageToken(x.NextPageToken)
  9762. }
  9763. }
  9764. // method id "mapsengine.rasters.patch":
  9765. type RastersPatchCall struct {
  9766. s *Service
  9767. id string
  9768. raster *Raster
  9769. urlParams_ gensupport.URLParams
  9770. ctx_ context.Context
  9771. }
  9772. // Patch: Mutate a raster asset.
  9773. func (r *RastersService) Patch(id string, raster *Raster) *RastersPatchCall {
  9774. c := &RastersPatchCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  9775. c.id = id
  9776. c.raster = raster
  9777. return c
  9778. }
  9779. // Fields allows partial responses to be retrieved. See
  9780. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  9781. // for more information.
  9782. func (c *RastersPatchCall) Fields(s ...googleapi.Field) *RastersPatchCall {
  9783. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  9784. return c
  9785. }
  9786. // Context sets the context to be used in this call's Do method. Any
  9787. // pending HTTP request will be aborted if the provided context is
  9788. // canceled.
  9789. func (c *RastersPatchCall) Context(ctx context.Context) *RastersPatchCall {
  9790. c.ctx_ = ctx
  9791. return c
  9792. }
  9793. func (c *RastersPatchCall) doRequest(alt string) (*http.Response, error) {
  9794. var body io.Reader = nil
  9795. body, err := googleapi.WithoutDataWrapper.JSONReader(c.raster)
  9796. if err != nil {
  9797. return nil, err
  9798. }
  9799. ctype := "application/json"
  9800. c.urlParams_.Set("alt", alt)
  9801. urls := googleapi.ResolveRelative(c.s.BasePath, "rasters/{id}")
  9802. urls += "?" + c.urlParams_.Encode()
  9803. req, _ := http.NewRequest("PATCH", urls, body)
  9804. googleapi.Expand(req.URL, map[string]string{
  9805. "id": c.id,
  9806. })
  9807. req.Header.Set("Content-Type", ctype)
  9808. req.Header.Set("User-Agent", c.s.userAgent())
  9809. if c.ctx_ != nil {
  9810. return ctxhttp.Do(c.ctx_, c.s.client, req)
  9811. }
  9812. return c.s.client.Do(req)
  9813. }
  9814. // Do executes the "mapsengine.rasters.patch" call.
  9815. func (c *RastersPatchCall) Do(opts ...googleapi.CallOption) error {
  9816. gensupport.SetOptions(c.urlParams_, opts...)
  9817. res, err := c.doRequest("json")
  9818. if err != nil {
  9819. return err
  9820. }
  9821. defer googleapi.CloseBody(res)
  9822. if err := googleapi.CheckResponse(res); err != nil {
  9823. return err
  9824. }
  9825. return nil
  9826. // {
  9827. // "description": "Mutate a raster asset.",
  9828. // "httpMethod": "PATCH",
  9829. // "id": "mapsengine.rasters.patch",
  9830. // "parameterOrder": [
  9831. // "id"
  9832. // ],
  9833. // "parameters": {
  9834. // "id": {
  9835. // "description": "The ID of the raster.",
  9836. // "location": "path",
  9837. // "required": true,
  9838. // "type": "string"
  9839. // }
  9840. // },
  9841. // "path": "rasters/{id}",
  9842. // "request": {
  9843. // "$ref": "Raster"
  9844. // },
  9845. // "scopes": [
  9846. // "https://www.googleapis.com/auth/mapsengine"
  9847. // ]
  9848. // }
  9849. }
  9850. // method id "mapsengine.rasters.process":
  9851. type RastersProcessCall struct {
  9852. s *Service
  9853. id string
  9854. urlParams_ gensupport.URLParams
  9855. ctx_ context.Context
  9856. }
  9857. // Process: Process a raster asset.
  9858. func (r *RastersService) Process(id string) *RastersProcessCall {
  9859. c := &RastersProcessCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  9860. c.id = id
  9861. return c
  9862. }
  9863. // Fields allows partial responses to be retrieved. See
  9864. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  9865. // for more information.
  9866. func (c *RastersProcessCall) Fields(s ...googleapi.Field) *RastersProcessCall {
  9867. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  9868. return c
  9869. }
  9870. // Context sets the context to be used in this call's Do method. Any
  9871. // pending HTTP request will be aborted if the provided context is
  9872. // canceled.
  9873. func (c *RastersProcessCall) Context(ctx context.Context) *RastersProcessCall {
  9874. c.ctx_ = ctx
  9875. return c
  9876. }
  9877. func (c *RastersProcessCall) doRequest(alt string) (*http.Response, error) {
  9878. var body io.Reader = nil
  9879. c.urlParams_.Set("alt", alt)
  9880. urls := googleapi.ResolveRelative(c.s.BasePath, "rasters/{id}/process")
  9881. urls += "?" + c.urlParams_.Encode()
  9882. req, _ := http.NewRequest("POST", urls, body)
  9883. googleapi.Expand(req.URL, map[string]string{
  9884. "id": c.id,
  9885. })
  9886. req.Header.Set("User-Agent", c.s.userAgent())
  9887. if c.ctx_ != nil {
  9888. return ctxhttp.Do(c.ctx_, c.s.client, req)
  9889. }
  9890. return c.s.client.Do(req)
  9891. }
  9892. // Do executes the "mapsengine.rasters.process" call.
  9893. // Exactly one of *ProcessResponse or error will be non-nil. Any non-2xx
  9894. // status code is an error. Response headers are in either
  9895. // *ProcessResponse.ServerResponse.Header or (if a response was returned
  9896. // at all) in error.(*googleapi.Error).Header. Use
  9897. // googleapi.IsNotModified to check whether the returned error was
  9898. // because http.StatusNotModified was returned.
  9899. func (c *RastersProcessCall) Do(opts ...googleapi.CallOption) (*ProcessResponse, error) {
  9900. gensupport.SetOptions(c.urlParams_, opts...)
  9901. res, err := c.doRequest("json")
  9902. if res != nil && res.StatusCode == http.StatusNotModified {
  9903. if res.Body != nil {
  9904. res.Body.Close()
  9905. }
  9906. return nil, &googleapi.Error{
  9907. Code: res.StatusCode,
  9908. Header: res.Header,
  9909. }
  9910. }
  9911. if err != nil {
  9912. return nil, err
  9913. }
  9914. defer googleapi.CloseBody(res)
  9915. if err := googleapi.CheckResponse(res); err != nil {
  9916. return nil, err
  9917. }
  9918. ret := &ProcessResponse{
  9919. ServerResponse: googleapi.ServerResponse{
  9920. Header: res.Header,
  9921. HTTPStatusCode: res.StatusCode,
  9922. },
  9923. }
  9924. if err := json.NewDecoder(res.Body).Decode(&ret); err != nil {
  9925. return nil, err
  9926. }
  9927. return ret, nil
  9928. // {
  9929. // "description": "Process a raster asset.",
  9930. // "httpMethod": "POST",
  9931. // "id": "mapsengine.rasters.process",
  9932. // "parameterOrder": [
  9933. // "id"
  9934. // ],
  9935. // "parameters": {
  9936. // "id": {
  9937. // "description": "The ID of the raster.",
  9938. // "location": "path",
  9939. // "required": true,
  9940. // "type": "string"
  9941. // }
  9942. // },
  9943. // "path": "rasters/{id}/process",
  9944. // "response": {
  9945. // "$ref": "ProcessResponse"
  9946. // },
  9947. // "scopes": [
  9948. // "https://www.googleapis.com/auth/mapsengine"
  9949. // ]
  9950. // }
  9951. }
  9952. // method id "mapsengine.rasters.upload":
  9953. type RastersUploadCall struct {
  9954. s *Service
  9955. raster *Raster
  9956. urlParams_ gensupport.URLParams
  9957. ctx_ context.Context
  9958. }
  9959. // Upload: Create a skeleton raster asset for upload.
  9960. func (r *RastersService) Upload(raster *Raster) *RastersUploadCall {
  9961. c := &RastersUploadCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  9962. c.raster = raster
  9963. return c
  9964. }
  9965. // Fields allows partial responses to be retrieved. See
  9966. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  9967. // for more information.
  9968. func (c *RastersUploadCall) Fields(s ...googleapi.Field) *RastersUploadCall {
  9969. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  9970. return c
  9971. }
  9972. // Context sets the context to be used in this call's Do method. Any
  9973. // pending HTTP request will be aborted if the provided context is
  9974. // canceled.
  9975. func (c *RastersUploadCall) Context(ctx context.Context) *RastersUploadCall {
  9976. c.ctx_ = ctx
  9977. return c
  9978. }
  9979. func (c *RastersUploadCall) doRequest(alt string) (*http.Response, error) {
  9980. var body io.Reader = nil
  9981. body, err := googleapi.WithoutDataWrapper.JSONReader(c.raster)
  9982. if err != nil {
  9983. return nil, err
  9984. }
  9985. ctype := "application/json"
  9986. c.urlParams_.Set("alt", alt)
  9987. urls := googleapi.ResolveRelative(c.s.BasePath, "rasters/upload")
  9988. urls += "?" + c.urlParams_.Encode()
  9989. req, _ := http.NewRequest("POST", urls, body)
  9990. googleapi.SetOpaque(req.URL)
  9991. req.Header.Set("Content-Type", ctype)
  9992. req.Header.Set("User-Agent", c.s.userAgent())
  9993. if c.ctx_ != nil {
  9994. return ctxhttp.Do(c.ctx_, c.s.client, req)
  9995. }
  9996. return c.s.client.Do(req)
  9997. }
  9998. // Do executes the "mapsengine.rasters.upload" call.
  9999. // Exactly one of *Raster or error will be non-nil. Any non-2xx status
  10000. // code is an error. Response headers are in either
  10001. // *Raster.ServerResponse.Header or (if a response was returned at all)
  10002. // in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to
  10003. // check whether the returned error was because http.StatusNotModified
  10004. // was returned.
  10005. func (c *RastersUploadCall) Do(opts ...googleapi.CallOption) (*Raster, error) {
  10006. gensupport.SetOptions(c.urlParams_, opts...)
  10007. res, err := c.doRequest("json")
  10008. if res != nil && res.StatusCode == http.StatusNotModified {
  10009. if res.Body != nil {
  10010. res.Body.Close()
  10011. }
  10012. return nil, &googleapi.Error{
  10013. Code: res.StatusCode,
  10014. Header: res.Header,
  10015. }
  10016. }
  10017. if err != nil {
  10018. return nil, err
  10019. }
  10020. defer googleapi.CloseBody(res)
  10021. if err := googleapi.CheckResponse(res); err != nil {
  10022. return nil, err
  10023. }
  10024. ret := &Raster{
  10025. ServerResponse: googleapi.ServerResponse{
  10026. Header: res.Header,
  10027. HTTPStatusCode: res.StatusCode,
  10028. },
  10029. }
  10030. if err := json.NewDecoder(res.Body).Decode(&ret); err != nil {
  10031. return nil, err
  10032. }
  10033. return ret, nil
  10034. // {
  10035. // "description": "Create a skeleton raster asset for upload.",
  10036. // "httpMethod": "POST",
  10037. // "id": "mapsengine.rasters.upload",
  10038. // "path": "rasters/upload",
  10039. // "request": {
  10040. // "$ref": "Raster"
  10041. // },
  10042. // "response": {
  10043. // "$ref": "Raster"
  10044. // },
  10045. // "scopes": [
  10046. // "https://www.googleapis.com/auth/mapsengine"
  10047. // ]
  10048. // }
  10049. }
  10050. // method id "mapsengine.rasters.files.insert":
  10051. type RastersFilesInsertCall struct {
  10052. s *Service
  10053. id string
  10054. urlParams_ gensupport.URLParams
  10055. media_ io.Reader
  10056. resumableBuffer_ *gensupport.ResumableBuffer
  10057. mediaType_ string
  10058. mediaSize_ int64 // mediaSize, if known. Used only for calls to progressUpdater_.
  10059. progressUpdater_ googleapi.ProgressUpdater
  10060. ctx_ context.Context
  10061. }
  10062. // Insert: Upload a file to a raster asset.
  10063. func (r *RastersFilesService) Insert(id string, filename string) *RastersFilesInsertCall {
  10064. c := &RastersFilesInsertCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  10065. c.id = id
  10066. c.urlParams_.Set("filename", filename)
  10067. return c
  10068. }
  10069. // Media specifies the media to upload in one or more chunks. The chunk
  10070. // size may be controlled by supplying a MediaOption generated by
  10071. // googleapi.ChunkSize. The chunk size defaults to
  10072. // googleapi.DefaultUploadChunkSize.
  10073. // At most one of Media and ResumableMedia may be set.
  10074. func (c *RastersFilesInsertCall) Media(r io.Reader, options ...googleapi.MediaOption) *RastersFilesInsertCall {
  10075. opts := googleapi.ProcessMediaOptions(options)
  10076. chunkSize := opts.ChunkSize
  10077. r, c.mediaType_ = gensupport.DetermineContentType(r, opts.ContentType)
  10078. c.media_, c.resumableBuffer_ = gensupport.PrepareUpload(r, chunkSize)
  10079. return c
  10080. }
  10081. // ResumableMedia specifies the media to upload in chunks and can be
  10082. // canceled with ctx.
  10083. //
  10084. // Deprecated: use Media instead.
  10085. //
  10086. // At most one of Media and ResumableMedia may be set. mediaType
  10087. // identifies the MIME media type of the upload, such as "image/png". If
  10088. // mediaType is "", it will be auto-detected. The provided ctx will
  10089. // supersede any context previously provided to the Context method.
  10090. func (c *RastersFilesInsertCall) ResumableMedia(ctx context.Context, r io.ReaderAt, size int64, mediaType string) *RastersFilesInsertCall {
  10091. c.ctx_ = ctx
  10092. rdr := gensupport.ReaderAtToReader(r, size)
  10093. rdr, c.mediaType_ = gensupport.DetermineContentType(rdr, mediaType)
  10094. c.resumableBuffer_ = gensupport.NewResumableBuffer(rdr, googleapi.DefaultUploadChunkSize)
  10095. c.media_ = nil
  10096. c.mediaSize_ = size
  10097. return c
  10098. }
  10099. // ProgressUpdater provides a callback function that will be called
  10100. // after every chunk. It should be a low-latency function in order to
  10101. // not slow down the upload operation. This should only be called when
  10102. // using ResumableMedia (as opposed to Media).
  10103. func (c *RastersFilesInsertCall) ProgressUpdater(pu googleapi.ProgressUpdater) *RastersFilesInsertCall {
  10104. c.progressUpdater_ = pu
  10105. return c
  10106. }
  10107. // Fields allows partial responses to be retrieved. See
  10108. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  10109. // for more information.
  10110. func (c *RastersFilesInsertCall) Fields(s ...googleapi.Field) *RastersFilesInsertCall {
  10111. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  10112. return c
  10113. }
  10114. // Context sets the context to be used in this call's Do method. Any
  10115. // pending HTTP request will be aborted if the provided context is
  10116. // canceled.
  10117. // This context will supersede any context previously provided to the
  10118. // ResumableMedia method.
  10119. func (c *RastersFilesInsertCall) Context(ctx context.Context) *RastersFilesInsertCall {
  10120. c.ctx_ = ctx
  10121. return c
  10122. }
  10123. func (c *RastersFilesInsertCall) doRequest(alt string) (*http.Response, error) {
  10124. var body io.Reader = nil
  10125. c.urlParams_.Set("alt", alt)
  10126. urls := googleapi.ResolveRelative(c.s.BasePath, "rasters/{id}/files")
  10127. if c.media_ != nil || c.resumableBuffer_ != nil {
  10128. urls = strings.Replace(urls, "https://www.googleapis.com/", "https://www.googleapis.com/upload/", 1)
  10129. protocol := "multipart"
  10130. if c.resumableBuffer_ != nil {
  10131. protocol = "resumable"
  10132. }
  10133. c.urlParams_.Set("uploadType", protocol)
  10134. }
  10135. urls += "?" + c.urlParams_.Encode()
  10136. body = new(bytes.Buffer)
  10137. ctype := "application/json"
  10138. if c.media_ != nil {
  10139. var combined io.ReadCloser
  10140. combined, ctype = gensupport.CombineBodyMedia(body, ctype, c.media_, c.mediaType_)
  10141. defer combined.Close()
  10142. body = combined
  10143. }
  10144. req, _ := http.NewRequest("POST", urls, body)
  10145. googleapi.Expand(req.URL, map[string]string{
  10146. "id": c.id,
  10147. })
  10148. if c.resumableBuffer_ != nil {
  10149. req.Header.Set("X-Upload-Content-Type", c.mediaType_)
  10150. }
  10151. req.Header.Set("Content-Type", ctype)
  10152. req.Header.Set("User-Agent", c.s.userAgent())
  10153. if c.ctx_ != nil {
  10154. return ctxhttp.Do(c.ctx_, c.s.client, req)
  10155. }
  10156. return c.s.client.Do(req)
  10157. }
  10158. // Do executes the "mapsengine.rasters.files.insert" call.
  10159. func (c *RastersFilesInsertCall) Do(opts ...googleapi.CallOption) error {
  10160. gensupport.SetOptions(c.urlParams_, opts...)
  10161. res, err := gensupport.Retry(c.ctx_, func() (*http.Response, error) {
  10162. return c.doRequest("json")
  10163. }, gensupport.DefaultBackoffStrategy())
  10164. if err != nil {
  10165. return err
  10166. }
  10167. defer googleapi.CloseBody(res)
  10168. if err := googleapi.CheckResponse(res); err != nil {
  10169. return err
  10170. }
  10171. if c.resumableBuffer_ != nil {
  10172. loc := res.Header.Get("Location")
  10173. rx := &gensupport.ResumableUpload{
  10174. Client: c.s.client,
  10175. UserAgent: c.s.userAgent(),
  10176. URI: loc,
  10177. Media: c.resumableBuffer_,
  10178. MediaType: c.mediaType_,
  10179. Callback: func(curr int64) {
  10180. if c.progressUpdater_ != nil {
  10181. c.progressUpdater_(curr, c.mediaSize_)
  10182. }
  10183. },
  10184. }
  10185. ctx := c.ctx_
  10186. if ctx == nil {
  10187. ctx = context.TODO()
  10188. }
  10189. res, err = rx.Upload(ctx)
  10190. if err != nil {
  10191. return err
  10192. }
  10193. defer res.Body.Close()
  10194. if err := googleapi.CheckResponse(res); err != nil {
  10195. return err
  10196. }
  10197. }
  10198. return nil
  10199. // {
  10200. // "description": "Upload a file to a raster asset.",
  10201. // "httpMethod": "POST",
  10202. // "id": "mapsengine.rasters.files.insert",
  10203. // "mediaUpload": {
  10204. // "accept": [
  10205. // "*/*"
  10206. // ],
  10207. // "maxSize": "10GB",
  10208. // "protocols": {
  10209. // "resumable": {
  10210. // "multipart": true,
  10211. // "path": "/resumable/upload/mapsengine/exp2/rasters/{id}/files"
  10212. // },
  10213. // "simple": {
  10214. // "multipart": true,
  10215. // "path": "/upload/mapsengine/exp2/rasters/{id}/files"
  10216. // }
  10217. // }
  10218. // },
  10219. // "parameterOrder": [
  10220. // "id",
  10221. // "filename"
  10222. // ],
  10223. // "parameters": {
  10224. // "filename": {
  10225. // "description": "The file name of this uploaded file.",
  10226. // "location": "query",
  10227. // "required": true,
  10228. // "type": "string"
  10229. // },
  10230. // "id": {
  10231. // "description": "The ID of the raster asset.",
  10232. // "location": "path",
  10233. // "required": true,
  10234. // "type": "string"
  10235. // }
  10236. // },
  10237. // "path": "rasters/{id}/files",
  10238. // "scopes": [
  10239. // "https://www.googleapis.com/auth/mapsengine"
  10240. // ],
  10241. // "supportsMediaUpload": true
  10242. // }
  10243. }
  10244. // method id "mapsengine.rasters.parents.list":
  10245. type RastersParentsListCall struct {
  10246. s *Service
  10247. id string
  10248. urlParams_ gensupport.URLParams
  10249. ifNoneMatch_ string
  10250. ctx_ context.Context
  10251. }
  10252. // List: Return all parent ids of the specified rasters.
  10253. func (r *RastersParentsService) List(id string) *RastersParentsListCall {
  10254. c := &RastersParentsListCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  10255. c.id = id
  10256. return c
  10257. }
  10258. // MaxResults sets the optional parameter "maxResults": The maximum
  10259. // number of items to include in a single response page. The maximum
  10260. // supported value is 50.
  10261. func (c *RastersParentsListCall) MaxResults(maxResults int64) *RastersParentsListCall {
  10262. c.urlParams_.Set("maxResults", fmt.Sprint(maxResults))
  10263. return c
  10264. }
  10265. // PageToken sets the optional parameter "pageToken": The continuation
  10266. // token, used to page through large result sets. To get the next page
  10267. // of results, set this parameter to the value of nextPageToken from the
  10268. // previous response.
  10269. func (c *RastersParentsListCall) PageToken(pageToken string) *RastersParentsListCall {
  10270. c.urlParams_.Set("pageToken", pageToken)
  10271. return c
  10272. }
  10273. // Fields allows partial responses to be retrieved. See
  10274. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  10275. // for more information.
  10276. func (c *RastersParentsListCall) Fields(s ...googleapi.Field) *RastersParentsListCall {
  10277. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  10278. return c
  10279. }
  10280. // IfNoneMatch sets the optional parameter which makes the operation
  10281. // fail if the object's ETag matches the given value. This is useful for
  10282. // getting updates only after the object has changed since the last
  10283. // request. Use googleapi.IsNotModified to check whether the response
  10284. // error from Do is the result of In-None-Match.
  10285. func (c *RastersParentsListCall) IfNoneMatch(entityTag string) *RastersParentsListCall {
  10286. c.ifNoneMatch_ = entityTag
  10287. return c
  10288. }
  10289. // Context sets the context to be used in this call's Do method. Any
  10290. // pending HTTP request will be aborted if the provided context is
  10291. // canceled.
  10292. func (c *RastersParentsListCall) Context(ctx context.Context) *RastersParentsListCall {
  10293. c.ctx_ = ctx
  10294. return c
  10295. }
  10296. func (c *RastersParentsListCall) doRequest(alt string) (*http.Response, error) {
  10297. var body io.Reader = nil
  10298. c.urlParams_.Set("alt", alt)
  10299. urls := googleapi.ResolveRelative(c.s.BasePath, "rasters/{id}/parents")
  10300. urls += "?" + c.urlParams_.Encode()
  10301. req, _ := http.NewRequest("GET", urls, body)
  10302. googleapi.Expand(req.URL, map[string]string{
  10303. "id": c.id,
  10304. })
  10305. req.Header.Set("User-Agent", c.s.userAgent())
  10306. if c.ifNoneMatch_ != "" {
  10307. req.Header.Set("If-None-Match", c.ifNoneMatch_)
  10308. }
  10309. if c.ctx_ != nil {
  10310. return ctxhttp.Do(c.ctx_, c.s.client, req)
  10311. }
  10312. return c.s.client.Do(req)
  10313. }
  10314. // Do executes the "mapsengine.rasters.parents.list" call.
  10315. // Exactly one of *ParentsListResponse or error will be non-nil. Any
  10316. // non-2xx status code is an error. Response headers are in either
  10317. // *ParentsListResponse.ServerResponse.Header or (if a response was
  10318. // returned at all) in error.(*googleapi.Error).Header. Use
  10319. // googleapi.IsNotModified to check whether the returned error was
  10320. // because http.StatusNotModified was returned.
  10321. func (c *RastersParentsListCall) Do(opts ...googleapi.CallOption) (*ParentsListResponse, error) {
  10322. gensupport.SetOptions(c.urlParams_, opts...)
  10323. res, err := c.doRequest("json")
  10324. if res != nil && res.StatusCode == http.StatusNotModified {
  10325. if res.Body != nil {
  10326. res.Body.Close()
  10327. }
  10328. return nil, &googleapi.Error{
  10329. Code: res.StatusCode,
  10330. Header: res.Header,
  10331. }
  10332. }
  10333. if err != nil {
  10334. return nil, err
  10335. }
  10336. defer googleapi.CloseBody(res)
  10337. if err := googleapi.CheckResponse(res); err != nil {
  10338. return nil, err
  10339. }
  10340. ret := &ParentsListResponse{
  10341. ServerResponse: googleapi.ServerResponse{
  10342. Header: res.Header,
  10343. HTTPStatusCode: res.StatusCode,
  10344. },
  10345. }
  10346. if err := json.NewDecoder(res.Body).Decode(&ret); err != nil {
  10347. return nil, err
  10348. }
  10349. return ret, nil
  10350. // {
  10351. // "description": "Return all parent ids of the specified rasters.",
  10352. // "httpMethod": "GET",
  10353. // "id": "mapsengine.rasters.parents.list",
  10354. // "parameterOrder": [
  10355. // "id"
  10356. // ],
  10357. // "parameters": {
  10358. // "id": {
  10359. // "description": "The ID of the rasters whose parents will be listed.",
  10360. // "location": "path",
  10361. // "required": true,
  10362. // "type": "string"
  10363. // },
  10364. // "maxResults": {
  10365. // "description": "The maximum number of items to include in a single response page. The maximum supported value is 50.",
  10366. // "format": "uint32",
  10367. // "location": "query",
  10368. // "type": "integer"
  10369. // },
  10370. // "pageToken": {
  10371. // "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.",
  10372. // "location": "query",
  10373. // "type": "string"
  10374. // }
  10375. // },
  10376. // "path": "rasters/{id}/parents",
  10377. // "response": {
  10378. // "$ref": "ParentsListResponse"
  10379. // },
  10380. // "scopes": [
  10381. // "https://www.googleapis.com/auth/mapsengine",
  10382. // "https://www.googleapis.com/auth/mapsengine.readonly"
  10383. // ]
  10384. // }
  10385. }
  10386. // Pages invokes f for each page of results.
  10387. // A non-nil error returned from f will halt the iteration.
  10388. // The provided context supersedes any context provided to the Context method.
  10389. func (c *RastersParentsListCall) Pages(ctx context.Context, f func(*ParentsListResponse) error) error {
  10390. c.ctx_ = ctx
  10391. defer c.PageToken(c.urlParams_.Get("pageToken")) // reset paging to original point
  10392. for {
  10393. x, err := c.Do()
  10394. if err != nil {
  10395. return err
  10396. }
  10397. if err := f(x); err != nil {
  10398. return err
  10399. }
  10400. if x.NextPageToken == "" {
  10401. return nil
  10402. }
  10403. c.PageToken(x.NextPageToken)
  10404. }
  10405. }
  10406. // method id "mapsengine.rasters.permissions.batchDelete":
  10407. type RastersPermissionsBatchDeleteCall struct {
  10408. s *Service
  10409. id string
  10410. permissionsbatchdeleterequest *PermissionsBatchDeleteRequest
  10411. urlParams_ gensupport.URLParams
  10412. ctx_ context.Context
  10413. }
  10414. // BatchDelete: Remove permission entries from an already existing
  10415. // asset.
  10416. func (r *RastersPermissionsService) BatchDelete(id string, permissionsbatchdeleterequest *PermissionsBatchDeleteRequest) *RastersPermissionsBatchDeleteCall {
  10417. c := &RastersPermissionsBatchDeleteCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  10418. c.id = id
  10419. c.permissionsbatchdeleterequest = permissionsbatchdeleterequest
  10420. return c
  10421. }
  10422. // Fields allows partial responses to be retrieved. See
  10423. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  10424. // for more information.
  10425. func (c *RastersPermissionsBatchDeleteCall) Fields(s ...googleapi.Field) *RastersPermissionsBatchDeleteCall {
  10426. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  10427. return c
  10428. }
  10429. // Context sets the context to be used in this call's Do method. Any
  10430. // pending HTTP request will be aborted if the provided context is
  10431. // canceled.
  10432. func (c *RastersPermissionsBatchDeleteCall) Context(ctx context.Context) *RastersPermissionsBatchDeleteCall {
  10433. c.ctx_ = ctx
  10434. return c
  10435. }
  10436. func (c *RastersPermissionsBatchDeleteCall) doRequest(alt string) (*http.Response, error) {
  10437. var body io.Reader = nil
  10438. body, err := googleapi.WithoutDataWrapper.JSONReader(c.permissionsbatchdeleterequest)
  10439. if err != nil {
  10440. return nil, err
  10441. }
  10442. ctype := "application/json"
  10443. c.urlParams_.Set("alt", alt)
  10444. urls := googleapi.ResolveRelative(c.s.BasePath, "rasters/{id}/permissions/batchDelete")
  10445. urls += "?" + c.urlParams_.Encode()
  10446. req, _ := http.NewRequest("POST", urls, body)
  10447. googleapi.Expand(req.URL, map[string]string{
  10448. "id": c.id,
  10449. })
  10450. req.Header.Set("Content-Type", ctype)
  10451. req.Header.Set("User-Agent", c.s.userAgent())
  10452. if c.ctx_ != nil {
  10453. return ctxhttp.Do(c.ctx_, c.s.client, req)
  10454. }
  10455. return c.s.client.Do(req)
  10456. }
  10457. // Do executes the "mapsengine.rasters.permissions.batchDelete" call.
  10458. // Exactly one of *PermissionsBatchDeleteResponse or error will be
  10459. // non-nil. Any non-2xx status code is an error. Response headers are in
  10460. // either *PermissionsBatchDeleteResponse.ServerResponse.Header or (if a
  10461. // response was returned at all) in error.(*googleapi.Error).Header. Use
  10462. // googleapi.IsNotModified to check whether the returned error was
  10463. // because http.StatusNotModified was returned.
  10464. func (c *RastersPermissionsBatchDeleteCall) Do(opts ...googleapi.CallOption) (*PermissionsBatchDeleteResponse, error) {
  10465. gensupport.SetOptions(c.urlParams_, opts...)
  10466. res, err := c.doRequest("json")
  10467. if res != nil && res.StatusCode == http.StatusNotModified {
  10468. if res.Body != nil {
  10469. res.Body.Close()
  10470. }
  10471. return nil, &googleapi.Error{
  10472. Code: res.StatusCode,
  10473. Header: res.Header,
  10474. }
  10475. }
  10476. if err != nil {
  10477. return nil, err
  10478. }
  10479. defer googleapi.CloseBody(res)
  10480. if err := googleapi.CheckResponse(res); err != nil {
  10481. return nil, err
  10482. }
  10483. ret := &PermissionsBatchDeleteResponse{
  10484. ServerResponse: googleapi.ServerResponse{
  10485. Header: res.Header,
  10486. HTTPStatusCode: res.StatusCode,
  10487. },
  10488. }
  10489. if err := json.NewDecoder(res.Body).Decode(&ret); err != nil {
  10490. return nil, err
  10491. }
  10492. return ret, nil
  10493. // {
  10494. // "description": "Remove permission entries from an already existing asset.",
  10495. // "httpMethod": "POST",
  10496. // "id": "mapsengine.rasters.permissions.batchDelete",
  10497. // "parameterOrder": [
  10498. // "id"
  10499. // ],
  10500. // "parameters": {
  10501. // "id": {
  10502. // "description": "The ID of the asset from which permissions will be removed.",
  10503. // "location": "path",
  10504. // "required": true,
  10505. // "type": "string"
  10506. // }
  10507. // },
  10508. // "path": "rasters/{id}/permissions/batchDelete",
  10509. // "request": {
  10510. // "$ref": "PermissionsBatchDeleteRequest"
  10511. // },
  10512. // "response": {
  10513. // "$ref": "PermissionsBatchDeleteResponse"
  10514. // },
  10515. // "scopes": [
  10516. // "https://www.googleapis.com/auth/mapsengine"
  10517. // ]
  10518. // }
  10519. }
  10520. // method id "mapsengine.rasters.permissions.batchUpdate":
  10521. type RastersPermissionsBatchUpdateCall struct {
  10522. s *Service
  10523. id string
  10524. permissionsbatchupdaterequest *PermissionsBatchUpdateRequest
  10525. urlParams_ gensupport.URLParams
  10526. ctx_ context.Context
  10527. }
  10528. // BatchUpdate: Add or update permission entries to an already existing
  10529. // asset.
  10530. //
  10531. // An asset can hold up to 20 different permission entries. Each
  10532. // batchInsert request is atomic.
  10533. func (r *RastersPermissionsService) BatchUpdate(id string, permissionsbatchupdaterequest *PermissionsBatchUpdateRequest) *RastersPermissionsBatchUpdateCall {
  10534. c := &RastersPermissionsBatchUpdateCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  10535. c.id = id
  10536. c.permissionsbatchupdaterequest = permissionsbatchupdaterequest
  10537. return c
  10538. }
  10539. // Fields allows partial responses to be retrieved. See
  10540. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  10541. // for more information.
  10542. func (c *RastersPermissionsBatchUpdateCall) Fields(s ...googleapi.Field) *RastersPermissionsBatchUpdateCall {
  10543. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  10544. return c
  10545. }
  10546. // Context sets the context to be used in this call's Do method. Any
  10547. // pending HTTP request will be aborted if the provided context is
  10548. // canceled.
  10549. func (c *RastersPermissionsBatchUpdateCall) Context(ctx context.Context) *RastersPermissionsBatchUpdateCall {
  10550. c.ctx_ = ctx
  10551. return c
  10552. }
  10553. func (c *RastersPermissionsBatchUpdateCall) doRequest(alt string) (*http.Response, error) {
  10554. var body io.Reader = nil
  10555. body, err := googleapi.WithoutDataWrapper.JSONReader(c.permissionsbatchupdaterequest)
  10556. if err != nil {
  10557. return nil, err
  10558. }
  10559. ctype := "application/json"
  10560. c.urlParams_.Set("alt", alt)
  10561. urls := googleapi.ResolveRelative(c.s.BasePath, "rasters/{id}/permissions/batchUpdate")
  10562. urls += "?" + c.urlParams_.Encode()
  10563. req, _ := http.NewRequest("POST", urls, body)
  10564. googleapi.Expand(req.URL, map[string]string{
  10565. "id": c.id,
  10566. })
  10567. req.Header.Set("Content-Type", ctype)
  10568. req.Header.Set("User-Agent", c.s.userAgent())
  10569. if c.ctx_ != nil {
  10570. return ctxhttp.Do(c.ctx_, c.s.client, req)
  10571. }
  10572. return c.s.client.Do(req)
  10573. }
  10574. // Do executes the "mapsengine.rasters.permissions.batchUpdate" call.
  10575. // Exactly one of *PermissionsBatchUpdateResponse or error will be
  10576. // non-nil. Any non-2xx status code is an error. Response headers are in
  10577. // either *PermissionsBatchUpdateResponse.ServerResponse.Header or (if a
  10578. // response was returned at all) in error.(*googleapi.Error).Header. Use
  10579. // googleapi.IsNotModified to check whether the returned error was
  10580. // because http.StatusNotModified was returned.
  10581. func (c *RastersPermissionsBatchUpdateCall) Do(opts ...googleapi.CallOption) (*PermissionsBatchUpdateResponse, error) {
  10582. gensupport.SetOptions(c.urlParams_, opts...)
  10583. res, err := c.doRequest("json")
  10584. if res != nil && res.StatusCode == http.StatusNotModified {
  10585. if res.Body != nil {
  10586. res.Body.Close()
  10587. }
  10588. return nil, &googleapi.Error{
  10589. Code: res.StatusCode,
  10590. Header: res.Header,
  10591. }
  10592. }
  10593. if err != nil {
  10594. return nil, err
  10595. }
  10596. defer googleapi.CloseBody(res)
  10597. if err := googleapi.CheckResponse(res); err != nil {
  10598. return nil, err
  10599. }
  10600. ret := &PermissionsBatchUpdateResponse{
  10601. ServerResponse: googleapi.ServerResponse{
  10602. Header: res.Header,
  10603. HTTPStatusCode: res.StatusCode,
  10604. },
  10605. }
  10606. if err := json.NewDecoder(res.Body).Decode(&ret); err != nil {
  10607. return nil, err
  10608. }
  10609. return ret, nil
  10610. // {
  10611. // "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.",
  10612. // "httpMethod": "POST",
  10613. // "id": "mapsengine.rasters.permissions.batchUpdate",
  10614. // "parameterOrder": [
  10615. // "id"
  10616. // ],
  10617. // "parameters": {
  10618. // "id": {
  10619. // "description": "The ID of the asset to which permissions will be added.",
  10620. // "location": "path",
  10621. // "required": true,
  10622. // "type": "string"
  10623. // }
  10624. // },
  10625. // "path": "rasters/{id}/permissions/batchUpdate",
  10626. // "request": {
  10627. // "$ref": "PermissionsBatchUpdateRequest"
  10628. // },
  10629. // "response": {
  10630. // "$ref": "PermissionsBatchUpdateResponse"
  10631. // },
  10632. // "scopes": [
  10633. // "https://www.googleapis.com/auth/mapsengine"
  10634. // ]
  10635. // }
  10636. }
  10637. // method id "mapsengine.rasters.permissions.list":
  10638. type RastersPermissionsListCall struct {
  10639. s *Service
  10640. id string
  10641. urlParams_ gensupport.URLParams
  10642. ifNoneMatch_ string
  10643. ctx_ context.Context
  10644. }
  10645. // List: Return all of the permissions for the specified asset.
  10646. func (r *RastersPermissionsService) List(id string) *RastersPermissionsListCall {
  10647. c := &RastersPermissionsListCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  10648. c.id = id
  10649. return c
  10650. }
  10651. // Fields allows partial responses to be retrieved. See
  10652. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  10653. // for more information.
  10654. func (c *RastersPermissionsListCall) Fields(s ...googleapi.Field) *RastersPermissionsListCall {
  10655. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  10656. return c
  10657. }
  10658. // IfNoneMatch sets the optional parameter which makes the operation
  10659. // fail if the object's ETag matches the given value. This is useful for
  10660. // getting updates only after the object has changed since the last
  10661. // request. Use googleapi.IsNotModified to check whether the response
  10662. // error from Do is the result of In-None-Match.
  10663. func (c *RastersPermissionsListCall) IfNoneMatch(entityTag string) *RastersPermissionsListCall {
  10664. c.ifNoneMatch_ = entityTag
  10665. return c
  10666. }
  10667. // Context sets the context to be used in this call's Do method. Any
  10668. // pending HTTP request will be aborted if the provided context is
  10669. // canceled.
  10670. func (c *RastersPermissionsListCall) Context(ctx context.Context) *RastersPermissionsListCall {
  10671. c.ctx_ = ctx
  10672. return c
  10673. }
  10674. func (c *RastersPermissionsListCall) doRequest(alt string) (*http.Response, error) {
  10675. var body io.Reader = nil
  10676. c.urlParams_.Set("alt", alt)
  10677. urls := googleapi.ResolveRelative(c.s.BasePath, "rasters/{id}/permissions")
  10678. urls += "?" + c.urlParams_.Encode()
  10679. req, _ := http.NewRequest("GET", urls, body)
  10680. googleapi.Expand(req.URL, map[string]string{
  10681. "id": c.id,
  10682. })
  10683. req.Header.Set("User-Agent", c.s.userAgent())
  10684. if c.ifNoneMatch_ != "" {
  10685. req.Header.Set("If-None-Match", c.ifNoneMatch_)
  10686. }
  10687. if c.ctx_ != nil {
  10688. return ctxhttp.Do(c.ctx_, c.s.client, req)
  10689. }
  10690. return c.s.client.Do(req)
  10691. }
  10692. // Do executes the "mapsengine.rasters.permissions.list" call.
  10693. // Exactly one of *PermissionsListResponse or error will be non-nil. Any
  10694. // non-2xx status code is an error. Response headers are in either
  10695. // *PermissionsListResponse.ServerResponse.Header or (if a response was
  10696. // returned at all) in error.(*googleapi.Error).Header. Use
  10697. // googleapi.IsNotModified to check whether the returned error was
  10698. // because http.StatusNotModified was returned.
  10699. func (c *RastersPermissionsListCall) Do(opts ...googleapi.CallOption) (*PermissionsListResponse, error) {
  10700. gensupport.SetOptions(c.urlParams_, opts...)
  10701. res, err := c.doRequest("json")
  10702. if res != nil && res.StatusCode == http.StatusNotModified {
  10703. if res.Body != nil {
  10704. res.Body.Close()
  10705. }
  10706. return nil, &googleapi.Error{
  10707. Code: res.StatusCode,
  10708. Header: res.Header,
  10709. }
  10710. }
  10711. if err != nil {
  10712. return nil, err
  10713. }
  10714. defer googleapi.CloseBody(res)
  10715. if err := googleapi.CheckResponse(res); err != nil {
  10716. return nil, err
  10717. }
  10718. ret := &PermissionsListResponse{
  10719. ServerResponse: googleapi.ServerResponse{
  10720. Header: res.Header,
  10721. HTTPStatusCode: res.StatusCode,
  10722. },
  10723. }
  10724. if err := json.NewDecoder(res.Body).Decode(&ret); err != nil {
  10725. return nil, err
  10726. }
  10727. return ret, nil
  10728. // {
  10729. // "description": "Return all of the permissions for the specified asset.",
  10730. // "httpMethod": "GET",
  10731. // "id": "mapsengine.rasters.permissions.list",
  10732. // "parameterOrder": [
  10733. // "id"
  10734. // ],
  10735. // "parameters": {
  10736. // "id": {
  10737. // "description": "The ID of the asset whose permissions will be listed.",
  10738. // "location": "path",
  10739. // "required": true,
  10740. // "type": "string"
  10741. // }
  10742. // },
  10743. // "path": "rasters/{id}/permissions",
  10744. // "response": {
  10745. // "$ref": "PermissionsListResponse"
  10746. // },
  10747. // "scopes": [
  10748. // "https://www.googleapis.com/auth/mapsengine",
  10749. // "https://www.googleapis.com/auth/mapsengine.readonly"
  10750. // ]
  10751. // }
  10752. }
  10753. // method id "mapsengine.tables.create":
  10754. type TablesCreateCall struct {
  10755. s *Service
  10756. table *Table
  10757. urlParams_ gensupport.URLParams
  10758. ctx_ context.Context
  10759. }
  10760. // Create: Create a table asset.
  10761. func (r *TablesService) Create(table *Table) *TablesCreateCall {
  10762. c := &TablesCreateCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  10763. c.table = table
  10764. return c
  10765. }
  10766. // Fields allows partial responses to be retrieved. See
  10767. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  10768. // for more information.
  10769. func (c *TablesCreateCall) Fields(s ...googleapi.Field) *TablesCreateCall {
  10770. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  10771. return c
  10772. }
  10773. // Context sets the context to be used in this call's Do method. Any
  10774. // pending HTTP request will be aborted if the provided context is
  10775. // canceled.
  10776. func (c *TablesCreateCall) Context(ctx context.Context) *TablesCreateCall {
  10777. c.ctx_ = ctx
  10778. return c
  10779. }
  10780. func (c *TablesCreateCall) doRequest(alt string) (*http.Response, error) {
  10781. var body io.Reader = nil
  10782. body, err := googleapi.WithoutDataWrapper.JSONReader(c.table)
  10783. if err != nil {
  10784. return nil, err
  10785. }
  10786. ctype := "application/json"
  10787. c.urlParams_.Set("alt", alt)
  10788. urls := googleapi.ResolveRelative(c.s.BasePath, "tables")
  10789. urls += "?" + c.urlParams_.Encode()
  10790. req, _ := http.NewRequest("POST", urls, body)
  10791. googleapi.SetOpaque(req.URL)
  10792. req.Header.Set("Content-Type", ctype)
  10793. req.Header.Set("User-Agent", c.s.userAgent())
  10794. if c.ctx_ != nil {
  10795. return ctxhttp.Do(c.ctx_, c.s.client, req)
  10796. }
  10797. return c.s.client.Do(req)
  10798. }
  10799. // Do executes the "mapsengine.tables.create" call.
  10800. // Exactly one of *Table or error will be non-nil. Any non-2xx status
  10801. // code is an error. Response headers are in either
  10802. // *Table.ServerResponse.Header or (if a response was returned at all)
  10803. // in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to
  10804. // check whether the returned error was because http.StatusNotModified
  10805. // was returned.
  10806. func (c *TablesCreateCall) Do(opts ...googleapi.CallOption) (*Table, error) {
  10807. gensupport.SetOptions(c.urlParams_, opts...)
  10808. res, err := c.doRequest("json")
  10809. if res != nil && res.StatusCode == http.StatusNotModified {
  10810. if res.Body != nil {
  10811. res.Body.Close()
  10812. }
  10813. return nil, &googleapi.Error{
  10814. Code: res.StatusCode,
  10815. Header: res.Header,
  10816. }
  10817. }
  10818. if err != nil {
  10819. return nil, err
  10820. }
  10821. defer googleapi.CloseBody(res)
  10822. if err := googleapi.CheckResponse(res); err != nil {
  10823. return nil, err
  10824. }
  10825. ret := &Table{
  10826. ServerResponse: googleapi.ServerResponse{
  10827. Header: res.Header,
  10828. HTTPStatusCode: res.StatusCode,
  10829. },
  10830. }
  10831. if err := json.NewDecoder(res.Body).Decode(&ret); err != nil {
  10832. return nil, err
  10833. }
  10834. return ret, nil
  10835. // {
  10836. // "description": "Create a table asset.",
  10837. // "httpMethod": "POST",
  10838. // "id": "mapsengine.tables.create",
  10839. // "path": "tables",
  10840. // "request": {
  10841. // "$ref": "Table"
  10842. // },
  10843. // "response": {
  10844. // "$ref": "Table"
  10845. // },
  10846. // "scopes": [
  10847. // "https://www.googleapis.com/auth/mapsengine"
  10848. // ]
  10849. // }
  10850. }
  10851. // method id "mapsengine.tables.delete":
  10852. type TablesDeleteCall struct {
  10853. s *Service
  10854. id string
  10855. urlParams_ gensupport.URLParams
  10856. ctx_ context.Context
  10857. }
  10858. // Delete: Delete a table.
  10859. func (r *TablesService) Delete(id string) *TablesDeleteCall {
  10860. c := &TablesDeleteCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  10861. c.id = id
  10862. return c
  10863. }
  10864. // Fields allows partial responses to be retrieved. See
  10865. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  10866. // for more information.
  10867. func (c *TablesDeleteCall) Fields(s ...googleapi.Field) *TablesDeleteCall {
  10868. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  10869. return c
  10870. }
  10871. // Context sets the context to be used in this call's Do method. Any
  10872. // pending HTTP request will be aborted if the provided context is
  10873. // canceled.
  10874. func (c *TablesDeleteCall) Context(ctx context.Context) *TablesDeleteCall {
  10875. c.ctx_ = ctx
  10876. return c
  10877. }
  10878. func (c *TablesDeleteCall) doRequest(alt string) (*http.Response, error) {
  10879. var body io.Reader = nil
  10880. c.urlParams_.Set("alt", alt)
  10881. urls := googleapi.ResolveRelative(c.s.BasePath, "tables/{id}")
  10882. urls += "?" + c.urlParams_.Encode()
  10883. req, _ := http.NewRequest("DELETE", urls, body)
  10884. googleapi.Expand(req.URL, map[string]string{
  10885. "id": c.id,
  10886. })
  10887. req.Header.Set("User-Agent", c.s.userAgent())
  10888. if c.ctx_ != nil {
  10889. return ctxhttp.Do(c.ctx_, c.s.client, req)
  10890. }
  10891. return c.s.client.Do(req)
  10892. }
  10893. // Do executes the "mapsengine.tables.delete" call.
  10894. func (c *TablesDeleteCall) Do(opts ...googleapi.CallOption) error {
  10895. gensupport.SetOptions(c.urlParams_, opts...)
  10896. res, err := c.doRequest("json")
  10897. if err != nil {
  10898. return err
  10899. }
  10900. defer googleapi.CloseBody(res)
  10901. if err := googleapi.CheckResponse(res); err != nil {
  10902. return err
  10903. }
  10904. return nil
  10905. // {
  10906. // "description": "Delete a table.",
  10907. // "httpMethod": "DELETE",
  10908. // "id": "mapsengine.tables.delete",
  10909. // "parameterOrder": [
  10910. // "id"
  10911. // ],
  10912. // "parameters": {
  10913. // "id": {
  10914. // "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.",
  10915. // "location": "path",
  10916. // "required": true,
  10917. // "type": "string"
  10918. // }
  10919. // },
  10920. // "path": "tables/{id}",
  10921. // "scopes": [
  10922. // "https://www.googleapis.com/auth/mapsengine"
  10923. // ]
  10924. // }
  10925. }
  10926. // method id "mapsengine.tables.get":
  10927. type TablesGetCall struct {
  10928. s *Service
  10929. id string
  10930. urlParams_ gensupport.URLParams
  10931. ifNoneMatch_ string
  10932. ctx_ context.Context
  10933. }
  10934. // Get: Return metadata for a particular table, including the schema.
  10935. func (r *TablesService) Get(id string) *TablesGetCall {
  10936. c := &TablesGetCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  10937. c.id = id
  10938. return c
  10939. }
  10940. // Version sets the optional parameter "version":
  10941. //
  10942. // Possible values:
  10943. // "draft" - The draft version.
  10944. // "published" - The published version.
  10945. func (c *TablesGetCall) Version(version string) *TablesGetCall {
  10946. c.urlParams_.Set("version", version)
  10947. return c
  10948. }
  10949. // Fields allows partial responses to be retrieved. See
  10950. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  10951. // for more information.
  10952. func (c *TablesGetCall) Fields(s ...googleapi.Field) *TablesGetCall {
  10953. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  10954. return c
  10955. }
  10956. // IfNoneMatch sets the optional parameter which makes the operation
  10957. // fail if the object's ETag matches the given value. This is useful for
  10958. // getting updates only after the object has changed since the last
  10959. // request. Use googleapi.IsNotModified to check whether the response
  10960. // error from Do is the result of In-None-Match.
  10961. func (c *TablesGetCall) IfNoneMatch(entityTag string) *TablesGetCall {
  10962. c.ifNoneMatch_ = entityTag
  10963. return c
  10964. }
  10965. // Context sets the context to be used in this call's Do method. Any
  10966. // pending HTTP request will be aborted if the provided context is
  10967. // canceled.
  10968. func (c *TablesGetCall) Context(ctx context.Context) *TablesGetCall {
  10969. c.ctx_ = ctx
  10970. return c
  10971. }
  10972. func (c *TablesGetCall) doRequest(alt string) (*http.Response, error) {
  10973. var body io.Reader = nil
  10974. c.urlParams_.Set("alt", alt)
  10975. urls := googleapi.ResolveRelative(c.s.BasePath, "tables/{id}")
  10976. urls += "?" + c.urlParams_.Encode()
  10977. req, _ := http.NewRequest("GET", urls, body)
  10978. googleapi.Expand(req.URL, map[string]string{
  10979. "id": c.id,
  10980. })
  10981. req.Header.Set("User-Agent", c.s.userAgent())
  10982. if c.ifNoneMatch_ != "" {
  10983. req.Header.Set("If-None-Match", c.ifNoneMatch_)
  10984. }
  10985. if c.ctx_ != nil {
  10986. return ctxhttp.Do(c.ctx_, c.s.client, req)
  10987. }
  10988. return c.s.client.Do(req)
  10989. }
  10990. // Do executes the "mapsengine.tables.get" call.
  10991. // Exactly one of *Table or error will be non-nil. Any non-2xx status
  10992. // code is an error. Response headers are in either
  10993. // *Table.ServerResponse.Header or (if a response was returned at all)
  10994. // in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to
  10995. // check whether the returned error was because http.StatusNotModified
  10996. // was returned.
  10997. func (c *TablesGetCall) Do(opts ...googleapi.CallOption) (*Table, error) {
  10998. gensupport.SetOptions(c.urlParams_, opts...)
  10999. res, err := c.doRequest("json")
  11000. if res != nil && res.StatusCode == http.StatusNotModified {
  11001. if res.Body != nil {
  11002. res.Body.Close()
  11003. }
  11004. return nil, &googleapi.Error{
  11005. Code: res.StatusCode,
  11006. Header: res.Header,
  11007. }
  11008. }
  11009. if err != nil {
  11010. return nil, err
  11011. }
  11012. defer googleapi.CloseBody(res)
  11013. if err := googleapi.CheckResponse(res); err != nil {
  11014. return nil, err
  11015. }
  11016. ret := &Table{
  11017. ServerResponse: googleapi.ServerResponse{
  11018. Header: res.Header,
  11019. HTTPStatusCode: res.StatusCode,
  11020. },
  11021. }
  11022. if err := json.NewDecoder(res.Body).Decode(&ret); err != nil {
  11023. return nil, err
  11024. }
  11025. return ret, nil
  11026. // {
  11027. // "description": "Return metadata for a particular table, including the schema.",
  11028. // "httpMethod": "GET",
  11029. // "id": "mapsengine.tables.get",
  11030. // "parameterOrder": [
  11031. // "id"
  11032. // ],
  11033. // "parameters": {
  11034. // "id": {
  11035. // "description": "The ID of the table.",
  11036. // "location": "path",
  11037. // "required": true,
  11038. // "type": "string"
  11039. // },
  11040. // "version": {
  11041. // "enum": [
  11042. // "draft",
  11043. // "published"
  11044. // ],
  11045. // "enumDescriptions": [
  11046. // "The draft version.",
  11047. // "The published version."
  11048. // ],
  11049. // "location": "query",
  11050. // "type": "string"
  11051. // }
  11052. // },
  11053. // "path": "tables/{id}",
  11054. // "response": {
  11055. // "$ref": "Table"
  11056. // },
  11057. // "scopes": [
  11058. // "https://www.googleapis.com/auth/mapsengine",
  11059. // "https://www.googleapis.com/auth/mapsengine.readonly"
  11060. // ]
  11061. // }
  11062. }
  11063. // method id "mapsengine.tables.list":
  11064. type TablesListCall struct {
  11065. s *Service
  11066. urlParams_ gensupport.URLParams
  11067. ifNoneMatch_ string
  11068. ctx_ context.Context
  11069. }
  11070. // List: Return all tables readable by the current user.
  11071. func (r *TablesService) List() *TablesListCall {
  11072. c := &TablesListCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  11073. return c
  11074. }
  11075. // Bbox sets the optional parameter "bbox": A bounding box, expressed as
  11076. // "west,south,east,north". If set, only assets which intersect this
  11077. // bounding box will be returned.
  11078. func (c *TablesListCall) Bbox(bbox string) *TablesListCall {
  11079. c.urlParams_.Set("bbox", bbox)
  11080. return c
  11081. }
  11082. // CreatedAfter sets the optional parameter "createdAfter": An RFC 3339
  11083. // formatted date-time value (e.g. 1970-01-01T00:00:00Z). Returned
  11084. // assets will have been created at or after this time.
  11085. func (c *TablesListCall) CreatedAfter(createdAfter string) *TablesListCall {
  11086. c.urlParams_.Set("createdAfter", createdAfter)
  11087. return c
  11088. }
  11089. // CreatedBefore sets the optional parameter "createdBefore": An RFC
  11090. // 3339 formatted date-time value (e.g. 1970-01-01T00:00:00Z). Returned
  11091. // assets will have been created at or before this time.
  11092. func (c *TablesListCall) CreatedBefore(createdBefore string) *TablesListCall {
  11093. c.urlParams_.Set("createdBefore", createdBefore)
  11094. return c
  11095. }
  11096. // CreatorEmail sets the optional parameter "creatorEmail": An email
  11097. // address representing a user. Returned assets that have been created
  11098. // by the user associated with the provided email address.
  11099. func (c *TablesListCall) CreatorEmail(creatorEmail string) *TablesListCall {
  11100. c.urlParams_.Set("creatorEmail", creatorEmail)
  11101. return c
  11102. }
  11103. // MaxResults sets the optional parameter "maxResults": The maximum
  11104. // number of items to include in a single response page. The maximum
  11105. // supported value is 100.
  11106. func (c *TablesListCall) MaxResults(maxResults int64) *TablesListCall {
  11107. c.urlParams_.Set("maxResults", fmt.Sprint(maxResults))
  11108. return c
  11109. }
  11110. // ModifiedAfter sets the optional parameter "modifiedAfter": An RFC
  11111. // 3339 formatted date-time value (e.g. 1970-01-01T00:00:00Z). Returned
  11112. // assets will have been modified at or after this time.
  11113. func (c *TablesListCall) ModifiedAfter(modifiedAfter string) *TablesListCall {
  11114. c.urlParams_.Set("modifiedAfter", modifiedAfter)
  11115. return c
  11116. }
  11117. // ModifiedBefore sets the optional parameter "modifiedBefore": An RFC
  11118. // 3339 formatted date-time value (e.g. 1970-01-01T00:00:00Z). Returned
  11119. // assets will have been modified at or before this time.
  11120. func (c *TablesListCall) ModifiedBefore(modifiedBefore string) *TablesListCall {
  11121. c.urlParams_.Set("modifiedBefore", modifiedBefore)
  11122. return c
  11123. }
  11124. // PageToken sets the optional parameter "pageToken": The continuation
  11125. // token, used to page through large result sets. To get the next page
  11126. // of results, set this parameter to the value of nextPageToken from the
  11127. // previous response.
  11128. func (c *TablesListCall) PageToken(pageToken string) *TablesListCall {
  11129. c.urlParams_.Set("pageToken", pageToken)
  11130. return c
  11131. }
  11132. // ProcessingStatus sets the optional parameter "processingStatus":
  11133. //
  11134. // Possible values:
  11135. // "complete" - The table has completed processing.
  11136. // "failed" - The table has failed processing.
  11137. // "notReady" - The table is not ready for processing.
  11138. // "processing" - The table is processing.
  11139. // "ready" - The table is ready for processing.
  11140. func (c *TablesListCall) ProcessingStatus(processingStatus string) *TablesListCall {
  11141. c.urlParams_.Set("processingStatus", processingStatus)
  11142. return c
  11143. }
  11144. // ProjectId sets the optional parameter "projectId": The ID of a Maps
  11145. // Engine project, used to filter the response. To list all available
  11146. // projects with their IDs, send a Projects: list request. You can also
  11147. // find your project ID as the value of the DashboardPlace:cid URL
  11148. // parameter when signed in to mapsengine.google.com.
  11149. func (c *TablesListCall) ProjectId(projectId string) *TablesListCall {
  11150. c.urlParams_.Set("projectId", projectId)
  11151. return c
  11152. }
  11153. // Role sets the optional parameter "role": The role parameter indicates
  11154. // that the response should only contain assets where the current user
  11155. // has the specified level of access.
  11156. //
  11157. // Possible values:
  11158. // "owner" - The user can read, write and administer the asset.
  11159. // "reader" - The user can read the asset.
  11160. // "writer" - The user can read and write the asset.
  11161. func (c *TablesListCall) Role(role string) *TablesListCall {
  11162. c.urlParams_.Set("role", role)
  11163. return c
  11164. }
  11165. // Search sets the optional parameter "search": An unstructured search
  11166. // string used to filter the set of results based on asset metadata.
  11167. func (c *TablesListCall) Search(search string) *TablesListCall {
  11168. c.urlParams_.Set("search", search)
  11169. return c
  11170. }
  11171. // Tags sets the optional parameter "tags": A comma separated list of
  11172. // tags. Returned assets will contain all the tags from the list.
  11173. func (c *TablesListCall) Tags(tags string) *TablesListCall {
  11174. c.urlParams_.Set("tags", tags)
  11175. return c
  11176. }
  11177. // Fields allows partial responses to be retrieved. See
  11178. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  11179. // for more information.
  11180. func (c *TablesListCall) Fields(s ...googleapi.Field) *TablesListCall {
  11181. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  11182. return c
  11183. }
  11184. // IfNoneMatch sets the optional parameter which makes the operation
  11185. // fail if the object's ETag matches the given value. This is useful for
  11186. // getting updates only after the object has changed since the last
  11187. // request. Use googleapi.IsNotModified to check whether the response
  11188. // error from Do is the result of In-None-Match.
  11189. func (c *TablesListCall) IfNoneMatch(entityTag string) *TablesListCall {
  11190. c.ifNoneMatch_ = entityTag
  11191. return c
  11192. }
  11193. // Context sets the context to be used in this call's Do method. Any
  11194. // pending HTTP request will be aborted if the provided context is
  11195. // canceled.
  11196. func (c *TablesListCall) Context(ctx context.Context) *TablesListCall {
  11197. c.ctx_ = ctx
  11198. return c
  11199. }
  11200. func (c *TablesListCall) doRequest(alt string) (*http.Response, error) {
  11201. var body io.Reader = nil
  11202. c.urlParams_.Set("alt", alt)
  11203. urls := googleapi.ResolveRelative(c.s.BasePath, "tables")
  11204. urls += "?" + c.urlParams_.Encode()
  11205. req, _ := http.NewRequest("GET", urls, body)
  11206. googleapi.SetOpaque(req.URL)
  11207. req.Header.Set("User-Agent", c.s.userAgent())
  11208. if c.ifNoneMatch_ != "" {
  11209. req.Header.Set("If-None-Match", c.ifNoneMatch_)
  11210. }
  11211. if c.ctx_ != nil {
  11212. return ctxhttp.Do(c.ctx_, c.s.client, req)
  11213. }
  11214. return c.s.client.Do(req)
  11215. }
  11216. // Do executes the "mapsengine.tables.list" call.
  11217. // Exactly one of *TablesListResponse or error will be non-nil. Any
  11218. // non-2xx status code is an error. Response headers are in either
  11219. // *TablesListResponse.ServerResponse.Header or (if a response was
  11220. // returned at all) in error.(*googleapi.Error).Header. Use
  11221. // googleapi.IsNotModified to check whether the returned error was
  11222. // because http.StatusNotModified was returned.
  11223. func (c *TablesListCall) Do(opts ...googleapi.CallOption) (*TablesListResponse, error) {
  11224. gensupport.SetOptions(c.urlParams_, opts...)
  11225. res, err := c.doRequest("json")
  11226. if res != nil && res.StatusCode == http.StatusNotModified {
  11227. if res.Body != nil {
  11228. res.Body.Close()
  11229. }
  11230. return nil, &googleapi.Error{
  11231. Code: res.StatusCode,
  11232. Header: res.Header,
  11233. }
  11234. }
  11235. if err != nil {
  11236. return nil, err
  11237. }
  11238. defer googleapi.CloseBody(res)
  11239. if err := googleapi.CheckResponse(res); err != nil {
  11240. return nil, err
  11241. }
  11242. ret := &TablesListResponse{
  11243. ServerResponse: googleapi.ServerResponse{
  11244. Header: res.Header,
  11245. HTTPStatusCode: res.StatusCode,
  11246. },
  11247. }
  11248. if err := json.NewDecoder(res.Body).Decode(&ret); err != nil {
  11249. return nil, err
  11250. }
  11251. return ret, nil
  11252. // {
  11253. // "description": "Return all tables readable by the current user.",
  11254. // "httpMethod": "GET",
  11255. // "id": "mapsengine.tables.list",
  11256. // "parameters": {
  11257. // "bbox": {
  11258. // "description": "A bounding box, expressed as \"west,south,east,north\". If set, only assets which intersect this bounding box will be returned.",
  11259. // "location": "query",
  11260. // "type": "string"
  11261. // },
  11262. // "createdAfter": {
  11263. // "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.",
  11264. // "format": "date-time",
  11265. // "location": "query",
  11266. // "type": "string"
  11267. // },
  11268. // "createdBefore": {
  11269. // "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.",
  11270. // "format": "date-time",
  11271. // "location": "query",
  11272. // "type": "string"
  11273. // },
  11274. // "creatorEmail": {
  11275. // "description": "An email address representing a user. Returned assets that have been created by the user associated with the provided email address.",
  11276. // "location": "query",
  11277. // "type": "string"
  11278. // },
  11279. // "maxResults": {
  11280. // "description": "The maximum number of items to include in a single response page. The maximum supported value is 100.",
  11281. // "format": "uint32",
  11282. // "location": "query",
  11283. // "type": "integer"
  11284. // },
  11285. // "modifiedAfter": {
  11286. // "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.",
  11287. // "format": "date-time",
  11288. // "location": "query",
  11289. // "type": "string"
  11290. // },
  11291. // "modifiedBefore": {
  11292. // "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.",
  11293. // "format": "date-time",
  11294. // "location": "query",
  11295. // "type": "string"
  11296. // },
  11297. // "pageToken": {
  11298. // "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.",
  11299. // "location": "query",
  11300. // "type": "string"
  11301. // },
  11302. // "processingStatus": {
  11303. // "enum": [
  11304. // "complete",
  11305. // "failed",
  11306. // "notReady",
  11307. // "processing",
  11308. // "ready"
  11309. // ],
  11310. // "enumDescriptions": [
  11311. // "The table has completed processing.",
  11312. // "The table has failed processing.",
  11313. // "The table is not ready for processing.",
  11314. // "The table is processing.",
  11315. // "The table is ready for processing."
  11316. // ],
  11317. // "location": "query",
  11318. // "type": "string"
  11319. // },
  11320. // "projectId": {
  11321. // "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.",
  11322. // "location": "query",
  11323. // "type": "string"
  11324. // },
  11325. // "role": {
  11326. // "description": "The role parameter indicates that the response should only contain assets where the current user has the specified level of access.",
  11327. // "enum": [
  11328. // "owner",
  11329. // "reader",
  11330. // "writer"
  11331. // ],
  11332. // "enumDescriptions": [
  11333. // "The user can read, write and administer the asset.",
  11334. // "The user can read the asset.",
  11335. // "The user can read and write the asset."
  11336. // ],
  11337. // "location": "query",
  11338. // "type": "string"
  11339. // },
  11340. // "search": {
  11341. // "description": "An unstructured search string used to filter the set of results based on asset metadata.",
  11342. // "location": "query",
  11343. // "type": "string"
  11344. // },
  11345. // "tags": {
  11346. // "description": "A comma separated list of tags. Returned assets will contain all the tags from the list.",
  11347. // "location": "query",
  11348. // "type": "string"
  11349. // }
  11350. // },
  11351. // "path": "tables",
  11352. // "response": {
  11353. // "$ref": "TablesListResponse"
  11354. // },
  11355. // "scopes": [
  11356. // "https://www.googleapis.com/auth/mapsengine",
  11357. // "https://www.googleapis.com/auth/mapsengine.readonly"
  11358. // ]
  11359. // }
  11360. }
  11361. // Pages invokes f for each page of results.
  11362. // A non-nil error returned from f will halt the iteration.
  11363. // The provided context supersedes any context provided to the Context method.
  11364. func (c *TablesListCall) Pages(ctx context.Context, f func(*TablesListResponse) error) error {
  11365. c.ctx_ = ctx
  11366. defer c.PageToken(c.urlParams_.Get("pageToken")) // reset paging to original point
  11367. for {
  11368. x, err := c.Do()
  11369. if err != nil {
  11370. return err
  11371. }
  11372. if err := f(x); err != nil {
  11373. return err
  11374. }
  11375. if x.NextPageToken == "" {
  11376. return nil
  11377. }
  11378. c.PageToken(x.NextPageToken)
  11379. }
  11380. }
  11381. // method id "mapsengine.tables.patch":
  11382. type TablesPatchCall struct {
  11383. s *Service
  11384. id string
  11385. table *Table
  11386. urlParams_ gensupport.URLParams
  11387. ctx_ context.Context
  11388. }
  11389. // Patch: Mutate a table asset.
  11390. func (r *TablesService) Patch(id string, table *Table) *TablesPatchCall {
  11391. c := &TablesPatchCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  11392. c.id = id
  11393. c.table = table
  11394. return c
  11395. }
  11396. // Fields allows partial responses to be retrieved. See
  11397. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  11398. // for more information.
  11399. func (c *TablesPatchCall) Fields(s ...googleapi.Field) *TablesPatchCall {
  11400. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  11401. return c
  11402. }
  11403. // Context sets the context to be used in this call's Do method. Any
  11404. // pending HTTP request will be aborted if the provided context is
  11405. // canceled.
  11406. func (c *TablesPatchCall) Context(ctx context.Context) *TablesPatchCall {
  11407. c.ctx_ = ctx
  11408. return c
  11409. }
  11410. func (c *TablesPatchCall) doRequest(alt string) (*http.Response, error) {
  11411. var body io.Reader = nil
  11412. body, err := googleapi.WithoutDataWrapper.JSONReader(c.table)
  11413. if err != nil {
  11414. return nil, err
  11415. }
  11416. ctype := "application/json"
  11417. c.urlParams_.Set("alt", alt)
  11418. urls := googleapi.ResolveRelative(c.s.BasePath, "tables/{id}")
  11419. urls += "?" + c.urlParams_.Encode()
  11420. req, _ := http.NewRequest("PATCH", urls, body)
  11421. googleapi.Expand(req.URL, map[string]string{
  11422. "id": c.id,
  11423. })
  11424. req.Header.Set("Content-Type", ctype)
  11425. req.Header.Set("User-Agent", c.s.userAgent())
  11426. if c.ctx_ != nil {
  11427. return ctxhttp.Do(c.ctx_, c.s.client, req)
  11428. }
  11429. return c.s.client.Do(req)
  11430. }
  11431. // Do executes the "mapsengine.tables.patch" call.
  11432. func (c *TablesPatchCall) Do(opts ...googleapi.CallOption) error {
  11433. gensupport.SetOptions(c.urlParams_, opts...)
  11434. res, err := c.doRequest("json")
  11435. if err != nil {
  11436. return err
  11437. }
  11438. defer googleapi.CloseBody(res)
  11439. if err := googleapi.CheckResponse(res); err != nil {
  11440. return err
  11441. }
  11442. return nil
  11443. // {
  11444. // "description": "Mutate a table asset.",
  11445. // "httpMethod": "PATCH",
  11446. // "id": "mapsengine.tables.patch",
  11447. // "parameterOrder": [
  11448. // "id"
  11449. // ],
  11450. // "parameters": {
  11451. // "id": {
  11452. // "description": "The ID of the table.",
  11453. // "location": "path",
  11454. // "required": true,
  11455. // "type": "string"
  11456. // }
  11457. // },
  11458. // "path": "tables/{id}",
  11459. // "request": {
  11460. // "$ref": "Table"
  11461. // },
  11462. // "scopes": [
  11463. // "https://www.googleapis.com/auth/mapsengine"
  11464. // ]
  11465. // }
  11466. }
  11467. // method id "mapsengine.tables.process":
  11468. type TablesProcessCall struct {
  11469. s *Service
  11470. id string
  11471. urlParams_ gensupport.URLParams
  11472. ctx_ context.Context
  11473. }
  11474. // Process: Process a table asset.
  11475. func (r *TablesService) Process(id string) *TablesProcessCall {
  11476. c := &TablesProcessCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  11477. c.id = id
  11478. return c
  11479. }
  11480. // Fields allows partial responses to be retrieved. See
  11481. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  11482. // for more information.
  11483. func (c *TablesProcessCall) Fields(s ...googleapi.Field) *TablesProcessCall {
  11484. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  11485. return c
  11486. }
  11487. // Context sets the context to be used in this call's Do method. Any
  11488. // pending HTTP request will be aborted if the provided context is
  11489. // canceled.
  11490. func (c *TablesProcessCall) Context(ctx context.Context) *TablesProcessCall {
  11491. c.ctx_ = ctx
  11492. return c
  11493. }
  11494. func (c *TablesProcessCall) doRequest(alt string) (*http.Response, error) {
  11495. var body io.Reader = nil
  11496. c.urlParams_.Set("alt", alt)
  11497. urls := googleapi.ResolveRelative(c.s.BasePath, "tables/{id}/process")
  11498. urls += "?" + c.urlParams_.Encode()
  11499. req, _ := http.NewRequest("POST", urls, body)
  11500. googleapi.Expand(req.URL, map[string]string{
  11501. "id": c.id,
  11502. })
  11503. req.Header.Set("User-Agent", c.s.userAgent())
  11504. if c.ctx_ != nil {
  11505. return ctxhttp.Do(c.ctx_, c.s.client, req)
  11506. }
  11507. return c.s.client.Do(req)
  11508. }
  11509. // Do executes the "mapsengine.tables.process" call.
  11510. // Exactly one of *ProcessResponse or error will be non-nil. Any non-2xx
  11511. // status code is an error. Response headers are in either
  11512. // *ProcessResponse.ServerResponse.Header or (if a response was returned
  11513. // at all) in error.(*googleapi.Error).Header. Use
  11514. // googleapi.IsNotModified to check whether the returned error was
  11515. // because http.StatusNotModified was returned.
  11516. func (c *TablesProcessCall) Do(opts ...googleapi.CallOption) (*ProcessResponse, error) {
  11517. gensupport.SetOptions(c.urlParams_, opts...)
  11518. res, err := c.doRequest("json")
  11519. if res != nil && res.StatusCode == http.StatusNotModified {
  11520. if res.Body != nil {
  11521. res.Body.Close()
  11522. }
  11523. return nil, &googleapi.Error{
  11524. Code: res.StatusCode,
  11525. Header: res.Header,
  11526. }
  11527. }
  11528. if err != nil {
  11529. return nil, err
  11530. }
  11531. defer googleapi.CloseBody(res)
  11532. if err := googleapi.CheckResponse(res); err != nil {
  11533. return nil, err
  11534. }
  11535. ret := &ProcessResponse{
  11536. ServerResponse: googleapi.ServerResponse{
  11537. Header: res.Header,
  11538. HTTPStatusCode: res.StatusCode,
  11539. },
  11540. }
  11541. if err := json.NewDecoder(res.Body).Decode(&ret); err != nil {
  11542. return nil, err
  11543. }
  11544. return ret, nil
  11545. // {
  11546. // "description": "Process a table asset.",
  11547. // "httpMethod": "POST",
  11548. // "id": "mapsengine.tables.process",
  11549. // "parameterOrder": [
  11550. // "id"
  11551. // ],
  11552. // "parameters": {
  11553. // "id": {
  11554. // "description": "The ID of the table.",
  11555. // "location": "path",
  11556. // "required": true,
  11557. // "type": "string"
  11558. // }
  11559. // },
  11560. // "path": "tables/{id}/process",
  11561. // "response": {
  11562. // "$ref": "ProcessResponse"
  11563. // },
  11564. // "scopes": [
  11565. // "https://www.googleapis.com/auth/mapsengine"
  11566. // ]
  11567. // }
  11568. }
  11569. // method id "mapsengine.tables.upload":
  11570. type TablesUploadCall struct {
  11571. s *Service
  11572. table *Table
  11573. urlParams_ gensupport.URLParams
  11574. ctx_ context.Context
  11575. }
  11576. // Upload: Create a placeholder table asset to which table files can be
  11577. // uploaded.
  11578. // Once the placeholder has been created, files are uploaded to the
  11579. // https://www.googleapis.com/upload/mapsengine/v1/tables/table_id/files
  11580. // endpoint.
  11581. // See Table Upload in the Developer's Guide or Table.files: insert in
  11582. // the reference documentation for more information.
  11583. func (r *TablesService) Upload(table *Table) *TablesUploadCall {
  11584. c := &TablesUploadCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  11585. c.table = table
  11586. return c
  11587. }
  11588. // Fields allows partial responses to be retrieved. See
  11589. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  11590. // for more information.
  11591. func (c *TablesUploadCall) Fields(s ...googleapi.Field) *TablesUploadCall {
  11592. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  11593. return c
  11594. }
  11595. // Context sets the context to be used in this call's Do method. Any
  11596. // pending HTTP request will be aborted if the provided context is
  11597. // canceled.
  11598. func (c *TablesUploadCall) Context(ctx context.Context) *TablesUploadCall {
  11599. c.ctx_ = ctx
  11600. return c
  11601. }
  11602. func (c *TablesUploadCall) doRequest(alt string) (*http.Response, error) {
  11603. var body io.Reader = nil
  11604. body, err := googleapi.WithoutDataWrapper.JSONReader(c.table)
  11605. if err != nil {
  11606. return nil, err
  11607. }
  11608. ctype := "application/json"
  11609. c.urlParams_.Set("alt", alt)
  11610. urls := googleapi.ResolveRelative(c.s.BasePath, "tables/upload")
  11611. urls += "?" + c.urlParams_.Encode()
  11612. req, _ := http.NewRequest("POST", urls, body)
  11613. googleapi.SetOpaque(req.URL)
  11614. req.Header.Set("Content-Type", ctype)
  11615. req.Header.Set("User-Agent", c.s.userAgent())
  11616. if c.ctx_ != nil {
  11617. return ctxhttp.Do(c.ctx_, c.s.client, req)
  11618. }
  11619. return c.s.client.Do(req)
  11620. }
  11621. // Do executes the "mapsengine.tables.upload" call.
  11622. // Exactly one of *Table or error will be non-nil. Any non-2xx status
  11623. // code is an error. Response headers are in either
  11624. // *Table.ServerResponse.Header or (if a response was returned at all)
  11625. // in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to
  11626. // check whether the returned error was because http.StatusNotModified
  11627. // was returned.
  11628. func (c *TablesUploadCall) Do(opts ...googleapi.CallOption) (*Table, error) {
  11629. gensupport.SetOptions(c.urlParams_, opts...)
  11630. res, err := c.doRequest("json")
  11631. if res != nil && res.StatusCode == http.StatusNotModified {
  11632. if res.Body != nil {
  11633. res.Body.Close()
  11634. }
  11635. return nil, &googleapi.Error{
  11636. Code: res.StatusCode,
  11637. Header: res.Header,
  11638. }
  11639. }
  11640. if err != nil {
  11641. return nil, err
  11642. }
  11643. defer googleapi.CloseBody(res)
  11644. if err := googleapi.CheckResponse(res); err != nil {
  11645. return nil, err
  11646. }
  11647. ret := &Table{
  11648. ServerResponse: googleapi.ServerResponse{
  11649. Header: res.Header,
  11650. HTTPStatusCode: res.StatusCode,
  11651. },
  11652. }
  11653. if err := json.NewDecoder(res.Body).Decode(&ret); err != nil {
  11654. return nil, err
  11655. }
  11656. return ret, nil
  11657. // {
  11658. // "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.",
  11659. // "httpMethod": "POST",
  11660. // "id": "mapsengine.tables.upload",
  11661. // "path": "tables/upload",
  11662. // "request": {
  11663. // "$ref": "Table"
  11664. // },
  11665. // "response": {
  11666. // "$ref": "Table"
  11667. // },
  11668. // "scopes": [
  11669. // "https://www.googleapis.com/auth/mapsengine"
  11670. // ]
  11671. // }
  11672. }
  11673. // method id "mapsengine.tables.features.batchDelete":
  11674. type TablesFeaturesBatchDeleteCall struct {
  11675. s *Service
  11676. id string
  11677. featuresbatchdeleterequest *FeaturesBatchDeleteRequest
  11678. urlParams_ gensupport.URLParams
  11679. ctx_ context.Context
  11680. }
  11681. // BatchDelete: Delete all features matching the given IDs.
  11682. func (r *TablesFeaturesService) BatchDelete(id string, featuresbatchdeleterequest *FeaturesBatchDeleteRequest) *TablesFeaturesBatchDeleteCall {
  11683. c := &TablesFeaturesBatchDeleteCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  11684. c.id = id
  11685. c.featuresbatchdeleterequest = featuresbatchdeleterequest
  11686. return c
  11687. }
  11688. // Fields allows partial responses to be retrieved. See
  11689. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  11690. // for more information.
  11691. func (c *TablesFeaturesBatchDeleteCall) Fields(s ...googleapi.Field) *TablesFeaturesBatchDeleteCall {
  11692. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  11693. return c
  11694. }
  11695. // Context sets the context to be used in this call's Do method. Any
  11696. // pending HTTP request will be aborted if the provided context is
  11697. // canceled.
  11698. func (c *TablesFeaturesBatchDeleteCall) Context(ctx context.Context) *TablesFeaturesBatchDeleteCall {
  11699. c.ctx_ = ctx
  11700. return c
  11701. }
  11702. func (c *TablesFeaturesBatchDeleteCall) doRequest(alt string) (*http.Response, error) {
  11703. var body io.Reader = nil
  11704. body, err := googleapi.WithoutDataWrapper.JSONReader(c.featuresbatchdeleterequest)
  11705. if err != nil {
  11706. return nil, err
  11707. }
  11708. ctype := "application/json"
  11709. c.urlParams_.Set("alt", alt)
  11710. urls := googleapi.ResolveRelative(c.s.BasePath, "tables/{id}/features/batchDelete")
  11711. urls += "?" + c.urlParams_.Encode()
  11712. req, _ := http.NewRequest("POST", urls, body)
  11713. googleapi.Expand(req.URL, map[string]string{
  11714. "id": c.id,
  11715. })
  11716. req.Header.Set("Content-Type", ctype)
  11717. req.Header.Set("User-Agent", c.s.userAgent())
  11718. if c.ctx_ != nil {
  11719. return ctxhttp.Do(c.ctx_, c.s.client, req)
  11720. }
  11721. return c.s.client.Do(req)
  11722. }
  11723. // Do executes the "mapsengine.tables.features.batchDelete" call.
  11724. func (c *TablesFeaturesBatchDeleteCall) Do(opts ...googleapi.CallOption) error {
  11725. gensupport.SetOptions(c.urlParams_, opts...)
  11726. res, err := c.doRequest("json")
  11727. if err != nil {
  11728. return err
  11729. }
  11730. defer googleapi.CloseBody(res)
  11731. if err := googleapi.CheckResponse(res); err != nil {
  11732. return err
  11733. }
  11734. return nil
  11735. // {
  11736. // "description": "Delete all features matching the given IDs.",
  11737. // "httpMethod": "POST",
  11738. // "id": "mapsengine.tables.features.batchDelete",
  11739. // "parameterOrder": [
  11740. // "id"
  11741. // ],
  11742. // "parameters": {
  11743. // "id": {
  11744. // "description": "The ID of the table that contains the features to be deleted.",
  11745. // "location": "path",
  11746. // "required": true,
  11747. // "type": "string"
  11748. // }
  11749. // },
  11750. // "path": "tables/{id}/features/batchDelete",
  11751. // "request": {
  11752. // "$ref": "FeaturesBatchDeleteRequest"
  11753. // },
  11754. // "scopes": [
  11755. // "https://www.googleapis.com/auth/mapsengine"
  11756. // ]
  11757. // }
  11758. }
  11759. // method id "mapsengine.tables.features.batchInsert":
  11760. type TablesFeaturesBatchInsertCall struct {
  11761. s *Service
  11762. id string
  11763. featuresbatchinsertrequest *FeaturesBatchInsertRequest
  11764. urlParams_ gensupport.URLParams
  11765. ctx_ context.Context
  11766. }
  11767. // BatchInsert: Append features to an existing table.
  11768. //
  11769. // A single batchInsert request can create:
  11770. //
  11771. // - Up to 50 features.
  11772. // - A combined total of 10 000 vertices.
  11773. // Feature limits are documented in the Supported data formats and
  11774. // limits article of the Google Maps Engine help center. Note that free
  11775. // and paid accounts have different limits.
  11776. //
  11777. // For more information about inserting features, read Creating features
  11778. // in the Google Maps Engine developer's guide.
  11779. func (r *TablesFeaturesService) BatchInsert(id string, featuresbatchinsertrequest *FeaturesBatchInsertRequest) *TablesFeaturesBatchInsertCall {
  11780. c := &TablesFeaturesBatchInsertCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  11781. c.id = id
  11782. c.featuresbatchinsertrequest = featuresbatchinsertrequest
  11783. return c
  11784. }
  11785. // Fields allows partial responses to be retrieved. See
  11786. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  11787. // for more information.
  11788. func (c *TablesFeaturesBatchInsertCall) Fields(s ...googleapi.Field) *TablesFeaturesBatchInsertCall {
  11789. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  11790. return c
  11791. }
  11792. // Context sets the context to be used in this call's Do method. Any
  11793. // pending HTTP request will be aborted if the provided context is
  11794. // canceled.
  11795. func (c *TablesFeaturesBatchInsertCall) Context(ctx context.Context) *TablesFeaturesBatchInsertCall {
  11796. c.ctx_ = ctx
  11797. return c
  11798. }
  11799. func (c *TablesFeaturesBatchInsertCall) doRequest(alt string) (*http.Response, error) {
  11800. var body io.Reader = nil
  11801. body, err := googleapi.WithoutDataWrapper.JSONReader(c.featuresbatchinsertrequest)
  11802. if err != nil {
  11803. return nil, err
  11804. }
  11805. ctype := "application/json"
  11806. c.urlParams_.Set("alt", alt)
  11807. urls := googleapi.ResolveRelative(c.s.BasePath, "tables/{id}/features/batchInsert")
  11808. urls += "?" + c.urlParams_.Encode()
  11809. req, _ := http.NewRequest("POST", urls, body)
  11810. googleapi.Expand(req.URL, map[string]string{
  11811. "id": c.id,
  11812. })
  11813. req.Header.Set("Content-Type", ctype)
  11814. req.Header.Set("User-Agent", c.s.userAgent())
  11815. if c.ctx_ != nil {
  11816. return ctxhttp.Do(c.ctx_, c.s.client, req)
  11817. }
  11818. return c.s.client.Do(req)
  11819. }
  11820. // Do executes the "mapsengine.tables.features.batchInsert" call.
  11821. func (c *TablesFeaturesBatchInsertCall) Do(opts ...googleapi.CallOption) error {
  11822. gensupport.SetOptions(c.urlParams_, opts...)
  11823. res, err := c.doRequest("json")
  11824. if err != nil {
  11825. return err
  11826. }
  11827. defer googleapi.CloseBody(res)
  11828. if err := googleapi.CheckResponse(res); err != nil {
  11829. return err
  11830. }
  11831. return nil
  11832. // {
  11833. // "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.",
  11834. // "httpMethod": "POST",
  11835. // "id": "mapsengine.tables.features.batchInsert",
  11836. // "parameterOrder": [
  11837. // "id"
  11838. // ],
  11839. // "parameters": {
  11840. // "id": {
  11841. // "description": "The ID of the table to append the features to.",
  11842. // "location": "path",
  11843. // "required": true,
  11844. // "type": "string"
  11845. // }
  11846. // },
  11847. // "path": "tables/{id}/features/batchInsert",
  11848. // "request": {
  11849. // "$ref": "FeaturesBatchInsertRequest"
  11850. // },
  11851. // "scopes": [
  11852. // "https://www.googleapis.com/auth/mapsengine"
  11853. // ]
  11854. // }
  11855. }
  11856. // method id "mapsengine.tables.features.batchPatch":
  11857. type TablesFeaturesBatchPatchCall struct {
  11858. s *Service
  11859. id string
  11860. featuresbatchpatchrequest *FeaturesBatchPatchRequest
  11861. urlParams_ gensupport.URLParams
  11862. ctx_ context.Context
  11863. }
  11864. // BatchPatch: Update the supplied features.
  11865. //
  11866. // A single batchPatch request can update:
  11867. //
  11868. // - Up to 50 features.
  11869. // - A combined total of 10 000 vertices.
  11870. // Feature limits are documented in the Supported data formats and
  11871. // limits article of the Google Maps Engine help center. Note that free
  11872. // and paid accounts have different limits.
  11873. //
  11874. // Feature updates use HTTP PATCH semantics:
  11875. //
  11876. // - A supplied value replaces an existing value (if any) in that
  11877. // field.
  11878. // - Omitted fields remain unchanged.
  11879. // - Complex values in geometries and properties must be replaced as
  11880. // atomic units. For example, providing just the coordinates of a
  11881. // geometry is not allowed; the complete geometry, including type, must
  11882. // be supplied.
  11883. // - Setting a property's value to null deletes that property.
  11884. // For more information about updating features, read Updating features
  11885. // in the Google Maps Engine developer's guide.
  11886. func (r *TablesFeaturesService) BatchPatch(id string, featuresbatchpatchrequest *FeaturesBatchPatchRequest) *TablesFeaturesBatchPatchCall {
  11887. c := &TablesFeaturesBatchPatchCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  11888. c.id = id
  11889. c.featuresbatchpatchrequest = featuresbatchpatchrequest
  11890. return c
  11891. }
  11892. // Fields allows partial responses to be retrieved. See
  11893. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  11894. // for more information.
  11895. func (c *TablesFeaturesBatchPatchCall) Fields(s ...googleapi.Field) *TablesFeaturesBatchPatchCall {
  11896. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  11897. return c
  11898. }
  11899. // Context sets the context to be used in this call's Do method. Any
  11900. // pending HTTP request will be aborted if the provided context is
  11901. // canceled.
  11902. func (c *TablesFeaturesBatchPatchCall) Context(ctx context.Context) *TablesFeaturesBatchPatchCall {
  11903. c.ctx_ = ctx
  11904. return c
  11905. }
  11906. func (c *TablesFeaturesBatchPatchCall) doRequest(alt string) (*http.Response, error) {
  11907. var body io.Reader = nil
  11908. body, err := googleapi.WithoutDataWrapper.JSONReader(c.featuresbatchpatchrequest)
  11909. if err != nil {
  11910. return nil, err
  11911. }
  11912. ctype := "application/json"
  11913. c.urlParams_.Set("alt", alt)
  11914. urls := googleapi.ResolveRelative(c.s.BasePath, "tables/{id}/features/batchPatch")
  11915. urls += "?" + c.urlParams_.Encode()
  11916. req, _ := http.NewRequest("POST", urls, body)
  11917. googleapi.Expand(req.URL, map[string]string{
  11918. "id": c.id,
  11919. })
  11920. req.Header.Set("Content-Type", ctype)
  11921. req.Header.Set("User-Agent", c.s.userAgent())
  11922. if c.ctx_ != nil {
  11923. return ctxhttp.Do(c.ctx_, c.s.client, req)
  11924. }
  11925. return c.s.client.Do(req)
  11926. }
  11927. // Do executes the "mapsengine.tables.features.batchPatch" call.
  11928. func (c *TablesFeaturesBatchPatchCall) Do(opts ...googleapi.CallOption) error {
  11929. gensupport.SetOptions(c.urlParams_, opts...)
  11930. res, err := c.doRequest("json")
  11931. if err != nil {
  11932. return err
  11933. }
  11934. defer googleapi.CloseBody(res)
  11935. if err := googleapi.CheckResponse(res); err != nil {
  11936. return err
  11937. }
  11938. return nil
  11939. // {
  11940. // "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.",
  11941. // "httpMethod": "POST",
  11942. // "id": "mapsengine.tables.features.batchPatch",
  11943. // "parameterOrder": [
  11944. // "id"
  11945. // ],
  11946. // "parameters": {
  11947. // "id": {
  11948. // "description": "The ID of the table containing the features to be patched.",
  11949. // "location": "path",
  11950. // "required": true,
  11951. // "type": "string"
  11952. // }
  11953. // },
  11954. // "path": "tables/{id}/features/batchPatch",
  11955. // "request": {
  11956. // "$ref": "FeaturesBatchPatchRequest"
  11957. // },
  11958. // "scopes": [
  11959. // "https://www.googleapis.com/auth/mapsengine"
  11960. // ]
  11961. // }
  11962. }
  11963. // method id "mapsengine.tables.features.get":
  11964. type TablesFeaturesGetCall struct {
  11965. s *Service
  11966. tableId string
  11967. id string
  11968. urlParams_ gensupport.URLParams
  11969. ifNoneMatch_ string
  11970. ctx_ context.Context
  11971. }
  11972. // Get: Return a single feature, given its ID.
  11973. func (r *TablesFeaturesService) Get(tableId string, id string) *TablesFeaturesGetCall {
  11974. c := &TablesFeaturesGetCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  11975. c.tableId = tableId
  11976. c.id = id
  11977. return c
  11978. }
  11979. // Select sets the optional parameter "select": A SQL-like projection
  11980. // clause used to specify returned properties. If this parameter is not
  11981. // included, all properties are returned.
  11982. func (c *TablesFeaturesGetCall) Select(select_ string) *TablesFeaturesGetCall {
  11983. c.urlParams_.Set("select", select_)
  11984. return c
  11985. }
  11986. // Version sets the optional parameter "version": The table version to
  11987. // access. See Accessing Public Data for information.
  11988. //
  11989. // Possible values:
  11990. // "draft" - The draft version.
  11991. // "published" - The published version.
  11992. func (c *TablesFeaturesGetCall) Version(version string) *TablesFeaturesGetCall {
  11993. c.urlParams_.Set("version", version)
  11994. return c
  11995. }
  11996. // Fields allows partial responses to be retrieved. See
  11997. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  11998. // for more information.
  11999. func (c *TablesFeaturesGetCall) Fields(s ...googleapi.Field) *TablesFeaturesGetCall {
  12000. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  12001. return c
  12002. }
  12003. // IfNoneMatch sets the optional parameter which makes the operation
  12004. // fail if the object's ETag matches the given value. This is useful for
  12005. // getting updates only after the object has changed since the last
  12006. // request. Use googleapi.IsNotModified to check whether the response
  12007. // error from Do is the result of In-None-Match.
  12008. func (c *TablesFeaturesGetCall) IfNoneMatch(entityTag string) *TablesFeaturesGetCall {
  12009. c.ifNoneMatch_ = entityTag
  12010. return c
  12011. }
  12012. // Context sets the context to be used in this call's Do method. Any
  12013. // pending HTTP request will be aborted if the provided context is
  12014. // canceled.
  12015. func (c *TablesFeaturesGetCall) Context(ctx context.Context) *TablesFeaturesGetCall {
  12016. c.ctx_ = ctx
  12017. return c
  12018. }
  12019. func (c *TablesFeaturesGetCall) doRequest(alt string) (*http.Response, error) {
  12020. var body io.Reader = nil
  12021. c.urlParams_.Set("alt", alt)
  12022. urls := googleapi.ResolveRelative(c.s.BasePath, "tables/{tableId}/features/{id}")
  12023. urls += "?" + c.urlParams_.Encode()
  12024. req, _ := http.NewRequest("GET", urls, body)
  12025. googleapi.Expand(req.URL, map[string]string{
  12026. "tableId": c.tableId,
  12027. "id": c.id,
  12028. })
  12029. req.Header.Set("User-Agent", c.s.userAgent())
  12030. if c.ifNoneMatch_ != "" {
  12031. req.Header.Set("If-None-Match", c.ifNoneMatch_)
  12032. }
  12033. if c.ctx_ != nil {
  12034. return ctxhttp.Do(c.ctx_, c.s.client, req)
  12035. }
  12036. return c.s.client.Do(req)
  12037. }
  12038. // Do executes the "mapsengine.tables.features.get" call.
  12039. // Exactly one of *Feature or error will be non-nil. Any non-2xx status
  12040. // code is an error. Response headers are in either
  12041. // *Feature.ServerResponse.Header or (if a response was returned at all)
  12042. // in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to
  12043. // check whether the returned error was because http.StatusNotModified
  12044. // was returned.
  12045. func (c *TablesFeaturesGetCall) Do(opts ...googleapi.CallOption) (*Feature, error) {
  12046. gensupport.SetOptions(c.urlParams_, opts...)
  12047. res, err := c.doRequest("json")
  12048. if res != nil && res.StatusCode == http.StatusNotModified {
  12049. if res.Body != nil {
  12050. res.Body.Close()
  12051. }
  12052. return nil, &googleapi.Error{
  12053. Code: res.StatusCode,
  12054. Header: res.Header,
  12055. }
  12056. }
  12057. if err != nil {
  12058. return nil, err
  12059. }
  12060. defer googleapi.CloseBody(res)
  12061. if err := googleapi.CheckResponse(res); err != nil {
  12062. return nil, err
  12063. }
  12064. ret := &Feature{
  12065. ServerResponse: googleapi.ServerResponse{
  12066. Header: res.Header,
  12067. HTTPStatusCode: res.StatusCode,
  12068. },
  12069. }
  12070. if err := json.NewDecoder(res.Body).Decode(&ret); err != nil {
  12071. return nil, err
  12072. }
  12073. return ret, nil
  12074. // {
  12075. // "description": "Return a single feature, given its ID.",
  12076. // "httpMethod": "GET",
  12077. // "id": "mapsengine.tables.features.get",
  12078. // "parameterOrder": [
  12079. // "tableId",
  12080. // "id"
  12081. // ],
  12082. // "parameters": {
  12083. // "id": {
  12084. // "description": "The ID of the feature to get.",
  12085. // "location": "path",
  12086. // "required": true,
  12087. // "type": "string"
  12088. // },
  12089. // "select": {
  12090. // "description": "A SQL-like projection clause used to specify returned properties. If this parameter is not included, all properties are returned.",
  12091. // "location": "query",
  12092. // "type": "string"
  12093. // },
  12094. // "tableId": {
  12095. // "description": "The ID of the table.",
  12096. // "location": "path",
  12097. // "required": true,
  12098. // "type": "string"
  12099. // },
  12100. // "version": {
  12101. // "description": "The table version to access. See Accessing Public Data for information.",
  12102. // "enum": [
  12103. // "draft",
  12104. // "published"
  12105. // ],
  12106. // "enumDescriptions": [
  12107. // "The draft version.",
  12108. // "The published version."
  12109. // ],
  12110. // "location": "query",
  12111. // "type": "string"
  12112. // }
  12113. // },
  12114. // "path": "tables/{tableId}/features/{id}",
  12115. // "response": {
  12116. // "$ref": "Feature"
  12117. // },
  12118. // "scopes": [
  12119. // "https://www.googleapis.com/auth/mapsengine",
  12120. // "https://www.googleapis.com/auth/mapsengine.readonly"
  12121. // ]
  12122. // }
  12123. }
  12124. // method id "mapsengine.tables.features.list":
  12125. type TablesFeaturesListCall struct {
  12126. s *Service
  12127. id string
  12128. urlParams_ gensupport.URLParams
  12129. ifNoneMatch_ string
  12130. ctx_ context.Context
  12131. }
  12132. // List: Return all features readable by the current user.
  12133. func (r *TablesFeaturesService) List(id string) *TablesFeaturesListCall {
  12134. c := &TablesFeaturesListCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  12135. c.id = id
  12136. return c
  12137. }
  12138. // Include sets the optional parameter "include": A comma separated list
  12139. // of optional data to include. Optional data available: schema.
  12140. func (c *TablesFeaturesListCall) Include(include string) *TablesFeaturesListCall {
  12141. c.urlParams_.Set("include", include)
  12142. return c
  12143. }
  12144. // Intersects sets the optional parameter "intersects": A geometry
  12145. // literal that specifies the spatial restriction of the query.
  12146. func (c *TablesFeaturesListCall) Intersects(intersects string) *TablesFeaturesListCall {
  12147. c.urlParams_.Set("intersects", intersects)
  12148. return c
  12149. }
  12150. // Limit sets the optional parameter "limit": The total number of
  12151. // features to return from the query, irrespective of the number of
  12152. // pages.
  12153. func (c *TablesFeaturesListCall) Limit(limit int64) *TablesFeaturesListCall {
  12154. c.urlParams_.Set("limit", fmt.Sprint(limit))
  12155. return c
  12156. }
  12157. // MaxResults sets the optional parameter "maxResults": The maximum
  12158. // number of items to include in the response, used for paging. The
  12159. // maximum supported value is 1000.
  12160. func (c *TablesFeaturesListCall) MaxResults(maxResults int64) *TablesFeaturesListCall {
  12161. c.urlParams_.Set("maxResults", fmt.Sprint(maxResults))
  12162. return c
  12163. }
  12164. // OrderBy sets the optional parameter "orderBy": An SQL-like order by
  12165. // clause used to sort results. If this parameter is not included, the
  12166. // order of features is undefined.
  12167. func (c *TablesFeaturesListCall) OrderBy(orderBy string) *TablesFeaturesListCall {
  12168. c.urlParams_.Set("orderBy", orderBy)
  12169. return c
  12170. }
  12171. // PageToken sets the optional parameter "pageToken": The continuation
  12172. // token, used to page through large result sets. To get the next page
  12173. // of results, set this parameter to the value of nextPageToken from the
  12174. // previous response.
  12175. func (c *TablesFeaturesListCall) PageToken(pageToken string) *TablesFeaturesListCall {
  12176. c.urlParams_.Set("pageToken", pageToken)
  12177. return c
  12178. }
  12179. // Select sets the optional parameter "select": A SQL-like projection
  12180. // clause used to specify returned properties. If this parameter is not
  12181. // included, all properties are returned.
  12182. func (c *TablesFeaturesListCall) Select(select_ string) *TablesFeaturesListCall {
  12183. c.urlParams_.Set("select", select_)
  12184. return c
  12185. }
  12186. // Version sets the optional parameter "version": The table version to
  12187. // access. See Accessing Public Data for information.
  12188. //
  12189. // Possible values:
  12190. // "draft" - The draft version.
  12191. // "published" - The published version.
  12192. func (c *TablesFeaturesListCall) Version(version string) *TablesFeaturesListCall {
  12193. c.urlParams_.Set("version", version)
  12194. return c
  12195. }
  12196. // Where sets the optional parameter "where": An SQL-like predicate used
  12197. // to filter results.
  12198. func (c *TablesFeaturesListCall) Where(where string) *TablesFeaturesListCall {
  12199. c.urlParams_.Set("where", where)
  12200. return c
  12201. }
  12202. // Fields allows partial responses to be retrieved. See
  12203. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  12204. // for more information.
  12205. func (c *TablesFeaturesListCall) Fields(s ...googleapi.Field) *TablesFeaturesListCall {
  12206. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  12207. return c
  12208. }
  12209. // IfNoneMatch sets the optional parameter which makes the operation
  12210. // fail if the object's ETag matches the given value. This is useful for
  12211. // getting updates only after the object has changed since the last
  12212. // request. Use googleapi.IsNotModified to check whether the response
  12213. // error from Do is the result of In-None-Match.
  12214. func (c *TablesFeaturesListCall) IfNoneMatch(entityTag string) *TablesFeaturesListCall {
  12215. c.ifNoneMatch_ = entityTag
  12216. return c
  12217. }
  12218. // Context sets the context to be used in this call's Do method. Any
  12219. // pending HTTP request will be aborted if the provided context is
  12220. // canceled.
  12221. func (c *TablesFeaturesListCall) Context(ctx context.Context) *TablesFeaturesListCall {
  12222. c.ctx_ = ctx
  12223. return c
  12224. }
  12225. func (c *TablesFeaturesListCall) doRequest(alt string) (*http.Response, error) {
  12226. var body io.Reader = nil
  12227. c.urlParams_.Set("alt", alt)
  12228. urls := googleapi.ResolveRelative(c.s.BasePath, "tables/{id}/features")
  12229. urls += "?" + c.urlParams_.Encode()
  12230. req, _ := http.NewRequest("GET", urls, body)
  12231. googleapi.Expand(req.URL, map[string]string{
  12232. "id": c.id,
  12233. })
  12234. req.Header.Set("User-Agent", c.s.userAgent())
  12235. if c.ifNoneMatch_ != "" {
  12236. req.Header.Set("If-None-Match", c.ifNoneMatch_)
  12237. }
  12238. if c.ctx_ != nil {
  12239. return ctxhttp.Do(c.ctx_, c.s.client, req)
  12240. }
  12241. return c.s.client.Do(req)
  12242. }
  12243. // Do executes the "mapsengine.tables.features.list" call.
  12244. // Exactly one of *FeaturesListResponse or error will be non-nil. Any
  12245. // non-2xx status code is an error. Response headers are in either
  12246. // *FeaturesListResponse.ServerResponse.Header or (if a response was
  12247. // returned at all) in error.(*googleapi.Error).Header. Use
  12248. // googleapi.IsNotModified to check whether the returned error was
  12249. // because http.StatusNotModified was returned.
  12250. func (c *TablesFeaturesListCall) Do(opts ...googleapi.CallOption) (*FeaturesListResponse, error) {
  12251. gensupport.SetOptions(c.urlParams_, opts...)
  12252. res, err := c.doRequest("json")
  12253. if res != nil && res.StatusCode == http.StatusNotModified {
  12254. if res.Body != nil {
  12255. res.Body.Close()
  12256. }
  12257. return nil, &googleapi.Error{
  12258. Code: res.StatusCode,
  12259. Header: res.Header,
  12260. }
  12261. }
  12262. if err != nil {
  12263. return nil, err
  12264. }
  12265. defer googleapi.CloseBody(res)
  12266. if err := googleapi.CheckResponse(res); err != nil {
  12267. return nil, err
  12268. }
  12269. ret := &FeaturesListResponse{
  12270. ServerResponse: googleapi.ServerResponse{
  12271. Header: res.Header,
  12272. HTTPStatusCode: res.StatusCode,
  12273. },
  12274. }
  12275. if err := json.NewDecoder(res.Body).Decode(&ret); err != nil {
  12276. return nil, err
  12277. }
  12278. return ret, nil
  12279. // {
  12280. // "description": "Return all features readable by the current user.",
  12281. // "httpMethod": "GET",
  12282. // "id": "mapsengine.tables.features.list",
  12283. // "parameterOrder": [
  12284. // "id"
  12285. // ],
  12286. // "parameters": {
  12287. // "id": {
  12288. // "description": "The ID of the table to which these features belong.",
  12289. // "location": "path",
  12290. // "required": true,
  12291. // "type": "string"
  12292. // },
  12293. // "include": {
  12294. // "description": "A comma separated list of optional data to include. Optional data available: schema.",
  12295. // "location": "query",
  12296. // "type": "string"
  12297. // },
  12298. // "intersects": {
  12299. // "description": "A geometry literal that specifies the spatial restriction of the query.",
  12300. // "location": "query",
  12301. // "type": "string"
  12302. // },
  12303. // "limit": {
  12304. // "description": "The total number of features to return from the query, irrespective of the number of pages.",
  12305. // "format": "uint32",
  12306. // "location": "query",
  12307. // "type": "integer"
  12308. // },
  12309. // "maxResults": {
  12310. // "description": "The maximum number of items to include in the response, used for paging. The maximum supported value is 1000.",
  12311. // "format": "uint32",
  12312. // "location": "query",
  12313. // "type": "integer"
  12314. // },
  12315. // "orderBy": {
  12316. // "description": "An SQL-like order by clause used to sort results. If this parameter is not included, the order of features is undefined.",
  12317. // "location": "query",
  12318. // "type": "string"
  12319. // },
  12320. // "pageToken": {
  12321. // "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.",
  12322. // "location": "query",
  12323. // "type": "string"
  12324. // },
  12325. // "select": {
  12326. // "description": "A SQL-like projection clause used to specify returned properties. If this parameter is not included, all properties are returned.",
  12327. // "location": "query",
  12328. // "type": "string"
  12329. // },
  12330. // "version": {
  12331. // "description": "The table version to access. See Accessing Public Data for information.",
  12332. // "enum": [
  12333. // "draft",
  12334. // "published"
  12335. // ],
  12336. // "enumDescriptions": [
  12337. // "The draft version.",
  12338. // "The published version."
  12339. // ],
  12340. // "location": "query",
  12341. // "type": "string"
  12342. // },
  12343. // "where": {
  12344. // "description": "An SQL-like predicate used to filter results.",
  12345. // "location": "query",
  12346. // "type": "string"
  12347. // }
  12348. // },
  12349. // "path": "tables/{id}/features",
  12350. // "response": {
  12351. // "$ref": "FeaturesListResponse"
  12352. // },
  12353. // "scopes": [
  12354. // "https://www.googleapis.com/auth/mapsengine",
  12355. // "https://www.googleapis.com/auth/mapsengine.readonly"
  12356. // ]
  12357. // }
  12358. }
  12359. // Pages invokes f for each page of results.
  12360. // A non-nil error returned from f will halt the iteration.
  12361. // The provided context supersedes any context provided to the Context method.
  12362. func (c *TablesFeaturesListCall) Pages(ctx context.Context, f func(*FeaturesListResponse) error) error {
  12363. c.ctx_ = ctx
  12364. defer c.PageToken(c.urlParams_.Get("pageToken")) // reset paging to original point
  12365. for {
  12366. x, err := c.Do()
  12367. if err != nil {
  12368. return err
  12369. }
  12370. if err := f(x); err != nil {
  12371. return err
  12372. }
  12373. if x.NextPageToken == "" {
  12374. return nil
  12375. }
  12376. c.PageToken(x.NextPageToken)
  12377. }
  12378. }
  12379. // method id "mapsengine.tables.files.insert":
  12380. type TablesFilesInsertCall struct {
  12381. s *Service
  12382. id string
  12383. urlParams_ gensupport.URLParams
  12384. media_ io.Reader
  12385. resumableBuffer_ *gensupport.ResumableBuffer
  12386. mediaType_ string
  12387. mediaSize_ int64 // mediaSize, if known. Used only for calls to progressUpdater_.
  12388. progressUpdater_ googleapi.ProgressUpdater
  12389. ctx_ context.Context
  12390. }
  12391. // Insert: Upload a file to a placeholder table asset. See Table Upload
  12392. // in the Developer's Guide for more information.
  12393. // Supported file types are listed in the Supported data formats and
  12394. // limits article of the Google Maps Engine help center.
  12395. func (r *TablesFilesService) Insert(id string, filename string) *TablesFilesInsertCall {
  12396. c := &TablesFilesInsertCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  12397. c.id = id
  12398. c.urlParams_.Set("filename", filename)
  12399. return c
  12400. }
  12401. // Media specifies the media to upload in one or more chunks. The chunk
  12402. // size may be controlled by supplying a MediaOption generated by
  12403. // googleapi.ChunkSize. The chunk size defaults to
  12404. // googleapi.DefaultUploadChunkSize.
  12405. // At most one of Media and ResumableMedia may be set.
  12406. func (c *TablesFilesInsertCall) Media(r io.Reader, options ...googleapi.MediaOption) *TablesFilesInsertCall {
  12407. opts := googleapi.ProcessMediaOptions(options)
  12408. chunkSize := opts.ChunkSize
  12409. r, c.mediaType_ = gensupport.DetermineContentType(r, opts.ContentType)
  12410. c.media_, c.resumableBuffer_ = gensupport.PrepareUpload(r, chunkSize)
  12411. return c
  12412. }
  12413. // ResumableMedia specifies the media to upload in chunks and can be
  12414. // canceled with ctx.
  12415. //
  12416. // Deprecated: use Media instead.
  12417. //
  12418. // At most one of Media and ResumableMedia may be set. mediaType
  12419. // identifies the MIME media type of the upload, such as "image/png". If
  12420. // mediaType is "", it will be auto-detected. The provided ctx will
  12421. // supersede any context previously provided to the Context method.
  12422. func (c *TablesFilesInsertCall) ResumableMedia(ctx context.Context, r io.ReaderAt, size int64, mediaType string) *TablesFilesInsertCall {
  12423. c.ctx_ = ctx
  12424. rdr := gensupport.ReaderAtToReader(r, size)
  12425. rdr, c.mediaType_ = gensupport.DetermineContentType(rdr, mediaType)
  12426. c.resumableBuffer_ = gensupport.NewResumableBuffer(rdr, googleapi.DefaultUploadChunkSize)
  12427. c.media_ = nil
  12428. c.mediaSize_ = size
  12429. return c
  12430. }
  12431. // ProgressUpdater provides a callback function that will be called
  12432. // after every chunk. It should be a low-latency function in order to
  12433. // not slow down the upload operation. This should only be called when
  12434. // using ResumableMedia (as opposed to Media).
  12435. func (c *TablesFilesInsertCall) ProgressUpdater(pu googleapi.ProgressUpdater) *TablesFilesInsertCall {
  12436. c.progressUpdater_ = pu
  12437. return c
  12438. }
  12439. // Fields allows partial responses to be retrieved. See
  12440. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  12441. // for more information.
  12442. func (c *TablesFilesInsertCall) Fields(s ...googleapi.Field) *TablesFilesInsertCall {
  12443. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  12444. return c
  12445. }
  12446. // Context sets the context to be used in this call's Do method. Any
  12447. // pending HTTP request will be aborted if the provided context is
  12448. // canceled.
  12449. // This context will supersede any context previously provided to the
  12450. // ResumableMedia method.
  12451. func (c *TablesFilesInsertCall) Context(ctx context.Context) *TablesFilesInsertCall {
  12452. c.ctx_ = ctx
  12453. return c
  12454. }
  12455. func (c *TablesFilesInsertCall) doRequest(alt string) (*http.Response, error) {
  12456. var body io.Reader = nil
  12457. c.urlParams_.Set("alt", alt)
  12458. urls := googleapi.ResolveRelative(c.s.BasePath, "tables/{id}/files")
  12459. if c.media_ != nil || c.resumableBuffer_ != nil {
  12460. urls = strings.Replace(urls, "https://www.googleapis.com/", "https://www.googleapis.com/upload/", 1)
  12461. protocol := "multipart"
  12462. if c.resumableBuffer_ != nil {
  12463. protocol = "resumable"
  12464. }
  12465. c.urlParams_.Set("uploadType", protocol)
  12466. }
  12467. urls += "?" + c.urlParams_.Encode()
  12468. body = new(bytes.Buffer)
  12469. ctype := "application/json"
  12470. if c.media_ != nil {
  12471. var combined io.ReadCloser
  12472. combined, ctype = gensupport.CombineBodyMedia(body, ctype, c.media_, c.mediaType_)
  12473. defer combined.Close()
  12474. body = combined
  12475. }
  12476. req, _ := http.NewRequest("POST", urls, body)
  12477. googleapi.Expand(req.URL, map[string]string{
  12478. "id": c.id,
  12479. })
  12480. if c.resumableBuffer_ != nil {
  12481. req.Header.Set("X-Upload-Content-Type", c.mediaType_)
  12482. }
  12483. req.Header.Set("Content-Type", ctype)
  12484. req.Header.Set("User-Agent", c.s.userAgent())
  12485. if c.ctx_ != nil {
  12486. return ctxhttp.Do(c.ctx_, c.s.client, req)
  12487. }
  12488. return c.s.client.Do(req)
  12489. }
  12490. // Do executes the "mapsengine.tables.files.insert" call.
  12491. func (c *TablesFilesInsertCall) Do(opts ...googleapi.CallOption) error {
  12492. gensupport.SetOptions(c.urlParams_, opts...)
  12493. res, err := gensupport.Retry(c.ctx_, func() (*http.Response, error) {
  12494. return c.doRequest("json")
  12495. }, gensupport.DefaultBackoffStrategy())
  12496. if err != nil {
  12497. return err
  12498. }
  12499. defer googleapi.CloseBody(res)
  12500. if err := googleapi.CheckResponse(res); err != nil {
  12501. return err
  12502. }
  12503. if c.resumableBuffer_ != nil {
  12504. loc := res.Header.Get("Location")
  12505. rx := &gensupport.ResumableUpload{
  12506. Client: c.s.client,
  12507. UserAgent: c.s.userAgent(),
  12508. URI: loc,
  12509. Media: c.resumableBuffer_,
  12510. MediaType: c.mediaType_,
  12511. Callback: func(curr int64) {
  12512. if c.progressUpdater_ != nil {
  12513. c.progressUpdater_(curr, c.mediaSize_)
  12514. }
  12515. },
  12516. }
  12517. ctx := c.ctx_
  12518. if ctx == nil {
  12519. ctx = context.TODO()
  12520. }
  12521. res, err = rx.Upload(ctx)
  12522. if err != nil {
  12523. return err
  12524. }
  12525. defer res.Body.Close()
  12526. if err := googleapi.CheckResponse(res); err != nil {
  12527. return err
  12528. }
  12529. }
  12530. return nil
  12531. // {
  12532. // "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.",
  12533. // "httpMethod": "POST",
  12534. // "id": "mapsengine.tables.files.insert",
  12535. // "mediaUpload": {
  12536. // "accept": [
  12537. // "*/*"
  12538. // ],
  12539. // "maxSize": "1GB",
  12540. // "protocols": {
  12541. // "resumable": {
  12542. // "multipart": true,
  12543. // "path": "/resumable/upload/mapsengine/exp2/tables/{id}/files"
  12544. // },
  12545. // "simple": {
  12546. // "multipart": true,
  12547. // "path": "/upload/mapsengine/exp2/tables/{id}/files"
  12548. // }
  12549. // }
  12550. // },
  12551. // "parameterOrder": [
  12552. // "id",
  12553. // "filename"
  12554. // ],
  12555. // "parameters": {
  12556. // "filename": {
  12557. // "description": "The file name of this uploaded file.",
  12558. // "location": "query",
  12559. // "required": true,
  12560. // "type": "string"
  12561. // },
  12562. // "id": {
  12563. // "description": "The ID of the table asset.",
  12564. // "location": "path",
  12565. // "required": true,
  12566. // "type": "string"
  12567. // }
  12568. // },
  12569. // "path": "tables/{id}/files",
  12570. // "scopes": [
  12571. // "https://www.googleapis.com/auth/mapsengine"
  12572. // ],
  12573. // "supportsMediaUpload": true
  12574. // }
  12575. }
  12576. // method id "mapsengine.tables.parents.list":
  12577. type TablesParentsListCall struct {
  12578. s *Service
  12579. id string
  12580. urlParams_ gensupport.URLParams
  12581. ifNoneMatch_ string
  12582. ctx_ context.Context
  12583. }
  12584. // List: Return all parent ids of the specified table.
  12585. func (r *TablesParentsService) List(id string) *TablesParentsListCall {
  12586. c := &TablesParentsListCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  12587. c.id = id
  12588. return c
  12589. }
  12590. // MaxResults sets the optional parameter "maxResults": The maximum
  12591. // number of items to include in a single response page. The maximum
  12592. // supported value is 50.
  12593. func (c *TablesParentsListCall) MaxResults(maxResults int64) *TablesParentsListCall {
  12594. c.urlParams_.Set("maxResults", fmt.Sprint(maxResults))
  12595. return c
  12596. }
  12597. // PageToken sets the optional parameter "pageToken": The continuation
  12598. // token, used to page through large result sets. To get the next page
  12599. // of results, set this parameter to the value of nextPageToken from the
  12600. // previous response.
  12601. func (c *TablesParentsListCall) PageToken(pageToken string) *TablesParentsListCall {
  12602. c.urlParams_.Set("pageToken", pageToken)
  12603. return c
  12604. }
  12605. // Fields allows partial responses to be retrieved. See
  12606. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  12607. // for more information.
  12608. func (c *TablesParentsListCall) Fields(s ...googleapi.Field) *TablesParentsListCall {
  12609. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  12610. return c
  12611. }
  12612. // IfNoneMatch sets the optional parameter which makes the operation
  12613. // fail if the object's ETag matches the given value. This is useful for
  12614. // getting updates only after the object has changed since the last
  12615. // request. Use googleapi.IsNotModified to check whether the response
  12616. // error from Do is the result of In-None-Match.
  12617. func (c *TablesParentsListCall) IfNoneMatch(entityTag string) *TablesParentsListCall {
  12618. c.ifNoneMatch_ = entityTag
  12619. return c
  12620. }
  12621. // Context sets the context to be used in this call's Do method. Any
  12622. // pending HTTP request will be aborted if the provided context is
  12623. // canceled.
  12624. func (c *TablesParentsListCall) Context(ctx context.Context) *TablesParentsListCall {
  12625. c.ctx_ = ctx
  12626. return c
  12627. }
  12628. func (c *TablesParentsListCall) doRequest(alt string) (*http.Response, error) {
  12629. var body io.Reader = nil
  12630. c.urlParams_.Set("alt", alt)
  12631. urls := googleapi.ResolveRelative(c.s.BasePath, "tables/{id}/parents")
  12632. urls += "?" + c.urlParams_.Encode()
  12633. req, _ := http.NewRequest("GET", urls, body)
  12634. googleapi.Expand(req.URL, map[string]string{
  12635. "id": c.id,
  12636. })
  12637. req.Header.Set("User-Agent", c.s.userAgent())
  12638. if c.ifNoneMatch_ != "" {
  12639. req.Header.Set("If-None-Match", c.ifNoneMatch_)
  12640. }
  12641. if c.ctx_ != nil {
  12642. return ctxhttp.Do(c.ctx_, c.s.client, req)
  12643. }
  12644. return c.s.client.Do(req)
  12645. }
  12646. // Do executes the "mapsengine.tables.parents.list" call.
  12647. // Exactly one of *ParentsListResponse or error will be non-nil. Any
  12648. // non-2xx status code is an error. Response headers are in either
  12649. // *ParentsListResponse.ServerResponse.Header or (if a response was
  12650. // returned at all) in error.(*googleapi.Error).Header. Use
  12651. // googleapi.IsNotModified to check whether the returned error was
  12652. // because http.StatusNotModified was returned.
  12653. func (c *TablesParentsListCall) Do(opts ...googleapi.CallOption) (*ParentsListResponse, error) {
  12654. gensupport.SetOptions(c.urlParams_, opts...)
  12655. res, err := c.doRequest("json")
  12656. if res != nil && res.StatusCode == http.StatusNotModified {
  12657. if res.Body != nil {
  12658. res.Body.Close()
  12659. }
  12660. return nil, &googleapi.Error{
  12661. Code: res.StatusCode,
  12662. Header: res.Header,
  12663. }
  12664. }
  12665. if err != nil {
  12666. return nil, err
  12667. }
  12668. defer googleapi.CloseBody(res)
  12669. if err := googleapi.CheckResponse(res); err != nil {
  12670. return nil, err
  12671. }
  12672. ret := &ParentsListResponse{
  12673. ServerResponse: googleapi.ServerResponse{
  12674. Header: res.Header,
  12675. HTTPStatusCode: res.StatusCode,
  12676. },
  12677. }
  12678. if err := json.NewDecoder(res.Body).Decode(&ret); err != nil {
  12679. return nil, err
  12680. }
  12681. return ret, nil
  12682. // {
  12683. // "description": "Return all parent ids of the specified table.",
  12684. // "httpMethod": "GET",
  12685. // "id": "mapsengine.tables.parents.list",
  12686. // "parameterOrder": [
  12687. // "id"
  12688. // ],
  12689. // "parameters": {
  12690. // "id": {
  12691. // "description": "The ID of the table whose parents will be listed.",
  12692. // "location": "path",
  12693. // "required": true,
  12694. // "type": "string"
  12695. // },
  12696. // "maxResults": {
  12697. // "description": "The maximum number of items to include in a single response page. The maximum supported value is 50.",
  12698. // "format": "uint32",
  12699. // "location": "query",
  12700. // "type": "integer"
  12701. // },
  12702. // "pageToken": {
  12703. // "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.",
  12704. // "location": "query",
  12705. // "type": "string"
  12706. // }
  12707. // },
  12708. // "path": "tables/{id}/parents",
  12709. // "response": {
  12710. // "$ref": "ParentsListResponse"
  12711. // },
  12712. // "scopes": [
  12713. // "https://www.googleapis.com/auth/mapsengine",
  12714. // "https://www.googleapis.com/auth/mapsengine.readonly"
  12715. // ]
  12716. // }
  12717. }
  12718. // Pages invokes f for each page of results.
  12719. // A non-nil error returned from f will halt the iteration.
  12720. // The provided context supersedes any context provided to the Context method.
  12721. func (c *TablesParentsListCall) Pages(ctx context.Context, f func(*ParentsListResponse) error) error {
  12722. c.ctx_ = ctx
  12723. defer c.PageToken(c.urlParams_.Get("pageToken")) // reset paging to original point
  12724. for {
  12725. x, err := c.Do()
  12726. if err != nil {
  12727. return err
  12728. }
  12729. if err := f(x); err != nil {
  12730. return err
  12731. }
  12732. if x.NextPageToken == "" {
  12733. return nil
  12734. }
  12735. c.PageToken(x.NextPageToken)
  12736. }
  12737. }
  12738. // method id "mapsengine.tables.permissions.batchDelete":
  12739. type TablesPermissionsBatchDeleteCall struct {
  12740. s *Service
  12741. id string
  12742. permissionsbatchdeleterequest *PermissionsBatchDeleteRequest
  12743. urlParams_ gensupport.URLParams
  12744. ctx_ context.Context
  12745. }
  12746. // BatchDelete: Remove permission entries from an already existing
  12747. // asset.
  12748. func (r *TablesPermissionsService) BatchDelete(id string, permissionsbatchdeleterequest *PermissionsBatchDeleteRequest) *TablesPermissionsBatchDeleteCall {
  12749. c := &TablesPermissionsBatchDeleteCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  12750. c.id = id
  12751. c.permissionsbatchdeleterequest = permissionsbatchdeleterequest
  12752. return c
  12753. }
  12754. // Fields allows partial responses to be retrieved. See
  12755. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  12756. // for more information.
  12757. func (c *TablesPermissionsBatchDeleteCall) Fields(s ...googleapi.Field) *TablesPermissionsBatchDeleteCall {
  12758. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  12759. return c
  12760. }
  12761. // Context sets the context to be used in this call's Do method. Any
  12762. // pending HTTP request will be aborted if the provided context is
  12763. // canceled.
  12764. func (c *TablesPermissionsBatchDeleteCall) Context(ctx context.Context) *TablesPermissionsBatchDeleteCall {
  12765. c.ctx_ = ctx
  12766. return c
  12767. }
  12768. func (c *TablesPermissionsBatchDeleteCall) doRequest(alt string) (*http.Response, error) {
  12769. var body io.Reader = nil
  12770. body, err := googleapi.WithoutDataWrapper.JSONReader(c.permissionsbatchdeleterequest)
  12771. if err != nil {
  12772. return nil, err
  12773. }
  12774. ctype := "application/json"
  12775. c.urlParams_.Set("alt", alt)
  12776. urls := googleapi.ResolveRelative(c.s.BasePath, "tables/{id}/permissions/batchDelete")
  12777. urls += "?" + c.urlParams_.Encode()
  12778. req, _ := http.NewRequest("POST", urls, body)
  12779. googleapi.Expand(req.URL, map[string]string{
  12780. "id": c.id,
  12781. })
  12782. req.Header.Set("Content-Type", ctype)
  12783. req.Header.Set("User-Agent", c.s.userAgent())
  12784. if c.ctx_ != nil {
  12785. return ctxhttp.Do(c.ctx_, c.s.client, req)
  12786. }
  12787. return c.s.client.Do(req)
  12788. }
  12789. // Do executes the "mapsengine.tables.permissions.batchDelete" call.
  12790. // Exactly one of *PermissionsBatchDeleteResponse or error will be
  12791. // non-nil. Any non-2xx status code is an error. Response headers are in
  12792. // either *PermissionsBatchDeleteResponse.ServerResponse.Header or (if a
  12793. // response was returned at all) in error.(*googleapi.Error).Header. Use
  12794. // googleapi.IsNotModified to check whether the returned error was
  12795. // because http.StatusNotModified was returned.
  12796. func (c *TablesPermissionsBatchDeleteCall) Do(opts ...googleapi.CallOption) (*PermissionsBatchDeleteResponse, error) {
  12797. gensupport.SetOptions(c.urlParams_, opts...)
  12798. res, err := c.doRequest("json")
  12799. if res != nil && res.StatusCode == http.StatusNotModified {
  12800. if res.Body != nil {
  12801. res.Body.Close()
  12802. }
  12803. return nil, &googleapi.Error{
  12804. Code: res.StatusCode,
  12805. Header: res.Header,
  12806. }
  12807. }
  12808. if err != nil {
  12809. return nil, err
  12810. }
  12811. defer googleapi.CloseBody(res)
  12812. if err := googleapi.CheckResponse(res); err != nil {
  12813. return nil, err
  12814. }
  12815. ret := &PermissionsBatchDeleteResponse{
  12816. ServerResponse: googleapi.ServerResponse{
  12817. Header: res.Header,
  12818. HTTPStatusCode: res.StatusCode,
  12819. },
  12820. }
  12821. if err := json.NewDecoder(res.Body).Decode(&ret); err != nil {
  12822. return nil, err
  12823. }
  12824. return ret, nil
  12825. // {
  12826. // "description": "Remove permission entries from an already existing asset.",
  12827. // "httpMethod": "POST",
  12828. // "id": "mapsengine.tables.permissions.batchDelete",
  12829. // "parameterOrder": [
  12830. // "id"
  12831. // ],
  12832. // "parameters": {
  12833. // "id": {
  12834. // "description": "The ID of the asset from which permissions will be removed.",
  12835. // "location": "path",
  12836. // "required": true,
  12837. // "type": "string"
  12838. // }
  12839. // },
  12840. // "path": "tables/{id}/permissions/batchDelete",
  12841. // "request": {
  12842. // "$ref": "PermissionsBatchDeleteRequest"
  12843. // },
  12844. // "response": {
  12845. // "$ref": "PermissionsBatchDeleteResponse"
  12846. // },
  12847. // "scopes": [
  12848. // "https://www.googleapis.com/auth/mapsengine"
  12849. // ]
  12850. // }
  12851. }
  12852. // method id "mapsengine.tables.permissions.batchUpdate":
  12853. type TablesPermissionsBatchUpdateCall struct {
  12854. s *Service
  12855. id string
  12856. permissionsbatchupdaterequest *PermissionsBatchUpdateRequest
  12857. urlParams_ gensupport.URLParams
  12858. ctx_ context.Context
  12859. }
  12860. // BatchUpdate: Add or update permission entries to an already existing
  12861. // asset.
  12862. //
  12863. // An asset can hold up to 20 different permission entries. Each
  12864. // batchInsert request is atomic.
  12865. func (r *TablesPermissionsService) BatchUpdate(id string, permissionsbatchupdaterequest *PermissionsBatchUpdateRequest) *TablesPermissionsBatchUpdateCall {
  12866. c := &TablesPermissionsBatchUpdateCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  12867. c.id = id
  12868. c.permissionsbatchupdaterequest = permissionsbatchupdaterequest
  12869. return c
  12870. }
  12871. // Fields allows partial responses to be retrieved. See
  12872. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  12873. // for more information.
  12874. func (c *TablesPermissionsBatchUpdateCall) Fields(s ...googleapi.Field) *TablesPermissionsBatchUpdateCall {
  12875. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  12876. return c
  12877. }
  12878. // Context sets the context to be used in this call's Do method. Any
  12879. // pending HTTP request will be aborted if the provided context is
  12880. // canceled.
  12881. func (c *TablesPermissionsBatchUpdateCall) Context(ctx context.Context) *TablesPermissionsBatchUpdateCall {
  12882. c.ctx_ = ctx
  12883. return c
  12884. }
  12885. func (c *TablesPermissionsBatchUpdateCall) doRequest(alt string) (*http.Response, error) {
  12886. var body io.Reader = nil
  12887. body, err := googleapi.WithoutDataWrapper.JSONReader(c.permissionsbatchupdaterequest)
  12888. if err != nil {
  12889. return nil, err
  12890. }
  12891. ctype := "application/json"
  12892. c.urlParams_.Set("alt", alt)
  12893. urls := googleapi.ResolveRelative(c.s.BasePath, "tables/{id}/permissions/batchUpdate")
  12894. urls += "?" + c.urlParams_.Encode()
  12895. req, _ := http.NewRequest("POST", urls, body)
  12896. googleapi.Expand(req.URL, map[string]string{
  12897. "id": c.id,
  12898. })
  12899. req.Header.Set("Content-Type", ctype)
  12900. req.Header.Set("User-Agent", c.s.userAgent())
  12901. if c.ctx_ != nil {
  12902. return ctxhttp.Do(c.ctx_, c.s.client, req)
  12903. }
  12904. return c.s.client.Do(req)
  12905. }
  12906. // Do executes the "mapsengine.tables.permissions.batchUpdate" call.
  12907. // Exactly one of *PermissionsBatchUpdateResponse or error will be
  12908. // non-nil. Any non-2xx status code is an error. Response headers are in
  12909. // either *PermissionsBatchUpdateResponse.ServerResponse.Header or (if a
  12910. // response was returned at all) in error.(*googleapi.Error).Header. Use
  12911. // googleapi.IsNotModified to check whether the returned error was
  12912. // because http.StatusNotModified was returned.
  12913. func (c *TablesPermissionsBatchUpdateCall) Do(opts ...googleapi.CallOption) (*PermissionsBatchUpdateResponse, error) {
  12914. gensupport.SetOptions(c.urlParams_, opts...)
  12915. res, err := c.doRequest("json")
  12916. if res != nil && res.StatusCode == http.StatusNotModified {
  12917. if res.Body != nil {
  12918. res.Body.Close()
  12919. }
  12920. return nil, &googleapi.Error{
  12921. Code: res.StatusCode,
  12922. Header: res.Header,
  12923. }
  12924. }
  12925. if err != nil {
  12926. return nil, err
  12927. }
  12928. defer googleapi.CloseBody(res)
  12929. if err := googleapi.CheckResponse(res); err != nil {
  12930. return nil, err
  12931. }
  12932. ret := &PermissionsBatchUpdateResponse{
  12933. ServerResponse: googleapi.ServerResponse{
  12934. Header: res.Header,
  12935. HTTPStatusCode: res.StatusCode,
  12936. },
  12937. }
  12938. if err := json.NewDecoder(res.Body).Decode(&ret); err != nil {
  12939. return nil, err
  12940. }
  12941. return ret, nil
  12942. // {
  12943. // "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.",
  12944. // "httpMethod": "POST",
  12945. // "id": "mapsengine.tables.permissions.batchUpdate",
  12946. // "parameterOrder": [
  12947. // "id"
  12948. // ],
  12949. // "parameters": {
  12950. // "id": {
  12951. // "description": "The ID of the asset to which permissions will be added.",
  12952. // "location": "path",
  12953. // "required": true,
  12954. // "type": "string"
  12955. // }
  12956. // },
  12957. // "path": "tables/{id}/permissions/batchUpdate",
  12958. // "request": {
  12959. // "$ref": "PermissionsBatchUpdateRequest"
  12960. // },
  12961. // "response": {
  12962. // "$ref": "PermissionsBatchUpdateResponse"
  12963. // },
  12964. // "scopes": [
  12965. // "https://www.googleapis.com/auth/mapsengine"
  12966. // ]
  12967. // }
  12968. }
  12969. // method id "mapsengine.tables.permissions.list":
  12970. type TablesPermissionsListCall struct {
  12971. s *Service
  12972. id string
  12973. urlParams_ gensupport.URLParams
  12974. ifNoneMatch_ string
  12975. ctx_ context.Context
  12976. }
  12977. // List: Return all of the permissions for the specified asset.
  12978. func (r *TablesPermissionsService) List(id string) *TablesPermissionsListCall {
  12979. c := &TablesPermissionsListCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  12980. c.id = id
  12981. return c
  12982. }
  12983. // Fields allows partial responses to be retrieved. See
  12984. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  12985. // for more information.
  12986. func (c *TablesPermissionsListCall) Fields(s ...googleapi.Field) *TablesPermissionsListCall {
  12987. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  12988. return c
  12989. }
  12990. // IfNoneMatch sets the optional parameter which makes the operation
  12991. // fail if the object's ETag matches the given value. This is useful for
  12992. // getting updates only after the object has changed since the last
  12993. // request. Use googleapi.IsNotModified to check whether the response
  12994. // error from Do is the result of In-None-Match.
  12995. func (c *TablesPermissionsListCall) IfNoneMatch(entityTag string) *TablesPermissionsListCall {
  12996. c.ifNoneMatch_ = entityTag
  12997. return c
  12998. }
  12999. // Context sets the context to be used in this call's Do method. Any
  13000. // pending HTTP request will be aborted if the provided context is
  13001. // canceled.
  13002. func (c *TablesPermissionsListCall) Context(ctx context.Context) *TablesPermissionsListCall {
  13003. c.ctx_ = ctx
  13004. return c
  13005. }
  13006. func (c *TablesPermissionsListCall) doRequest(alt string) (*http.Response, error) {
  13007. var body io.Reader = nil
  13008. c.urlParams_.Set("alt", alt)
  13009. urls := googleapi.ResolveRelative(c.s.BasePath, "tables/{id}/permissions")
  13010. urls += "?" + c.urlParams_.Encode()
  13011. req, _ := http.NewRequest("GET", urls, body)
  13012. googleapi.Expand(req.URL, map[string]string{
  13013. "id": c.id,
  13014. })
  13015. req.Header.Set("User-Agent", c.s.userAgent())
  13016. if c.ifNoneMatch_ != "" {
  13017. req.Header.Set("If-None-Match", c.ifNoneMatch_)
  13018. }
  13019. if c.ctx_ != nil {
  13020. return ctxhttp.Do(c.ctx_, c.s.client, req)
  13021. }
  13022. return c.s.client.Do(req)
  13023. }
  13024. // Do executes the "mapsengine.tables.permissions.list" call.
  13025. // Exactly one of *PermissionsListResponse or error will be non-nil. Any
  13026. // non-2xx status code is an error. Response headers are in either
  13027. // *PermissionsListResponse.ServerResponse.Header or (if a response was
  13028. // returned at all) in error.(*googleapi.Error).Header. Use
  13029. // googleapi.IsNotModified to check whether the returned error was
  13030. // because http.StatusNotModified was returned.
  13031. func (c *TablesPermissionsListCall) Do(opts ...googleapi.CallOption) (*PermissionsListResponse, error) {
  13032. gensupport.SetOptions(c.urlParams_, opts...)
  13033. res, err := c.doRequest("json")
  13034. if res != nil && res.StatusCode == http.StatusNotModified {
  13035. if res.Body != nil {
  13036. res.Body.Close()
  13037. }
  13038. return nil, &googleapi.Error{
  13039. Code: res.StatusCode,
  13040. Header: res.Header,
  13041. }
  13042. }
  13043. if err != nil {
  13044. return nil, err
  13045. }
  13046. defer googleapi.CloseBody(res)
  13047. if err := googleapi.CheckResponse(res); err != nil {
  13048. return nil, err
  13049. }
  13050. ret := &PermissionsListResponse{
  13051. ServerResponse: googleapi.ServerResponse{
  13052. Header: res.Header,
  13053. HTTPStatusCode: res.StatusCode,
  13054. },
  13055. }
  13056. if err := json.NewDecoder(res.Body).Decode(&ret); err != nil {
  13057. return nil, err
  13058. }
  13059. return ret, nil
  13060. // {
  13061. // "description": "Return all of the permissions for the specified asset.",
  13062. // "httpMethod": "GET",
  13063. // "id": "mapsengine.tables.permissions.list",
  13064. // "parameterOrder": [
  13065. // "id"
  13066. // ],
  13067. // "parameters": {
  13068. // "id": {
  13069. // "description": "The ID of the asset whose permissions will be listed.",
  13070. // "location": "path",
  13071. // "required": true,
  13072. // "type": "string"
  13073. // }
  13074. // },
  13075. // "path": "tables/{id}/permissions",
  13076. // "response": {
  13077. // "$ref": "PermissionsListResponse"
  13078. // },
  13079. // "scopes": [
  13080. // "https://www.googleapis.com/auth/mapsengine",
  13081. // "https://www.googleapis.com/auth/mapsengine.readonly"
  13082. // ]
  13083. // }
  13084. }